diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index 8810f92f461..e2c10736012 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -48,16 +48,17 @@ HttpChannelParent::HttpChannelParent(PBrowserParent* iframeEmbedding, , mLoadContext(aLoadContext) { // Ensure gHttpHandler is initialized: we need the atom table up and running. - nsIHttpProtocolHandler* handler; - CallGetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &handler); - MOZ_ASSERT(handler); + nsCOMPtr dummyInitializer = + do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http"); + + MOZ_ASSERT(gHttpHandler); + mHttpHandler = gHttpHandler; mTabParent = static_cast(iframeEmbedding); } HttpChannelParent::~HttpChannelParent() { - gHttpHandler->Release(); } void diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h index 63b9835d4e0..8ac8196cefc 100644 --- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -19,6 +19,7 @@ class nsICacheEntryDescriptor; class nsIAssociatedContentSecurity; +class nsHttpHandler; namespace mozilla { @@ -120,6 +121,7 @@ private: PBOverrideStatus mPBOverride; nsCOMPtr mLoadContext; + nsRefPtr mHttpHandler; }; } // namespace net