Backed out changeset dc9d9c01080a (bug 1399453) for static bustage at layers/CompositorThread.h:68: bad implicit conversion constructor for 'CompositorThreadHolderDebug'. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 23 Oct 2017 18:26:14 +0200
changeset 387775 91f976f5e4c5b59db6a8b1eb6bc39c3ec992774d
parent 387774 aaf86ab8bea034ee41a172b494752facbc88a396
child 387776 b721be9535ab7fa072f51f88eddac4510d14c463
push id32735
push userarchaeopteryx@coole-files.de
push dateTue, 24 Oct 2017 09:53:08 +0000
treeherdermozilla-central@a80d568a417e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1399453
milestone58.0a1
backs outdc9d9c01080a3a9d36af97706a0ec612663c48b0
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
Backed out changeset dc9d9c01080a (bug 1399453) for static bustage at layers/CompositorThread.h:68: bad implicit conversion constructor for 'CompositorThreadHolderDebug'. r=backout on a CLOSED TREE
gfx/ipc/VsyncBridgeParent.cpp
gfx/ipc/VsyncBridgeParent.h
gfx/layers/ipc/CompositorManagerParent.cpp
gfx/layers/ipc/CompositorManagerParent.h
gfx/layers/ipc/CompositorThread.cpp
gfx/layers/ipc/CompositorThread.h
gfx/layers/ipc/ImageBridgeParent.cpp
gfx/layers/ipc/ImageBridgeParent.h
gfx/layers/ipc/VideoBridgeParent.cpp
gfx/layers/ipc/VideoBridgeParent.h
--- a/gfx/ipc/VsyncBridgeParent.cpp
+++ b/gfx/ipc/VsyncBridgeParent.cpp
@@ -23,17 +23,17 @@ VsyncBridgeParent::Start(Endpoint<PVsync
 
   return parent;
 }
 
 VsyncBridgeParent::VsyncBridgeParent()
  : mOpen(false)
 {
   MOZ_COUNT_CTOR(VsyncBridgeParent);
-  mCompositorThreadRef = new CompositorThreadHolderDebug("VsyncBridge");
+  mCompositorThreadRef = CompositorThreadHolder::GetSingleton();
 }
 
 VsyncBridgeParent::~VsyncBridgeParent()
 {
   MOZ_COUNT_DTOR(VsyncBridgeParent);
 }
 
 void
--- a/gfx/ipc/VsyncBridgeParent.h
+++ b/gfx/ipc/VsyncBridgeParent.h
@@ -33,15 +33,15 @@ private:
   VsyncBridgeParent();
   ~VsyncBridgeParent();
 
   void Open(Endpoint<PVsyncBridgeParent>&& aEndpoint);
   void ShutdownImpl();
 
 private:
   bool mOpen;
-  RefPtr<layers::CompositorThreadHolderDebug> mCompositorThreadRef;
+  RefPtr<layers::CompositorThreadHolder> mCompositorThreadRef;
 };
 
 } // namespace gfx
 } // namespace mozilla
 
 #endif // include_gfx_ipc_VsyncBridgeParent_h
--- a/gfx/layers/ipc/CompositorManagerParent.cpp
+++ b/gfx/layers/ipc/CompositorManagerParent.cpp
@@ -36,34 +36,30 @@ CompositorManagerParent::CreateSameProce
     MOZ_ASSERT_UNREACHABLE("Already initialized");
     return nullptr;
   }
 
   // The child is responsible for setting up the IPC channel in the same
   // process case because if we open from the child perspective, we can do it
   // on the main thread and complete before we return the manager handles.
   RefPtr<CompositorManagerParent> parent = new CompositorManagerParent();
-  parent->mCompositorThreadHolder =
-    new CompositorThreadHolderDebug("CompositorManagerSame");
   parent->SetOtherProcessId(base::GetCurrentProcId());
   return parent.forget();
 }
 
 /* static */ void
 CompositorManagerParent::Create(Endpoint<PCompositorManagerParent>&& aEndpoint)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // We are creating a manager for the another process, inside the GPU process
   // (or UI process if it subsumbed the GPU process).
   MOZ_ASSERT(aEndpoint.OtherPid() != base::GetCurrentProcId());
 
   RefPtr<CompositorManagerParent> bridge = new CompositorManagerParent();
-  bridge->mCompositorThreadHolder =
-    new CompositorThreadHolderDebug("CompositorManagerContent");
 
   RefPtr<Runnable> runnable = NewRunnableMethod<Endpoint<PCompositorManagerParent>&&>(
     "CompositorManagerParent::Bind",
     bridge,
     &CompositorManagerParent::Bind,
     Move(aEndpoint));
   CompositorThreadHolder::Loop()->PostTask(runnable.forget());
 }
@@ -104,16 +100,17 @@ CompositorManagerParent::CreateSameProce
     new CompositorBridgeParent(sInstance, aScale, vsyncRate, aOptions,
                                aUseExternalSurfaceSize, aSurfaceSize);
 
   sInstance->mPendingCompositorBridges.AppendElement(bridge);
   return bridge.forget();
 }
 
 CompositorManagerParent::CompositorManagerParent()
+  : mCompositorThreadHolder(CompositorThreadHolder::GetSingleton())
 {
 }
 
 CompositorManagerParent::~CompositorManagerParent()
 {
 }
 
 void
--- a/gfx/layers/ipc/CompositorManagerParent.h
+++ b/gfx/layers/ipc/CompositorManagerParent.h
@@ -13,17 +13,17 @@
 #include "mozilla/RefPtr.h"             // for already_AddRefed
 #include "mozilla/layers/PCompositorManagerParent.h"
 #include "nsTArray.h"                   // for AutoTArray
 
 namespace mozilla {
 namespace layers {
 
 class CompositorBridgeParent;
-class CompositorThreadHolderDebug;
+class CompositorThreadHolder;
 
 #ifndef DEBUG
 #define COMPOSITOR_MANAGER_PARENT_EXPLICIT_SHUTDOWN
 #endif
 
 class CompositorManagerParent final : public PCompositorManagerParent
 {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorManagerParent)
@@ -58,17 +58,17 @@ private:
   ~CompositorManagerParent() override;
 
   void Bind(Endpoint<PCompositorManagerParent>&& aEndpoint);
 
   void DeallocPCompositorManagerParent() override;
 
   void DeferredDestroy();
 
-  RefPtr<CompositorThreadHolderDebug> mCompositorThreadHolder;
+  RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
 
   AutoTArray<RefPtr<CompositorBridgeParent>, 1> mPendingCompositorBridges;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif
--- a/gfx/layers/ipc/CompositorThread.cpp
+++ b/gfx/layers/ipc/CompositorThread.cpp
@@ -4,56 +4,26 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "CompositorThread.h"
 #include "MainThreadUtils.h"
 #include "nsThreadUtils.h"
 #include "CompositorBridgeParent.h"
 #include "mozilla/layers/ImageBridgeParent.h"
 #include "mozilla/media/MediaSystemResourceService.h"
-#ifdef MOZ_CRASHREPORTER
-#include "nsExceptionHandler.h"     // for CrashReporter
-#endif
 
 namespace mozilla {
 
 namespace gfx {
 // See VRManagerChild.cpp
 void ReleaseVRManagerParentSingleton();
 } // namespace gfx
 
 namespace layers {
 
-#ifdef MOZ_CRASHREPORTER
-static Atomic<int32_t> sHoldersNextId(0);
-#endif
-
-CompositorThreadHolderDebug::CompositorThreadHolderDebug(const char* aName)
-  : mHolder(CompositorThreadHolder::GetSingleton())
-{
-#ifdef MOZ_CRASHREPORTER
-  if (XRE_IsParentProcess()) {
-    mId.AppendLiteral("gfxCTH:");
-    mId.Append(aName);
-    mId.AppendLiteral(":");
-    mId.AppendInt(++sHoldersNextId);
-    CrashReporter::AnnotateCrashReport(mId, NS_LITERAL_CSTRING("1"));
-  }
-#endif
-}
-
-CompositorThreadHolderDebug::~CompositorThreadHolderDebug()
-{
-#ifdef MOZ_CRASHREPORTER
-  if (XRE_IsParentProcess()) {
-    CrashReporter::AnnotateCrashReport(mId, NS_LITERAL_CSTRING("0"));
-  }
-#endif
-}
-
 static StaticRefPtr<CompositorThreadHolder> sCompositorThreadHolder;
 static bool sFinishedCompositorShutDown = false;
 
 CompositorThreadHolder* GetCompositorThreadHolder()
 {
   return sCompositorThreadHolder;
 }
 
--- a/gfx/layers/ipc/CompositorThread.h
+++ b/gfx/layers/ipc/CompositorThread.h
@@ -55,30 +55,14 @@ private:
   base::Thread* const mCompositorThread;
 
   static base::Thread* CreateCompositorThread();
   static void DestroyCompositorThread(base::Thread* aCompositorThread);
 
   friend class CompositorBridgeParent;
 };
 
-class CompositorThreadHolderDebug final
-{
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorThreadHolderDebug)
-
-public:
-  CompositorThreadHolderDebug(const char* aName);
-
-private:
-  ~CompositorThreadHolderDebug();
-
-  RefPtr<CompositorThreadHolder> mHolder;
-#ifdef MOZ_CRASHREPORTER
-  nsAutoCString mId;
-#endif
-};
-
 base::Thread* CompositorThread();
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // mozilla_layers_CompositorThread_h
--- a/gfx/layers/ipc/ImageBridgeParent.cpp
+++ b/gfx/layers/ipc/ImageBridgeParent.cpp
@@ -61,23 +61,20 @@ ImageBridgeParent::Setup()
   }
 }
 
 ImageBridgeParent::ImageBridgeParent(MessageLoop* aLoop,
                                      ProcessId aChildProcessId)
   : mMessageLoop(aLoop)
   , mSetChildThreadPriority(false)
   , mClosed(false)
+  , mCompositorThreadHolder(CompositorThreadHolder::GetSingleton())
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  mCompositorThreadHolder =
-    new CompositorThreadHolderDebug(IsSameProcess() ? "ImageBridgeSame"
-                                                    : "ImageBridge");
-
   // creates the map only if it has not been created already, so it is safe
   // with several bridges
   {
     MonitorAutoLock lock(*sImageBridgesLock);
     sImageBridges[aChildProcessId] = this;
   }
   SetOtherProcessId(aChildProcessId);
 }
--- a/gfx/layers/ipc/ImageBridgeParent.h
+++ b/gfx/layers/ipc/ImageBridgeParent.h
@@ -137,15 +137,15 @@ private:
   bool mSetChildThreadPriority;
   bool mClosed;
 
   /**
    * Map of all living ImageBridgeParent instances
    */
   static std::map<base::ProcessId, ImageBridgeParent*> sImageBridges;
 
-  RefPtr<CompositorThreadHolderDebug> mCompositorThreadHolder;
+  RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // gfx_layers_ipc_ImageBridgeParent_h_
--- a/gfx/layers/ipc/VideoBridgeParent.cpp
+++ b/gfx/layers/ipc/VideoBridgeParent.cpp
@@ -16,17 +16,17 @@ using namespace mozilla::gfx;
 
 static VideoBridgeParent* sVideoBridgeSingleton;
 
 VideoBridgeParent::VideoBridgeParent()
   : mClosed(false)
 {
   mSelfRef = this;
   sVideoBridgeSingleton = this;
-  mCompositorThreadRef = new CompositorThreadHolderDebug("VideoBridge");
+  mCompositorThreadRef = CompositorThreadHolder::GetSingleton();
 }
 
 VideoBridgeParent::~VideoBridgeParent()
 {
   sVideoBridgeSingleton = nullptr;
 }
 
 /* static */ VideoBridgeParent*
--- a/gfx/layers/ipc/VideoBridgeParent.h
+++ b/gfx/layers/ipc/VideoBridgeParent.h
@@ -7,17 +7,17 @@
 #define gfx_layers_ipc_VideoBridgeParent_h_
 
 #include "mozilla/layers/PVideoBridgeParent.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 
 namespace mozilla {
 namespace layers {
 
-class CompositorThreadHolderDebug;
+class CompositorThreadHolder;
 
 class VideoBridgeParent final : public PVideoBridgeParent,
                                 public HostIPCAllocator,
                                 public ShmemAllocator
 {
 public:
   VideoBridgeParent();
   ~VideoBridgeParent();
@@ -58,17 +58,17 @@ public:
   void DeallocShmem(ipc::Shmem& aShmem) override;
 
 private:
   void DeallocPVideoBridgeParent() override;
 
   // This keeps us alive until ActorDestroy(), at which point we do a
   // deferred destruction of ourselves.
   RefPtr<VideoBridgeParent> mSelfRef;
-  RefPtr<CompositorThreadHolderDebug> mCompositorThreadRef;
+  RefPtr<CompositorThreadHolder> mCompositorThreadRef;
 
   std::map<uint64_t, PTextureParent*> mTextureMap;
 
   bool mClosed;
 };
 
 } // namespace layers
 } // namespace mozilla