Bug 1262326 - Make test_user_agent_overrides.html work in e10s r=nwgh
authorValentin Gosu <valentin.gosu@gmail.com>
Thu, 21 Apr 2016 16:59:17 +0200
changeset 294799 ffe9793118b797db7b190d6a227314903a84e3f4
parent 294798 945158dca099946bdac8dcdc3b10986b26fbe443
child 294800 082bd84583c34e160cc271aad2524b40111142a4
push id30211
push userkwierso@gmail.com
push dateTue, 26 Apr 2016 00:12:12 +0000
treeherdermozilla-central@cfc7ebe59293 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnwgh
bugs1262326
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1262326 - Make test_user_agent_overrides.html work in e10s r=nwgh * Rename SchedulingContext to RequestContext * Move SetLoadGroupUserAgentOverride to nsHttpChannel * Cache the userAgentOverride in RequestContext instead of LoadGroup MozReview-Commit-ID: FQS9uSRR8kd
netwerk/base/RequestContextService.cpp
netwerk/base/RequestContextService.h
netwerk/base/SchedulingContextService.cpp
netwerk/base/SchedulingContextService.h
netwerk/base/moz.build
netwerk/base/nsILoadGroup.idl
netwerk/base/nsIRequestContext.idl
netwerk/base/nsISchedulingContext.idl
netwerk/base/nsLoadGroup.cpp
netwerk/base/nsLoadGroup.h
netwerk/build/nsNetCID.h
netwerk/build/nsNetModule.cpp
netwerk/ipc/NeckoChannelParams.ipdlh
netwerk/ipc/NeckoParent.cpp
netwerk/ipc/NeckoParent.h
netwerk/ipc/PNecko.ipdl
netwerk/protocol/http/Http2Push.cpp
netwerk/protocol/http/Http2Push.h
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/Http2Stream.cpp
netwerk/protocol/http/Http2Stream.h
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/HttpChannelParent.h
netwerk/protocol/http/NullHttpChannel.cpp
netwerk/protocol/http/SpdyPush31.cpp
netwerk/protocol/http/SpdyPush31.h
netwerk/protocol/http/SpdySession31.cpp
netwerk/protocol/http/SpdyStream31.cpp
netwerk/protocol/http/SpdyStream31.h
netwerk/protocol/http/nsAHttpTransaction.h
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsHttpHandler.h
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsHttpTransaction.h
netwerk/protocol/http/nsIHttpChannel.idl
netwerk/protocol/viewsource/nsViewSourceChannel.cpp
netwerk/test/mochitests/mochitest.ini
netwerk/test/mochitests/test_user_agent_overrides.html
rename from netwerk/base/SchedulingContextService.cpp
rename to netwerk/base/RequestContextService.cpp
--- a/netwerk/base/SchedulingContextService.cpp
+++ b/netwerk/base/RequestContextService.cpp
@@ -4,194 +4,210 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsAutoPtr.h"
 #include "nsIObserverService.h"
 #include "nsIUUIDGenerator.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
-#include "SchedulingContextService.h"
+#include "RequestContextService.h"
 
 #include "mozilla/Atomics.h"
 #include "mozilla/Services.h"
 
 #include "mozilla/net/PSpdyPush.h"
 
 namespace mozilla {
 namespace net {
 
-// nsISchedulingContext
-class SchedulingContext final : public nsISchedulingContext
+// nsIRequestContext
+class RequestContext final : public nsIRequestContext
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSISCHEDULINGCONTEXT
+  NS_DECL_NSIREQUESTCONTEXT
 
-  explicit SchedulingContext(const nsID& id);
+  explicit RequestContext(const nsID& id);
 private:
-  virtual ~SchedulingContext();
+  virtual ~RequestContext();
 
   nsID mID;
   char mCID[NSID_LENGTH];
   Atomic<uint32_t>       mBlockingTransactionCount;
   nsAutoPtr<SpdyPushCache> mSpdyCache;
+  nsCString mUserAgentOverride;
 };
 
-NS_IMPL_ISUPPORTS(SchedulingContext, nsISchedulingContext)
+NS_IMPL_ISUPPORTS(RequestContext, nsIRequestContext)
 
-SchedulingContext::SchedulingContext(const nsID& aID)
+RequestContext::RequestContext(const nsID& aID)
   : mBlockingTransactionCount(0)
 {
   mID = aID;
   mID.ToProvidedString(mCID);
 }
 
-SchedulingContext::~SchedulingContext()
+RequestContext::~RequestContext()
 {
 }
 
 NS_IMETHODIMP
-SchedulingContext::GetBlockingTransactionCount(uint32_t *aBlockingTransactionCount)
+RequestContext::GetBlockingTransactionCount(uint32_t *aBlockingTransactionCount)
 {
   NS_ENSURE_ARG_POINTER(aBlockingTransactionCount);
   *aBlockingTransactionCount = mBlockingTransactionCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SchedulingContext::AddBlockingTransaction()
+RequestContext::AddBlockingTransaction()
 {
   mBlockingTransactionCount++;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SchedulingContext::RemoveBlockingTransaction(uint32_t *outval)
+RequestContext::RemoveBlockingTransaction(uint32_t *outval)
 {
   NS_ENSURE_ARG_POINTER(outval);
   mBlockingTransactionCount--;
   *outval = mBlockingTransactionCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SchedulingContext::GetSpdyPushCache(mozilla::net::SpdyPushCache **aSpdyPushCache)
+RequestContext::GetSpdyPushCache(mozilla::net::SpdyPushCache **aSpdyPushCache)
 {
   *aSpdyPushCache = mSpdyCache.get();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SchedulingContext::SetSpdyPushCache(mozilla::net::SpdyPushCache *aSpdyPushCache)
+RequestContext::SetSpdyPushCache(mozilla::net::SpdyPushCache *aSpdyPushCache)
 {
   mSpdyCache = aSpdyPushCache;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SchedulingContext::GetID(nsID *outval)
+RequestContext::GetID(nsID *outval)
 {
   NS_ENSURE_ARG_POINTER(outval);
   *outval = mID;
   return NS_OK;
 }
 
-//nsISchedulingContextService
-SchedulingContextService *SchedulingContextService::sSelf = nullptr;
+NS_IMETHODIMP
+RequestContext::GetUserAgentOverride(nsACString& aUserAgentOverride)
+{
+  aUserAgentOverride = mUserAgentOverride;
+  return NS_OK;
+}
 
-NS_IMPL_ISUPPORTS(SchedulingContextService, nsISchedulingContextService, nsIObserver)
+NS_IMETHODIMP
+RequestContext::SetUserAgentOverride(const nsACString& aUserAgentOverride)
+{
+  mUserAgentOverride = aUserAgentOverride;
+  return NS_OK;
+}
+
 
-SchedulingContextService::SchedulingContextService()
+//nsIRequestContextService
+RequestContextService *RequestContextService::sSelf = nullptr;
+
+NS_IMPL_ISUPPORTS(RequestContextService, nsIRequestContextService, nsIObserver)
+
+RequestContextService::RequestContextService()
 {
-  MOZ_ASSERT(!sSelf, "multiple scs instances!");
+  MOZ_ASSERT(!sSelf, "multiple rcs instances!");
   MOZ_ASSERT(NS_IsMainThread());
   sSelf = this;
 }
 
-SchedulingContextService::~SchedulingContextService()
+RequestContextService::~RequestContextService()
 {
   MOZ_ASSERT(NS_IsMainThread());
   Shutdown();
   sSelf = nullptr;
 }
 
 nsresult
-SchedulingContextService::Init()
+RequestContextService::Init()
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
   if (!obs) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   return obs->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
 }
 
 void
-SchedulingContextService::Shutdown()
+RequestContextService::Shutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
   mTable.Clear();
 }
 
 /* static */ nsresult
-SchedulingContextService::Create(nsISupports *aOuter, const nsIID& aIID, void **aResult)
+RequestContextService::Create(nsISupports *aOuter, const nsIID& aIID, void **aResult)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (aOuter != nullptr) {
     return NS_ERROR_NO_AGGREGATION;
   }
 
-  RefPtr<SchedulingContextService> svc = new SchedulingContextService();
+  RefPtr<RequestContextService> svc = new RequestContextService();
   nsresult rv = svc->Init();
   NS_ENSURE_SUCCESS(rv, rv);
 
   return svc->QueryInterface(aIID, aResult);
 }
 
 NS_IMETHODIMP
-SchedulingContextService::GetSchedulingContext(const nsID& scID, nsISchedulingContext **sc)
+RequestContextService::GetRequestContext(const nsID& rcID, nsIRequestContext **rc)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  NS_ENSURE_ARG_POINTER(sc);
-  *sc = nullptr;
+  NS_ENSURE_ARG_POINTER(rc);
+  *rc = nullptr;
 
-  if (!mTable.Get(scID, sc)) {
-    nsCOMPtr<nsISchedulingContext> newSC = new SchedulingContext(scID);
-    mTable.Put(scID, newSC);
-    newSC.swap(*sc);
+  if (!mTable.Get(rcID, rc)) {
+    nsCOMPtr<nsIRequestContext> newSC = new RequestContext(rcID);
+    mTable.Put(rcID, newSC);
+    newSC.swap(*rc);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SchedulingContextService::NewSchedulingContextID(nsID *scID)
+RequestContextService::NewRequestContextID(nsID *rcID)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (!mUUIDGen) {
     nsresult rv;
     mUUIDGen = do_GetService("@mozilla.org/uuid-generator;1", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  return mUUIDGen->GenerateUUIDInPlace(scID);
+  return mUUIDGen->GenerateUUIDInPlace(rcID);
 }
 
 NS_IMETHODIMP
-SchedulingContextService::RemoveSchedulingContext(const nsID& scID)
+RequestContextService::RemoveRequestContext(const nsID& rcID)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  mTable.Remove(scID);
+  mTable.Remove(rcID);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SchedulingContextService::Observe(nsISupports *subject, const char *topic,
+RequestContextService::Observe(nsISupports *subject, const char *topic,
                                   const char16_t *data_unicode)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (!strcmp(NS_XPCOM_SHUTDOWN_OBSERVER_ID, topic)) {
     Shutdown();
   }
 
   return NS_OK;
rename from netwerk/base/SchedulingContextService.h
rename to netwerk/base/RequestContextService.h
--- a/netwerk/base/SchedulingContextService.h
+++ b/netwerk/base/RequestContextService.h
@@ -1,46 +1,47 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ;*; */
 /* vim: set sw=2 ts=8 et tw=80 : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla__net__SchedulingContextService_h
-#define mozilla__net__SchedulingContextService_h
+#ifndef mozilla__net__RequestContextService_h
+#define mozilla__net__RequestContextService_h
 
 #include "nsCOMPtr.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIObserver.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 
 class nsIUUIDGenerator;
 
 namespace mozilla {
 namespace net {
 
-class SchedulingContextService final : public nsISchedulingContextService
-                                     , public nsIObserver
+class RequestContextService final
+  : public nsIRequestContextService
+  , public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS
-  NS_DECL_NSISCHEDULINGCONTEXTSERVICE
+  NS_DECL_NSIREQUESTCONTEXTSERVICE
   NS_DECL_NSIOBSERVER
 
-  SchedulingContextService();
+  RequestContextService();
 
   nsresult Init();
   void Shutdown();
   static nsresult Create(nsISupports *outer, const nsIID& iid, void **result);
 
 private:
-  virtual ~SchedulingContextService();
+  virtual ~RequestContextService();
 
-  static SchedulingContextService *sSelf;
+  static RequestContextService *sSelf;
 
-  nsInterfaceHashtable<nsIDHashKey, nsISchedulingContext> mTable;
+  nsInterfaceHashtable<nsIDHashKey, nsIRequestContext> mTable;
   nsCOMPtr<nsIUUIDGenerator> mUUIDGen;
 };
 
 } // ::mozilla::net
 } // ::mozilla
 
-#endif // mozilla__net__SchedulingContextService_h
+#endif // mozilla__net__RequestContextService_h
--- a/netwerk/base/moz.build
+++ b/netwerk/base/moz.build
@@ -89,21 +89,21 @@ XPIDL_SOURCES += [
     'nsIProtocolProxyService2.idl',
     'nsIProxiedChannel.idl',
     'nsIProxiedProtocolHandler.idl',
     'nsIProxyInfo.idl',
     'nsIRandomGenerator.idl',
     'nsIRedirectChannelRegistrar.idl',
     'nsIRedirectResultListener.idl',
     'nsIRequest.idl',
+    'nsIRequestContext.idl',
     'nsIRequestObserver.idl',
     'nsIRequestObserverProxy.idl',
     'nsIResponseHeadProvider.idl',
     'nsIResumableChannel.idl',
-    'nsISchedulingContext.idl',
     'nsISecCheckWrapChannel.idl',
     'nsISecretDecoderRing.idl',
     'nsISecureBrowserUI.idl',
     'nsISecurityEventSink.idl',
     'nsISecurityInfoProvider.idl',
     'nsISensitiveInfoHiddenURI.idl',
     'nsISerializationHelper.idl',
     'nsIServerSocket.idl',
@@ -249,17 +249,17 @@ UNIFIED_SOURCES += [
     'nsUnicharStreamLoader.cpp',
     'nsURLHelper.cpp',
     'nsURLParsers.cpp',
     'OfflineObserver.cpp',
     'PollableEvent.cpp',
     'Predictor.cpp',
     'ProxyAutoConfig.cpp',
     'RedirectChannelRegistrar.cpp',
-    'SchedulingContextService.cpp',
+    'RequestContextService.cpp',
     'SimpleBuffer.cpp',
     'StreamingProtocolService.cpp',
     'Tickler.cpp',
     'TLSServerSocket.cpp',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     SOURCES += [
--- a/netwerk/base/nsILoadGroup.idl
+++ b/netwerk/base/nsILoadGroup.idl
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIRequest.idl"
 
 interface nsISimpleEnumerator;
 interface nsIRequestObserver;
 interface nsIInterfaceRequestor;
-interface nsISchedulingContext;
+interface nsIRequestContext;
 
 typedef unsigned long nsLoadFlags;
 
 /**
  * A load group maintains a collection of nsIRequest objects.
  * This is used in lots of places where groups of requests need to be tracked.
  * For example, nsIDocument::mDocumentLoadGroup is used to track all requests
  * made for subdocuments in order to track page load progress and allow all
@@ -78,17 +78,17 @@ interface nsILoadGroup : nsIRequest
      * Notification callbacks for the load group.
      */
     attribute nsIInterfaceRequestor notificationCallbacks;
 
     /**
      * Context for managing things like js/css connection blocking,
      * and per-tab connection grouping.
      */
-    [noscript] readonly attribute nsID schedulingContextID;
+    [noscript] readonly attribute nsID requestContextID;
 
     /**
      * The set of load flags that will be added to all new requests added to
      * this group. Any existing requests in the load group are not modified,
      * so it is expected these flags will be added before requests are added
      * to the group - typically via nsIDocShell::defaultLoadFlags on a new
      * docShell.
      * Note that these flags are *not* added to the default request for the
rename from netwerk/base/nsISchedulingContext.idl
rename to netwerk/base/nsIRequestContext.idl
--- a/netwerk/base/nsISchedulingContext.idl
+++ b/netwerk/base/nsIRequestContext.idl
@@ -12,28 +12,28 @@ namespace net {
 class SpdyPushCache;
 }
 }
 %}
 
 [ptr] native SpdyPushCachePtr(mozilla::net::SpdyPushCache);
 
 /**
- * The nsISchedulingContext is used to maintain state about connections
+ * The nsIRequestContext is used to maintain state about connections
  * that are in some way associated with each other (often by being part
  * of the same load group) and how they interact with blocking items like
  * HEAD css/js loads.
  *
- * This used to be known as nsILoadGroupConnectionInfo.
+ * This used to be known as nsILoadGroupConnectionInfo and nsISchedulingContext.
  */
 [scriptable, uuid(658e3e6e-8633-4b1a-8d66-fa9f72293e63)]
-interface nsISchedulingContext : nsISupports
+interface nsIRequestContext : nsISupports
 {
   /**
-   * A unique identifier for this scheduling context
+   * A unique identifier for this request context
    */
   [noscript] readonly attribute nsID ID;
 
   /**
    * Number of active blocking transactions associated with this context
    */
   readonly attribute unsigned long blockingTransactionCount;
 
@@ -47,44 +47,49 @@ interface nsISchedulingContext : nsISupp
    * Decrease the number of active blocking transactions associated
    * with this context by one. The return value is the number of remaining
    * blockers.
    */
   unsigned long removeBlockingTransaction();
 
   /**
    * This gives out a weak pointer to the push cache.
-   * The nsISchedulingContext implementation owns the cache
+   * The nsIRequestContext implementation owns the cache
    * and will destroy it when overwritten or when the context
    * ends.
    */
   [noscript] attribute SpdyPushCachePtr spdyPushCache;
+
+  /**
+   * This holds a cached value of the user agent override.
+   */
+  [noscript] attribute ACString userAgentOverride;
 };
 
 /**
- * The nsISchedulingContextService is how anyone gets access to a scheduling
+ * The nsIRequestContextService is how anyone gets access to a request
  * context when they haven't been explicitly given a strong reference to an
  * existing one. It is responsible for creating and handing out strong
- * references to nsISchedulingContexts, but only keeps weak references itself.
- * The shared scheduling context will go away once no one else is keeping a
- * reference to it. If you ask for a scheduling context that has no one else
- * holding a reference to it, you'll get a brand new scheduling context. Anyone
- * who asks for the same scheduling context while you're holding a reference
- * will get a reference to the same scheduling context you have.
+ * references to nsIRequestContexts, but only keeps weak references itself.
+ * The shared request context will go away once no one else is keeping a
+ * reference to it. If you ask for a request context that has no one else
+ * holding a reference to it, you'll get a brand new request context. Anyone
+ * who asks for the same request context while you're holding a reference
+ * will get a reference to the same request context you have.
  */
 [uuid(7fcbf4da-d828-4acc-b144-e5435198f727)]
-interface nsISchedulingContextService : nsISupports
+interface nsIRequestContextService : nsISupports
 {
   /**
-   * Get an existing scheduling context from its ID
+   * Get an existing request context from its ID
    */
-  nsISchedulingContext getSchedulingContext(in nsIDRef id);
+  nsIRequestContext getRequestContext(in nsIDRef id);
 
   /**
-   * Create a new scheduling context identifier
+   * Create a new request context identifier
    */
-  nsID newSchedulingContextID();
+  nsID newRequestContextID();
 
   /**
-   * Remove an existing scheduling context from its ID
+   * Remove an existing request context from its ID
    */
-  void removeSchedulingContext(in nsIDRef id);
+  void removeRequestContext(in nsIDRef id);
 };
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -13,17 +13,17 @@
 #include "nsCOMPtr.h"
 #include "mozilla/Logging.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "mozilla/Telemetry.h"
 #include "nsITimedChannel.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIRequestObserver.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 #include "CacheObserver.h"
 #include "MainThreadUtils.h"
 
 #include "mozilla/net/NeckoChild.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
@@ -120,30 +120,30 @@ nsLoadGroup::nsLoadGroup(nsISupports* ou
 
 nsLoadGroup::~nsLoadGroup()
 {
     DebugOnly<nsresult> rv = Cancel(NS_BINDING_ABORTED);
     NS_ASSERTION(NS_SUCCEEDED(rv), "Cancel failed");
 
     mDefaultLoadRequest = 0;
 
-    if (mSchedulingContext) {
-        nsID scid;
-        mSchedulingContext->GetID(&scid);
+    if (mRequestContext) {
+        nsID rcid;
+        mRequestContext->GetID(&rcid);
 
         if (IsNeckoChild() && gNeckoChild) {
-            char scid_str[NSID_LENGTH];
-            scid.ToProvidedString(scid_str);
+            char rcid_str[NSID_LENGTH];
+            rcid.ToProvidedString(rcid_str);
 
-            nsCString scid_nscs;
-            scid_nscs.AssignASCII(scid_str);
+            nsCString rcid_nscs;
+            rcid_nscs.AssignASCII(rcid_str);
 
-            gNeckoChild->SendRemoveSchedulingContext(scid_nscs);
+            gNeckoChild->SendRemoveRequestContext(rcid_nscs);
         } else {
-            mSchedulingContextService->RemoveSchedulingContext(scid);
+            mRequestContextService->RemoveRequestContext(rcid);
         }
     }
 
     LOG(("LOADGROUP [%x]: Destroyed.\n", this));
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -696,22 +696,22 @@ nsLoadGroup::GetNotificationCallbacks(ns
 NS_IMETHODIMP
 nsLoadGroup::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks)
 {
     mCallbacks = aCallbacks;
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetSchedulingContextID(nsID *aSCID)
+nsLoadGroup::GetRequestContextID(nsID *aRCID)
 {
-    if (!mSchedulingContext) {
+    if (!mRequestContext) {
         return NS_ERROR_NOT_AVAILABLE;
     }
-    return mSchedulingContext->GetID(aSCID);
+    return mRequestContext->GetID(aRCID);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsILoadGroupChild methods:
 
 NS_IMETHODIMP
 nsLoadGroup::GetParentLoadGroup(nsILoadGroup * *aParentLoadGroup)
 {
@@ -1064,21 +1064,21 @@ nsresult nsLoadGroup::MergeDefaultLoadFl
         rv = aRequest->SetLoadFlags(flags);
     }
     outFlags = flags;
     return rv;
 }
 
 nsresult nsLoadGroup::Init()
 {
-    mSchedulingContextService = do_GetService("@mozilla.org/network/scheduling-context-service;1");
-    if (mSchedulingContextService) {
-        nsID schedulingContextID;
-        if (NS_SUCCEEDED(mSchedulingContextService->NewSchedulingContextID(&schedulingContextID))) {
-            mSchedulingContextService->GetSchedulingContext(schedulingContextID,
-                                                            getter_AddRefs(mSchedulingContext));
+    mRequestContextService = do_GetService("@mozilla.org/network/request-context-service;1");
+    if (mRequestContextService) {
+        nsID requestContextID;
+        if (NS_SUCCEEDED(mRequestContextService->NewRequestContextID(&requestContextID))) {
+            mRequestContextService->GetRequestContext(requestContextID,
+                                                      getter_AddRefs(mRequestContext));
         }
     }
 
     return NS_OK;
 }
 
 #undef LOG
--- a/netwerk/base/nsLoadGroup.h
+++ b/netwerk/base/nsLoadGroup.h
@@ -12,18 +12,18 @@
 #include "nsAgg.h"
 #include "nsCOMPtr.h"
 #include "nsWeakPtr.h"
 #include "nsWeakReference.h"
 #include "nsISupportsPriority.h"
 #include "PLDHashTable.h"
 #include "mozilla/TimeStamp.h"
 
-class nsISchedulingContext;
-class nsISchedulingContextService;
+class nsIRequestContext;
+class nsIRequestContextService;
 class nsITimedChannel;
 
 class nsLoadGroup : public nsILoadGroup,
                     public nsILoadGroupChild,
                     public nsISupportsPriority,
                     public nsSupportsWeakReference,
                     public nsPILoadGroupInternal
 {
@@ -66,18 +66,18 @@ private:
 
 protected:
     uint32_t                        mForegroundCount;
     uint32_t                        mLoadFlags;
     uint32_t                        mDefaultLoadFlags;
 
     nsCOMPtr<nsILoadGroup>          mLoadGroup; // load groups can contain load groups
     nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
-    nsCOMPtr<nsISchedulingContext>  mSchedulingContext;
-    nsCOMPtr<nsISchedulingContextService> mSchedulingContextService;
+    nsCOMPtr<nsIRequestContext>  mRequestContext;
+    nsCOMPtr<nsIRequestContextService> mRequestContextService;
 
     nsCOMPtr<nsIRequest>            mDefaultLoadRequest;
     PLDHashTable                    mRequests;
 
     nsWeakPtr                       mObserver;
     nsWeakPtr                       mParentLoadGroup;
 
     nsresult                        mStatus;
--- a/netwerk/build/nsNetCID.h
+++ b/netwerk/build/nsNetCID.h
@@ -476,20 +476,20 @@
 #define NS_CAPTIVEPORTAL_CID \
 { /* bdbe0555-fc3d-4f7b-9205-c309ceb2d641 */ \
     0xbdbe0555, \
     0xfc3d, \
     0x4f7b, \
   { 0x92, 0x05, 0xc3, 0x09, 0xce, 0xb2, 0xd6, 0x41 } \
 }
 
-// service implementing nsISchedulingContextService
-#define NS_SCHEDULINGCONTEXTSERVICE_CONTRACTID \
-    "@mozilla.org/network/scheduling-context-service;1"
-#define NS_SCHEDULINGCONTEXTSERVICE_CID \
+// service implementing nsIRequestContextService
+#define NS_REQUESTCONTEXTSERVICE_CONTRACTID \
+    "@mozilla.org/network/request-context-service;1"
+#define NS_REQUESTCONTEXTSERVICE_CID \
 { /* d5499fa7-7ba8-49ff-9e30-1858b99ace69 */ \
     0xd5499fa7, \
     0x7ba8, \
     0x49ff, \
     {0x93, 0x30, 0x18, 0x58, 0xb9, 0x9a, 0xce, 0x69} \
 }
 
 /******************************************************************************
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -140,19 +140,19 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(LoadConte
 
 #include "mozilla/net/CaptivePortalService.h"
 namespace mozilla {
 namespace net {
   NS_GENERIC_FACTORY_CONSTRUCTOR(CaptivePortalService)
 } // namespace net
 } // namespace mozilla
 
-#include "SchedulingContextService.h"
-typedef mozilla::net::SchedulingContextService SchedulingContextService;
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(SchedulingContextService, Init)
+#include "RequestContextService.h"
+typedef mozilla::net::RequestContextService RequestContextService;
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(RequestContextService, Init)
 
 ///////////////////////////////////////////////////////////////////////////////
 
 extern nsresult
 net_NewIncrementalDownload(nsISupports *, const nsIID &, void **);
 
 #define NS_INCREMENTALDOWNLOAD_CID \
 { /* a62af1ba-79b3-4896-8aaf-b148bfce4280 */         \
@@ -832,17 +832,17 @@ NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERV
 NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_SERIALIZATION_HELPER_CID);
 NS_DEFINE_NAMED_CID(NS_REDIRECTCHANNELREGISTRAR_CID);
 NS_DEFINE_NAMED_CID(NS_CACHE_STORAGE_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_NSILOADCONTEXTINFOFACTORY_CID);
 NS_DEFINE_NAMED_CID(NS_NETWORKPREDICTOR_CID);
 NS_DEFINE_NAMED_CID(NS_CAPTIVEPORTAL_CID);
-NS_DEFINE_NAMED_CID(NS_SCHEDULINGCONTEXTSERVICE_CID);
+NS_DEFINE_NAMED_CID(NS_REQUESTCONTEXTSERVICE_CID);
 
 static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
     { &kNS_IOSERVICE_CID, false, nullptr, nsIOServiceConstructor },
     { &kNS_STREAMTRANSPORTSERVICE_CID, false, nullptr, nsStreamTransportServiceConstructor },
     { &kNS_SOCKETTRANSPORTSERVICE_CID, false, nullptr, nsSocketTransportServiceConstructor },
     { &kNS_SERVERSOCKET_CID, false, nullptr, nsServerSocketConstructor },
     { &kNS_TLSSERVERSOCKET_CID, false, nullptr, TLSServerSocketConstructor },
     { &kNS_UDPSOCKET_CID, false, nullptr, nsUDPSocketConstructor },
@@ -984,17 +984,17 @@ static const mozilla::Module::CIDEntry k
     { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
 #endif
     { &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor },
     { &kNS_REDIRECTCHANNELREGISTRAR_CID, false, nullptr, RedirectChannelRegistrarConstructor },
     { &kNS_CACHE_STORAGE_SERVICE_CID, false, nullptr, CacheStorageServiceConstructor },
     { &kNS_NSILOADCONTEXTINFOFACTORY_CID, false, nullptr, LoadContextInfoFactoryConstructor },
     { &kNS_NETWORKPREDICTOR_CID, false, nullptr, mozilla::net::Predictor::Create },
     { &kNS_CAPTIVEPORTAL_CID, false, nullptr, mozilla::net::CaptivePortalServiceConstructor },
-    { &kNS_SCHEDULINGCONTEXTSERVICE_CID, false, nullptr, SchedulingContextServiceConstructor },
+    { &kNS_REQUESTCONTEXTSERVICE_CID, false, nullptr, RequestContextServiceConstructor },
     { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
     { NS_IOSERVICE_CONTRACTID, &kNS_IOSERVICE_CID },
     { NS_NETUTIL_CONTRACTID, &kNS_IOSERVICE_CID },
     { NS_STREAMTRANSPORTSERVICE_CONTRACTID, &kNS_STREAMTRANSPORTSERVICE_CID },
     { NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &kNS_SOCKETTRANSPORTSERVICE_CID },
@@ -1142,17 +1142,17 @@ static const mozilla::Module::ContractID
 #endif
     { NS_SERIALIZATION_HELPER_CONTRACTID, &kNS_SERIALIZATION_HELPER_CID },
     { NS_REDIRECTCHANNELREGISTRAR_CONTRACTID, &kNS_REDIRECTCHANNELREGISTRAR_CID },
     { NS_CACHE_STORAGE_SERVICE_CONTRACTID, &kNS_CACHE_STORAGE_SERVICE_CID },
     { NS_CACHE_STORAGE_SERVICE_CONTRACTID2, &kNS_CACHE_STORAGE_SERVICE_CID },
     { NS_NSILOADCONTEXTINFOFACTORY_CONTRACTID, &kNS_NSILOADCONTEXTINFOFACTORY_CID },
     { NS_NETWORKPREDICTOR_CONTRACTID, &kNS_NETWORKPREDICTOR_CID },
     { NS_CAPTIVEPORTAL_CONTRACTID, &kNS_CAPTIVEPORTAL_CID },
-    { NS_SCHEDULINGCONTEXTSERVICE_CONTRACTID, &kNS_SCHEDULINGCONTEXTSERVICE_CID },
+    { NS_REQUESTCONTEXTSERVICE_CONTRACTID, &kNS_REQUESTCONTEXTSERVICE_CID },
     { nullptr }
 };
 
 static const mozilla::Module kNeckoModule = {
     mozilla::Module::kVersion,
     kNeckoCIDs,
     kNeckoContracts,
     kNeckoCategories,
--- a/netwerk/ipc/NeckoChannelParams.ipdlh
+++ b/netwerk/ipc/NeckoChannelParams.ipdlh
@@ -109,17 +109,17 @@ struct HttpChannelOpenArgs
   nsCString                   appCacheClientID;
   bool                        allowSpdy;
   bool                        allowAltSvc;
   OptionalFileDescriptorSet   fds;
   OptionalLoadInfoArgs        loadInfo;
   OptionalHttpResponseHead    synthesizedResponseHead;
   nsCString                   synthesizedSecurityInfoSerialization;
   uint32_t                    cacheKey;
-  nsCString                   schedulingContextID;
+  nsCString                   requestContextID;
   OptionalCorsPreflightArgs   preflightArgs;
   uint32_t                    initialRwin;
   bool                        blockAuthPrompt;
   bool                        suspendAfterSynthesizeResponse;
   bool                        allowStaleCacheContent;
   nsCString                   contentTypeHint;
 };
 
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -1017,25 +1017,25 @@ NeckoParent::OfflineNotification(nsISupp
                     "SendAppOfflineStatus failed for targetAppId: %u\n", targetAppId);
     }
   }
 
   return NS_OK;
 }
 
 bool
-NeckoParent::RecvRemoveSchedulingContext(const nsCString& scid)
+NeckoParent::RecvRemoveRequestContext(const nsCString& rcid)
 {
-  nsCOMPtr<nsISchedulingContextService> scsvc =
-    do_GetService("@mozilla.org/network/scheduling-context-service;1");
-  if (!scsvc) {
+  nsCOMPtr<nsIRequestContextService> rcsvc =
+    do_GetService("@mozilla.org/network/request-context-service;1");
+  if (!rcsvc) {
     return true;
   }
 
   nsID id;
-  id.Parse(scid.BeginReading());
-  scsvc->RemoveSchedulingContext(id);
+  id.Parse(rcid.BeginReading());
+  rcsvc->RemoveRequestContext(id);
 
   return true;
 }
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -223,17 +223,17 @@ protected:
                                const bool& hasVerifier) override;
 
   virtual bool RecvPredLearn(const ipc::URIParams& aTargetURI,
                              const ipc::OptionalURIParams& aSourceURI,
                              const PredictorPredictReason& aReason,
                              const IPC::SerializedLoadContext& aLoadContext) override;
   virtual bool RecvPredReset() override;
 
-  virtual bool RecvRemoveSchedulingContext(const nsCString& scid) override;
+  virtual bool RecvRemoveRequestContext(const nsCString& rcid) override;
 
 private:
   nsCString mCoreAppsBasePath;
   nsCString mWebAppsBasePath;
   RefPtr<OfflineObserver> mObserver;
 };
 
 /**
--- a/netwerk/ipc/PNecko.ipdl
+++ b/netwerk/ipc/PNecko.ipdl
@@ -107,17 +107,17 @@ parent:
    * These are called from the child with the results of the auth prompt.
    * callbackId is the id that was passed in PBrowser::AsyncAuthPrompt,
    * corresponding to an nsIAuthPromptCallback
    */
   async OnAuthAvailable(uint64_t callbackId, nsString user,
                         nsString password, nsString domain);
   async OnAuthCancelled(uint64_t callbackId, bool userCancel);
 
-  async RemoveSchedulingContext(nsCString scid);
+  async RemoveRequestContext(nsCString rcid);
 
 child:
   /*
    * Bring up the http auth prompt for a nested remote mozbrowser.
    * NestedFrameId is the id corresponding to the PBrowser.  It is the same id
    * that was passed to the PBrowserOrId param in to the PHttpChannel constructor
    */
   async AsyncAuthPromptForNestedFrame(TabId nestedFrameId, nsCString uri,
--- a/netwerk/protocol/http/Http2Push.cpp
+++ b/netwerk/protocol/http/Http2Push.cpp
@@ -72,17 +72,17 @@ Http2PushedStream::Http2PushedStream(Htt
   , mDeferCleanupOnSuccess(true)
   , mDeferCleanupOnPush(false)
   , mOnPushFailed(false)
 {
   LOG3(("Http2PushedStream ctor this=%p 0x%X\n", this, aID));
   mStreamID = aID;
   MOZ_ASSERT(!(aID & 1)); // must be even to be a pushed stream
   mBufferedPush->SetPushStream(this);
-  mSchedulingContext = aAssociatedStream->SchedulingContext();
+  mRequestContext = aAssociatedStream->RequestContext();
   mLastRead = TimeStamp::Now();
   SetPriority(aAssociatedStream->Priority() + 1);
 }
 
 bool
 Http2PushedStream::GetPushComplete()
 {
   return mPushCompleted;
--- a/netwerk/protocol/http/Http2Push.h
+++ b/netwerk/protocol/http/Http2Push.h
@@ -12,17 +12,17 @@
 #include "Http2Session.h"
 #include "Http2Stream.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/UniquePtr.h"
 #include "nsHttpRequestHead.h"
 #include "nsILoadGroup.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 #include "nsString.h"
 #include "PSpdyPush.h"
 
 namespace mozilla {
 namespace net {
 
 class Http2PushTransactionBuffer;
 
@@ -43,17 +43,17 @@ public:
   void SetConsumerStream(Http2Stream *aStream);
   bool GetHashKey(nsCString &key);
 
   // override of Http2Stream
   nsresult ReadSegments(nsAHttpSegmentReader *,  uint32_t, uint32_t *) override;
   nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *) override;
   void AdjustInitialWindow() override;
 
-  nsISchedulingContext *SchedulingContext() override { return mSchedulingContext; };
+  nsIRequestContext *RequestContext() override { return mRequestContext; };
   void ConnectPushedStream(Http2Stream *consumer);
 
   bool TryOnPush();
   static bool TestOnPush(Http2Stream *consumer);
 
   virtual bool DeferCleanup(nsresult status) override;
   void SetDeferCleanupOnSuccess(bool val) { mDeferCleanupOnSuccess = val; }
 
@@ -67,17 +67,17 @@ public:
 
   nsCString &GetRequestString() { return mRequestString; }
 
 private:
 
   Http2Stream *mConsumerStream; // paired request stream that consumes from
                                 // real http/2 one.. null until a match is made.
 
-  nsCOMPtr<nsISchedulingContext> mSchedulingContext;
+  nsCOMPtr<nsIRequestContext> mRequestContext;
 
   nsAHttpTransaction *mAssociatedTransaction;
 
   Http2PushTransactionBuffer *mBufferedPush;
   mozilla::TimeStamp mLastRead;
 
   nsCString mHashKey;
   nsresult mStatus;
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -20,17 +20,17 @@
 #include "Http2Push.h"
 
 #include "mozilla/Endian.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Preferences.h"
 #include "nsHttp.h"
 #include "nsHttpHandler.h"
 #include "nsHttpConnection.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 #include "nsISSLSocketControl.h"
 #include "nsISSLStatus.h"
 #include "nsISSLStatusProvider.h"
 #include "nsISupportsPriority.h"
 #include "nsStandardURL.h"
 #include "nsURLHelper.h"
 #include "prnetdb.h"
 #include "sslt.h"
@@ -1033,20 +1033,20 @@ Http2Session::CleanupStream(Http2Stream 
   uint32_t id = aStream->StreamID();
   if (id > 0) {
     mStreamIDHash.Remove(id);
     if (!(id & 1)) {
       mPushedStreams.RemoveElement(aStream);
       Http2PushedStream *pushStream = static_cast<Http2PushedStream *>(aStream);
       nsAutoCString hashKey;
       pushStream->GetHashKey(hashKey);
-      nsISchedulingContext *schedulingContext = aStream->SchedulingContext();
-      if (schedulingContext) {
+      nsIRequestContext *requestContext = aStream->RequestContext();
+      if (requestContext) {
         SpdyPushCache *cache = nullptr;
-        schedulingContext->GetSpdyPushCache(&cache);
+        requestContext->GetSpdyPushCache(&cache);
         if (cache) {
           Http2PushedStream *trash = cache->RemovePushedStreamHttp2(hashKey);
           LOG3(("Http2Session::CleanupStream %p aStream=%p pushStream=%p trash=%p",
                 this, aStream, pushStream, trash));
         }
       }
     }
   }
@@ -1603,22 +1603,22 @@ Http2Session::RecvPushPromise(Http2Sessi
   } else if (!(associatedID & 1)) {
     LOG3(("Http2Session::RecvPushPromise %p assocated=0x%X on pushed (even) stream not allowed\n",
           self, associatedID));
     self->GenerateRstStream(PROTOCOL_ERROR, promisedID);
   } else if (!associatedStream) {
     LOG3(("Http2Session::RecvPushPromise %p lookup associated ID failed.\n", self));
     self->GenerateRstStream(PROTOCOL_ERROR, promisedID);
   } else {
-    nsISchedulingContext *schedulingContext = associatedStream->SchedulingContext();
-    if (schedulingContext) {
-      schedulingContext->GetSpdyPushCache(&cache);
+    nsIRequestContext *requestContext = associatedStream->RequestContext();
+    if (requestContext) {
+      requestContext->GetSpdyPushCache(&cache);
       if (!cache) {
         cache = new SpdyPushCache();
-        if (!cache || NS_FAILED(schedulingContext->SetSpdyPushCache(cache))) {
+        if (!cache || NS_FAILED(requestContext->SetSpdyPushCache(cache))) {
           delete cache;
           cache = nullptr;
         }
       }
     }
     if (!cache) {
       // this is unexpected, but we can handle it just by refusing the push
       LOG3(("Http2Session::RecvPushPromise Push Recevied without push cache\n"));
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -418,20 +418,20 @@ Http2Stream::ParseHttpRequestHeaders(con
   CreatePushHashKey(nsDependentCString(head->IsHTTPS() ? "https" : "http"),
                     authorityHeader, mSession->Serial(),
                     head->RequestURI(),
                     mOrigin, hashkey);
 
   // check the push cache for GET
   if (head->IsGet()) {
     // from :scheme, :authority, :path
-    nsISchedulingContext *schedulingContext = mTransaction->SchedulingContext();
+    nsIRequestContext *requestContext = mTransaction->RequestContext();
     SpdyPushCache *cache = nullptr;
-    if (schedulingContext) {
-      schedulingContext->GetSpdyPushCache(&cache);
+    if (requestContext) {
+      requestContext->GetSpdyPushCache(&cache);
     }
 
     Http2PushedStream *pushedStream = nullptr;
 
     // If a push stream is attached to the transaction via onPush, match only with that
     // one. This occurs when a push was made with in conjunction with a nsIHttpPushListener
     nsHttpTransaction *trans = mTransaction->QueryHttpTransaction();
     if (trans && (pushedStream = trans->TakePushedStream())) {
@@ -448,18 +448,18 @@ Http2Stream::ParseHttpRequestHeaders(con
     // we remove the pushedstream from the push cache so that
     // it will not be used for another GET. This does not destroy the
     // stream itself - that is done when the transactionhash is done with it.
     if (cache && !pushedStream){
         pushedStream = cache->RemovePushedStreamHttp2(hashkey);
     }
 
     LOG3(("Pushed Stream Lookup "
-          "session=%p key=%s schedulingcontext=%p cache=%p hit=%p\n",
-          mSession, hashkey.get(), schedulingContext, cache, pushedStream));
+          "session=%p key=%s requestcontext=%p cache=%p hit=%p\n",
+          mSession, hashkey.get(), requestContext, cache, pushedStream));
 
     if (pushedStream) {
       LOG3(("Pushed Stream Match located %p id=0x%X key=%s\n",
             pushedStream, pushedStream->StreamID(), hashkey.get()));
       pushedStream->SetConsumerStream(this);
       mPushSource = pushedStream;
       SetSentFin(true);
       AdjustPushedPriority();
--- a/netwerk/protocol/http/Http2Stream.h
+++ b/netwerk/protocol/http/Http2Stream.h
@@ -69,19 +69,19 @@ public:
   bool RequestBlockedOnRead()
   {
     return static_cast<bool>(mRequestBlockedOnRead);
   }
 
   bool HasRegisteredID() { return mStreamID != 0; }
 
   nsAHttpTransaction *Transaction() { return mTransaction; }
-  virtual nsISchedulingContext *SchedulingContext()
+  virtual nsIRequestContext *RequestContext()
   {
-    return mTransaction ? mTransaction->SchedulingContext() : nullptr;
+    return mTransaction ? mTransaction->RequestContext() : nullptr;
   }
 
   void Close(nsresult reason);
 
   void SetRecvdFin(bool aStatus);
   bool RecvdFin() { return mRecvdFin; }
 
   void SetRecvdData(bool aStatus) { mReceivedData = aStatus ? 1 : 0; }
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -118,17 +118,17 @@ HttpBaseChannel::HttpBaseChannel()
 #ifdef MOZ_VALGRIND
   // Zero the entire unions so that Valgrind doesn't complain when we send them
   // to another process.
   memset(&mSelfAddr, 0, sizeof(NetAddr));
   memset(&mPeerAddr, 0, sizeof(NetAddr));
 #endif
   mSelfAddr.raw.family = PR_AF_UNSPEC;
   mPeerAddr.raw.family = PR_AF_UNSPEC;
-  mSchedulingContextID.Clear();
+  mRequestContextID.Clear();
 }
 
 HttpBaseChannel::~HttpBaseChannel()
 {
   LOG(("Destroying HttpBaseChannel @%x\n", this));
 
   NS_ReleaseOnMainThread(mLoadInfo.forget());
 
@@ -1807,27 +1807,27 @@ HttpBaseChannel::RedirectTo(nsIURI *targ
   // This would break the nsIStreamListener contract.
   NS_ENSURE_FALSE(mOnStartRequestCalled, NS_ERROR_NOT_AVAILABLE);
 
   mAPIRedirectToURI = targetURI;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::GetSchedulingContextID(nsID *aSCID)
+HttpBaseChannel::GetRequestContextID(nsID *aRCID)
 {
-  NS_ENSURE_ARG_POINTER(aSCID);
-  *aSCID = mSchedulingContextID;
+  NS_ENSURE_ARG_POINTER(aRCID);
+  *aRCID = mRequestContextID;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::SetSchedulingContextID(const nsID aSCID)
+HttpBaseChannel::SetRequestContextID(const nsID aRCID)
 {
-  mSchedulingContextID = aSCID;
+  mRequestContextID = aRCID;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::GetIsMainDocumentChannel(bool* aValue)
 {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = mForceMainDocumentChannel || (mLoadFlags & LOAD_DOCUMENT_URI);
@@ -2542,51 +2542,16 @@ HttpBaseChannel::ShouldIntercept(nsIURI*
                                                         &shouldIntercept);
     if (NS_FAILED(rv)) {
       return false;
     }
   }
   return shouldIntercept;
 }
 
-void
-HttpBaseChannel::SetLoadGroupUserAgentOverride()
-{
-  nsCOMPtr<nsIURI> uri;
-  GetURI(getter_AddRefs(uri));
-  nsAutoCString uriScheme;
-  if (uri) {
-    uri->GetScheme(uriScheme);
-  }
-  nsCOMPtr<nsILoadGroupChild> childLoadGroup = do_QueryInterface(mLoadGroup);
-  nsCOMPtr<nsILoadGroup> rootLoadGroup;
-  if (childLoadGroup) {
-    childLoadGroup->GetRootLoadGroup(getter_AddRefs(rootLoadGroup));
-  }
-  if (rootLoadGroup && !uriScheme.EqualsLiteral("file")) {
-    nsAutoCString ua;
-    if (nsContentUtils::IsNonSubresourceRequest(this)) {
-      gHttpHandler->OnUserAgentRequest(this);
-      GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
-      rootLoadGroup->SetUserAgentOverrideCache(ua);
-    } else {
-      GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
-      // Don't overwrite the UA if it is already set (eg by an XHR with explicit UA).
-      if (ua.IsEmpty()) {
-        rootLoadGroup->GetUserAgentOverrideCache(ua);
-        SetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua, false);
-      }
-    }
-  } else {
-    // If the root loadgroup doesn't exist or if the channel's URI's scheme is "file",
-    // fall back on getting the UA override per channel.
-    gHttpHandler->OnUserAgentRequest(this);
-  }
-}
-
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsITraceableChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpBaseChannel::SetNewListener(nsIStreamListener *aListener, nsIStreamListener **_retval)
 {
   if (!mTracingEnabled)
@@ -2894,18 +2859,18 @@ HttpBaseChannel::SetupReplacementChannel
     nsresult hasHeader = mRequestHead.GetHeader(nsHttp::Accept, oldAcceptValue);
     if (NS_SUCCEEDED(hasHeader)) {
       httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
                                     oldAcceptValue,
                                     false);
     }
   }
 
-  // share the scheduling context - see bug 1236650
-  httpChannel->SetSchedulingContextID(mSchedulingContextID);
+  // share the request context - see bug 1236650
+  httpChannel->SetRequestContextID(mRequestContextID);
 
   if (httpInternal) {
     // Convey third party cookie and spdy flags.
     httpInternal->SetThirdPartyFlags(mThirdPartyFlags);
     httpInternal->SetAllowSpdy(mAllowSpdy);
     httpInternal->SetAllowAltSvc(mAllowAltSvc);
 
     RefPtr<nsHttpChannel> realChannel;
@@ -3338,22 +3303,22 @@ HttpBaseChannel::GetInnerDOMWindow()
     }
 
     return innerWindow;
 }
 
 //------------------------------------------------------------------------------
 
 bool
-HttpBaseChannel::EnsureSchedulingContextID()
+HttpBaseChannel::EnsureRequestContextID()
 {
     nsID nullID;
     nullID.Clear();
-    if (!mSchedulingContextID.Equals(nullID)) {
-        // Already have a scheduling context ID, no need to do the rest of this work
+    if (!mRequestContextID.Equals(nullID)) {
+        // Already have a request context ID, no need to do the rest of this work
         return true;
     }
 
     // Find the loadgroup at the end of the chain in order
     // to make sure all channels derived from the load group
     // use the same connection scope.
     nsCOMPtr<nsILoadGroupChild> childLoadGroup = do_QueryInterface(mLoadGroup);
     if (!childLoadGroup) {
@@ -3362,17 +3327,17 @@ HttpBaseChannel::EnsureSchedulingContext
 
     nsCOMPtr<nsILoadGroup> rootLoadGroup;
     childLoadGroup->GetRootLoadGroup(getter_AddRefs(rootLoadGroup));
     if (!rootLoadGroup) {
         return false;
     }
 
     // Set the load group connection scope on the transaction
-    rootLoadGroup->GetSchedulingContextID(&mSchedulingContextID);
+    rootLoadGroup->GetRequestContextID(&mRequestContextID);
     return true;
 }
 
 void
 HttpBaseChannel::SetCorsPreflightParameters(const nsTArray<nsCString>& aUnsafeHeaders)
 {
   MOZ_RELEASE_ASSERT(!mRequestObserversCalled);
 
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -163,21 +163,21 @@ public:
   NS_IMETHOD SetRedirectionLimit(uint32_t value) override;
   NS_IMETHOD IsNoStoreResponse(bool *value) override;
   NS_IMETHOD IsNoCacheResponse(bool *value) override;
   NS_IMETHOD IsPrivateResponse(bool *value) override;
   NS_IMETHOD GetResponseStatus(uint32_t *aValue) override;
   NS_IMETHOD GetResponseStatusText(nsACString& aValue) override;
   NS_IMETHOD GetRequestSucceeded(bool *aValue) override;
   NS_IMETHOD RedirectTo(nsIURI *newURI) override;
-  NS_IMETHOD GetSchedulingContextID(nsID *aSCID) override;
+  NS_IMETHOD GetRequestContextID(nsID *aRCID) override;
   NS_IMETHOD GetTransferSize(uint64_t *aTransferSize) override;
   NS_IMETHOD GetDecodedBodySize(uint64_t *aDecodedBodySize) override;
   NS_IMETHOD GetEncodedBodySize(uint64_t *aEncodedBodySize) override;
-  NS_IMETHOD SetSchedulingContextID(const nsID aSCID) override;
+  NS_IMETHOD SetRequestContextID(const nsID aRCID) override;
   NS_IMETHOD GetIsMainDocumentChannel(bool* aValue) override;
   NS_IMETHOD SetIsMainDocumentChannel(bool aValue) override;
   NS_IMETHOD GetProtocolVersion(nsACString & aProtocolVersion) override;
 
   // nsIHttpChannelInternal
   NS_IMETHOD GetDocumentURI(nsIURI **aDocumentURI) override;
   NS_IMETHOD SetDocumentURI(nsIURI *aDocumentURI) override;
   NS_IMETHOD GetRequestVersion(uint32_t *major, uint32_t *minor) override;
@@ -348,18 +348,16 @@ protected:
   nsIPrincipal *GetURIPrincipal();
 
   bool BypassServiceWorker() const;
 
   // Returns true if this channel should intercept the network request and prepare
   // for a possible synthesized response instead.
   bool ShouldIntercept(nsIURI* aURI = nullptr);
 
-  void SetLoadGroupUserAgentOverride();
-
   friend class PrivateBrowsingChannel<HttpBaseChannel>;
   friend class InterceptFailedOnStop;
 
   nsCOMPtr<nsIURI>                  mURI;
   nsCOMPtr<nsIURI>                  mOriginalURI;
   nsCOMPtr<nsIURI>                  mDocumentURI;
   nsCOMPtr<nsIStreamListener>       mListener;
   nsCOMPtr<nsISupports>             mListenerContext;
@@ -500,18 +498,18 @@ protected:
 
   uint64_t mTransferSize;
   uint64_t mDecodedBodySize;
   uint64_t mEncodedBodySize;
 
   // The network interface id that's associated with this channel.
   nsCString mNetworkInterfaceId;
 
-  nsID mSchedulingContextID;
-  bool EnsureSchedulingContextID();
+  nsID mRequestContextID;
+  bool EnsureRequestContextID();
 
   bool                              mRequireCORSPreflight;
   nsTArray<nsCString>               mUnsafeHeaders;
 
   nsCOMPtr<nsIConsoleReportCollector> mReportCollector;
 
   bool mForceMainDocumentChannel;
 };
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -1774,19 +1774,16 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
     // connection. See nsHttpChannel::AsyncOpen().
     AsyncAbort(mStatus);
     return NS_OK;
   }
 
   // Set user agent override from docshell
   HttpBaseChannel::SetDocshellUserAgentOverride();
 
-  // Set user agent override from loadgroup
-  HttpBaseChannel::SetLoadGroupUserAgentOverride();
-
   MOZ_ASSERT_IF(mPostRedirectChannelShouldUpgrade,
                 mPostRedirectChannelShouldIntercept);
   bool shouldUpgrade = mPostRedirectChannelShouldUpgrade;
   if (mPostRedirectChannelShouldIntercept ||
       ShouldInterceptURI(mURI, shouldUpgrade)) {
     mResponseCouldBeSynthesized = true;
 
     nsCOMPtr<nsINetworkInterceptController> controller;
@@ -1942,20 +1939,20 @@ HttpChannelChild::ContinueAsyncOpen()
 
   openArgs.allowStaleCacheContent() = mAllowStaleCacheContent;
 
   openArgs.contentTypeHint() = mContentTypeHint;
 
   nsresult rv = mozilla::ipc::LoadInfoToLoadInfoArgs(mLoadInfo, &openArgs.loadInfo());
   NS_ENSURE_SUCCESS(rv, rv);
 
-  EnsureSchedulingContextID();
-  char scid[NSID_LENGTH];
-  mSchedulingContextID.ToProvidedString(scid);
-  openArgs.schedulingContextID().AssignASCII(scid);
+  EnsureRequestContextID();
+  char rcid[NSID_LENGTH];
+  mRequestContextID.ToProvidedString(rcid);
+  openArgs.requestContextID().AssignASCII(rcid);
 
   // The socket transport in the chrome process now holds a logical ref to us
   // until OnStopRequest, or we do a redirect, or we hit an IPDL error.
   AddIPDLReference();
 
   PBrowserOrId browser = static_cast<ContentChild*>(gNeckoChild->Manager())
                          ->GetBrowserOrId(tabChild);
   gNeckoChild->SendPHttpChannelConstructor(this, browser,
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -125,17 +125,17 @@ HttpChannelParent::Init(const HttpChanne
                        a.requestMethod(), a.uploadStream(),
                        a.uploadStreamHasHeaders(), a.priority(), a.classOfService(),
                        a.redirectionLimit(), a.allowPipelining(), a.allowSTS(),
                        a.thirdPartyFlags(), a.resumeAt(), a.startPos(),
                        a.entityID(), a.chooseApplicationCache(),
                        a.appCacheClientID(), a.allowSpdy(), a.allowAltSvc(), a.fds(),
                        a.loadInfo(), a.synthesizedResponseHead(),
                        a.synthesizedSecurityInfoSerialization(),
-                       a.cacheKey(), a.schedulingContextID(), a.preflightArgs(),
+                       a.cacheKey(), a.requestContextID(), a.preflightArgs(),
                        a.initialRwin(), a.blockAuthPrompt(),
                        a.suspendAfterSynthesizeResponse(),
                        a.allowStaleCacheContent(), a.contentTypeHint());
   }
   case HttpChannelCreationArgs::THttpChannelConnectArgs:
   {
     const HttpChannelConnectArgs& cArgs = aArgs.get_HttpChannelConnectArgs();
     return ConnectChannel(cArgs.channelId(), cArgs.shouldIntercept());
@@ -253,17 +253,17 @@ HttpChannelParent::DoAsyncOpen(  const U
                                  const nsCString&           appCacheClientID,
                                  const bool&                allowSpdy,
                                  const bool&                allowAltSvc,
                                  const OptionalFileDescriptorSet& aFds,
                                  const OptionalLoadInfoArgs& aLoadInfoArgs,
                                  const OptionalHttpResponseHead& aSynthesizedResponseHead,
                                  const nsCString&           aSecurityInfoSerialization,
                                  const uint32_t&            aCacheKey,
-                                 const nsCString&           aSchedulingContextID,
+                                 const nsCString&           aRequestContextID,
                                  const OptionalCorsPreflightArgs& aCorsPreflightArgs,
                                  const uint32_t&            aInitialRwin,
                                  const bool&                aBlockAuthPrompt,
                                  const bool&                aSuspendAfterSynthesizeResponse,
                                  const bool&                aAllowStaleCacheContent,
                                  const nsCString&           aContentTypeHint)
 {
   nsCOMPtr<nsIURI> uri = DeserializeURI(aURI);
@@ -473,19 +473,19 @@ HttpChannelParent::DoAsyncOpen(  const U
       // This works because we've already called SetNotificationCallbacks and
       // done mPBOverride logic by this point.
       chooseAppCache = NS_ShouldCheckAppCache(principal, NS_UsePrivateBrowsing(mChannel));
 
       appCacheChan->SetChooseApplicationCache(chooseAppCache);
     }
   }
 
-  nsID schedulingContextID;
-  schedulingContextID.Parse(aSchedulingContextID.BeginReading());
-  mChannel->SetSchedulingContextID(schedulingContextID);
+  nsID requestContextID;
+  requestContextID.Parse(aRequestContextID.BeginReading());
+  mChannel->SetRequestContextID(requestContextID);
 
   mSuspendAfterSynthesizeResponse = aSuspendAfterSynthesizeResponse;
 
   if (loadInfo && loadInfo->GetEnforceSecurity()) {
     rv = mChannel->AsyncOpen2(mParentListener);
   }
   else {
     rv = mChannel->AsyncOpen(mParentListener, nullptr);
--- a/netwerk/protocol/http/HttpChannelParent.h
+++ b/netwerk/protocol/http/HttpChannelParent.h
@@ -128,17 +128,17 @@ protected:
                    const nsCString&           appCacheClientID,
                    const bool&                allowSpdy,
                    const bool&                allowAltSvc,
                    const OptionalFileDescriptorSet& aFds,
                    const OptionalLoadInfoArgs& aLoadInfoArgs,
                    const OptionalHttpResponseHead& aSynthesizedResponseHead,
                    const nsCString&           aSecurityInfoSerialization,
                    const uint32_t&            aCacheKey,
-                   const nsCString&           aSchedulingContextID,
+                   const nsCString&           aRequestContextID,
                    const OptionalCorsPreflightArgs& aCorsPreflightArgs,
                    const uint32_t&            aInitialRwin,
                    const bool&                aBlockAuthPrompt,
                    const bool&                aSuspendAfterSynthesizeResponse,
                    const bool&                aAllowStaleCacheContent,
                    const nsCString&           aContentTypeHint);
 
   virtual bool RecvSetPriority(const uint16_t& priority) override;
--- a/netwerk/protocol/http/NullHttpChannel.cpp
+++ b/netwerk/protocol/http/NullHttpChannel.cpp
@@ -229,23 +229,23 @@ NullHttpChannel::IsPrivateResponse(bool 
 
 NS_IMETHODIMP
 NullHttpChannel::RedirectTo(nsIURI *aNewURI)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-NullHttpChannel::GetSchedulingContextID(nsID *_retval)
+NullHttpChannel::GetRequestContextID(nsID *_retval)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-NullHttpChannel::SetSchedulingContextID(const nsID scID)
+NullHttpChannel::SetRequestContextID(const nsID rcID)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 NullHttpChannel::GetProtocolVersion(nsACString& aProtocolVersion)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/netwerk/protocol/http/SpdyPush31.cpp
+++ b/netwerk/protocol/http/SpdyPush31.cpp
@@ -35,17 +35,17 @@ SpdyPushedStream31::SpdyPushedStream31(S
   , mBufferedPush(aTransaction)
   , mStatus(NS_OK)
   , mPushCompleted(false)
   , mDeferCleanupOnSuccess(true)
 {
   LOG3(("SpdyPushedStream31 ctor this=%p id=0x%X\n", this, aID));
   mStreamID = aID;
   mBufferedPush->SetPushStream(this);
-  mSchedulingContext = aAssociatedStream->SchedulingContext();
+  mRequestContext = aAssociatedStream->RequestContext();
   mLastRead = TimeStamp::Now();
 }
 
 bool
 SpdyPushedStream31::GetPushComplete()
 {
   return mPushCompleted;
 }
--- a/netwerk/protocol/http/SpdyPush31.h
+++ b/netwerk/protocol/http/SpdyPush31.h
@@ -7,17 +7,17 @@
 
 #ifndef mozilla_net_SpdyPush31_Internal_h
 #define mozilla_net_SpdyPush31_Internal_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/UniquePtr.h"
 #include "nsHttpRequestHead.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 #include "nsString.h"
 #include "PSpdyPush.h"
 #include "SpdySession31.h"
 #include "SpdyStream31.h"
 
 namespace mozilla {
 namespace net {
 
@@ -36,17 +36,17 @@ public:
   SpdyStream31 *GetConsumerStream() { return mConsumerStream; };
   void SetConsumerStream(SpdyStream31 *aStream) { mConsumerStream = aStream; }
   bool GetHashKey(nsCString &key);
 
   // override of SpdyStream31
   nsresult ReadSegments(nsAHttpSegmentReader *,  uint32_t, uint32_t *);
   nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *);
 
-  nsISchedulingContext *SchedulingContext() { return mSchedulingContext; };
+  nsIRequestContext *RequestContext() { return mRequestContext; };
   void ConnectPushedStream(SpdyStream31 *consumer);
 
   bool DeferCleanupOnSuccess() { return mDeferCleanupOnSuccess; }
   void SetDeferCleanupOnSuccess(bool val) { mDeferCleanupOnSuccess = val; }
 
   bool IsOrphaned(TimeStamp now);
 
   nsresult GetBufferedData(char *buf, uint32_t count, uint32_t *countWritten);
@@ -54,17 +54,17 @@ public:
   // overload of SpdyStream31
   virtual bool HasSink() { return !!mConsumerStream; }
 
 private:
 
   SpdyStream31 *mConsumerStream; // paired request stream that consumes from
   // real spdy one.. null until a match is made.
 
-  nsCOMPtr<nsISchedulingContext> mSchedulingContext;
+  nsCOMPtr<nsIRequestContext> mRequestContext;
 
   SpdyPush31TransactionBuffer *mBufferedPush;
   TimeStamp          mLastRead;
 
   nsCString mHashKey;
   nsresult mStatus;
   bool mPushCompleted; // server push FIN received
   bool mDeferCleanupOnSuccess;
--- a/netwerk/protocol/http/SpdySession31.cpp
+++ b/netwerk/protocol/http/SpdySession31.cpp
@@ -14,17 +14,17 @@
 #define LOG_ENABLED() LOG5_ENABLED()
 
 #include "mozilla/Telemetry.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Snprintf.h"
 #include "nsHttp.h"
 #include "nsHttpHandler.h"
 #include "nsHttpConnection.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 #include "nsISupportsPriority.h"
 #include "prnetdb.h"
 #include "SpdyPush31.h"
 #include "SpdySession31.h"
 #include "SpdyStream31.h"
 #include "SpdyZlibReporter.h"
 #include "nsSocketTransportService2.h"
 
@@ -1039,22 +1039,22 @@ SpdySession31::HandleSynStream(SpdySessi
     LOG3(("SpdySession31::HandleSynStream Push Recevied when Disabled\n"));
     self->GenerateRstStream(RST_REFUSED_STREAM, streamID);
 
   } else if (!associatedStream) {
     LOG3(("SpdySession31::HandleSynStream %p lookup associated ID failed.\n", self));
     self->GenerateRstStream(RST_INVALID_STREAM, streamID);
 
   } else {
-    nsISchedulingContext *schedulingContext = associatedStream->SchedulingContext();
-    if (schedulingContext) {
-      schedulingContext->GetSpdyPushCache(&cache);
+    nsIRequestContext *requestContext = associatedStream->RequestContext();
+    if (requestContext) {
+      requestContext->GetSpdyPushCache(&cache);
       if (!cache) {
         cache = new SpdyPushCache();
-        if (!cache || NS_FAILED(schedulingContext->SetSpdyPushCache(cache))) {
+        if (!cache || NS_FAILED(requestContext->SetSpdyPushCache(cache))) {
           delete cache;
           cache = nullptr;
         }
       }
     }
     if (!cache) {
       // this is unexpected, but we can handle it just be refusing the push
       LOG3(("SpdySession31::HandleSynStream Push Recevied without push cache\n"));
--- a/netwerk/protocol/http/SpdyStream31.cpp
+++ b/netwerk/protocol/http/SpdyStream31.cpp
@@ -301,20 +301,20 @@ SpdyStream31::ParseHttpRequestHeaders(co
   CreatePushHashKey(nsDependentCString(mTransaction->RequestHead()->IsHTTPS() ? "https" : "http"),
                     hostHeader, mSession->Serial(),
                     mTransaction->RequestHead()->RequestURI(),
                     mOrigin, hashkey);
 
   // check the push cache for GET
   if (mTransaction->RequestHead()->IsGet()) {
     // from :scheme, :host, :path
-    nsISchedulingContext *schedulingContext = mTransaction->SchedulingContext();
+    nsIRequestContext *requestContext = mTransaction->RequestContext();
     SpdyPushCache *cache = nullptr;
-    if (schedulingContext)
-      schedulingContext->GetSpdyPushCache(&cache);
+    if (requestContext)
+      requestContext->GetSpdyPushCache(&cache);
 
     SpdyPushedStream31 *pushedStream = nullptr;
     // we remove the pushedstream from the push cache so that
     // it will not be used for another GET. This does not destroy the
     // stream itself - that is done when the transactionhash is done with it.
     if (cache)
       pushedStream = cache->RemovePushedStreamSpdy31(hashkey);
 
--- a/netwerk/protocol/http/SpdyStream31.h
+++ b/netwerk/protocol/http/SpdyStream31.h
@@ -38,19 +38,19 @@ public:
   bool GetFullyOpen();
   // returns failure if stream cannot be made ready and stream
   // should be canceled
   nsresult SetFullyOpen();
 
   bool HasRegisteredID() { return mStreamID != 0; }
 
   nsAHttpTransaction *Transaction() { return mTransaction; }
-  virtual nsISchedulingContext *SchedulingContext()
+  virtual nsIRequestContext *RequestContext()
   {
-    return mTransaction ? mTransaction->SchedulingContext() : nullptr;
+    return mTransaction ? mTransaction->RequestContext() : nullptr;
   }
 
   void Close(nsresult reason);
 
   void SetRecvdFin(bool aStatus) { mRecvdFin = aStatus ? 1 : 0; }
   bool RecvdFin() { return mRecvdFin; }
 
   void SetRecvdData(bool aStatus) { mReceivedData = aStatus ? 1 : 0; }
--- a/netwerk/protocol/http/nsAHttpTransaction.h
+++ b/netwerk/protocol/http/nsAHttpTransaction.h
@@ -6,17 +6,17 @@
 #define nsAHttpTransaction_h__
 
 #include "nsISupports.h"
 #include "nsTArray.h"
 #include "nsWeakReference.h"
 
 class nsIInterfaceRequestor;
 class nsITransport;
-class nsISchedulingContext;
+class nsIRequestContext;
 
 namespace mozilla { namespace net {
 
 class nsAHttpConnection;
 class nsAHttpSegmentReader;
 class nsAHttpSegmentWriter;
 class nsHttpTransaction;
 class nsHttpPipeline;
@@ -153,18 +153,18 @@ public:
     // non nsHttpTransaction implementations of nsAHttpTransaction
     virtual nsHttpTransaction *QueryHttpTransaction() { return nullptr; }
 
     // If we used rtti this would be the result of doing
     // dynamic_cast<SpdyConnectTransaction *>(this).. i.e. it can be nullptr for
     // other types
     virtual SpdyConnectTransaction *QuerySpdyConnectTransaction() { return nullptr; }
 
-    // return the scheduling context associated with the transaction
-    virtual nsISchedulingContext *SchedulingContext() { return nullptr; }
+    // return the request context associated with the transaction
+    virtual nsIRequestContext *RequestContext() { return nullptr; }
 
     // return the connection information associated with the transaction
     virtual nsHttpConnectionInfo *ConnectionInfo() = 0;
 
     // The base definition of these is done in nsHttpTransaction.cpp
     virtual bool ResponseTimeoutEnabled() const;
     virtual PRIntervalTime ResponseTimeout();
 
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -667,37 +667,37 @@ nsHttpChannel::ContinueHandleAsyncFallba
 
     if (mLoadGroup)
         mLoadGroup->RemoveRequest(this, nullptr, mStatus);
 
     return rv;
 }
 
 void
-nsHttpChannel::SetupTransactionSchedulingContext()
-{
-    if (!EnsureSchedulingContextID()) {
+nsHttpChannel::SetupTransactionRequestContext()
+{
+    if (!EnsureRequestContextID()) {
         return;
     }
 
-    nsISchedulingContextService *scsvc =
-        gHttpHandler->GetSchedulingContextService();
-    if (!scsvc) {
+    nsIRequestContextService *rcsvc =
+        gHttpHandler->GetRequestContextService();
+    if (!rcsvc) {
         return;
     }
 
-    nsCOMPtr<nsISchedulingContext> sc;
-    nsresult rv = scsvc->GetSchedulingContext(mSchedulingContextID,
-                                              getter_AddRefs(sc));
+    nsCOMPtr<nsIRequestContext> rc;
+    nsresult rv = rcsvc->GetRequestContext(mRequestContextID,
+                                           getter_AddRefs(rc));
 
     if (NS_FAILED(rv)) {
         return;
     }
 
-    mTransaction->SetSchedulingContext(sc);
+    mTransaction->SetRequestContext(rc);
 }
 
 static bool
 SafeForPipelining(nsHttpRequestHead::ParsedMethodType method,
                   const nsCString &methodString)
 {
     if (method == nsHttpRequestHead::kMethod_Get ||
         method == nsHttpRequestHead::kMethod_Head ||
@@ -903,17 +903,17 @@ nsHttpChannel::SetupTransaction()
                             NS_GetCurrentThread(), callbacks, this,
                             getter_AddRefs(responseStream));
     if (NS_FAILED(rv)) {
         mTransaction = nullptr;
         return rv;
     }
 
     mTransaction->SetClassOfService(mClassOfService);
-    SetupTransactionSchedulingContext();
+    SetupTransactionRequestContext();
 
     rv = nsInputStreamPump::Create(getter_AddRefs(mTransactionPump),
                                    responseStream);
     return rv;
 }
 
 // NOTE: This function duplicates code from nsBaseChannel. This will go away
 // once HTTP uses nsBaseChannel (part of bug 312760)
@@ -5344,20 +5344,17 @@ nsHttpChannel::BeginConnect()
 
     // check to see if authorization headers should be included
     // mCustomAuthHeader is set in AsyncOpen if we find Authorization header
     mAuthProvider->AddAuthorizationHeaders(mCustomAuthHeader);
 
     // notify "http-on-modify-request" observers
     CallOnModifyRequestObservers();
 
-    // If mLoadGroup is null, e10s is enabled and this will be handled by HttpChannelChild.
-    if (mLoadGroup) {
-      HttpBaseChannel::SetLoadGroupUserAgentOverride();
-    }
+    SetLoadGroupUserAgentOverride();
 
     // Check to see if we should redirect this channel elsewhere by
     // nsIHttpChannel.redirectTo API request
     if (mAPIRedirectToURI) {
         return AsyncCall(&nsHttpChannel::HandleAsyncAPIRedirect);
     }
     // Check to see if this principal exists on local blocklists.
     RefPtr<nsChannelClassifier> channelClassifier = new nsChannelClassifier();
@@ -7415,10 +7412,54 @@ nsHttpChannel::MaybeWarnAboutAppCache()
     // Then, issue a deprecation warning.
     nsCOMPtr<nsIDeprecationWarner> warner;
     GetCallback(warner);
     if (warner) {
         warner->IssueWarning(nsIDocument::eAppCache, false);
     }
 }
 
+void
+nsHttpChannel::SetLoadGroupUserAgentOverride()
+{
+    nsCOMPtr<nsIURI> uri;
+    GetURI(getter_AddRefs(uri));
+    nsAutoCString uriScheme;
+    if (uri) {
+        uri->GetScheme(uriScheme);
+    }
+
+    // We don't need a UA for file: protocols.
+    if (uriScheme.EqualsLiteral("file")) {
+        gHttpHandler->OnUserAgentRequest(this);
+        return;
+    }
+
+    nsIRequestContextService* rcsvc = gHttpHandler->GetRequestContextService();
+    nsCOMPtr<nsIRequestContext> rc;
+    if (rcsvc) {
+        rcsvc->GetRequestContext(mRequestContextID,
+                                    getter_AddRefs(rc));
+    }
+
+    nsAutoCString ua;
+    if (nsContentUtils::IsNonSubresourceRequest(this)) {
+        gHttpHandler->OnUserAgentRequest(this);
+        if (rc) {
+            GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
+            rc->SetUserAgentOverride(ua);
+        }
+    } else {
+        GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
+        // Don't overwrite the UA if it is already set (eg by an XHR with explicit UA).
+        if (ua.IsEmpty()) {
+            if (rc) {
+                rc->GetUserAgentOverride(ua);
+                SetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua, false);
+            } else {
+                gHttpHandler->OnUserAgentRequest(this);
+            }
+        }
+    }
+}
+
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -265,17 +265,17 @@ private:
 
     bool     RequestIsConditional();
     nsresult BeginConnect();
     nsresult ContinueBeginConnectWithResult();
     void     ContinueBeginConnect();
     nsresult Connect();
     void     SpeculativeConnect();
     nsresult SetupTransaction();
-    void     SetupTransactionSchedulingContext();
+    void     SetupTransactionRequestContext();
     nsresult CallOnStartRequest();
     nsresult ProcessResponse();
     nsresult ContinueProcessResponse1(nsresult);
     nsresult ContinueProcessResponse2(nsresult);
     nsresult ProcessNormal();
     nsresult ContinueProcessNormal(nsresult);
     void     ProcessAltService();
     nsresult ProcessNotModified();
@@ -428,16 +428,18 @@ private:
     void UntieValidationRequest();
     nsresult OpenCacheInputStream(nsICacheEntry* cacheEntry, bool startBuffering,
                                   bool checkingAppCacheEntry);
 
     void SetPushedStream(Http2PushedStream *stream);
 
     void MaybeWarnAboutAppCache();
 
+    void SetLoadGroupUserAgentOverride();
+
 private:
     nsCOMPtr<nsICancelable>           mProxyRequest;
 
     RefPtr<nsInputStreamPump>       mTransactionPump;
     RefPtr<nsHttpTransaction>       mTransaction;
 
     uint64_t                          mLogicalOffset;
 
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -24,17 +24,17 @@
 #include "nsISocketTransport.h"
 #include "nsISSLSocketControl.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/net/DashboardTypes.h"
 #include "NullHttpTransaction.h"
 #include "nsIDNSRecord.h"
 #include "nsITransport.h"
 #include "nsInterfaceRequestorAgg.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 #include "nsISocketTransportService.h"
 #include <algorithm>
 #include "mozilla/ChaosMode.h"
 #include "mozilla/unused.h"
 #include "nsIURI.h"
 
 #include "mozilla/Telemetry.h"
 
@@ -1468,30 +1468,30 @@ nsHttpConnectionMgr::TryDispatchTransact
                 trans->RemoveDispatchedAsBlocking();  /* just in case */
                 DispatchTransaction(ent, trans, conn);
                 return NS_OK;
             }
             unusedSpdyPersistentConnection = conn;
         }
     }
 
-    // If this is not a blocking transaction and the scheduling context for it is
+    // If this is not a blocking transaction and the request context for it is
     // currently processing one or more blocking transactions then we
     // need to just leave it in the queue until those are complete unless it is
     // explicitly marked as unblocked.
     if (!(caps & NS_HTTP_LOAD_AS_BLOCKING)) {
         if (!(caps & NS_HTTP_LOAD_UNBLOCKED)) {
-            nsISchedulingContext *schedulingContext = trans->SchedulingContext();
-            if (schedulingContext) {
+            nsIRequestContext *requestContext = trans->RequestContext();
+            if (requestContext) {
                 uint32_t blockers = 0;
-                if (NS_SUCCEEDED(schedulingContext->GetBlockingTransactionCount(&blockers)) &&
+                if (NS_SUCCEEDED(requestContext->GetBlockingTransactionCount(&blockers)) &&
                     blockers) {
                     // need to wait for blockers to clear
-                    LOG(("   blocked by scheduling context: [sc=%p trans=%p blockers=%d]\n",
-                         schedulingContext, trans, blockers));
+                    LOG(("   blocked by request context: [rc=%p trans=%p blockers=%d]\n",
+                         requestContext, trans, blockers));
                     return NS_ERROR_NOT_AVAILABLE;
                 }
             }
         }
     } else {
         // Mark the transaction and its load group as blocking right now to prevent
         // other transactions from being reordered in the queue due to slow syns.
         trans->DispatchedAsBlocking();
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -346,18 +346,18 @@ nsHttpHandler::Init()
     if (NS_FAILED(rv)) return rv;
 
     rv = mPrivateAuthCache.Init();
     if (NS_FAILED(rv)) return rv;
 
     rv = InitConnectionMgr();
     if (NS_FAILED(rv)) return rv;
 
-    mSchedulingContextService =
-        do_GetService("@mozilla.org/network/scheduling-context-service;1");
+    mRequestContextService =
+        do_GetService("@mozilla.org/network/request-context-service;1");
 
 #if defined(ANDROID) || defined(MOZ_MULET)
     mProductSub.AssignLiteral(MOZILLA_UAVERSION);
 #else
     mProductSub.AssignLiteral("20100101");
 #endif
 
 #if DEBUG
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -19,17 +19,17 @@
 #include "nsIObserver.h"
 #include "nsISpeculativeConnect.h"
 
 class nsIHttpChannel;
 class nsIPrefBranch;
 class nsICancelable;
 class nsICookieService;
 class nsIIOService;
-class nsISchedulingContextService;
+class nsIRequestContextService;
 class nsISiteSecurityService;
 class nsIStreamConverterService;
 class nsITimer;
 
 extern mozilla::Atomic<PRThread*, mozilla::Relaxed> gSocketThread;
 
 namespace mozilla {
 namespace net {
@@ -347,19 +347,19 @@ public:
     bool Active() { return mHandlerActive; }
 
     // When the disk cache is responding slowly its use is suppressed
     // for 1 minute for most requests. Callable from main thread only.
     TimeStamp GetCacheSkippedUntil() { return mCacheSkippedUntil; }
     void SetCacheSkippedUntil(TimeStamp arg) { mCacheSkippedUntil = arg; }
     void ClearCacheSkippedUntil() { mCacheSkippedUntil = TimeStamp(); }
 
-    nsISchedulingContextService *GetSchedulingContextService()
+    nsIRequestContextService *GetRequestContextService()
     {
-        return mSchedulingContextService.get();
+        return mRequestContextService.get();
     }
 
     void ShutdownConnectionManager();
 
 private:
     virtual ~nsHttpHandler();
 
     //
@@ -562,17 +562,17 @@ private:
     bool mTCPKeepaliveLongLivedEnabled;
     // Time (secs) before first keepalive probe; between successful probes.
     int32_t mTCPKeepaliveLongLivedIdleTimeS;
 
     // if true, generate NS_ERROR_PARTIAL_TRANSFER for h1 responses with
     // incorrect content lengths or malformed chunked encodings
     FrameCheckLevel mEnforceH1Framing;
 
-    nsCOMPtr<nsISchedulingContextService> mSchedulingContextService;
+    nsCOMPtr<nsIRequestContextService> mRequestContextService;
 
     // True if remote newtab content-signature disabled because of the channel.
     bool mNewTabContentSignaturesDisabled;
 
 private:
     // For Rate Pacing Certain Network Events. Only assign this pointer on
     // socket thread.
     void MakeNewRequestTokenBucket();
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -30,17 +30,17 @@
 #include "nsIHttpActivityObserver.h"
 #include "nsSocketTransportService2.h"
 #include "nsICancelable.h"
 #include "nsIEventTarget.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIInputStream.h"
 #include "nsITransport.h"
 #include "nsIOService.h"
-#include "nsISchedulingContext.h"
+#include "nsIRequestContext.h"
 #include <algorithm>
 
 #ifdef MOZ_WIDGET_GONK
 #include "NetStatistics.h"
 #endif
 
 //-----------------------------------------------------------------------------
 
@@ -1875,73 +1875,73 @@ nsHttpTransaction::CancelPipeline(uint32
     // Avoid pipelining this transaction on restart by classifying it as solo.
     // This also prevents BadUnexpectedLarge from being reported more
     // than one time per transaction.
     mClassification = CLASS_SOLO;
 }
 
 
 void
-nsHttpTransaction::SetSchedulingContext(nsISchedulingContext *aSchedulingContext)
+nsHttpTransaction::SetRequestContext(nsIRequestContext *aRequestContext)
 {
-    LOG(("nsHttpTransaction %p SetSchedulingContext %p\n", this, aSchedulingContext));
-    mSchedulingContext = aSchedulingContext;
+    LOG(("nsHttpTransaction %p SetRequestContext %p\n", this, aRequestContext));
+    mRequestContext = aRequestContext;
 }
 
 // Called when the transaction marked for blocking is associated with a connection
 // (i.e. added to a new h1 conn, an idle http connection, or placed into
 // a http pipeline). It is safe to call this multiple times with it only
 // having an effect once.
 void
 nsHttpTransaction::DispatchedAsBlocking()
 {
     if (mDispatchedAsBlocking)
         return;
 
     LOG(("nsHttpTransaction %p dispatched as blocking\n", this));
 
-    if (!mSchedulingContext)
+    if (!mRequestContext)
         return;
 
     LOG(("nsHttpTransaction adding blocking transaction %p from "
-         "scheduling context %p\n", this, mSchedulingContext.get()));
+         "request context %p\n", this, mRequestContext.get()));
 
-    mSchedulingContext->AddBlockingTransaction();
+    mRequestContext->AddBlockingTransaction();
     mDispatchedAsBlocking = true;
 }
 
 void
 nsHttpTransaction::RemoveDispatchedAsBlocking()
 {
-    if (!mSchedulingContext || !mDispatchedAsBlocking)
+    if (!mRequestContext || !mDispatchedAsBlocking)
         return;
 
     uint32_t blockers = 0;
-    nsresult rv = mSchedulingContext->RemoveBlockingTransaction(&blockers);
+    nsresult rv = mRequestContext->RemoveBlockingTransaction(&blockers);
 
     LOG(("nsHttpTransaction removing blocking transaction %p from "
-         "scheduling context %p. %d blockers remain.\n", this,
-         mSchedulingContext.get(), blockers));
+         "request context %p. %d blockers remain.\n", this,
+         mRequestContext.get(), blockers));
 
     if (NS_SUCCEEDED(rv) && !blockers) {
         LOG(("nsHttpTransaction %p triggering release of blocked channels "
-             " with scheduling context=%p\n", this, mSchedulingContext.get()));
+             " with request context=%p\n", this, mRequestContext.get()));
         gHttpHandler->ConnMgr()->ProcessPendingQ();
     }
 
     mDispatchedAsBlocking = false;
 }
 
 void
 nsHttpTransaction::ReleaseBlockingTransaction()
 {
     RemoveDispatchedAsBlocking();
-    LOG(("nsHttpTransaction %p scheduling context set to null "
-         "in ReleaseBlockingTransaction() - was %p\n", this, mSchedulingContext.get()));
-    mSchedulingContext = nullptr;
+    LOG(("nsHttpTransaction %p request context set to null "
+         "in ReleaseBlockingTransaction() - was %p\n", this, mRequestContext.get()));
+    mRequestContext = nullptr;
 }
 
 void
 nsHttpTransaction::DisableSpdy()
 {
     mCaps |= NS_HTTP_DISALLOW_SPDY;
     if (mConnInfo) {
         // This is our clone of the connection info, not the persistent one that
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -24,17 +24,17 @@
 #endif
 
 //-----------------------------------------------------------------------------
 
 class nsIHttpActivityObserver;
 class nsIEventTarget;
 class nsIInputStream;
 class nsIOutputStream;
-class nsISchedulingContext;
+class nsIRequestContext;
 
 namespace mozilla { namespace net {
 
 class nsHttpChunkedDecoder;
 class nsHttpRequestHead;
 class nsHttpResponseHead;
 
 //-----------------------------------------------------------------------------
@@ -121,19 +121,19 @@ public:
 
     void PrintDiagnostics(nsCString &log);
 
     // Sets mPendingTime to the current time stamp or to a null time stamp (if now is false)
     void SetPendingTime(bool now = true) { mPendingTime = now ? TimeStamp::Now() : TimeStamp(); }
     const TimeStamp GetPendingTime() { return mPendingTime; }
     bool UsesPipelining() const { return mCaps & NS_HTTP_ALLOW_PIPELINING; }
 
-    // overload of nsAHttpTransaction::SchedulingContext()
-    nsISchedulingContext *SchedulingContext() override { return mSchedulingContext.get(); }
-    void SetSchedulingContext(nsISchedulingContext *aSchedulingContext);
+    // overload of nsAHttpTransaction::RequestContext()
+    nsIRequestContext *RequestContext() override { return mRequestContext.get(); }
+    void SetRequestContext(nsIRequestContext *aRequestContext);
     void DispatchedAsBlocking();
     void RemoveDispatchedAsBlocking();
 
     nsHttpTransaction *QueryHttpTransaction() override { return this; }
 
     Http2PushedStream *GetPushedStream() { return mPushedStream; }
     Http2PushedStream *TakePushedStream()
     {
@@ -219,17 +219,17 @@ private:
     Mutex mLock;
 
     nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
     nsCOMPtr<nsITransportEventSink> mTransportSink;
     nsCOMPtr<nsIEventTarget>        mConsumerTarget;
     nsCOMPtr<nsISupports>           mSecurityInfo;
     nsCOMPtr<nsIAsyncInputStream>   mPipeIn;
     nsCOMPtr<nsIAsyncOutputStream>  mPipeOut;
-    nsCOMPtr<nsISchedulingContext>  mSchedulingContext;
+    nsCOMPtr<nsIRequestContext>     mRequestContext;
 
     nsCOMPtr<nsISupports>             mChannel;
     nsCOMPtr<nsIHttpActivityObserver> mActivityDistributor;
 
     nsCString                       mReqHeaderBuf;    // flattened request headers
     nsCOMPtr<nsIInputStream>        mRequestStream;
     int64_t                         mRequestSize;
 
--- a/netwerk/protocol/http/nsIHttpChannel.idl
+++ b/netwerk/protocol/http/nsIHttpChannel.idl
@@ -394,12 +394,12 @@ interface nsIHttpChannel : nsIChannel
      * caller to call it wins.
      *
      * @throws NS_ERROR_NOT_AVAILABLE if called after the channel has already
      *         started to deliver the content to its listener.
      */
     void redirectTo(in nsIURI aTargetURI);
 
     /**
-     * Identifies the scheduling context for this load.
+     * Identifies the request context for this load.
      */
-    [noscript] attribute nsID schedulingContextID;
+    [noscript] attribute nsID requestContextID;
 };
--- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp
+++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp
@@ -930,27 +930,27 @@ nsViewSourceChannel::IsPrivateResponse(b
 NS_IMETHODIMP
 nsViewSourceChannel::RedirectTo(nsIURI *uri)
 {
     return !mHttpChannel ? NS_ERROR_NULL_POINTER :
         mHttpChannel->RedirectTo(uri);
 }
 
 NS_IMETHODIMP
-nsViewSourceChannel::GetSchedulingContextID(nsID *_retval)
+nsViewSourceChannel::GetRequestContextID(nsID *_retval)
 {
     return !mHttpChannel ? NS_ERROR_NULL_POINTER :
-        mHttpChannel->GetSchedulingContextID(_retval);
+        mHttpChannel->GetRequestContextID(_retval);
 }
 
 NS_IMETHODIMP
-nsViewSourceChannel::SetSchedulingContextID(const nsID scid)
+nsViewSourceChannel::SetRequestContextID(const nsID rcid)
 {
     return !mHttpChannel ? NS_ERROR_NULL_POINTER :
-        mHttpChannel->SetSchedulingContextID(scid);
+        mHttpChannel->SetRequestContextID(rcid);
 }
 
 NS_IMETHODIMP
 nsViewSourceChannel::GetIsMainDocumentChannel(bool* aValue)
 {
     return !mHttpChannel ? NS_ERROR_NULL_POINTER :
         mHttpChannel->GetIsMainDocumentChannel(aValue);
 }
--- a/netwerk/test/mochitests/mochitest.ini
+++ b/netwerk/test/mochitests/mochitest.ini
@@ -15,17 +15,16 @@ support-files =
   redirect.sjs
   !/dom/apps/tests/file_app.sjs
 
 [test_arraybufferinputstream.html]
 [test_partially_cached_content.html]
 [test_rel_preconnect.html]
 [test_uri_scheme.html]
 [test_user_agent_overrides.html]
-skip-if = e10s
 [test_user_agent_updates.html]
 skip-if = e10s
 [test_user_agent_updates_reset.html]
 [test_viewsource_unlinkable.html]
 [test_xhr_method_case.html]
 [test_web_packaged_app.html]
 skip-if = buildapp != 'mulet'
 [test_loadinfo_redirectchain.html]
--- a/netwerk/test/mochitests/test_user_agent_overrides.html
+++ b/netwerk/test/mochitests/test_user_agent_overrides.html
@@ -214,25 +214,25 @@ function testPriority(callback) {
 function testOverrides(callback) {
   SpecialPowers.pushPrefEnv({
     set: [[PREF_OVERRIDES_ENABLED, true]]
   }, function nextTest() {
     testUA(tests.shift(), function() { tests.length ? nextTest() : callback() });
   });
 }
 
-SpecialPowers.Cu.import('resource://gre/modules/UserAgentOverrides.jsm', window);
-SpecialPowers.wrap(UserAgentOverrides).init();
+SpecialPowers.loadChromeScript(_ => {
+  Components.utils.import("resource://gre/modules/UserAgentOverrides.jsm");
+  UserAgentOverrides.init();
+});
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestCompleteLog();
 SimpleTest.requestLongerTimeout(5);
 
-info(SpecialPowers.Cc["@mozilla.org/dom/site-specific-user-agent;1"].number);
-
 testOverrides(function() {
   testInactive(function() {
     testPriority(SimpleTest.finish)
   });
 });
 
 </script>
 </pre>