Backed out changeset c66813164419 (bug 1533103) on dev's request. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Wed, 06 Mar 2019 22:00:51 +0200
changeset 520566 65a4518c0301020c35a60437a4b810c3a0fbc34a
parent 520565 ac5ecad3f2d06ef972425ad47e4d402870746d49
child 520567 6927cfe9f9caa0052b0be1fb8387254c5efac6d1
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1533103
milestone67.0a1
backs outc66813164419e99c5e8d0343a0386a0251550455
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
Backed out changeset c66813164419 (bug 1533103) on dev's request. CLOSED TREE
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -1777,17 +1777,16 @@ struct MOZ_STACK_CLASS CompartmentFinder
   // Input: we look for a compartment which is same-origin with the
   // given principal.
   nsIPrincipal* principal;
 
   // Output: We set this member if we find a compartment.
   JS::Compartment* compartment;
 };
 
-#if 0 /* Temporarily disabled; will reenable in bug 1533105 */
 static JS::CompartmentIterResult FindSameOriginCompartment(
     JSContext* aCx, void* aData, JS::Compartment* aCompartment) {
   auto* data = static_cast<CompartmentFinderState*>(aData);
   MOZ_ASSERT(!data->compartment, "Why are we getting called?");
 
   // If this compartment is not safe to share across globals, don't do
   // anything with it; in particular we should not be getting a
   // CompartmentPrivate from such a compartment, because it may be in
@@ -1802,17 +1801,16 @@ static JS::CompartmentIterResult FindSam
     // Can't reuse this one, keep going.
     return JS::CompartmentIterResult::KeepGoing;
   }
 
   // We have a winner!
   data->compartment = aCompartment;
   return JS::CompartmentIterResult::Stop;
 }
-#endif
 
 static JS::RealmCreationOptions& SelectZone(
     JSContext* aCx, nsIPrincipal* aPrincipal, nsGlobalWindowInner* aNewInner,
     JS::RealmCreationOptions& aOptions) {
   // Use the shared system compartment for chrome windows.
   if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
     return aOptions.setExistingCompartment(xpc::PrivilegedJunkScope());
   }
@@ -1823,26 +1821,24 @@ static JS::RealmCreationOptions& SelectZ
       // We're a toplevel load.  Use a new zone.  This way, when we do
       // zone-based compartment sharing we won't share compartments
       // across navigations.
       return aOptions.setNewCompartmentAndZone();
     }
 
     // If we have a top-level window, use its zone.
     if (top && top->GetGlobalJSObject()) {
-#if 0 /* Temporarily disabled; will reenable in bug 1533105 */
       JS::Zone* zone = JS::GetObjectZone(top->GetGlobalJSObject());
       // Now try to find an existing compartment that's same-origin
       // with our principal.
       CompartmentFinderState data(aPrincipal);
       JS_IterateCompartmentsInZone(aCx, zone, &data, FindSameOriginCompartment);
       if (data.compartment) {
         return aOptions.setExistingCompartment(data.compartment);
       }
-#endif
       return aOptions.setNewCompartmentInExistingZone(top->GetGlobalJSObject());
     }
   }
 
   return aOptions.setNewCompartmentAndZone();
 }
 
 /**