зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1187419 - Make sure SettingsRequestManager is only loaded in parent. r=gwagner
This commit is contained in:
Родитель
a39ceed4a2
Коммит
4bf7163f65
|
@ -6,6 +6,7 @@
|
|||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.importGlobalProperties(['File']);
|
||||
|
@ -39,6 +40,9 @@ function debug(s) {
|
|||
dump("-*- SettingsRequestManager: " + s + "\n");
|
||||
}
|
||||
|
||||
let inParent = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime)
|
||||
.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
|
||||
|
||||
const kXpcomShutdownObserverTopic = "xpcom-shutdown";
|
||||
const kInnerWindowDestroyed = "inner-window-destroyed";
|
||||
const kMozSettingsChangedObserverTopic = "mozsettings-changed";
|
||||
|
@ -1210,5 +1214,11 @@ let SettingsRequestManager = {
|
|||
}
|
||||
};
|
||||
|
||||
this.SettingsRequestManager = SettingsRequestManager;
|
||||
SettingsRequestManager.init();
|
||||
// This code should ALWAYS be living only on the parent side.
|
||||
if (!inParent) {
|
||||
debug("SettingsRequestManager should be living on parent side.");
|
||||
throw Cr.NS_ERROR_ABORT;
|
||||
} else {
|
||||
this.SettingsRequestManager = SettingsRequestManager;
|
||||
SettingsRequestManager.init();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче