Backed out changeset d07106878066 (bug 1162772) for many tests failing with Assertion failure: principal->GetIsCodebasePrincipal(), at dom/base/nsGlobalWindow.cpp:2412. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 30 Apr 2016 09:54:16 +0200
changeset 295611 18c3745427c04961696b9178e1367abead511cd4
parent 295610 5e4f1107cd17a9809d18234f4a7c2da5420ea9ab
child 295612 15070beaee3548018781299762f6c15995e05924
push id19015
push usercbook@mozilla.com
push dateMon, 02 May 2016 09:39:23 +0000
treeherderfx-team@2080375bc69d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1162772
milestone49.0a1
backs outd07106878066a0d6a95336c71435b9d3e759a876
Backed out changeset d07106878066 (bug 1162772) for many tests failing with Assertion failure: principal->GetIsCodebasePrincipal(), at dom/base/nsGlobalWindow.cpp:2412. r=backout on a CLOSED TREE
js/src/jsapi.h
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -2211,18 +2211,17 @@ class JS_PUBLIC_API(CompartmentCreationO
     CompartmentCreationOptions()
       : addonId_(nullptr),
         traceGlobal_(nullptr),
         invisibleToDebugger_(false),
         mergeable_(false),
         preserveJitCode_(false),
         cloneSingletons_(false),
         experimentalDateTimeFormatFormatToPartsEnabled_(false),
-        sharedMemoryAndAtomics_(false),
-        secureContext_(false)
+        sharedMemoryAndAtomics_(false)
     {
         zone_.spec = JS::FreshZone;
     }
 
     // A null add-on ID means that the compartment is not associated with an
     // add-on.
     JSAddonId* addonIdOrNull() const { return addonId_; }
     CompartmentCreationOptions& setAddonId(JSAddonId* id) {
@@ -2295,40 +2294,29 @@ class JS_PUBLIC_API(CompartmentCreationO
     CompartmentCreationOptions& setExperimentalDateTimeFormatFormatToPartsEnabled(bool flag) {
         experimentalDateTimeFormatFormatToPartsEnabled_ = flag;
         return *this;
     }
 
     bool getSharedMemoryAndAtomicsEnabled() const;
     CompartmentCreationOptions& setSharedMemoryAndAtomicsEnabled(bool flag);
 
-    // This flag doesn't affect JS engine behavior.  It is used by Gecko to
-    // mark whether content windows and workers are "Secure Context"s. See
-    // https://w3c.github.io/webappsec-secure-contexts/
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=1162772#c34
-    bool secureContext() const { return secureContext_; }
-    CompartmentCreationOptions& setSecureContext(bool flag) {
-        secureContext_ = flag;
-        return *this;
-    }
-
   private:
     JSAddonId* addonId_;
     JSTraceOp traceGlobal_;
     union {
         ZoneSpecifier spec;
         void* pointer; // js::Zone* is not exposed in the API.
     } zone_;
     bool invisibleToDebugger_;
     bool mergeable_;
     bool preserveJitCode_;
     bool cloneSingletons_;
     bool experimentalDateTimeFormatFormatToPartsEnabled_;
     bool sharedMemoryAndAtomics_;
-    bool secureContext_;
 };
 
 /**
  * CompartmentBehaviors specifies behaviors of a compartment that can be
  * changed after the compartment's been created.
  */
 class JS_PUBLIC_API(CompartmentBehaviors)
 {
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -138,22 +138,16 @@ JS_NewObjectWithUniqueType(JSContext* cx
 
 JS_FRIEND_API(JSObject*)
 JS_NewObjectWithoutMetadata(JSContext* cx, const JSClass* clasp, JS::Handle<JSObject*> proto)
 {
     AutoSuppressAllocationMetadataBuilder suppressMetadata(cx);
     return JS_NewObjectWithGivenProto(cx, clasp, proto);
 }
 
-JS_FRIEND_API(bool)
-JS_GetIsSecureContext(JSCompartment* compartment)
-{
-    return compartment->creationOptions().secureContext();
-}
-
 JS_FRIEND_API(JSPrincipals*)
 JS_GetCompartmentPrincipals(JSCompartment* compartment)
 {
     return compartment->principals();
 }
 
 JS_FRIEND_API(void)
 JS_SetCompartmentPrincipals(JSCompartment* compartment, JSPrincipals* principals)
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -142,19 +142,16 @@ static_assert(JS_TELEMETRY_DEFINE_GETTER
               "This value needs to be kept in sync with SelfHostingDefines.h");
 
 typedef void
 (*JSAccumulateTelemetryDataCallback)(int id, uint32_t sample, const char* key);
 
 extern JS_FRIEND_API(void)
 JS_SetAccumulateTelemetryCallback(JSRuntime* rt, JSAccumulateTelemetryDataCallback callback);
 
-extern JS_FRIEND_API(bool)
-JS_GetIsSecureContext(JSCompartment* compartment);
-
 extern JS_FRIEND_API(JSPrincipals*)
 JS_GetCompartmentPrincipals(JSCompartment* compartment);
 
 extern JS_FRIEND_API(void)
 JS_SetCompartmentPrincipals(JSCompartment* compartment, JSPrincipals* principals);
 
 extern JS_FRIEND_API(JSPrincipals*)
 JS_GetScriptPrincipals(JSScript* script);