зеркало из https://github.com/mozilla/gecko-dev.git
Bug 972075 - Add profile markers from browser element event synthesis. r=BenWa, r=vingtetun
This commit is contained in:
Родитель
b896a20a13
Коммит
6fe23512c2
|
@ -254,9 +254,9 @@ BrowserElementParent.prototype = {
|
|||
"hello": this._recvHello,
|
||||
"contextmenu": this._fireCtxMenuEvent,
|
||||
"locationchange": this._fireEventFromMsg,
|
||||
"loadstart": this._fireEventFromMsg,
|
||||
"loadend": this._fireEventFromMsg,
|
||||
"titlechange": this._fireEventFromMsg,
|
||||
"loadstart": this._fireProfiledEventFromMsg,
|
||||
"loadend": this._fireProfiledEventFromMsg,
|
||||
"titlechange": this._fireProfiledEventFromMsg,
|
||||
"iconchange": this._fireEventFromMsg,
|
||||
"manifestchange": this._fireEventFromMsg,
|
||||
"metachange": this._fireEventFromMsg,
|
||||
|
@ -267,8 +267,8 @@ BrowserElementParent.prototype = {
|
|||
"securitychange": this._fireEventFromMsg,
|
||||
"error": this._fireEventFromMsg,
|
||||
"scroll": this._fireEventFromMsg,
|
||||
"firstpaint": this._fireEventFromMsg,
|
||||
"documentfirstpaint": this._fireEventFromMsg,
|
||||
"firstpaint": this._fireProfiledEventFromMsg,
|
||||
"documentfirstpaint": this._fireProfiledEventFromMsg,
|
||||
"nextpaint": this._recvNextPaint,
|
||||
"keyevent": this._fireKeyEvent,
|
||||
"showmodalprompt": this._handleShowModalPrompt,
|
||||
|
@ -407,6 +407,16 @@ BrowserElementParent.prototype = {
|
|||
return !this._frameElement.dispatchEvent(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
* add profiler marker for each event fired.
|
||||
*/
|
||||
_fireProfiledEventFromMsg: function(data) {
|
||||
if (Services.profiler !== undefined) {
|
||||
Services.profiler.AddMarker(data.json.msg_name);
|
||||
}
|
||||
this._fireEventFromMsg(data);
|
||||
},
|
||||
|
||||
/**
|
||||
* Fire either a vanilla or a custom event, depending on the contents of
|
||||
* |data|.
|
||||
|
|
|
@ -64,6 +64,9 @@ let initTable = [
|
|||
["obs", "@mozilla.org/observer-service;1", "nsIObserverService"],
|
||||
["perms", "@mozilla.org/permissionmanager;1", "nsIPermissionManager"],
|
||||
["prompt", "@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService"],
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
["profiler", "@mozilla.org/tools/profiler;1", "nsIProfiler"],
|
||||
#endif
|
||||
["scriptloader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader"],
|
||||
["scriptSecurityManager", "@mozilla.org/scriptsecuritymanager;1", "nsIScriptSecurityManager"],
|
||||
#ifdef MOZ_TOOLKIT_SEARCH
|
||||
|
|
Загрузка…
Ссылка в новой задаче