if (!mCacheEntry)  return NS_ERROR_NOT_AVAILABLE; if (!(mAccessGranted & nsICache::ACCESS_READ)) return NS_ERROR_CACHE_READ_ACCESS_DENIED; if (!mTransport) { nsresult rv; rv = nsCacheService::GlobalInstance()-> GetTransportForEntry(mCacheEntry, mAccessGranted, getter_AddRefs(mTransport)); if (NS_FAILED(rv))  return rv; }
nsresult  rv = EnsureTransportWithAccess(nsICache::ACCESS_READ); if (NS_FAILED(rv)) return rv;
nsCacheEntryDescriptor::OpenInputStream(PRUint32           offset,                                        PRUint32           count,                                        PRUint32           flags,                                        nsIInputStream  ** result){    NS_ENSURE_ARG_POINTER(result);    if (!mCacheEntry)  return NS_ERROR_NOT_AVAILABLE;    if (!(mAccessGranted & nsICache::ACCESS_READ))        return NS_ERROR_CACHE_READ_ACCESS_DENIED;    if (!mTransport) {        nsresult rv;        rv = nsCacheService::GlobalInstance()->            GetTransportForEntry(mCacheEntry,                                 mAccessGranted,                                 getter_AddRefs(mTransport));        if (NS_FAILED(rv))  return rv;    }        return mTransport->OpenInputStream(offset, count, flags, result);}