diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index a126715393d8..2aff747553be 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -428,6 +428,7 @@ HttpChannelChild::OnStopRequest(const nsresult& statusCode) // We need to keep the document loading channel alive for further // communication, mainly for collecting a security state values. mKeptAlive = true; + SendDocumentChannelCleanup(); } } diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index ca84feacedb9..263b5ebf022a 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -259,6 +259,16 @@ HttpChannelParent::RecvRedirect2Result(const nsresult& result, return true; } +bool +HttpChannelParent::RecvDocumentChannelCleanup() +{ + // We must clear the cache entry here, else we'll block other channels from + // reading it if we've got it open for writing. + mCacheDescriptor = 0; + + return true; +} + //----------------------------------------------------------------------------- // nsIRequestObserver and nsIStreamListener methods equivalents //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h index 38ad22b7e29f..7ce007657a7c 100644 --- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -109,6 +109,7 @@ protected: const PRInt32& low, const PRInt32& broken, const PRInt32& no); + virtual bool RecvDocumentChannelCleanup(); virtual void ActorDestroy(ActorDestroyReason why); diff --git a/netwerk/protocol/http/PHttpChannel.ipdl b/netwerk/protocol/http/PHttpChannel.ipdl index ea2702104569..a297ad90c7de 100644 --- a/netwerk/protocol/http/PHttpChannel.ipdl +++ b/netwerk/protocol/http/PHttpChannel.ipdl @@ -94,6 +94,11 @@ parent: // Reports approval/veto of redirect by child process redirect observers Redirect2Result(nsresult result, RequestHeaderTuples changedHeaders); + // For document loads we keep this protocol open after child's + // OnStopRequest, and send this msg (instead of __delete__) to allow + // partial cleanup on parent. + DocumentChannelCleanup(); + child: OnStartRequest(nsHttpResponseHead responseHead, PRBool useResponseHead,