зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1396634 - Speed up the content scripts globals retrieval from the tab actor. r=ochameau
MozReview-Commit-ID: HA5GlenrSNm --HG-- extra : rebase_source : 681a537313fc11b45efce2e37629dc0faddb308f
This commit is contained in:
Родитель
f94db93911
Коммит
2952493fed
|
@ -26,10 +26,12 @@ var { TabSources } = require("./utils/TabSources");
|
||||||
var makeDebugger = require("./utils/make-debugger");
|
var makeDebugger = require("./utils/make-debugger");
|
||||||
const EventEmitter = require("devtools/shared/event-emitter");
|
const EventEmitter = require("devtools/shared/event-emitter");
|
||||||
|
|
||||||
|
const EXTENSION_CONTENT_JSM = "resource://gre/modules/ExtensionContent.jsm";
|
||||||
|
|
||||||
loader.lazyRequireGetter(this, "ThreadActor", "devtools/server/actors/script", true);
|
loader.lazyRequireGetter(this, "ThreadActor", "devtools/server/actors/script", true);
|
||||||
loader.lazyRequireGetter(this, "unwrapDebuggerObjectGlobal", "devtools/server/actors/script", true);
|
loader.lazyRequireGetter(this, "unwrapDebuggerObjectGlobal", "devtools/server/actors/script", true);
|
||||||
loader.lazyRequireGetter(this, "WorkerActorList", "devtools/server/actors/worker-list", true);
|
loader.lazyRequireGetter(this, "WorkerActorList", "devtools/server/actors/worker-list", true);
|
||||||
loader.lazyImporter(this, "ExtensionContent", "resource://gre/modules/ExtensionContent.jsm");
|
loader.lazyImporter(this, "ExtensionContent", EXTENSION_CONTENT_JSM);
|
||||||
|
|
||||||
loader.lazyRequireGetter(this, "StyleSheetActor", "devtools/server/actors/stylesheets", true);
|
loader.lazyRequireGetter(this, "StyleSheetActor", "devtools/server/actors/stylesheets", true);
|
||||||
|
|
||||||
|
@ -336,8 +338,11 @@ TabActor.prototype = {
|
||||||
* current tab content's DOM window.
|
* current tab content's DOM window.
|
||||||
*/
|
*/
|
||||||
get webextensionsContentScriptGlobals() {
|
get webextensionsContentScriptGlobals() {
|
||||||
// Ignore xpcshell runtime which spawn TabActors without a window.
|
// Ignore xpcshell runtime which spawn TabActors without a window
|
||||||
if (this.window) {
|
// and only retrieve the content scripts globals if the ExtensionContent JSM module
|
||||||
|
// has been already loaded (which is true if the WebExtensions internals have already
|
||||||
|
// been loaded in the same content process).
|
||||||
|
if (this.window && Cu.isModuleLoaded(EXTENSION_CONTENT_JSM)) {
|
||||||
return ExtensionContent.getContentScriptGlobals(this.window);
|
return ExtensionContent.getContentScriptGlobals(this.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче