Bug 913881, part 2 - Make a bunch of nsCycleCollector methods private. r=smaug
authorAndrew McCreight <continuation@gmail.com>
Tue, 10 Sep 2013 08:56:35 -0700
changeset 146391 50f93200b17607796f95476e4e251310335af888
parent 146390 431aa2871160c2498b0d6ee6bb84f74e5eb5aaa0
child 146392 8ac551efe4e110a439212a70002807fa1b7e9bac
push id33549
push useramccreight@mozilla.com
push dateTue, 10 Sep 2013 15:57:05 +0000
treeherdermozilla-inbound@fb46afe7f48b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs913881
milestone26.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 913881, part 2 - Make a bunch of nsCycleCollector methods private. r=smaug
xpcom/base/nsCycleCollector.cpp
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -929,84 +929,79 @@ private:
     nsCOMPtr<nsIMemoryMultiReporter> mReporter;
 
     nsPurpleBuffer mPurpleBuf;
 
     uint32_t mUnmergedNeeded;
     uint32_t mMergedInARow;
 
 public:
+    nsCycleCollector();
+    ~nsCycleCollector();
+
     void RegisterJSRuntime(CycleCollectedJSRuntime *aJSRuntime);
     void ForgetJSRuntime();
 
     void SetBeforeUnlinkCallback(CC_BeforeUnlinkCallback aBeforeUnlinkCB)
     {
         CheckThreadSafety();
         mBeforeUnlinkCB = aBeforeUnlinkCB;
     }
 
     void SetForgetSkippableCallback(CC_ForgetSkippableCallback aForgetSkippableCB)
     {
         CheckThreadSafety();
         mForgetSkippableCB = aForgetSkippableCB;
     }
 
-    void MarkRoots(GCGraphBuilder &aBuilder);
-    void ScanRoots();
-    void ScanWeakMaps();
-
-    void ForgetSkippable(bool aRemoveChildlessNodes, bool aAsyncSnowWhiteFreeing);
-
-    // returns whether anything was collected
-    bool CollectWhite(nsICycleCollectorListener *aListener);
-
-    nsCycleCollector();
-    ~nsCycleCollector();
-
     void Suspect(void *n, nsCycleCollectionParticipant *cp,
                  nsCycleCollectingAutoRefCnt *aRefCnt);
-
-    void CheckThreadSafety();
-
-private:
-    void ShutdownCollect(nsICycleCollectorListener *aListener);
-
-public:
+    uint32_t SuspectedCount();
+    void ForgetSkippable(bool aRemoveChildlessNodes, bool aAsyncSnowWhiteFreeing);
+    bool FreeSnowWhite(bool aUntilNoSWInPurpleBuffer);
+
     bool Collect(ccType aCCType,
                  nsTArray<PtrInfo*> *aWhiteNodes,
                  nsCycleCollectorResults *aResults,
                  nsICycleCollectorListener *aListener);
+    void Shutdown();
+
+    void SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
+                             size_t *aObjectSize,
+                             size_t *aGraphNodesSize,
+                             size_t *aGraphEdgesSize,
+                             size_t *aWhiteNodeSize,
+                             size_t *aPurpleBufferSize) const;
+
+private:
+    void CheckThreadSafety();
+    void ShutdownCollect(nsICycleCollectorListener *aListener);
 
     void PrepareForCollection(nsCycleCollectorResults *aResults,
                               nsTArray<PtrInfo*> *aWhiteNodes);
     void FixGrayBits(bool aForceGC);
     bool ShouldMergeZones(ccType aCCType);
-    void CleanupAfterCollection();
 
     void BeginCollection(ccType aCCType, nsICycleCollectorListener *aListener);
-
-    bool FreeSnowWhite(bool aUntilNoSWInPurpleBuffer);
-
-    uint32_t SuspectedCount();
-    void Shutdown();
+    void MarkRoots(GCGraphBuilder &aBuilder);
+    void ScanRoots();
+    void ScanWeakMaps();
+
+    // returns whether anything was collected
+    bool CollectWhite(nsICycleCollectorListener *aListener);
+
+    void CleanupAfterCollection();
 
     void ClearGraph()
     {
         mGraph.mNodes.Clear();
         mGraph.mEdges.Clear();
         mGraph.mWeakMaps.Clear();
         mGraph.mRootCount = 0;
     }
-
-    void SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
-                             size_t *aObjectSize,
-                             size_t *aGraphNodesSize,
-                             size_t *aGraphEdgesSize,
-                             size_t *aWhiteNodeSize,
-                             size_t *aPurpleBufferSize) const;
 };
 
 /**
  * GraphWalker is templatized over a Visitor class that must provide
  * the following two methods:
  *
  * bool ShouldVisitNode(PtrInfo const *pi);
  * void VisitNode(PtrInfo *pi);