Bug 1453011 - Remove some unused nsIXPCScriptable flags. r=bz.
☠☠ backed out by 30ed797c2454 ☠ ☠
authorPeter Van der Beken <peterv@propagandism.org>
Thu, 22 Mar 2018 10:37:43 +0100
changeset 468298 cae243fb2a3c6ff03072e36ad0dd0dd2e599e74d
parent 468297 adf56a83131b3a97bfdce574973a8b03959882c9
child 468299 4464997475c15a2db0040658981b6ef1056447c6
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1453011
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 1453011 - Remove some unused nsIXPCScriptable flags. r=bz.
dom/base/moz.build
dom/base/nsIDOMClassInfo.h
dom/battery/BatteryManager.cpp
dom/network/Connection.cpp
js/xpconnect/idl/nsIXPCScriptable.idl
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/XPCWrappedNativeJSOps.cpp
js/xpconnect/src/XPCWrappedNativeProto.cpp
js/xpconnect/src/xpcprivate.h
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -78,17 +78,16 @@ EXPORTS += [
     'nsIContent.h',
     'nsIContentInlines.h',
     'nsIContentIterator.h',
     'nsIContentSerializer.h',
     'nsIdentifierMapEntry.h',
     'nsIDocument.h',
     'nsIDocumentInlines.h',
     'nsIDocumentObserver.h',
-    'nsIDOMClassInfo.h',
     'nsIGlobalObject.h',
     'nsImageLoadingContent.h',
     'nsIMutationObserver.h',
     'nsINode.h',
     'nsINodeList.h',
     'nsIScriptContext.h',
     'nsIScriptGlobalObject.h',
     'nsIScriptObjectPrincipal.h',
deleted file mode 100644
--- a/dom/base/nsIDOMClassInfo.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsIDOMClassInfo_h___
-#define nsIDOMClassInfo_h___
-
-#include "nsIXPCScriptable.h"
-
-#define DOM_BASE_SCRIPTABLE_FLAGS                                          \
-  (XPC_SCRIPTABLE_USE_JSSTUB_FOR_ADDPROPERTY |                             \
-   XPC_SCRIPTABLE_USE_JSSTUB_FOR_DELPROPERTY |                             \
-   XPC_SCRIPTABLE_ALLOW_PROP_MODS_TO_PROTOTYPE |                           \
-   XPC_SCRIPTABLE_DONT_ASK_INSTANCE_FOR_SCRIPTABLE |                       \
-   XPC_SCRIPTABLE_DONT_REFLECT_INTERFACE_NAMES)
-
-#define DEFAULT_SCRIPTABLE_FLAGS                                           \
-  (DOM_BASE_SCRIPTABLE_FLAGS |                                             \
-   XPC_SCRIPTABLE_WANT_RESOLVE |                                           \
-   XPC_SCRIPTABLE_WANT_PRECREATE)
-
-#define DOM_DEFAULT_SCRIPTABLE_FLAGS                                       \
-  (DEFAULT_SCRIPTABLE_FLAGS |                                              \
-   XPC_SCRIPTABLE_DONT_ENUM_QUERY_INTERFACE |                              \
-   XPC_SCRIPTABLE_CLASSINFO_INTERFACES_ONLY)
-
-#endif /* nsIDOMClassInfo_h___ */
--- a/dom/battery/BatteryManager.cpp
+++ b/dom/battery/BatteryManager.cpp
@@ -8,17 +8,16 @@
 #include <limits>
 #include "BatteryManager.h"
 #include "Constants.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "mozilla/Hal.h"
 #include "mozilla/dom/BatteryManagerBinding.h"
 #include "mozilla/Preferences.h"
 #include "nsContentUtils.h"
-#include "nsIDOMClassInfo.h"
 #include "nsIDocument.h"
 
 /**
  * We have to use macros here because our leak analysis tool things we are
  * leaking strings when we have |static const nsString|. Sad :(
  */
 #define LEVELCHANGE_EVENT_NAME           NS_LITERAL_STRING("levelchange")
 #define CHARGINGCHANGE_EVENT_NAME        NS_LITERAL_STRING("chargingchange")
--- a/dom/network/Connection.cpp
+++ b/dom/network/Connection.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Connection.h"
 #include "ConnectionMainThread.h"
 #include "ConnectionWorker.h"
-#include "nsIDOMClassInfo.h"
 #include "Constants.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/WorkerPrivate.h"
 
 /**
  * We have to use macros here because our leak analysis tool things we are
  * leaking strings when we have |static const nsString|. Sad :(
  */
--- a/js/xpconnect/idl/nsIXPCScriptable.idl
+++ b/js/xpconnect/idl/nsIXPCScriptable.idl
@@ -44,20 +44,20 @@ interface nsIXPConnectWrappedNative;
     #define XPC_SCRIPTABLE_WANT_FINALIZE                    (1 <<  6)
     #define XPC_SCRIPTABLE_WANT_CALL                        (1 <<  7)
     #define XPC_SCRIPTABLE_WANT_CONSTRUCT                   (1 <<  8)
     #define XPC_SCRIPTABLE_WANT_HASINSTANCE                 (1 <<  9)
     #define XPC_SCRIPTABLE_USE_JSSTUB_FOR_ADDPROPERTY       (1 << 10)
     #define XPC_SCRIPTABLE_USE_JSSTUB_FOR_DELPROPERTY       (1 << 11)
     // (1 << 12) is unused
     #define XPC_SCRIPTABLE_DONT_ENUM_QUERY_INTERFACE        (1 << 13)
-    #define XPC_SCRIPTABLE_DONT_ASK_INSTANCE_FOR_SCRIPTABLE (1 << 14)
-    #define XPC_SCRIPTABLE_CLASSINFO_INTERFACES_ONLY        (1 << 15)
+    // (1 << 14) is unused
+    // (1 << 15) is unused
     #define XPC_SCRIPTABLE_ALLOW_PROP_MODS_DURING_RESOLVE   (1 << 16)
-    #define XPC_SCRIPTABLE_ALLOW_PROP_MODS_TO_PROTOTYPE     (1 << 17)
+    // (1 << 17) is unused
     #define XPC_SCRIPTABLE_IS_GLOBAL_OBJECT                 (1 << 18)
     #define XPC_SCRIPTABLE_DONT_REFLECT_INTERFACE_NAMES     (1 << 19)
 %}
 
 /**
  * Note: This is not really an XPCOM interface.  For example, callers must
  * guarantee that they set the *_retval of the various methods that return a
  * boolean to PR_TRUE before making the call.  Implementations may skip writing
@@ -114,18 +114,15 @@ interface nsIXPCScriptable : nsISupports
     GET_IT(WantResolve,                  WANT_RESOLVE)
     GET_IT(WantFinalize,                 WANT_FINALIZE)
     GET_IT(WantCall,                     WANT_CALL)
     GET_IT(WantConstruct,                WANT_CONSTRUCT)
     GET_IT(WantHasInstance,              WANT_HASINSTANCE)
     GET_IT(UseJSStubForAddProperty,      USE_JSSTUB_FOR_ADDPROPERTY)
     GET_IT(UseJSStubForDelProperty,      USE_JSSTUB_FOR_DELPROPERTY)
     GET_IT(DontEnumQueryInterface,       DONT_ENUM_QUERY_INTERFACE)
-    GET_IT(DontAskInstanceForScriptable, DONT_ASK_INSTANCE_FOR_SCRIPTABLE)
-    GET_IT(ClassInfoInterfacesOnly,      CLASSINFO_INTERFACES_ONLY)
     GET_IT(AllowPropModsDuringResolve,   ALLOW_PROP_MODS_DURING_RESOLVE)
-    GET_IT(AllowPropModsToPrototype,     ALLOW_PROP_MODS_TO_PROTOTYPE)
     GET_IT(IsGlobalObject,               IS_GLOBAL_OBJECT)
     GET_IT(DontReflectInterfaceNames,    DONT_REFLECT_INTERFACE_NAMES)
 
     #undef GET_IT
 %}
 };
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2863,17 +2863,17 @@ XPCJSRuntime::InitializeStrings(JSContex
     return true;
 }
 
 bool
 XPCJSRuntime::DescribeCustomObjects(JSObject* obj, const js::Class* clasp,
                                     char (&name)[72]) const
 {
 
-    if (!IS_PROTO_CLASS(clasp)) {
+    if (clasp != &XPC_WN_Proto_JSClass) {
         return false;
     }
 
     XPCWrappedNativeProto* p =
         static_cast<XPCWrappedNativeProto*>(xpc_GetJSPrivate(obj));
     nsCOMPtr<nsIXPCScriptable> scr = p->GetScriptable();
     if (!scr) {
         return false;
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -567,23 +567,16 @@ XPCWrappedNative::GatherScriptable(nsISu
     MOZ_ASSERT(!*aScrWrapper, "bad param");
 
     nsCOMPtr<nsIXPCScriptable> scrProto;
     nsCOMPtr<nsIXPCScriptable> scrWrapper;
 
     // Get the class scriptable helper (if present)
     if (aClassInfo) {
         scrProto = GatherProtoScriptable(aClassInfo);
-
-        if (scrProto && scrProto->DontAskInstanceForScriptable()) {
-            scrWrapper = scrProto;
-            scrProto.forget(aScrProto);
-            scrWrapper.forget(aScrWrapper);
-            return;
-        }
     }
 
     // Do the same for the wrapper specific scriptable
     scrWrapper = do_QueryInterface(aObj);
     if (scrWrapper) {
         // A whole series of assertions to catch bad uses of scriptable flags on
         // the scrWrapper...
 
@@ -592,35 +585,20 @@ XPCWrappedNative::GatherScriptable(nsISu
         MOZ_ASSERT_IF(scrWrapper->WantPreCreate(),
                       scrProto && scrProto->WantPreCreate());
 
         // Can't set DONT_ENUM_QUERY_INTERFACE on an instance scriptable
         // without also setting it on the class scriptable (if present).
         MOZ_ASSERT_IF(scrWrapper->DontEnumQueryInterface() && scrProto,
                       scrProto->DontEnumQueryInterface());
 
-        // Can't set DONT_ASK_INSTANCE_FOR_SCRIPTABLE on an instance scriptable
-        // without also setting it on the class scriptable.
-        MOZ_ASSERT_IF(scrWrapper->DontAskInstanceForScriptable(),
-                      scrProto && scrProto->DontAskInstanceForScriptable());
-
-        // Can't set CLASSINFO_INTERFACES_ONLY on an instance scriptable
-        // without also setting it on the class scriptable (if present).
-        MOZ_ASSERT_IF(scrWrapper->ClassInfoInterfacesOnly() && scrProto,
-                      scrProto->ClassInfoInterfacesOnly());
-
         // Can't set ALLOW_PROP_MODS_DURING_RESOLVE on an instance scriptable
         // without also setting it on the class scriptable (if present).
         MOZ_ASSERT_IF(scrWrapper->AllowPropModsDuringResolve() && scrProto,
                       scrProto->AllowPropModsDuringResolve());
-
-        // Can't set ALLOW_PROP_MODS_TO_PROTOTYPE on an instance scriptable
-        // without also setting it on the class scriptable (if present).
-        MOZ_ASSERT_IF(scrWrapper->AllowPropModsToPrototype() && scrProto,
-                      scrProto->AllowPropModsToPrototype());
     } else {
         scrWrapper = scrProto;
     }
 
     scrProto.forget(aScrProto);
     scrWrapper.forget(aScrWrapper);
 }
 
@@ -977,25 +955,16 @@ XPCWrappedNative::InitTearOff(XPCWrapped
 
     const nsIID* iid = aInterface->GetIID();
     nsISupports* identity = GetIdentityObject();
 
     // This is an nsRefPtr instead of an nsCOMPtr because it may not be the
     // canonical nsISupports for this object.
     RefPtr<nsISupports> qiResult;
 
-    // If the scriptable helper forbids us from reflecting additional
-    // interfaces, then don't even try the QI, just fail.
-    if (mScriptable &&
-        mScriptable->ClassInfoInterfacesOnly() &&
-        !mSet->HasInterface(aInterface) &&
-        !mSet->HasInterfaceWithAncestor(aInterface)) {
-        return NS_ERROR_NO_INTERFACE;
-    }
-
     // We are about to call out to other code.
     // So protect our intended tearoff.
 
     aTearOff->SetReserved();
 
     if (NS_FAILED(identity->QueryInterface(*iid, getter_AddRefs(qiResult))) || !qiResult) {
         aTearOff->SetInterface(nullptr);
         return NS_ERROR_NO_INTERFACE;
--- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
@@ -247,28 +247,16 @@ DefinePropertyIfFound(XPCCallContext& cc
         else
             found = set->FindMember(id, &member, &iface);
     } else
         found = (nullptr != (member = iface->FindMember(id)));
 
     if (!found) {
         if (reflectToStringAndToSource) {
             JSNative call;
-            uint32_t flags = 0;
-
-            if (scr) {
-                nsCOMPtr<nsIClassInfo> classInfo = do_QueryInterface(scr);
-
-                if (classInfo) {
-                    nsresult rv = classInfo->GetFlags(&flags);
-                    if (NS_FAILED(rv))
-                        return Throw(rv, ccx);
-                }
-            }
-
             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)))
@@ -947,20 +935,19 @@ XPC_WN_GetterSetter(JSContext* cx, unsig
 
     ccx.SetCallInfo(iface, member, false);
     return XPCWrappedNative::GetAttribute(ccx);
 }
 
 /***************************************************************************/
 
 static bool
-XPC_WN_Shared_Proto_Enumerate(JSContext* cx, HandleObject obj)
+XPC_WN_Proto_Enumerate(JSContext* cx, HandleObject obj)
 {
-    MOZ_ASSERT(js::GetObjectClass(obj) == &XPC_WN_ModsAllowed_Proto_JSClass ||
-               js::GetObjectClass(obj) == &XPC_WN_NoMods_Proto_JSClass,
+    MOZ_ASSERT(js::GetObjectClass(obj) == &XPC_WN_Proto_JSClass,
                "bad proto");
     XPCWrappedNativeProto* self =
         (XPCWrappedNativeProto*) xpc_GetJSPrivate(obj);
     if (!self)
         return false;
 
     XPCNativeSet* set = self->GetSet();
     if (!set)
@@ -981,106 +968,53 @@ XPC_WN_Shared_Proto_Enumerate(JSContext*
                 return false;
         }
     }
 
     return true;
 }
 
 static void
-XPC_WN_Shared_Proto_Finalize(js::FreeOp* fop, JSObject* obj)
+XPC_WN_Proto_Finalize(js::FreeOp* fop, JSObject* obj)
 {
     // This can be null if xpc shutdown has already happened
     XPCWrappedNativeProto* p = (XPCWrappedNativeProto*) xpc_GetJSPrivate(obj);
     if (p)
         p->JSProtoObjectFinalized(fop, obj);
 }
 
 static size_t
-XPC_WN_Shared_Proto_ObjectMoved(JSObject* obj, JSObject* old)
+XPC_WN_Proto_ObjectMoved(JSObject* obj, JSObject* old)
 {
     // This can be null if xpc shutdown has already happened
     XPCWrappedNativeProto* p = (XPCWrappedNativeProto*) xpc_GetJSPrivate(obj);
     if (!p)
         return 0;
 
     p->JSProtoObjectMoved(obj, old);
     return 0;
 }
 
 static void
-XPC_WN_Shared_Proto_Trace(JSTracer* trc, JSObject* obj)
+XPC_WN_Proto_Trace(JSTracer* trc, JSObject* obj)
 {
     // This can be null if xpc shutdown has already happened
     XPCWrappedNativeProto* p =
         (XPCWrappedNativeProto*) xpc_GetJSPrivate(obj);
     if (p)
         p->TraceInside(trc);
 }
 
 /*****************************************************/
 
 static bool
-XPC_WN_ModsAllowed_Proto_Resolve(JSContext* cx, HandleObject obj, HandleId id, bool* resolvep)
-{
-    MOZ_ASSERT(js::GetObjectClass(obj) == &XPC_WN_ModsAllowed_Proto_JSClass,
-               "bad proto");
-
-    XPCWrappedNativeProto* self =
-        (XPCWrappedNativeProto*) xpc_GetJSPrivate(obj);
-    if (!self)
-        return false;
-
-    XPCCallContext ccx(cx);
-    if (!ccx.IsValid())
-        return false;
-
-    nsCOMPtr<nsIXPCScriptable> scr = self->GetScriptable();
-    return DefinePropertyIfFound(ccx, obj, id,
-                                 self->GetSet(), nullptr, nullptr,
-                                 self->GetScope(),
-                                 true, nullptr, nullptr, scr,
-                                 JSPROP_ENUMERATE, resolvep);
-}
-
-static const js::ClassOps XPC_WN_ModsAllowed_Proto_JSClassOps = {
-    nullptr,                            // addProperty
-    nullptr,                            // delProperty
-    XPC_WN_Shared_Proto_Enumerate,      // enumerate
-    nullptr,                            // newEnumerate
-    XPC_WN_ModsAllowed_Proto_Resolve,   // resolve
-    nullptr,                            // mayResolve
-    XPC_WN_Shared_Proto_Finalize,       // finalize
-    nullptr,                            // call
-    nullptr,                            // construct
-    nullptr,                            // hasInstance
-    XPC_WN_Shared_Proto_Trace,          // trace
-};
-
-static const js::ClassExtension XPC_WN_Shared_Proto_ClassExtension = {
-    nullptr,    /* weakmapKeyDelegateOp */
-    XPC_WN_Shared_Proto_ObjectMoved
-};
-
-const js::Class XPC_WN_ModsAllowed_Proto_JSClass = {
-    "XPC_WN_ModsAllowed_Proto_JSClass",
-    XPC_WRAPPER_FLAGS,
-    &XPC_WN_ModsAllowed_Proto_JSClassOps,
-    JS_NULL_CLASS_SPEC,
-    &XPC_WN_Shared_Proto_ClassExtension,
-    JS_NULL_OBJECT_OPS
-};
-
-/***************************************************************************/
-
-static bool
 XPC_WN_OnlyIWrite_Proto_AddPropertyStub(JSContext* cx, HandleObject obj, HandleId id,
                                         HandleValue v)
 {
-    MOZ_ASSERT(js::GetObjectClass(obj) == &XPC_WN_NoMods_Proto_JSClass,
+    MOZ_ASSERT(js::GetObjectClass(obj) == &XPC_WN_Proto_JSClass,
                "bad proto");
 
     XPCWrappedNativeProto* self =
         (XPCWrappedNativeProto*) xpc_GetJSPrivate(obj);
     if (!self)
         return false;
 
     XPCCallContext ccx(cx);
@@ -1090,19 +1024,19 @@ XPC_WN_OnlyIWrite_Proto_AddPropertyStub(
     // Allow XPConnect to add the property only
     if (ccx.GetResolveName() == id)
         return true;
 
     return Throw(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO, cx);
 }
 
 static bool
-XPC_WN_NoMods_Proto_Resolve(JSContext* cx, HandleObject obj, HandleId id, bool* resolvedp)
+XPC_WN_Proto_Resolve(JSContext* cx, HandleObject obj, HandleId id, bool* resolvedp)
 {
-    MOZ_ASSERT(js::GetObjectClass(obj) == &XPC_WN_NoMods_Proto_JSClass,
+    MOZ_ASSERT(js::GetObjectClass(obj) == &XPC_WN_Proto_JSClass,
                "bad proto");
 
     XPCWrappedNativeProto* self =
         (XPCWrappedNativeProto*) xpc_GetJSPrivate(obj);
     if (!self)
         return false;
 
     XPCCallContext ccx(cx);
@@ -1115,36 +1049,41 @@ XPC_WN_NoMods_Proto_Resolve(JSContext* c
                                  self->GetSet(), nullptr, nullptr,
                                  self->GetScope(),
                                  true, nullptr, nullptr, scr,
                                  JSPROP_READONLY |
                                  JSPROP_PERMANENT |
                                  JSPROP_ENUMERATE, resolvedp);
 }
 
-static const js::ClassOps XPC_WN_NoMods_Proto_JSClassOps = {
+static const js::ClassOps XPC_WN_Proto_JSClassOps = {
     XPC_WN_OnlyIWrite_Proto_AddPropertyStub,   // addProperty
     XPC_WN_CannotDeletePropertyStub,           // delProperty
-    XPC_WN_Shared_Proto_Enumerate,             // enumerate
+    XPC_WN_Proto_Enumerate,                    // enumerate
     nullptr,                                   // newEnumerate
-    XPC_WN_NoMods_Proto_Resolve,               // resolve
+    XPC_WN_Proto_Resolve,                      // resolve
     nullptr,                                   // mayResolve
-    XPC_WN_Shared_Proto_Finalize,              // finalize
+    XPC_WN_Proto_Finalize,                     // finalize
     nullptr,                                   // call
     nullptr,                                   // construct
     nullptr,                                   // hasInstance
-    XPC_WN_Shared_Proto_Trace,                 // trace
+    XPC_WN_Proto_Trace,                        // trace
 };
 
-const js::Class XPC_WN_NoMods_Proto_JSClass = {
-    "XPC_WN_NoMods_Proto_JSClass",
+static const js::ClassExtension XPC_WN_Proto_ClassExtension = {
+    nullptr,    /* weakmapKeyDelegateOp */
+    XPC_WN_Proto_ObjectMoved
+};
+
+const js::Class XPC_WN_Proto_JSClass = {
+    "XPC_WN_Proto_JSClass",
     XPC_WRAPPER_FLAGS,
-    &XPC_WN_NoMods_Proto_JSClassOps,
+    &XPC_WN_Proto_JSClassOps,
     JS_NULL_CLASS_SPEC,
-    &XPC_WN_Shared_Proto_ClassExtension,
+    &XPC_WN_Proto_ClassExtension,
     JS_NULL_OBJECT_OPS
 };
 
 /***************************************************************************/
 
 static bool
 XPC_WN_TearOff_Enumerate(JSContext* cx, HandleObject obj)
 {
--- a/js/xpconnect/src/XPCWrappedNativeProto.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp
@@ -51,24 +51,19 @@ XPCWrappedNativeProto::~XPCWrappedNative
 
 bool
 XPCWrappedNativeProto::Init(nsIXPCScriptable* scriptable,
                             bool callPostCreatePrototype)
 {
     AutoJSContext cx;
     mScriptable = scriptable;
 
-    const js::Class* jsclazz =
-        (mScriptable && mScriptable->AllowPropModsToPrototype())
-        ? &XPC_WN_ModsAllowed_Proto_JSClass
-        : &XPC_WN_NoMods_Proto_JSClass;
-
     JS::RootedObject global(cx, mScope->GetGlobalJSObject());
     JS::RootedObject proto(cx, JS_GetObjectPrototype(cx, global));
-    mJSProtoObject = JS_NewObjectWithUniqueType(cx, js::Jsvalify(jsclazz),
+    mJSProtoObject = JS_NewObjectWithUniqueType(cx, js::Jsvalify(&XPC_WN_Proto_JSClass),
                                                 proto);
 
     bool success = !!mJSProtoObject;
     if (success) {
         JS_SetPrivate(mJSProtoObject, this);
         if (callPostCreatePrototype)
             success = CallPostCreatePrototype();
     }
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -826,38 +826,28 @@ private:
 *
 ****************************************************************************
 ***************************************************************************/
 
 // These are the various JSClasses and callbacks whose use that required
 // visibility from more than one .cpp file.
 
 extern const js::Class XPC_WN_NoHelper_JSClass;
-extern const js::Class XPC_WN_NoMods_Proto_JSClass;
-extern const js::Class XPC_WN_ModsAllowed_Proto_JSClass;
+extern const js::Class XPC_WN_Proto_JSClass;
 extern const js::Class XPC_WN_Tearoff_JSClass;
 #define XPC_WN_TEAROFF_RESERVED_SLOTS 1
 #define XPC_WN_TEAROFF_FLAT_OBJECT_SLOT 0
 extern const js::Class XPC_WN_NoHelper_Proto_JSClass;
 
 extern bool
 XPC_WN_CallMethod(JSContext* cx, unsigned argc, JS::Value* vp);
 
 extern bool
 XPC_WN_GetterSetter(JSContext* cx, unsigned argc, JS::Value* vp);
 
-// Maybe this macro should check for class->enumerate ==
-// XPC_WN_Shared_Proto_Enumerate or something rather than checking for
-// 4 classes?
-static inline bool IS_PROTO_CLASS(const js::Class* clazz)
-{
-    return clazz == &XPC_WN_NoMods_Proto_JSClass ||
-           clazz == &XPC_WN_ModsAllowed_Proto_JSClass;
-}
-
 /***************************************************************************/
 // XPCWrappedNativeScope is one-to-one with a JS global object.
 
 class nsXPCComponentsBase;
 class XPCWrappedNativeScope final
 {
 public: