Bug 1184630 - Remove the unused XPCWrappedNative::LocateTearOff(). r=gabor
authorAndrew McCreight <continuation@gmail.com>
Thu, 16 Jul 2015 17:50:43 -0700
changeset 285074 6e0a788400b73f162c3072e2050aab4a69bffb2f
parent 285073 7a5dd58d1b3ddfc8ca967421e38cd8b5a2869826
child 285075 c8da15a0fb07d5342d806fac7acada0c361e0993
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor
bugs1184630
milestone42.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 1184630 - Remove the unused XPCWrappedNative::LocateTearOff(). r=gabor Also, remove some redundant access specifiers in XPCWrappedNative.
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/xpcprivate.h
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -1031,30 +1031,16 @@ XPCWrappedNative::ExtendSet(XPCNativeInt
             return false;
 
         mSet = newSet;
     }
     return true;
 }
 
 XPCWrappedNativeTearOff*
-XPCWrappedNative::LocateTearOff(XPCNativeInterface* aInterface)
-{
-    for (XPCWrappedNativeTearOffChunk* chunk = &mFirstChunk;
-         chunk != nullptr;
-         chunk = chunk->mNextChunk) {
-        XPCWrappedNativeTearOff* tearOff = &chunk->mTearOff;
-        if (tearOff->GetInterface() == aInterface) {
-            return tearOff;
-        }
-    }
-    return nullptr;
-}
-
-XPCWrappedNativeTearOff*
 XPCWrappedNative::FindTearOff(XPCNativeInterface* aInterface,
                               bool needJSObject /* = false */,
                               nsresult* pError /* = nullptr */)
 {
     AutoJSContext cx;
     nsresult rv = NS_OK;
     XPCWrappedNativeTearOff* to;
     XPCWrappedNativeTearOff* firstAvailable = nullptr;
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2151,17 +2151,16 @@ public:
                   XPCWrappedNative** wrappedGlobal);
 
     static nsresult
     GetNewOrUsed(xpcObjectHelper& helper,
                  XPCWrappedNativeScope* Scope,
                  XPCNativeInterface* Interface,
                  XPCWrappedNative** wrapper);
 
-public:
     static nsresult
     GetUsedOnly(nsISupports* Object,
                 XPCWrappedNativeScope* Scope,
                 XPCNativeInterface* Interface,
                 XPCWrappedNative** wrapper);
 
     void FlatJSObjectFinalized();
     void FlatJSObjectMoved(JSObject* obj, const JSObject* old);
@@ -2176,17 +2175,16 @@ public:
     static bool GetAttribute(XPCCallContext& ccx)
         {return CallMethod(ccx, CALL_GETTER);}
 
     static bool SetAttribute(XPCCallContext& ccx)
         {return CallMethod(ccx, CALL_SETTER);}
 
     inline bool HasInterfaceNoQI(const nsIID& iid);
 
-    XPCWrappedNativeTearOff* LocateTearOff(XPCNativeInterface* aInterface);
     XPCWrappedNativeTearOff* FindTearOff(XPCNativeInterface* aInterface,
                                          bool needJSObject = false,
                                          nsresult* pError = nullptr);
     XPCWrappedNativeTearOff* FindTearOff(const nsIID& iid);
 
     void Mark() const
     {
         mSet->Mark();
@@ -2270,18 +2268,16 @@ protected:
     void UpdateScriptableInfo(XPCNativeScriptableInfo* si);
 
 private:
     enum {
         // Flags bits for mFlatJSObject:
         FLAT_JS_OBJECT_VALID = JS_BIT(0)
     };
 
-private:
-
     bool Init(const XPCNativeScriptableCreateInfo* sci);
     bool FinishInit();
 
     bool ExtendSet(XPCNativeInterface* aInterface);
 
     nsresult InitTearOff(XPCWrappedNativeTearOff* aTearOff,
                          XPCNativeInterface* aInterface,
                          bool needJSObject);