mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 790593 - Notify when the profiler starts and stops through the observer service. r=ehsan
This commit is contained in:
parent
841e6ae593
commit
4af0818cb7
@ -29,6 +29,8 @@
|
||||
#include "nsIXULAppInfo.h"
|
||||
#include "nsDirectoryServiceUtils.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
// JS
|
||||
#include "jsdbgapi.h"
|
||||
@ -1096,6 +1098,10 @@ void mozilla_sampler_start(int aProfileEntries, int aInterval,
|
||||
t->Start();
|
||||
if (t->ProfileJS())
|
||||
stack->enableJSSampling();
|
||||
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
if (os)
|
||||
os->NotifyObservers(nullptr, "profiler-started", nullptr);
|
||||
}
|
||||
|
||||
void mozilla_sampler_stop()
|
||||
@ -1118,6 +1124,10 @@ void mozilla_sampler_stop()
|
||||
|
||||
if (disableJS)
|
||||
stack->disableJSSampling();
|
||||
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
if (os)
|
||||
os->NotifyObservers(nullptr, "profiler-stopped", nullptr);
|
||||
}
|
||||
|
||||
bool mozilla_sampler_is_active()
|
||||
|
Loading…
Reference in New Issue
Block a user