Bug 1137536, part 1 - Move DeferredFinalize out of the cyclecollector namespace. r=smaug
authorAndrew McCreight <continuation@gmail.com>
Wed, 18 Mar 2015 11:36:03 -0700
changeset 264649 ae02f2179c4c203926c6405a0a74b6d43b14e8d6
parent 264648 f3ad3e6c736747d30c8e7d8396bb776e6b2396c4
child 264650 6583592e42eb0d0813d242cec865da2cf64e69b6
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1137536
milestone39.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 1137536, part 1 - Move DeferredFinalize out of the cyclecollector namespace. r=smaug
dom/bindings/BindingUtils.h
dom/xbl/nsXBLBinding.cpp
js/xpconnect/src/XPCWrappedJS.cpp
js/xpconnect/src/XPCWrappedNative.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/base/nsCycleCollector.h
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -2928,28 +2928,28 @@ struct DeferredFinalizerImpl
 template<class T,
          bool isISupports=IsBaseOf<nsISupports, T>::value>
 struct DeferredFinalizer
 {
   static void
   AddForDeferredFinalization(T* aObject)
   {
     typedef DeferredFinalizerImpl<T> Impl;
-    cyclecollector::DeferredFinalize(Impl::AppendDeferredFinalizePointer,
-                                     Impl::DeferredFinalize, aObject);
+    DeferredFinalize(Impl::AppendDeferredFinalizePointer,
+                     Impl::DeferredFinalize, aObject);
   }
 };
 
 template<class T>
 struct DeferredFinalizer<T, true>
 {
   static void
   AddForDeferredFinalization(T* aObject)
   {
-    cyclecollector::DeferredFinalize(reinterpret_cast<nsISupports*>(aObject));
+    DeferredFinalize(reinterpret_cast<nsISupports*>(aObject));
   }
 };
 
 template<class T>
 static void
 AddForDeferredFinalization(T* aObject)
 {
   DeferredFinalizer<T>::AddForDeferredFinalization(aObject);
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -69,17 +69,17 @@ using namespace mozilla::dom;
 //
 // The JS class for XBLBinding
 //
 static void
 XBLFinalize(JSFreeOp *fop, JSObject *obj)
 {
   nsXBLDocumentInfo* docInfo =
     static_cast<nsXBLDocumentInfo*>(::JS_GetPrivate(obj));
-  cyclecollector::DeferredFinalize(docInfo);
+  DeferredFinalize(docInfo);
 }
 
 static bool
 XBLEnumerate(JSContext *cx, JS::Handle<JSObject*> obj)
 {
   nsXBLPrototypeBinding* protoBinding =
     static_cast<nsXBLPrototypeBinding*>(::JS_GetReservedSlot(obj, 0).toPrivate());
   MOZ_ASSERT(protoBinding);
--- a/js/xpconnect/src/XPCWrappedJS.cpp
+++ b/js/xpconnect/src/XPCWrappedJS.cpp
@@ -463,17 +463,17 @@ nsXPCWrappedJS::Unlink()
         // let the root go
         NS_RELEASE(mRoot);
     }
 
     mClass = nullptr;
     if (mOuter) {
         XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
         if (rt->GCIsRunning()) {
-            cyclecollector::DeferredFinalize(mOuter.forget().take());
+            DeferredFinalize(mOuter.forget().take());
         } else {
             mOuter = nullptr;
         }
     }
 }
 
 nsXPCWrappedJS*
 nsXPCWrappedJS::Find(REFNSIID aIID)
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -593,17 +593,17 @@ XPCWrappedNative::Destroy()
         // Post-1.9 we should not remove this wrapper from the map if it is
         // uninitialized.
         map->Remove(this);
     }
 
     if (mIdentity) {
         XPCJSRuntime* rt = GetRuntime();
         if (rt && rt->GetDoingFinalization()) {
-            cyclecollector::DeferredFinalize(mIdentity.forget().take());
+            DeferredFinalize(mIdentity.forget().take());
         } else {
             mIdentity = nullptr;
         }
     }
 
     mMaybeScope = nullptr;
 }
 
@@ -908,17 +908,17 @@ XPCWrappedNative::FlatJSObjectFinalized(
             if (obj) {
 #ifdef XP_WIN
                 // Try to detect free'd pointer
                 MOZ_ASSERT(*(int*)obj != 0xdddddddd, "bad pointer!");
                 MOZ_ASSERT(*(int*)obj != 0,          "bad pointer!");
 #endif
                 XPCJSRuntime* rt = GetRuntime();
                 if (rt) {
-                    cyclecollector::DeferredFinalize(obj);
+                    DeferredFinalize(obj);
                 } else {
                     obj->Release();
                 }
                 to->SetNative(nullptr);
             }
 
             to->SetInterface(nullptr);
         }
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -3905,17 +3905,16 @@ CycleCollectedJSRuntime::Get()
   if (data) {
     return data->mRuntime;
   }
   return nullptr;
 }
 
 
 namespace mozilla {
-namespace cyclecollector {
 
 void
 DeferredFinalize(nsISupports* aSupports)
 {
   CycleCollectedJSRuntime* rt = CycleCollectedJSRuntime::Get();
   MOZ_ASSERT(rt, "Should have a CycleCollectedJSRuntime by now");
   rt->DeferredFinalize(aSupports);
 }
@@ -3925,17 +3924,16 @@ DeferredFinalize(DeferredFinalizeAppendF
                  DeferredFinalizeFunction aFunc,
                  void* aThing)
 {
   CycleCollectedJSRuntime* rt = CycleCollectedJSRuntime::Get();
   MOZ_ASSERT(rt, "Should have a CycleCollectedJSRuntime by now");
   rt->DeferredFinalize(aAppendFunc, aFunc, aThing);
 }
 
-} // namespace cyclecollector
 } // namespace mozilla
 
 
 MOZ_NEVER_INLINE static void
 SuspectAfterShutdown(void* aPtr, nsCycleCollectionParticipant* aCp,
                      nsCycleCollectingAutoRefCnt* aRefCnt,
                      bool* aShouldDelete)
 {
--- a/xpcom/base/nsCycleCollector.h
+++ b/xpcom/base/nsCycleCollector.h
@@ -73,20 +73,17 @@ void nsCycleCollector_forgetJSRuntime();
 { 0x94, 0xea, 0xae, 0xde, 0x2c, 0x62, 0x08, 0xd3 } }
 
 extern nsresult
 nsCycleCollectorLoggerConstructor(nsISupports* aOuter,
                                   const nsIID& aIID,
                                   void** aInstancePtr);
 
 namespace mozilla {
-namespace cyclecollector {
 
 void DeferredFinalize(DeferredFinalizeAppendFunction aAppendFunc,
                       DeferredFinalizeFunction aFunc,
                       void* aThing);
 void DeferredFinalize(nsISupports* aSupports);
 
-
-} // namespace cyclecollector
 } // namespace mozilla
 
 #endif // nsCycleCollector_h__