From 512654c1f72d4666ad4e34bdc53cdab1d4d1fee7 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Tue, 9 Aug 2016 07:43:00 -0400 Subject: [PATCH] Bug 1293621 - Make sure that nsIOService::GetCachedProtocolHandler is called only on the main thread. r=jduell --HG-- extra : rebase_source : de5224ef195dddd356a95a693224c6ac1554467c --- netwerk/base/nsIOService.cpp | 4 ++++ netwerk/base/nsIOService.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp index b4d4f8e293a1..449e7b60df62 100644 --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp @@ -453,6 +453,8 @@ nsIOService::AsyncOnChannelRedirect(nsIChannel* oldChan, nsIChannel* newChan, nsresult nsIOService::CacheProtocolHandler(const char *scheme, nsIProtocolHandler *handler) { + MOZ_ASSERT(NS_IsMainThread()); + for (unsigned int i=0; i mNetworkLinkService; bool mNetworkLinkServiceInitialized; - // Cached protocol handlers + // Cached protocol handlers, only accessed on the main thread nsWeakPtr mWeakHandler[NS_N(gScheme)]; // cached categories