Bug 774388 - Patch 3: remove sCompositorLoop, it's redundant - r=nical,mattwoodrow
authorBenoit Jacob <bjacob@mozilla.com>
Thu, 05 Jun 2014 16:42:13 -0400
changeset 207278 d1979fa5e898fe753fa526120d343a04a557c638
parent 207277 750ec8fa408909e21698d0ba378d5af660fe02ab
child 207279 e66a83f534b2168d01927f7110a656fc94311ebb
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, mattwoodrow
bugs774388
milestone32.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 774388 - Patch 3: remove sCompositorLoop, it's redundant - r=nical,mattwoodrow
gfx/layers/ipc/CompositorParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -75,33 +75,31 @@ static LayerTreeMap sIndirectLayerTrees;
 
 // FIXME/bug 774386: we're assuming that there's only one
 // CompositorParent, but that's not always true.  This assumption only
 // affects CrossProcessCompositorParent below.
 static Thread* sCompositorThread = nullptr;
 // manual reference count of the compositor thread.
 static int sCompositorThreadRefCount = 0;
 static MessageLoop* sMainLoop = nullptr;
-static MessageLoop* sCompositorLoop = nullptr;
 
 // See ImageBridgeChild.cpp
 void ReleaseImageBridgeParentSingleton();
 
 static void DeferredDeleteCompositorParent(CompositorParent* aNowReadyToDie)
 {
   aNowReadyToDie->Release();
 }
 
 static void DeleteCompositorThread()
 {
   if (NS_IsMainThread()){
     ReleaseImageBridgeParentSingleton();
     delete sCompositorThread;
     sCompositorThread = nullptr;
-    sCompositorLoop = nullptr;
   } else {
     sMainLoop->PostTask(FROM_HERE, NewRunnableFunction(&DeleteCompositorThread));
   }
 }
 
 static void ReleaseCompositorThread()
 {
   if(--sCompositorThreadRefCount == 0) {
@@ -111,34 +109,31 @@ static void ReleaseCompositorThread()
 
 static void SetThreadPriority()
 {
   hal::SetCurrentThreadPriority(hal::THREAD_PRIORITY_COMPOSITOR);
 }
 
 void CompositorParent::StartUp()
 {
-  MOZ_ASSERT(!sCompositorLoop);
   CreateCompositorMap();
   CreateThread();
   sMainLoop = MessageLoop::current();
 }
 
 void CompositorParent::ShutDown()
 {
   DestroyThread();
   DestroyCompositorMap();
 }
 
 bool CompositorParent::CreateThread()
 {
   NS_ASSERTION(NS_IsMainThread(), "Should be on the main Thread!");
-  if (sCompositorThread || sCompositorLoop) {
-    return true;
-  }
+  MOZ_ASSERT(!sCompositorThread);
   sCompositorThreadRefCount = 1;
   sCompositorThread = new Thread("Compositor");
 
   Thread::Options options;
   /* Timeout values are powers-of-two to enable us get better data.
      128ms is chosen for transient hangs because 8Hz should be the minimally
      acceptable goal for Compositor responsiveness (normal goal is 60Hz). */
   options.transient_hang_timeout = 128; // milliseconds
@@ -158,17 +153,17 @@ bool CompositorParent::CreateThread()
 void CompositorParent::DestroyThread()
 {
   NS_ASSERTION(NS_IsMainThread(), "Should be on the main Thread!");
   ReleaseCompositorThread();
 }
 
 MessageLoop* CompositorParent::CompositorLoop()
 {
-  return sCompositorThread ? sCompositorThread->message_loop() : sCompositorLoop;
+  return sCompositorThread ? sCompositorThread->message_loop() : nullptr;
 }
 
 CompositorParent::CompositorParent(nsIWidget* aWidget,
                                    bool aUseExternalSurfaceSize,
                                    int aSurfaceWidth, int aSurfaceHeight)
   : mWidget(aWidget)
   , mCurrentCompositeTask(nullptr)
   , mIsTesting(false)