Bug 1613873 - P1: Implementation of SimpleHttpChannel r=dragana

Differential Revision: https://phabricator.services.mozilla.com/D61998
This commit is contained in:
Kershaw Chang
2020-03-03 09:31:35 +00:00
parent d343d3bc87
commit bf62f8e4fc
7 changed files with 1347 additions and 25 deletions

View File

@@ -385,6 +385,7 @@ nsresult HttpBaseChannel::Init(nsIURI* aURI, uint32_t aCaps,
!type.EqualsLiteral("unknown"))
mProxyInfo = aProxyInfo;
mCurrentThread = GetCurrentThreadEventTarget();
return rv;
}
@@ -2983,7 +2984,8 @@ HttpBaseChannel::SetNewListener(nsIStreamListener* aListener,
//-----------------------------------------------------------------------------
void HttpBaseChannel::ReleaseListeners() {
MOZ_ASSERT(NS_IsMainThread(), "Should only be called on the main thread.");
MOZ_ASSERT(mCurrentThread->IsOnCurrentThread(),
"Should only be called on the current thread");
mListener = nullptr;
mCallbacks = nullptr;