Bug 1448414. Remove the DOM_OBJECT classinfo bit. r=kmag
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 28 Mar 2018 22:46:23 -0400
changeset 410737 b4278b2f0801917efce3826515817a7e1251b4ce
parent 410736 825bb50e3922642a4a5b92a67bd6a6fe4e3bea7e
child 410738 829f884d8d4e1b283c8187c5789ec789516fdd46
push id33736
push usershindli@mozilla.com
push dateFri, 30 Mar 2018 09:56:41 +0000
treeherdermozilla-central@b7fa9d95150e [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)))
             {