Bug 1448414. Remove the DOM_OBJECT classinfo bit. r=kmag
☠☠ backed out by 1fc80ba9ed07 ☠ ☠
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 28 Mar 2018 22:46:23 -0400
changeset 410664 9e41e9c653f26f87285ccb5696b492c1e8c7c3be
parent 410663 9349d1b031c916b2827d317b4f55c0c9e7dbb81c
child 410665 0c7442ef9bbd58b45ddec508edae705e2bec0649
push id33734
push useraciure@mozilla.com
push dateThu, 29 Mar 2018 22:07:07 +0000
treeherdermozilla-central@dcd10220d55a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1448414
milestone61.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 1448414. Remove the DOM_OBJECT classinfo bit. r=kmag
caps/nsScriptSecurityManager.cpp
js/xpconnect/src/XPCWrappedNativeJSOps.cpp
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -1207,22 +1207,16 @@ nsScriptSecurityManager::doGetObjectPrin
 NS_IMETHODIMP
 nsScriptSecurityManager::CanCreateWrapper(JSContext *cx,
                                           const nsIID &aIID,
                                           nsISupports *aObj,
                                           nsIClassInfo *aClassInfo)
 {
 // XXX Special case for Exception ?
 
-    uint32_t flags;
-    if (aClassInfo && NS_SUCCEEDED(aClassInfo->GetFlags(&flags)) &&
-        (flags & nsIClassInfo::DOM_OBJECT)) {
-        return NS_OK;
-    }
-
     // We give remote-XUL whitelisted domains a free pass here. See bug 932906.
     JS::Rooted<JS::Realm*> contextRealm(cx, JS::GetCurrentRealmOrNull(cx));
     MOZ_RELEASE_ASSERT(contextRealm);
     if (!xpc::AllowContentXBLScope(contextRealm)) {
         return NS_OK;
     }
 
     if (nsContentUtils::IsCallerChrome()) {
--- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
@@ -262,22 +262,17 @@ DefinePropertyIfFound(XPCCallContext& cc
 
                 if (classInfo) {
                     nsresult rv = classInfo->GetFlags(&flags);
                     if (NS_FAILED(rv))
                         return Throw(rv, ccx);
                 }
             }
 
-            bool overwriteToString = !(flags & nsIClassInfo::DOM_OBJECT)
-                || Preferences::GetBool("dom.XPCToStringForDOMClasses", false);
-
-            if(id == xpccx->GetStringID(XPCJSContext::IDX_TO_STRING)
-                && overwriteToString)
-            {
+            if (id == xpccx->GetStringID(XPCJSContext::IDX_TO_STRING)) {
                 call = XPC_WN_Shared_ToString;
                 name = xpccx->GetStringName(XPCJSContext::IDX_TO_STRING);
             } else if (id == xpccx->GetStringID(XPCJSContext::IDX_TO_SOURCE)) {
                 call = XPC_WN_Shared_ToSource;
                 name = xpccx->GetStringName(XPCJSContext::IDX_TO_SOURCE);
             } else if (id == SYMBOL_TO_JSID(
                                JS::GetWellKnownSymbol(ccx, JS::SymbolCode::toPrimitive)))
             {