Backed out changesets 41d0ad0271a6, 2bda66cf60fd, and dd1fc46d4d56 (bug 1118845) for B2G mochitest failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 08 Jan 2015 21:50:19 -0500
changeset 222880 8d838801a16de5e235bfe42235d451d02f5866fc
parent 222879 f87ebcbf7a2e4b29511a03b235ada9a4629f44b1
child 222881 70bc10b845afeee83d9fa20464b0f365c9e08094
push id10731
push usercbook@mozilla.com
push dateFri, 09 Jan 2015 14:51:37 +0000
treeherderfx-team@e6756043d930 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1118845
milestone37.0a1
backs out41d0ad0271a6693cab09ef2cfdd26d15fb3a9ce6
2bda66cf60fd98af7c82b0df55052d647d9d33b6
dd1fc46d4d5694418fa1071ab6231237f0949c24
Backed out changesets 41d0ad0271a6, 2bda66cf60fd, and dd1fc46d4d56 (bug 1118845) for B2G mochitest failures. CLOSED TREE
docshell/base/LoadContext.cpp
docshell/base/LoadContext.h
dom/workers/RuntimeService.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
netwerk/base/public/nsNetUtil.h
netwerk/base/src/nsNetUtil.cpp
--- a/docshell/base/LoadContext.cpp
+++ b/docshell/base/LoadContext.cpp
@@ -6,38 +6,29 @@
 
 #include "mozilla/Assertions.h"
 #include "mozilla/LoadContext.h"
 
 namespace mozilla {
 
 NS_IMPL_ISUPPORTS(LoadContext, nsILoadContext, nsIInterfaceRequestor)
 
-LoadContext::LoadContext(nsIPrincipal* aPrincipal, nsILoadContext* aOptionalBase)
+LoadContext::LoadContext(nsIPrincipal* aPrincipal)
   : mTopFrameElement(nullptr)
   , mNestedFrameId(0)
   , mIsContent(true)
   , mUsePrivateBrowsing(false)
   , mUseRemoteTabs(false)
 #ifdef DEBUG
   , mIsNotNull(true)
 #endif
 {
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aPrincipal->GetAppId(&mAppId)));
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
     aPrincipal->GetIsInBrowserElement(&mIsInBrowserElement)));
-
-  if (!aOptionalBase) {
-    return;
-  }
-
-  MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aOptionalBase->GetIsContent(&mIsContent)));
-  MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
-    aOptionalBase->GetUsePrivateBrowsing(&mUsePrivateBrowsing)));
-  MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aOptionalBase->GetUseRemoteTabs(&mUseRemoteTabs)));
 }
 
 //-----------------------------------------------------------------------------
 // LoadContext::nsILoadContext
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 LoadContext::GetAssociatedWindow(nsIDOMWindow**)
--- a/docshell/base/LoadContext.h
+++ b/docshell/base/LoadContext.h
@@ -102,18 +102,17 @@ public:
     , mIsInBrowserElement(false)
 #ifdef DEBUG
     , mIsNotNull(true)
 #endif
   {}
 
   // Constructor for creating a LoadContext with a given principal's appId and
   // browser flag.
-  explicit LoadContext(nsIPrincipal* aPrincipal,
-                       nsILoadContext* aOptionalBase = nullptr);
+  explicit LoadContext(nsIPrincipal* aPrincipal);
 
 private:
   ~LoadContext() {}
 
   nsWeakPtr     mTopFrameElement;
   uint64_t      mNestedFrameId;
   uint32_t      mAppId;
   bool          mIsContent;
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -2248,18 +2248,17 @@ RuntimeService::CreateSharedWorkerIntern
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
   MOZ_ASSERT(window);
 
   JSContext* cx = aGlobal.Context();
 
   WorkerPrivate::LoadInfo loadInfo;
   nsresult rv = WorkerPrivate::GetLoadInfo(cx, window, nullptr, aScriptURL,
-                                           false, WorkerPrivate::ForceNewLoadGroup,
-                                           &loadInfo);
+                                           false, &loadInfo);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return CreateSharedWorkerFromLoadInfo(cx, &loadInfo, aScriptURL, aName, aType,
                                         aSharedWorker);
 }
 
 nsresult
 RuntimeService::CreateSharedWorkerFromLoadInfo(JSContext* aCx,
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3983,18 +3983,17 @@ WorkerPrivate::Constructor(JSContext* aC
   MOZ_ASSERT_IF(aWorkerType == WorkerTypeDedicated,
                 aSharedWorkerName.IsEmpty());
 
   Maybe<LoadInfo> stackLoadInfo;
   if (!aLoadInfo) {
     stackLoadInfo.emplace();
 
     nsresult rv = GetLoadInfo(aCx, nullptr, parent, aScriptURL,
-                              aIsChromeWorker, InheritLoadGroup,
-                              stackLoadInfo.ptr());
+                              aIsChromeWorker, stackLoadInfo.ptr());
     if (NS_FAILED(rv)) {
       scriptloader::ReportLoadError(aCx, aScriptURL, rv, !parent);
       aRv.Throw(rv);
       return nullptr;
     }
 
     aLoadInfo = stackLoadInfo.ptr();
   }
@@ -4039,19 +4038,17 @@ WorkerPrivate::Constructor(JSContext* aC
 
   return worker.forget();
 }
 
 // static
 nsresult
 WorkerPrivate::GetLoadInfo(JSContext* aCx, nsPIDOMWindow* aWindow,
                            WorkerPrivate* aParent, const nsAString& aScriptURL,
-                           bool aIsChromeWorker,
-                           LoadGroupBehavior aLoadGroupBehavior,
-                           LoadInfo* aLoadInfo)
+                           bool aIsChromeWorker, LoadInfo* aLoadInfo)
 {
   using namespace mozilla::dom::workers::scriptloader;
   using mozilla::dom::indexedDB::IDBFactory;
 
   MOZ_ASSERT(aCx);
   MOZ_ASSERT_IF(NS_IsMainThread(), aCx == nsContentUtils::GetCurrentJSContext());
 
   if (aWindow) {
@@ -4274,19 +4271,19 @@ WorkerPrivate::GetLoadInfo(JSContext* aC
       rv = loadInfo.mCSP->GetAllowsEval(&loadInfo.mReportCSPViolations,
                                         &loadInfo.mEvalAllowed);
       NS_ENSURE_SUCCESS(rv, rv);
     } else {
       loadInfo.mEvalAllowed = true;
       loadInfo.mReportCSPViolations = false;
     }
 
-    if (!loadInfo.mLoadGroup || aLoadGroupBehavior == ForceNewLoadGroup) {
+    if (!loadInfo.mLoadGroup) {
       rv = NS_NewLoadGroup(getter_AddRefs(loadInfo.mLoadGroup),
-                           loadInfo.mPrincipal, loadInfo.mLoadGroup);
+                           loadInfo.mPrincipal);
       NS_ENSURE_SUCCESS(rv, rv);
     }
     MOZ_ASSERT(NS_LoadGroupMatchesPrincipal(loadInfo.mLoadGroup,
                                             loadInfo.mPrincipal));
 
     rv = ChannelFromScriptURLMainThread(loadInfo.mPrincipal, loadInfo.mBaseURI,
                                         document, loadInfo.mLoadGroup,
                                         aScriptURL,
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -916,26 +916,20 @@ public:
   static already_AddRefed<WorkerPrivate>
   Constructor(JSContext* aCx, const nsAString& aScriptURL, bool aIsChromeWorker,
               WorkerType aWorkerType, const nsACString& aSharedWorkerName,
               LoadInfo* aLoadInfo, ErrorResult& aRv);
 
   static bool
   WorkerAvailable(JSContext* /* unused */, JSObject* /* unused */);
 
-  enum LoadGroupBehavior
-  {
-    InheritLoadGroup,
-    ForceNewLoadGroup
-  };
-
   static nsresult
   GetLoadInfo(JSContext* aCx, nsPIDOMWindow* aWindow, WorkerPrivate* aParent,
               const nsAString& aScriptURL, bool aIsChromeWorker,
-              LoadGroupBehavior aLoadGroupBehavior, LoadInfo* aLoadInfo);
+              LoadInfo* aLoadInfo);
 
   WorkerDebugger*
   Debugger() const
   {
     AssertIsOnMainThread();
     MOZ_ASSERT(mDebugger);
     return mDebugger;
   }
--- a/netwerk/base/public/nsNetUtil.h
+++ b/netwerk/base/public/nsNetUtil.h
@@ -990,22 +990,19 @@ NS_NewLoadGroup(nsILoadGroup      **resu
         if (NS_SUCCEEDED(rv)) {
             *result = nullptr;
             group.swap(*result);
         }
     }
     return rv;
 }
 
-// Create a new nsILoadGroup that will match the given principal.  Also,
-// if a base laod group is provided, populate the nsILoadContext of the
-// new group with information from the existing context.
+// Create a new nsILoadGroup that will match the given principal.
 nsresult
-NS_NewLoadGroup(nsILoadGroup** aResult, nsIPrincipal* aPrincipal,
-                nsILoadGroup* aOptionalBase = nullptr);
+NS_NewLoadGroup(nsILoadGroup** aResult, nsIPrincipal* aPrincipal);
 
 // Determine if the given loadGroup/principal pair will produce a principal
 // with similar permissions when passed to NS_NewChannel().  This checks for
 // things like making sure the appId and browser element flags match.  Without
 // an appropriate load group these values can be lost when getting the result
 // principal back out of the channel.  Null principals are also always allowed
 // as they do not have permissions to actually use the load group.
 bool
--- a/netwerk/base/src/nsNetUtil.cpp
+++ b/netwerk/base/src/nsNetUtil.cpp
@@ -14,37 +14,26 @@ bool NS_IsReasonableHTTPHeaderValue(cons
 }
 
 bool NS_IsValidHTTPToken(const nsACString& aToken)
 {
   return mozilla::net::nsHttp::IsValidToken(aToken);
 }
 
 nsresult
-NS_NewLoadGroup(nsILoadGroup** aResult, nsIPrincipal* aPrincipal,
-                nsILoadGroup* aOptionalBase)
+NS_NewLoadGroup(nsILoadGroup** aResult, nsIPrincipal* aPrincipal)
 {
     using mozilla::LoadContext;
     nsresult rv;
 
-    nsCOMPtr<nsILoadContext> baseLoadContext;
-    if (aOptionalBase) {
-      nsCOMPtr<nsIInterfaceRequestor> cb;
-      rv = aOptionalBase->GetNotificationCallbacks(getter_AddRefs(cb));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      baseLoadContext = do_QueryInterface(cb);
-    }
-
     nsCOMPtr<nsILoadGroup> group =
         do_CreateInstance(NS_LOADGROUP_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsRefPtr<LoadContext> loadContext = new LoadContext(aPrincipal,
-                                                        baseLoadContext);
+    nsRefPtr<LoadContext> loadContext = new LoadContext(aPrincipal);
     rv = group->SetNotificationCallbacks(loadContext);
     NS_ENSURE_SUCCESS(rv, rv);
 
     group.forget(aResult);
     return rv;
 }
 
 bool