mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 751034 part 3 - Send notifications through remote debugging protocol when the profiler starts/stops. r=past
This commit is contained in:
parent
614cf671dc
commit
4e94d3a722
@ -166,7 +166,8 @@ const ThreadStateTypes = {
|
||||
const UnsolicitedNotifications = {
|
||||
"newScript": "newScript",
|
||||
"tabDetached": "tabDetached",
|
||||
"tabNavigated": "tabNavigated"
|
||||
"tabNavigated": "tabNavigated",
|
||||
"profilerStateChanged": "profilerStateChanged"
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -8,10 +8,15 @@
|
||||
* Creates a ProfilerActor. ProfilerActor provides remote access to the
|
||||
* built-in profiler module.
|
||||
*/
|
||||
function ProfilerActor()
|
||||
function ProfilerActor(aConnection)
|
||||
{
|
||||
this._conn = aConnection;
|
||||
this._profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
|
||||
this._started = false;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Services.obs.addObserver(this, "profiler-started", false);
|
||||
Services.obs.addObserver(this, "profiler-stopped", false);
|
||||
}
|
||||
|
||||
ProfilerActor.prototype = {
|
||||
@ -58,7 +63,14 @@ ProfilerActor.prototype = {
|
||||
onGetSharedLibraryInformation: function(aRequest) {
|
||||
var sharedLibraries = this._profiler.getSharedLibraryInformation();
|
||||
return { "sharedLibraryInformation": sharedLibraries }
|
||||
}
|
||||
},
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "profiler-started") {
|
||||
this.conn.send({ from: this.actorID, type: "profilerStateChanged", isActive: true });
|
||||
} else if (aTopic == "profiler-stopped") {
|
||||
this.conn.send({ from: this.actorID, type: "profilerStateChanged", isActive: false });
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user