if (!mCacheEntry)  return NS_ERROR_NOT_AVAILABLE; if (!(mAccessGranted & nsICache::ACCESS_WRITE)) return NS_ERROR_CACHE_WRITE_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_WRITE); if (NS_FAILED(rv)) return rv;
nsCacheEntryDescriptor::AsyncWrite(nsIStreamProvider * provider,                                   nsISupports *       ctxt,                                   PRUint32            offset,                                    PRUint32            count,                                    PRUint32            flags,                                    nsIRequest       ** result){    // we're not planning on implementing this    return NS_ERROR_NOT_IMPLEMENTED;#if 0    NS_ENSURE_ARG_POINTER(result);    if (!mCacheEntry)  return NS_ERROR_NOT_AVAILABLE;    if (!(mAccessGranted & nsICache::ACCESS_WRITE))        return NS_ERROR_CACHE_WRITE_ACCESS_DENIED;    if (!mTransport) {        nsresult rv;        rv = nsCacheService::GlobalInstance()->            GetTransportForEntry(mCacheEntry,                                 mAccessGranted,                                 getter_AddRefs(mTransport));        if (NS_FAILED(rv))  return rv;    }        return mTransport->AsyncWrite(provider, ctxt, offset, count, flags, result);#endif}