mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
Bug 882543 - Register the MSG thread for in the profiler. r=benwa
This commit is contained in:
parent
2703867eb2
commit
857acbc9aa
@ -23,6 +23,7 @@
|
|||||||
#include "AudioNodeStream.h"
|
#include "AudioNodeStream.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "DOMMediaStream.h"
|
#include "DOMMediaStream.h"
|
||||||
|
#include "GeckoProfiler.h"
|
||||||
|
|
||||||
using namespace mozilla::layers;
|
using namespace mozilla::layers;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
@ -1201,6 +1202,7 @@ MediaStreamGraphImpl::RunThread()
|
|||||||
if (!mRealtime) {
|
if (!mRealtime) {
|
||||||
mNonRealtimeIsRunning = false;
|
mNonRealtimeIsRunning = false;
|
||||||
}
|
}
|
||||||
|
profiler_unregister_thread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1246,6 +1248,23 @@ MediaStreamGraphImpl::ForceShutDown()
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
class MediaStreamGraphInitThreadRunnable : public nsRunnable {
|
||||||
|
public:
|
||||||
|
explicit MediaStreamGraphInitThreadRunnable(MediaStreamGraphImpl* aGraph)
|
||||||
|
: mGraph(aGraph)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
NS_IMETHOD Run()
|
||||||
|
{
|
||||||
|
char aLocal;
|
||||||
|
profiler_register_thread("MediaStreamGraph", &aLocal);
|
||||||
|
mGraph->RunThread();
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
MediaStreamGraphImpl* mGraph;
|
||||||
|
};
|
||||||
|
|
||||||
class MediaStreamGraphThreadRunnable : public nsRunnable {
|
class MediaStreamGraphThreadRunnable : public nsRunnable {
|
||||||
public:
|
public:
|
||||||
explicit MediaStreamGraphThreadRunnable(MediaStreamGraphImpl* aGraph)
|
explicit MediaStreamGraphThreadRunnable(MediaStreamGraphImpl* aGraph)
|
||||||
@ -1385,7 +1404,7 @@ MediaStreamGraphImpl::RunInStableState()
|
|||||||
// Start the thread now. We couldn't start it earlier because
|
// Start the thread now. We couldn't start it earlier because
|
||||||
// the graph might exit immediately on finding it has no streams. The
|
// the graph might exit immediately on finding it has no streams. The
|
||||||
// first message for a new graph must create a stream.
|
// first message for a new graph must create a stream.
|
||||||
nsCOMPtr<nsIRunnable> event = new MediaStreamGraphThreadRunnable(this);
|
nsCOMPtr<nsIRunnable> event = new MediaStreamGraphInitThreadRunnable(this);
|
||||||
NS_NewNamedThread("MediaStreamGrph", getter_AddRefs(mThread), event);
|
NS_NewNamedThread("MediaStreamGrph", getter_AddRefs(mThread), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user