Bug 1323100 - Stop double-registering the MediaStreamGraph thread with the profiler. r?froydnj
MozReview-Commit-ID: 7WxNLZpBWL4
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -34,29 +34,16 @@ extern mozilla::LazyLogModule gMediaStre
#else
#define LIFECYCLE_LOG(...)
#endif
namespace mozilla {
StaticRefPtr<nsIThreadPool> AsyncCubebTask::sThreadPool;
-struct AutoProfilerUnregisterThread
-{
- // The empty ctor is used to silence a pre-4.8.0 GCC unused variable warning.
- AutoProfilerUnregisterThread()
- {
- }
-
- ~AutoProfilerUnregisterThread()
- {
- profiler_unregister_thread();
- }
-};
-
GraphDriver::GraphDriver(MediaStreamGraphImpl* aGraphImpl)
: mIterationStart(0),
mIterationEnd(0),
mGraphImpl(aGraphImpl),
mWaitState(WAITSTATE_RUNNING),
mCurrentTimeStamp(TimeStamp::Now()),
mPreviousDriver(nullptr),
mNextDriver(nullptr)
@@ -191,19 +178,17 @@ ThreadedDriver::~ThreadedDriver()
class MediaStreamGraphInitThreadRunnable : public Runnable {
public:
explicit MediaStreamGraphInitThreadRunnable(ThreadedDriver* aDriver)
: mDriver(aDriver)
{
}
NS_IMETHOD Run() override
{
- char aLocal;
STREAM_LOG(LogLevel::Debug, ("Starting system thread"));
- profiler_register_thread("MediaStreamGraph", &aLocal);
LIFECYCLE_LOG("Starting a new system driver for graph %p\n",
mDriver->mGraphImpl);
GraphDriver* previousDriver = nullptr;
{
MonitorAutoLock mon(mDriver->mGraphImpl->GetMonitor());
previousDriver = mDriver->PreviousDriver();
}
@@ -311,18 +296,16 @@ bool
SystemClockDriver::IsFallback()
{
return mIsFallback;
}
void
ThreadedDriver::RunThread()
{
- AutoProfilerUnregisterThread autoUnregister;
-
bool stillProcessing = true;
while (stillProcessing) {
mIterationStart = IterationEnd();
mIterationEnd += GetIntervalForIteration();
GraphTime stateComputedTime = StateComputedTime();
if (stateComputedTime < mIterationEnd) {
STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected"));