Bug 960715, part 1 - Remove XPCWrappedNativeProto::ClassIsMainThreadOnly. r=bholley
authorAndrew McCreight <continuation@gmail.com>
Fri, 17 Jan 2014 05:57:34 -0800
changeset 163948 0ed69fa19314301d0945280944137efa8c9bf2ab
parent 163947 b9757c55e79b9c917b760fe76b5156179872926e
child 163949 2be8ad58c32ef2fcd713b26d8adcb16b649f354f
push id38588
push useramccreight@mozilla.com
push dateFri, 17 Jan 2014 13:57:55 +0000
treeherdermozilla-inbound@2be8ad58c32e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs960715
milestone29.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 960715, part 1 - Remove XPCWrappedNativeProto::ClassIsMainThreadOnly. r=bholley
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/xpcprivate.h
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -1151,24 +1151,16 @@ XPCWrappedNative::ReparentWrapperIfFound
 
         if (wrapper)
             flat = wrapper->GetFlatJSObject();
     }
 
     if (!flat)
         return NS_OK;
 
-    // ReparentWrapperIfFound is really only meant to be called from DOM code
-    // which must happen only on the main thread. Bail if we're on some other
-    // thread or have a non-main-thread-only wrapper.
-    if (wrapper->GetProto() &&
-        !wrapper->GetProto()->ClassIsMainThreadOnly()) {
-        return NS_ERROR_FAILURE;
-    }
-
     JSAutoCompartment ac(cx, aNewScope->GetGlobalJSObject());
 
     if (aOldScope != aNewScope) {
         // Oh, so now we need to move the wrapper to a different scope.
         AutoMarkingWrappedNativeProtoPtr oldProto(cx);
         AutoMarkingWrappedNativeProtoPtr newProto(cx);
 
         // Cross-scope means cross-compartment.
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -1845,17 +1845,16 @@ public:
     GetClassInfoFlags() const {return mClassInfoFlags;}
 
 #ifdef GET_IT
 #undef GET_IT
 #endif
 #define GET_IT(f_) const {return !!(mClassInfoFlags & nsIClassInfo:: f_ );}
 
     bool ClassIsSingleton()           GET_IT(SINGLETON)
-    bool ClassIsMainThreadOnly()      GET_IT(MAIN_THREAD_ONLY)
     bool ClassIsDOMObject()           GET_IT(DOM_OBJECT)
     bool ClassIsPluginObject()        GET_IT(PLUGIN_OBJECT)
 
 #undef GET_IT
 
     void SetScriptableInfo(XPCNativeScriptableInfo* si)
         {MOZ_ASSERT(!mScriptableInfo, "leak here!"); mScriptableInfo = si;}