Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout

This commit is contained in:
Sebastian Hengst 2017-04-14 23:39:22 +02:00
parent 9e0ecf32c5
commit a07223d699
834 changed files with 1534 additions and 1515 deletions

View File

@ -135,8 +135,8 @@ this.AccessFu = { // jshint ignore:line
]);
}
Services.obs.addObserver(this, 'remote-browser-shown');
Services.obs.addObserver(this, 'inprocess-browser-shown');
Services.obs.addObserver(this, 'remote-browser-shown', false);
Services.obs.addObserver(this, 'inprocess-browser-shown', false);
Utils.win.addEventListener('TabOpen', this);
Utils.win.addEventListener('TabClose', this);
Utils.win.addEventListener('TabSelect', this);

View File

@ -599,7 +599,7 @@ const AccessibilityEventObserver = {
if (this.started || this.listenerCount === 0) {
return;
}
Services.obs.addObserver(this, 'accessible-event');
Services.obs.addObserver(this, 'accessible-event', false);
this.started = true;
},

View File

@ -100,7 +100,7 @@ function waitForEvent(eventType, expectedIdOrAcc) {
}
}
};
Services.obs.addObserver(eventObserver, 'accessible-event');
Services.obs.addObserver(eventObserver, 'accessible-event', false);
});
}

View File

@ -47,7 +47,7 @@ function a11yInitOrShutdownPromise() {
Services.obs.removeObserver(observe, 'a11y-init-or-shutdown');
resolve(data);
};
Services.obs.addObserver(observe, 'a11y-init-or-shutdown');
Services.obs.addObserver(observe, 'a11y-init-or-shutdown', false);
});
}
@ -123,7 +123,7 @@ function waitForEvent(eventType, expectedId) {
}
}
};
Services.obs.addObserver(eventObserver, 'accessible-event');
Services.obs.addObserver(eventObserver, 'accessible-event', false);
});
}

View File

@ -149,5 +149,5 @@ function whenDelayedStartupFinished(aWindow, aCallback) {
Services.obs.removeObserver(observer, aTopic);
setTimeout(aCallback, 0);
}
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
}

View File

@ -2120,7 +2120,7 @@ function listenA11yEvents(aStartToListen)
if (aStartToListen) {
// Add observer when adding the first applicant only.
if (!(gA11yEventApplicantsCount++))
Services.obs.addObserver(gA11yEventObserver, "accessible-event");
Services.obs.addObserver(gA11yEventObserver, "accessible-event", false);
} else {
// Remove observer when there are no more applicants only.
// '< 0' case should not happen, but just in case: removeObserver() will throw.

View File

@ -70,7 +70,7 @@ var AccessFuTest = {
isDeeply(data.details, aWaitForData, "Data is correct");
aListener.apply(listener);
};
Services.obs.addObserver(listener, 'accessibility-output');
Services.obs.addObserver(listener, 'accessibility-output', false);
return listener;
},

View File

@ -111,10 +111,10 @@ const observer = {
}
};
observerService.addObserver(observer, "content-document-interactive");
observerService.addObserver(observer, "content-document-loaded");
observerService.addObserver(observer, "chrome-document-interactive");
observerService.addObserver(observer, "chrome-document-loaded");
observerService.addObserver(observer, "content-document-interactive", false);
observerService.addObserver(observer, "content-document-loaded", false);
observerService.addObserver(observer, "chrome-document-interactive", false);
observerService.addObserver(observer, "chrome-document-loaded", false);
addEventListener("unload", observer, false);
})(this);

View File

@ -66,7 +66,7 @@ const ContextMenuExtension = Class({
globalMessageManager.addMessageListener("sdk/context-menu/read", messageListener);
globalMessageManager.addMessageListener("sdk/context-menu/readers?", messageListener);
preferencesService.addObserver(OVERFLOW_THRESH, this);
preferencesService.addObserver(OVERFLOW_THRESH, this, false);
},
observe(_, __, name) {
if (name === OVERFLOW_THRESH) {

View File

@ -129,10 +129,10 @@ historyObserver.onVisit = function(url, visitId, time, sessionId,
}
this.realOnVisit(url, visitId, time, sessionId, referringId, transitionType);
};
historyService.addObserver(historyObserver);
historyService.addObserver(historyObserver, false);
var bookmarkObserver = createObserverInstance(BOOKMARK_EVENTS, BOOKMARK_ARGS);
bookmarkService.addObserver(bookmarkObserver);
bookmarkService.addObserver(bookmarkObserver, false);
when(() => {
historyService.removeObserver(historyObserver);

View File

@ -34,7 +34,7 @@ const PrefsTarget = Class({
// start listening to preference changes
let observer = prefTargetNS(this).observer = onChange.bind(this);
branch.addObserver('', observer);
branch.addObserver('', observer, false);
// Make sure to destroy this on unload
unload(destroy.bind(this));

View File

@ -52,5 +52,5 @@ else {
Services.tm.dispatchToMainThread(() => gOnceInitializedDeferred.resolve());
}
Services.obs.addObserver(listener, appStartup);
Services.obs.addObserver(listener, appStartup, false);
}

View File

@ -37,7 +37,7 @@ function startup(data, reason) {
dump("MU: APPLICATION-QUIT\n");
}
};
Services.obs.addObserver(QuitObserver, "quit-application");
Services.obs.addObserver(QuitObserver, "quit-application", false);
log("MU: ready to watch firefox exit.");
} catch(e) {
log("MU: unable to register quit-application observer: " + e);

View File

@ -53,7 +53,7 @@ exports.asyncWindowLeakTest = function*(assert, asyncTestFunc) {
weakWindows.push(Cu.getWeakReference(supportsWeak));
}
}
Services.obs.addObserver(windowObserver, "domwindowopened");
Services.obs.addObserver(windowObserver, "domwindowopened", false);
// Execute the body of the test.
let testLoader = yield asyncTestFunc(assert);

View File

@ -233,7 +233,7 @@ exports["test emit to nsIObserverService observers"] = function(assert) {
}
};
nsIObserverService.addObserver(nsIObserver, topic);
nsIObserverService.addObserver(nsIObserver, topic, false);
events.emit(topic, { subject: uri, data: "some data" });
@ -258,7 +258,7 @@ exports["test emit to nsIObserverService observers"] = function(assert) {
assert.equal(timesCalled, 2, "removed observers no longer invoked");
nsIObserverService.addObserver(nsIObserver, "*");
nsIObserverService.addObserver(nsIObserver, "*", false);
events.emit(topic, { data: "data again" });

View File

@ -224,7 +224,7 @@ function onStart() {
defaultOrientation = screenOrientation;
queueResize();
}, 'simulator-adjust-window-size');
}, 'simulator-adjust-window-size', false);
// Queue resize request in order to prevent race and slowdowns
// by requesting resize multiple times per loop

View File

@ -222,7 +222,7 @@ var shell = {
Services.obs.removeObserver(observer, topic);
}
}, "network-connection-state-changed");
}, "network-connection-state-changed", false);
},
get homeURL() {
@ -758,22 +758,22 @@ var shell = {
Services.obs.addObserver(function onFullscreenOriginChange(subject, topic, data) {
shell.sendChromeEvent({ type: "fullscreenoriginchange",
fullscreenorigin: data });
}, "fullscreen-origin-change");
}, "fullscreen-origin-change", false);
Services.obs.addObserver(function onBluetoothVolumeChange(subject, topic, data) {
shell.sendChromeEvent({
type: "bluetooth-volumeset",
value: data
});
}, 'bluetooth-volume-change');
}, 'bluetooth-volume-change', false);
Services.obs.addObserver(function(subject, topic, data) {
shell.sendCustomEvent('mozmemorypressure');
}, 'memory-pressure');
}, 'memory-pressure', false);
Services.obs.addObserver(function(subject, topic, data) {
shell.notifyEventListenerReady();
}, 'system-message-listener-ready');
}, 'system-message-listener-ready', false);
var permissionMap = new Map([
['unknown', Services.perms.UNKNOWN_ACTION],
@ -903,14 +903,14 @@ window.addEventListener('ContentStart', function ss_onContentStart() {
shell.reportCrash(false, props.getProperty("dumpID"));
}
},
"ipc:content-shutdown");
"ipc:content-shutdown", false);
})();
var CaptivePortalLoginHelper = {
init: function init() {
Services.obs.addObserver(this, 'captive-portal-login');
Services.obs.addObserver(this, 'captive-portal-login-abort');
Services.obs.addObserver(this, 'captive-portal-login-success');
Services.obs.addObserver(this, 'captive-portal-login', false);
Services.obs.addObserver(this, 'captive-portal-login-abort', false);
Services.obs.addObserver(this, 'captive-portal-login-success', false);
},
handleEvent: function handleEvent(detail) {
Services.captivePortalDetector.cancelLogin(detail.id);
@ -997,7 +997,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
prompt: promptWarning
});
}
}, "geolocation-device-events");
}, "geolocation-device-events", false);
})();
(function headphonesStatusTracker() {
@ -1006,7 +1006,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
type: 'headphones-status-changed',
state: aData
});
}, "headphones-status-changed");
}, "headphones-status-changed", false);
})();
(function audioChannelChangedTracker() {
@ -1015,7 +1015,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
type: 'audio-channel-changed',
channel: aData
});
}, "audio-channel-changed");
}, "audio-channel-changed", false);
})();
(function defaultVolumeChannelChangedTracker() {
@ -1024,7 +1024,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
type: 'default-volume-channel-changed',
channel: aData
});
}, "default-volume-channel-changed");
}, "default-volume-channel-changed", false);
})();
(function visibleAudioChannelChangedTracker() {
@ -1034,7 +1034,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
channel: aData
});
shell.visibleNormalAudioActive = (aData == 'normal');
}, "visible-audio-channel-changed");
}, "visible-audio-channel-changed", false);
})();
(function recordingStatusTracker() {
@ -1133,8 +1133,8 @@ window.addEventListener('ContentStart', function update_onContentStart() {
delete gRecordingActiveProcesses[processId];
}
};
Services.obs.addObserver(recordingHandler, 'recording-device-events');
Services.obs.addObserver(recordingHandler, 'recording-device-ipc-events');
Services.obs.addObserver(recordingHandler, 'recording-device-events', false);
Services.obs.addObserver(recordingHandler, 'recording-device-ipc-events', false);
Services.obs.addObserver(function(aSubject, aTopic, aData) {
// send additional recording events if content process is being killed
@ -1142,7 +1142,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
if (gRecordingActiveProcesses.hasOwnProperty(processId)) {
Services.obs.notifyObservers(aSubject, 'recording-device-ipc-events', 'content-shutdown');
}
}, 'ipc:content-shutdown');
}, 'ipc:content-shutdown', false);
})();
(function volumeStateTracker() {
@ -1151,7 +1151,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
type: 'volume-state-changed',
active: (aData == 'Shared')
});
}, 'volume-state-changed');
}, 'volume-state-changed', false);
})();
if (isGonk) {
@ -1229,12 +1229,12 @@ Services.obs.addObserver(function resetProfile(subject, topic, data) {
}
}
},
'profile-before-change-telemetry');
'profile-before-change-telemetry', false);
let appStartup = Cc['@mozilla.org/toolkit/app-startup;1']
.getService(Ci.nsIAppStartup);
appStartup.quit(Ci.nsIAppStartup.eForceQuit);
}, 'b2g-reset-profile');
}, 'b2g-reset-profile', false);
var showInstallScreen;

View File

@ -26,8 +26,8 @@ addMessageListener('init-chrome-event', function(message) {
}
}, true);
Services.obs.addObserver(peekChildId, 'recording-device-events');
Services.obs.addObserver(peekChildId, 'recording-device-ipc-events');
Services.obs.addObserver(peekChildId, 'recording-device-events', false);
Services.obs.addObserver(peekChildId, 'recording-device-ipc-events', false);
});
addMessageListener('fake-content-shutdown', function(message) {

View File

@ -62,7 +62,7 @@ var AlertsHelper = {
_listeners: {},
init: function() {
Services.obs.addObserver(this, "xpcom-shutdown");
Services.obs.addObserver(this, "xpcom-shutdown", false);
for (let message of kMessages) {
ppmm.addMessageListener(message, this);
}

View File

@ -44,7 +44,7 @@ const kTopicAlertFinished = "alertfinished";
const kTopicAlertClickCallback = "alertclickcallback";
function AlertsService() {
Services.obs.addObserver(this, "xpcom-shutdown");
Services.obs.addObserver(this, "xpcom-shutdown", false);
}
AlertsService.prototype = {

View File

@ -170,8 +170,8 @@ var ErrorPage = {
},
init: function errorPageInit() {
Services.obs.addObserver(this, 'inprocess-browser-shown');
Services.obs.addObserver(this, 'remote-browser-shown');
Services.obs.addObserver(this, 'inprocess-browser-shown', false);
Services.obs.addObserver(this, 'remote-browser-shown', false);
},
observe: function errorPageObserve(aSubject, aTopic, aData) {

View File

@ -20,9 +20,9 @@ const Observer = {
_frames: new Map(),
start: function () {
Services.obs.addObserver(this, 'remote-browser-shown');
Services.obs.addObserver(this, 'inprocess-browser-shown');
Services.obs.addObserver(this, 'message-manager-close');
Services.obs.addObserver(this, 'remote-browser-shown', false);
Services.obs.addObserver(this, 'inprocess-browser-shown', false);
Services.obs.addObserver(this, 'message-manager-close', false);
SystemAppProxy.getFrames().forEach(frame => {
let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;

View File

@ -48,9 +48,9 @@ this.FxAccountsMgmtService = {
},
init: function() {
Services.obs.addObserver(this, ONLOGIN_NOTIFICATION);
Services.obs.addObserver(this, ONVERIFIED_NOTIFICATION);
Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION);
Services.obs.addObserver(this, ONLOGIN_NOTIFICATION, false);
Services.obs.addObserver(this, ONVERIFIED_NOTIFICATION, false);
Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION, false);
SystemAppProxy.addEventListener("mozFxAccountsContentEvent",
FxAccountsMgmtService);
},

View File

@ -155,7 +155,7 @@ var LogShake = {
SystemAppProxy.addEventListener(CAPTURE_LOGS_CONTENT_EVENT, this);
SystemAppProxy.addEventListener(SCREEN_CHANGE_EVENT, this);
Services.obs.addObserver(this, "xpcom-shutdown");
Services.obs.addObserver(this, "xpcom-shutdown", false);
},
/**

View File

@ -160,7 +160,7 @@ ProcessGlobal.prototype = {
observe: function pg_observe(subject, topic, data) {
switch (topic) {
case 'app-startup': {
Services.obs.addObserver(this, 'console-api-log-event');
Services.obs.addObserver(this, 'console-api-log-event', false);
let inParent = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime)
.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;

View File

@ -50,7 +50,7 @@ this.SafeMode = {
}
}
Services.prefs.addObserver(kSafeModePref, observer);
Services.prefs.addObserver(kSafeModePref, observer, false);
});
},

View File

@ -132,8 +132,8 @@ function Pipe() {
Pipe.prototype = {
init: function pipe_init() {
Services.obs.addObserver(this, "identity-child-process-shutdown");
Services.obs.addObserver(this, "identity-controller-unwatch");
Services.obs.addObserver(this, "identity-child-process-shutdown", false);
Services.obs.addObserver(this, "identity-controller-unwatch", false);
},
uninit: function pipe_uninit() {
@ -329,9 +329,9 @@ this.SignInToWebsiteController = {
init: function SignInToWebsiteController_init(aOptions) {
aOptions = aOptions || {};
this.pipe = aOptions.pipe || new Pipe();
Services.obs.addObserver(this, "identity-controller-watch");
Services.obs.addObserver(this, "identity-controller-request");
Services.obs.addObserver(this, "identity-controller-logout");
Services.obs.addObserver(this, "identity-controller-watch", false);
Services.obs.addObserver(this, "identity-controller-request", false);
Services.obs.addObserver(this, "identity-controller-logout", false);
},
uninit: function SignInToWebsiteController_uninit() {

View File

@ -79,9 +79,9 @@ SimulatorScreen.prototype = {
let windows = this._windows;
switch (topic) {
case 'profile-after-change':
Services.obs.addObserver(this, 'document-element-inserted');
Services.obs.addObserver(this, 'simulator-orientation-change');
Services.obs.addObserver(this, 'inner-window-destroyed');
Services.obs.addObserver(this, 'document-element-inserted', false);
Services.obs.addObserver(this, 'simulator-orientation-change', false);
Services.obs.addObserver(this, 'inner-window-destroyed', false);
break;
case 'document-element-inserted':

View File

@ -131,7 +131,7 @@ function makeObserver(aObserveTopic, aObserveFunc) {
}
};
Services.obs.addObserver(observer, aObserveTopic);
Services.obs.addObserver(observer, aObserveTopic, false);
}
// a hook to set up the ID service with an identity with keypair and all

View File

@ -104,7 +104,7 @@ function run_test() {
run_next_test();
}
Services.obs.addObserver(onMessage, CHROME_MSG);
Services.obs.addObserver(onMessage, CHROME_MSG, false);
attachMocks();

View File

@ -151,7 +151,7 @@ add_test(function test_invalidEmailCase_signIn() {
}
}
Services.obs.addObserver(onMessage, "mozFxAccountsChromeEvent");
Services.obs.addObserver(onMessage, "mozFxAccountsChromeEvent", false);
SystemAppProxy._sendCustomEvent = mockSendCustomEvent;

View File

@ -388,7 +388,7 @@ appUpdater.prototype =
return;
}
Services.obs.removeObserver(arguments.callee, "update-staged");
}, "update-staged");
}, "update-staged", false);
} else {
this.selectPanel("apply");
}

View File

@ -499,7 +499,7 @@ function initObservers() {
}
for (let topic of OBSERVER_TOPICS) {
Services.obs.addObserver(observe, topic);
Services.obs.addObserver(observe, topic, false);
}
window.addEventListener("unload", function(event) {
log("about:accounts unloading")

View File

@ -49,9 +49,9 @@ var CaptivePortalWatcher = {
},
init() {
Services.obs.addObserver(this, "captive-portal-login");
Services.obs.addObserver(this, "captive-portal-login-abort");
Services.obs.addObserver(this, "captive-portal-login-success");
Services.obs.addObserver(this, "captive-portal-login", false);
Services.obs.addObserver(this, "captive-portal-login-abort", false);
Services.obs.addObserver(this, "captive-portal-login-success", false);
if (cps.state == cps.LOCKED_PORTAL) {
// A captive portal has already been detected.
@ -105,7 +105,7 @@ var CaptivePortalWatcher = {
// so they can log in before continuing to browse.
if (win != Services.ww.activeWindow) {
this._delayedCaptivePortalDetectedInProgress = true;
Services.obs.addObserver(this, "xul-window-visible");
Services.obs.addObserver(this, "xul-window-visible", false);
}
this._showNotification();
@ -155,7 +155,7 @@ var CaptivePortalWatcher = {
// focus a tab with the login page with no noticeable delay.
self.ensureCaptivePortalTab();
}
}, "captive-portal-check-complete");
}, "captive-portal-check-complete", false);
},
_captivePortalGone() {
@ -251,7 +251,7 @@ var CaptivePortalWatcher = {
}
gBrowser.removeTab(tab);
}
Services.obs.addObserver(tabCloser, "captive-portal-login-abort");
Services.obs.addObserver(tabCloser, "captive-portal-login-success");
Services.obs.addObserver(tabCloser, "captive-portal-login-abort", false);
Services.obs.addObserver(tabCloser, "captive-portal-login-success", false);
},
};

View File

@ -24,7 +24,7 @@ var CompactTheme = {
init() {
this.initialized = true;
Services.obs.addObserver(this, "lightweight-theme-styling-update");
Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
if (this.isThemeCurrentlyApplied) {
this._toggleStyleSheet(true);

View File

@ -115,7 +115,7 @@ var gFxAccounts = {
}
for (let topic of this.topics) {
Services.obs.addObserver(this, topic);
Services.obs.addObserver(this, topic, false);
}
gNavToolbox.addEventListener("customizationstarting", this);

View File

@ -1485,7 +1485,7 @@ var BookmarkingUI = {
}
};
Services.prefs.addObserver(this.RECENTLY_BOOKMARKED_PREF, prefObserver);
Services.prefs.addObserver(this.RECENTLY_BOOKMARKED_PREF, prefObserver, false);
PlacesUtils.bookmarks.addObserver(this._recentlyBookmarkedObserver, true);
// The context menu doesn't exist in non-browser windows on Mac
@ -2014,7 +2014,7 @@ var BookmarkingUI = {
var AutoShowBookmarksToolbar = {
init() {
Services.obs.addObserver(this, "autoshow-bookmarks-toolbar");
Services.obs.addObserver(this, "autoshow-bookmarks-toolbar", false);
},
uninit() {

View File

@ -40,7 +40,7 @@ SocialUI = {
mm.loadFrameScript("chrome://browser/content/content.js", true);
mm.loadFrameScript("chrome://browser/content/social-content.js", true);
Services.obs.addObserver(this, "social:providers-changed");
Services.obs.addObserver(this, "social:providers-changed", false);
CustomizableUI.addListener(this);
SocialActivationListener.init();

View File

@ -12,7 +12,7 @@ var TabsInTitlebar = {
return;
}
this._readPref();
Services.prefs.addObserver(this._prefName, this);
Services.prefs.addObserver(this._prefName, this, false);
// We need to update the appearance of the titlebar when the menu changes
// from the active to the inactive state. We can't, however, rely on

View File

@ -36,7 +36,7 @@ var gBrowserThumbnails = {
init: function Thumbnails_init() {
PageThumbs.addExpirationFilter(this);
gBrowser.addTabsProgressListener(this);
Services.prefs.addObserver(this.PREF_DISK_CACHE_SSL, this);
Services.prefs.addObserver(this.PREF_DISK_CACHE_SSL, this, false);
this._sslDiskCacheEnabled =
Services.prefs.getBoolPref(this.PREF_DISK_CACHE_SSL);

View File

@ -22,8 +22,8 @@ var TrackingProtection = {
this.icon = $("#tracking-protection-icon");
this.updateEnabled();
Services.prefs.addObserver(this.PREF_ENABLED_GLOBALLY, this);
Services.prefs.addObserver(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, this);
Services.prefs.addObserver(this.PREF_ENABLED_GLOBALLY, this, false);
Services.prefs.addObserver(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, this, false);
this.activeTooltipText =
gNavigatorBundle.getString("trackingProtection.icon.activeTooltip");

View File

@ -1088,7 +1088,8 @@ function RedirectLoad({ target: browser, data }) {
}
};
Services.obs.addObserver(delayedStartupFinished,
"browser-delayed-startup-finished");
"browser-delayed-startup-finished",
false);
}
}
@ -1133,7 +1134,7 @@ var gBrowserInit = {
onLoad() {
gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver);
Services.obs.addObserver(gPluginHandler.NPAPIPluginCrashed, "plugin-crashed");
Services.obs.addObserver(gPluginHandler.NPAPIPluginCrashed, "plugin-crashed", false);
window.addEventListener("AppCommand", HandleAppCommandEvent, true);
@ -1371,16 +1372,16 @@ var gBrowserInit = {
// Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
setTimeout(function() { SafeBrowsing.init(); }, 2000);
Services.obs.addObserver(gIdentityHandler, "perm-changed");
Services.obs.addObserver(gSessionHistoryObserver, "browser:purge-session-history");
Services.obs.addObserver(gStoragePressureObserver, "QuotaManager::StoragePressure");
Services.obs.addObserver(gXPInstallObserver, "addon-install-disabled");
Services.obs.addObserver(gXPInstallObserver, "addon-install-started");
Services.obs.addObserver(gXPInstallObserver, "addon-install-blocked");
Services.obs.addObserver(gXPInstallObserver, "addon-install-origin-blocked");
Services.obs.addObserver(gXPInstallObserver, "addon-install-failed");
Services.obs.addObserver(gXPInstallObserver, "addon-install-confirmation");
Services.obs.addObserver(gXPInstallObserver, "addon-install-complete");
Services.obs.addObserver(gIdentityHandler, "perm-changed", false);
Services.obs.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false);
Services.obs.addObserver(gStoragePressureObserver, "QuotaManager::StoragePressure", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-disabled", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-started", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-blocked", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-origin-blocked", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-failed", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-confirmation", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-complete", false);
window.messageManager.addMessageListener("Browser:URIFixup", gKeywordURIFixup);
BrowserOffline.init();
@ -1424,7 +1425,7 @@ var gBrowserInit = {
BookmarkingUI.init();
AutoShowBookmarksToolbar.init();
gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton);
gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton, false);
var homeButton = document.getElementById("home-button");
gHomeButton.updateTooltip(homeButton);
@ -1456,7 +1457,7 @@ var gBrowserInit = {
PlacesToolbarHelper.init();
ctrlTab.readPref();
gPrefService.addObserver(ctrlTab.prefName, ctrlTab);
gPrefService.addObserver(ctrlTab.prefName, ctrlTab, false);
// Initialize the download manager some time after the app starts so that
// auto-resume downloads begin (such as after crashing or quitting with
@ -2767,7 +2768,7 @@ var gMenuButtonUpdateBadge = {
init() {
if (this.enabled) {
this.kTopics.forEach(t => {
Services.obs.addObserver(this, t);
Services.obs.addObserver(this, t, false);
});
}
},
@ -2989,8 +2990,8 @@ var BrowserOnClick = {
mm.addMessageListener("Browser:SSLErrorReportTelemetry", this);
mm.addMessageListener("Browser:SSLErrorGoBack", this);
Services.obs.addObserver(this, "captive-portal-login-abort");
Services.obs.addObserver(this, "captive-portal-login-success");
Services.obs.addObserver(this, "captive-portal-login-abort", false);
Services.obs.addObserver(this, "captive-portal-login-success", false);
},
uninit() {
@ -3818,7 +3819,7 @@ const BrowserSearch = {
}
win = window.openDialog(getBrowserURL(), "_blank",
"chrome,all,dialog=no", "about:blank");
Services.obs.addObserver(observer, "browser-delayed-startup-finished");
Services.obs.addObserver(observer, "browser-delayed-startup-finished", false);
}
return;
}
@ -4196,8 +4197,8 @@ function OpenBrowserWindow(options) {
// Make sure to remove the 'document-shown' observer in case the window
// is being closed right after it was opened to avoid leaking.
Services.obs.addObserver(newDocumentShown, "document-shown");
Services.obs.addObserver(windowClosed, "domwindowclosed");
Services.obs.addObserver(newDocumentShown, "document-shown", false);
Services.obs.addObserver(windowClosed, "domwindowclosed", false);
var charsetArg = new String();
var handler = Components.classes["@mozilla.org/browser/clh;1"]
@ -5416,7 +5417,7 @@ var TabletModeUpdater = {
init() {
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
this.update(WindowsUIUtils.inTabletMode);
Services.obs.addObserver(this, "tablet-mode-change");
Services.obs.addObserver(this, "tablet-mode-change", false);
}
},
@ -6122,7 +6123,7 @@ var BrowserOffline = {
if (!this._uiElement)
this._uiElement = document.getElementById("workOfflineMenuitemState");
Services.obs.addObserver(this, "network:offline-status-changed");
Services.obs.addObserver(this, "network:offline-status-changed", false);
this._updateOfflineUI(Services.io.offline);
@ -6351,7 +6352,7 @@ var IndexedDBPromptHelper = {
init:
function IndexedDBPromptHelper_init() {
Services.obs.addObserver(this, this._permissionsPrompt);
Services.obs.addObserver(this, this._permissionsPrompt, false);
},
uninit:
@ -6565,7 +6566,7 @@ function BrowserOpenAddonsMgr(aView) {
browserWindow = browserWin;
}
}
Services.obs.addObserver(receivePong, "EM-pong");
Services.obs.addObserver(receivePong, "EM-pong", false);
Services.obs.notifyObservers(null, "EM-ping", "");
Services.obs.removeObserver(receivePong, "EM-pong");
@ -6595,7 +6596,7 @@ function BrowserOpenAddonsMgr(aView) {
aSubject.QueryInterface(Ci.nsIDOMWindow);
aSubject.focus();
resolve(aSubject);
}, "EM-loaded");
}, "EM-loaded", false);
});
}
@ -8158,7 +8159,8 @@ function duplicateTabIn(aTab, where, delta) {
};
Services.obs.addObserver(delayedStartupFinished,
"browser-delayed-startup-finished");
"browser-delayed-startup-finished",
false);
break;
case "tabshifted":
SessionStore.duplicateTab(window, aTab, delta);
@ -8259,7 +8261,7 @@ var ToolbarIconColor = {
window.addEventListener("activate", this);
window.addEventListener("deactivate", this);
Services.obs.addObserver(this, "lightweight-theme-styling-update");
Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
// If the window isn't active now, we assume that it has never been active
// before and will soon become active such that inferFromText will be

View File

@ -599,7 +599,7 @@ function addImage(imageViewRow) {
document.getElementById("mediaTab").hidden = false;
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.addObserver(imagePermissionObserver, "perm-changed");
.addObserver(imagePermissionObserver, "perm-changed", false);
}
} else {
var i = gImageHash[url][type][alt];

View File

@ -47,7 +47,7 @@ function onLoadPermission(uri, principal) {
initRow(i);
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.addObserver(permissionObserver, "perm-changed");
os.addObserver(permissionObserver, "perm-changed", false);
onUnloadRegistry.push(onUnloadPermission);
permTab.hidden = false;
} else

View File

@ -627,8 +627,8 @@ Sanitizer.prototype = {
}
}
}
Services.obs.addObserver(onWindowOpened, "browser-delayed-startup-finished");
Services.obs.addObserver(onWindowClosed, "xul-window-destroyed");
Services.obs.addObserver(onWindowOpened, "browser-delayed-startup-finished", false);
Services.obs.addObserver(onWindowClosed, "xul-window-destroyed", false);
});
// Start the process of closing windows

View File

@ -26,10 +26,10 @@ var RemoteTabViewer = {
_tabsList: null,
init() {
Services.obs.addObserver(this, "weave:service:login:finish");
Services.obs.addObserver(this, "weave:engine:sync:finish");
Services.obs.addObserver(this, "weave:service:login:finish", false);
Services.obs.addObserver(this, "weave:engine:sync:finish", false);
Services.obs.addObserver(this, "cloudsync:tabs:update");
Services.obs.addObserver(this, "cloudsync:tabs:update", false);
this._tabsList = document.getElementById("tabsList");

View File

@ -603,7 +603,7 @@ function gKeywordURIFixup(fixupInfo) {
sendAsyncMessage("Browser:URIFixup", data);
}
Services.obs.addObserver(gKeywordURIFixup, "keyword-uri-fixup");
Services.obs.addObserver(gKeywordURIFixup, "keyword-uri-fixup", false);
addEventListener("unload", () => {
Services.obs.removeObserver(gKeywordURIFixup, "keyword-uri-fixup");
}, false);
@ -884,7 +884,7 @@ var RefreshBlocker = {
this.enable();
}
Services.prefs.addObserver(this.PREF, this);
Services.prefs.addObserver(this.PREF, this, false);
},
uninit() {

View File

@ -5157,7 +5157,7 @@
this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
this.mCurrentBrowser.permanentKey = {};
Services.obs.addObserver(this, "contextual-identity-updated");
Services.obs.addObserver(this, "contextual-identity-updated", false);
this.mCurrentTab = this.tabContainer.firstChild;
const nsIEventListenerService =
@ -5227,7 +5227,7 @@
// To correctly handle keypresses for potential FindAsYouType, while
// the tab's find bar is not yet initialized.
this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
Services.prefs.addObserver("accessibility.typeaheadfind", this);
Services.prefs.addObserver("accessibility.typeaheadfind", this, false);
messageManager.addMessageListener("Findbar:Keypress", this);
// Add listeners for prerender messages
@ -5707,7 +5707,7 @@
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false);
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
Services.prefs.addObserver("privacy.userContext", this);
Services.prefs.addObserver("privacy.userContext", this, false);
this.observe(null, "nsPref:changed", "privacy.userContext.enabled");
]]>
</constructor>

View File

@ -40,7 +40,7 @@ function onAlertShowing() {
"Permission should exist prior to removal");
let disableForOriginMenuItem = alertWindow.document.getElementById("disableForOriginMenuItem");
is(disableForOriginMenuItem.localName, "menuitem", "menuitem found");
Services.obs.addObserver(permObserver, "perm-changed");
Services.obs.addObserver(permObserver, "perm-changed", false);
alertWindow.addEventListener("beforeunload", onAlertClosing);
disableForOriginMenuItem.click();
info("Clicked on disable-for-origin menuitem")

View File

@ -241,7 +241,7 @@ function waitForEvent(topic, status = null) {
resolve(innerStatus);
}
}
}, topic))
}, topic, false))
}
/**

View File

@ -149,7 +149,7 @@ function waitForXulWindowVisible() {
Services.obs.addObserver(function observe() {
Services.obs.removeObserver(observe, "xul-window-visible");
resolve();
}, "xul-window-visible");
}, "xul-window-visible", false);
});
}

View File

@ -260,7 +260,7 @@ add_task(function* () {
} catch (ex) {}
resolve();
});
Services.obs.addObserver(searchObserver, "browser-search-engine-modified");
Services.obs.addObserver(searchObserver, "browser-search-engine-modified", false);
Services.search.addEngine("http://test:80/browser/browser/base/content/test/general/POSTSearchEngine.xml",
null, null, false);
});

View File

@ -296,7 +296,7 @@ function* test_swapped_browser_while_not_playing(oldTab, newBrowser) {
let observer = (subject, topic, data) => {
ok(false, "Should not see an audio-playback notification");
};
Services.obs.addObserver(observer, "audiochannel-activity-normal");
Services.obs.addObserver(observer, "audiochannel-activity-normal", false);
setTimeout(() => {
Services.obs.removeObserver(observer, "audiochannel-activity-normal");
resolve();

View File

@ -21,7 +21,7 @@ function onTabModalDialogLoaded(node) {
SpecialPowers.pushPrefEnv({"set": [["dom.require_user_interaction_for_beforeunload", false]]});
// Listen for the dialog being created
Services.obs.addObserver(onTabModalDialogLoaded, "tabmodal-dialog-loaded");
Services.obs.addObserver(onTabModalDialogLoaded, "tabmodal-dialog-loaded", false);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("browser.tabs.warnOnClose");
Services.obs.removeObserver(onTabModalDialogLoaded, "tabmodal-dialog-loaded");

View File

@ -54,7 +54,7 @@ function checkPage(data) {
"online.");
Services.obs.removeObserver(observer, "network:offline-status-changed");
finish();
}, "network:offline-status-changed");
}, "network:offline-status-changed", false);
ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
content.document.getElementById("errorTryAgain").click();

View File

@ -55,7 +55,7 @@ function waitForProgressNotification(aPanelOpen = false, aExpectedCount = 1) {
}
Services.obs.removeObserver(observer, topic);
resolve();
}, topic);
}, topic, false);
});
let panelEventPromise;
@ -102,7 +102,7 @@ function waitForNotification(aId, aExpectedCount = 1) {
}
Services.obs.removeObserver(observer, topic);
resolve();
}, topic);
}, topic, false);
});
let panelEventPromise = new Promise(resolve => {
@ -507,7 +507,7 @@ function test_sequential() {
Services.obs.addObserver(function observer() {
Services.obs.removeObserver(observer, "addon-install-confirmation");
resolve();
}, "addon-install-confirmation");
}, "addon-install-confirmation", false);
});
// Make sure browser-addons.js executes first
@ -630,7 +630,7 @@ function test_localFile() {
Services.obs.addObserver(function observer() {
Services.obs.removeObserver(observer, "addon-install-failed");
resolve();
}, "addon-install-failed");
}, "addon-install-failed", false);
});
gBrowser.selectedTab = gBrowser.addTab("about:blank");
yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
@ -1017,7 +1017,7 @@ function test_failedSecurity() {
Services.obs.addObserver(function observer() {
Services.obs.removeObserver(observer, "addon-install-failed");
resolve();
}, "addon-install-failed");
}, "addon-install-failed", false);
});
// Allow the browser code to add the failure notification and then wait
@ -1053,9 +1053,9 @@ add_task(function* () {
Services.prefs.setBoolPref("extensions.install.requireSecureOrigin", false);
Services.prefs.setIntPref("security.dialog_enable_delay", 0);
Services.obs.addObserver(XPInstallObserver, "addon-install-started");
Services.obs.addObserver(XPInstallObserver, "addon-install-blocked");
Services.obs.addObserver(XPInstallObserver, "addon-install-failed");
Services.obs.addObserver(XPInstallObserver, "addon-install-started", false);
Services.obs.addObserver(XPInstallObserver, "addon-install-blocked", false);
Services.obs.addObserver(XPInstallObserver, "addon-install-failed", false);
registerCleanupFunction(function() {
// Make sure no more test parts run in case we were timed out

View File

@ -282,7 +282,7 @@ add_task(function* () {
});
};
Services.obs.addObserver(gObserver, "invalidformsubmit");
Services.obs.addObserver(gObserver, "invalidformsubmit", false);
executeSoon(function() {
browser.contentDocument.getElementById("s").click();

View File

@ -339,7 +339,7 @@ add_task(function* formHistory() {
Services.obs.removeObserver(onAdd, "satchel-storage-changed");
executeSoon(() => deferred.resolve());
}
}, "satchel-storage-changed");
}, "satchel-storage-changed", false);
yield Promise.all([msg("addInputValueToFormHistory"), deferred.promise]);
// Reset the input.
@ -363,7 +363,7 @@ add_task(function* formHistory() {
Services.obs.removeObserver(onRemove, "satchel-storage-changed");
executeSoon(() => deferred.resolve());
}
}, "satchel-storage-changed");
}, "satchel-storage-changed", false);
state = yield msg("key", "VK_DELETE");
checkState(state, "x", ["xfoo", "xbar"], -1);
@ -394,7 +394,7 @@ add_task(function* cycleEngines() {
SimpleTest.is(subj.name, newEngineName, "Engine cycled correctly");
Services.obs.removeObserver(resolver, "browser-search-engine-modified");
deferred.resolve();
}, "browser-search-engine-modified");
}, "browser-search-engine-modified", false);
return deferred.promise;
}
@ -608,7 +608,7 @@ add_task(function* search() {
Services.obs.removeObserver(onRemove, "satchel-storage-changed");
executeSoon(() => deferred.resolve());
}
}, "satchel-storage-changed");
}, "satchel-storage-changed", false);
yield msg("key", { key: "x", waitForSuggestions: true });
yield msg("key", "VK_DOWN");

View File

@ -11,7 +11,7 @@ function waitForDialog(callback) {
}
// Listen for the dialog being created
Services.obs.addObserver(onTabModalDialogLoaded, "tabmodal-dialog-loaded");
Services.obs.addObserver(onTabModalDialogLoaded, "tabmodal-dialog-loaded", false);
}
function waitForDialogDestroyed(node, callback) {

View File

@ -191,7 +191,7 @@ function makeObserver(aObserveTopic, aObserveFunc) {
Services.obs.removeObserver(callback, aObserveTopic);
}
Services.obs.addObserver(callback, aObserveTopic);
Services.obs.addObserver(callback, aObserveTopic, false);
return removeMe;
}

View File

@ -200,7 +200,7 @@ function promiseObserver(topic, count = 1) {
resolve(aSubject);
}
}
Services.obs.addObserver(obs, topic);
Services.obs.addObserver(obs, topic, false);
});
}

View File

@ -44,7 +44,7 @@ add_task(function*() {
resolve();
}
};
Services.prefs.addObserver(HOMEPAGE_PREF, observer);
Services.prefs.addObserver(HOMEPAGE_PREF, observer, false);
});
setHomepageDialog.document.documentElement.acceptDialog();

View File

@ -41,7 +41,7 @@ function test() {
executeSoon(nextTest);
};
Services.obs.addObserver(searchObserver, "browser-search-engine-modified");
Services.obs.addObserver(searchObserver, "browser-search-engine-modified", false);
registerCleanupFunction(function() {
gBrowser.removeTab(tab);

View File

@ -44,7 +44,7 @@ var CrashObserver = {
}
}
}
Services.obs.addObserver(CrashObserver, "ipc:content-shutdown");
Services.obs.addObserver(CrashObserver, "ipc:content-shutdown", false);
registerCleanupFunction(() => {
Services.obs.removeObserver(CrashObserver, "ipc:content-shutdown");

View File

@ -23,7 +23,7 @@ function promiseFormHistoryRemoved() {
Services.obs.addObserver(function onfh() {
Services.obs.removeObserver(onfh, "satchel-storage-changed");
deferred.resolve();
}, "satchel-storage-changed");
}, "satchel-storage-changed", false);
return deferred.promise;
}

View File

@ -93,7 +93,7 @@ function test() {
executeSoon(aCallback);
info("whenDelayedStartupFinished found our window");
}
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
}
mockTransferRegisterer.register();
@ -161,8 +161,8 @@ function test() {
}
}
Services.obs.addObserver(observer, "http-on-modify-request");
Services.obs.addObserver(observer, "http-on-examine-response");
Services.obs.addObserver(observer, "http-on-modify-request", false);
Services.obs.addObserver(observer, "http-on-examine-response", false);
testOnWindow(undefined, function(win) {
// The first save from a regular window sets a cookie.

View File

@ -140,7 +140,7 @@ function test() {
executeSoon(aCallback);
info("whenDelayedStartupFinished found our window");
}
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
}
mockTransferRegisterer.register();

View File

@ -162,7 +162,7 @@ function createReportResponseStatusPromise(expectedURI) {
resolve(subject.responseStatus);
}
};
Services.obs.addObserver(observer, "http-on-examine-response");
Services.obs.addObserver(observer, "http-on-examine-response", false);
});
}

View File

@ -48,7 +48,7 @@ function promiseObserver(topic) {
Services.obs.removeObserver(obs, aTopic);
resolve(aSubject);
}
Services.obs.addObserver(obs, topic);
Services.obs.addObserver(obs, topic, false);
});
}

View File

@ -10,7 +10,7 @@ function waitForNewWindow() {
});
};
Services.obs.addObserver(listener, "toplevel-window-ready")
Services.obs.addObserver(listener, "toplevel-window-ready", false)
});
}

View File

@ -58,7 +58,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) {
Services.obs.removeObserver(observer, aTopic);
executeSoon(aCallback);
}
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
}
function updateTabContextMenu(tab, onOpened) {
@ -199,7 +199,7 @@ function updateBlocklist(aCallback) {
Services.obs.removeObserver(observer, "blocklist-updated");
SimpleTest.executeSoon(aCallback);
};
Services.obs.addObserver(observer, "blocklist-updated");
Services.obs.addObserver(observer, "blocklist-updated", false);
blocklistNotifier.notify(null);
}
@ -229,7 +229,7 @@ function promiseWindowWillBeClosed(win) {
Services.obs.removeObserver(observe, topic);
resolve();
}
}, "domwindowclosed");
}, "domwindowclosed", false);
});
}
@ -249,7 +249,7 @@ function promiseOpenAndLoadWindow(aOptions, aWaitForDelayedStartup = false) {
}
Services.obs.removeObserver(onDS, "browser-delayed-startup-finished");
deferred.resolve(win);
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
} else {
win.addEventListener("load", function() {
@ -506,7 +506,7 @@ var FullZoomHelper = {
Services.obs.addObserver(function obs(subj, topic, data) {
Services.obs.removeObserver(obs, topic);
resolve();
}, "browser-fullZoom:location-change");
}, "browser-fullZoom:location-change", false);
});
},
@ -721,7 +721,7 @@ function promiseTopicObserved(aTopic) {
function PTO_observe(aSubject, aTopic2, aData) {
Services.obs.removeObserver(PTO_observe, aTopic2);
resolve({subject: aSubject, data: aData});
}, aTopic);
}, aTopic, false);
});
}
@ -769,7 +769,7 @@ function promiseOnBookmarkItemAdded(aExpectedURI) {
])
};
info("Waiting for a bookmark to be added");
PlacesUtils.bookmarks.addObserver(bookmarksObserver);
PlacesUtils.bookmarks.addObserver(bookmarksObserver, false);
});
}
@ -793,7 +793,7 @@ function* loadBadCertPage(url) {
};
Services.obs.addObserver(certExceptionDialogObserver,
"cert-exception-ui-ready");
"cert-exception-ui-ready", false);
});
let loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);

View File

@ -49,7 +49,7 @@ add_task(function* () {
ok(true, "thumbnail created after preloaded tab was shown");
resolve();
}, "page-thumbnail:create");
}, "page-thumbnail:create", false);
});
// Enable captures.

View File

@ -5,7 +5,7 @@ function test() {
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
Services.obs.addObserver(observer, "page-info-dialog-loaded");
Services.obs.addObserver(observer, "page-info-dialog-loaded", false);
pageInfo = BrowserPageInfo();
}, {capture: true, once: true});
content.location =

View File

@ -23,7 +23,7 @@ function pageLoad() {
}
function doOnOpenPageInfo(continuation) {
Services.obs.addObserver(pageInfoObserve, "page-info-dialog-loaded");
Services.obs.addObserver(pageInfoObserve, "page-info-dialog-loaded", false);
gNextTest = continuation;
// An explanation: it looks like the test harness complains about leaked
// windows if we don't keep a reference to every window we've opened.

View File

@ -109,7 +109,7 @@ add_task(function* setup() {
extraFile.remove(false);
};
Services.obs.addObserver(crashObserver, "plugin-crashed");
Services.obs.addObserver(crashObserver, "plugin-crashed", false);
// plugins.testmode will make BrowserPlugins:Test:ClearCrashData work.
Services.prefs.setBoolPref("plugins.testmode", true);
registerCleanupFunction(() => {

View File

@ -238,7 +238,7 @@ function updateBlocklist(aCallback) {
Services.obs.removeObserver(observer, "blocklist-updated");
SimpleTest.executeSoon(aCallback);
};
Services.obs.addObserver(observer, "blocklist-updated");
Services.obs.addObserver(observer, "blocklist-updated", false);
blocklistNotifier.notify(null);
}

View File

@ -23,7 +23,7 @@ function promiseTopicObserved(topic) {
Services.obs.addObserver(function PTO_observe(obsSubject, obsTopic, obsData) {
Services.obs.removeObserver(PTO_observe, obsTopic);
deferred.resolve([obsSubject, obsData]);
}, topic);
}, topic, false);
return deferred.promise;
}

View File

@ -129,7 +129,7 @@ function delayedStartupFinished(aWindow) {
Services.obs.removeObserver(observer, aTopic);
resolve();
}
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
});
}

View File

@ -298,7 +298,7 @@ function* loadBadCertPage(url) {
};
Services.obs.addObserver(certExceptionDialogObserver,
"cert-exception-ui-ready");
"cert-exception-ui-ready", false);
});
let loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);

View File

@ -16,7 +16,7 @@ function promiseObserverNotified(aTopic) {
dump("notification promised " + topic);
Services.obs.removeObserver(onNotification, topic);
TestUtils.executeSoon(() => resolve({subject, data}));
}, aTopic);
}, aTopic, false);
});
}
@ -241,7 +241,7 @@ function toggleOfflineStatus(goOfflineState) {
info("offline state changed to " + Services.io.offline);
is(expect, Services.io.offline, "network:offline-status-changed successful toggle");
resolve();
}, "network:offline-status-changed");
}, "network:offline-status-changed", false);
BrowserOffline.toggleOfflineStatus();
} else {
resolve();

View File

@ -32,7 +32,7 @@ add_task(function*() {
info("Prompts opened.");
resolve();
}
}, "tabmodal-dialog-loaded");
}, "tabmodal-dialog-loaded", false);
});
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url, true);

View File

@ -125,7 +125,8 @@ function loadTab(tab, url) {
Services.obs.removeObserver(observer, aTopic);
resolve();
},
"uri-visit-saved"
"uri-visit-saved",
false
);
});

View File

@ -210,7 +210,7 @@ function setUserMadeChoicePref(userMadeChoice) {
Services.prefs.addObserver(CHOICE_PREF, function obs(subj, topic, data) {
Services.prefs.removeObserver(CHOICE_PREF, obs);
resolve();
});
}, false);
}
Services.prefs.setBoolPref(CHOICE_PREF, userMadeChoice);
if (currentUserMadeChoice == userMadeChoice) {

View File

@ -8,7 +8,7 @@ function checkAll(win) {
resolve();
},
};
Services.obs.addObserver(observer, "EM-update-check-finished");
Services.obs.addObserver(observer, "EM-update-check-finished", false);
});
}

View File

@ -40,7 +40,7 @@ function observer(aSubject, aTopic, aData) {
}
kObservedTopics.forEach(topic => {
Services.obs.addObserver(observer, topic);
Services.obs.addObserver(observer, topic, false);
});
addMessageListener("Test:ExpectObserverCalled", ({data}) => {
@ -100,7 +100,7 @@ addMessageListener("Test:WaitForObserverCall", ({data}) => {
else
--gObservedTopics[topic];
}
}, topic);
}, topic, false);
});
addMessageListener("Test:WaitForMessage", () => {

View File

@ -58,7 +58,7 @@ function promiseWindow(url) {
Services.obs.removeObserver(obs, "domwindowopened");
resolve(win);
}, {once: true});
}, "domwindowopened");
}, "domwindowopened", false);
});
}
@ -70,7 +70,7 @@ function whenDelayedStartupFinished(aWindow) {
Services.obs.removeObserver(observer, aTopic);
resolve();
}
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
});
}

View File

@ -64,7 +64,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
.getService(Components.interfaces.nsIPrefService)
.getBranch("browser.urlbar.");
this._prefs.addObserver("", this);
this._prefs.addObserver("", this, false);
this.clickSelectsAll = this._prefs.getBoolPref("clickSelectsAll");
this.doubleClickSelectsAll = this._prefs.getBoolPref("doubleClickSelectsAll");
this.completeDefaultIndex = this._prefs.getBoolPref("autoFill");

View File

@ -345,7 +345,7 @@ function openLinkIn(url, where, params) {
}, "webNavigation-createdNavigationTarget", null);
}
};
Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished");
Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished", false);
}
win = Services.ww.openWindow(sourceWindow, getBrowserURL(), null, features, sa);
return;
@ -767,7 +767,7 @@ function openPreferences(paneID, extraArgs) {
}
Services.obs.removeObserver(advancedPaneLoadedObs, "advanced-pane-loaded");
switchToAdvancedSubPane(browser.contentDocument);
}, "advanced-pane-loaded");
}, "advanced-pane-loaded", false);
} else {
if (paneID) {
browser.contentWindow.gotoPref(paneID);

View File

@ -4013,7 +4013,7 @@ function OverflowableToolbar(aToolbarNode) {
if (window.gBrowserInit.delayedStartupFinished) {
this.init();
} else {
Services.obs.addObserver(this, "browser-delayed-startup-finished");
Services.obs.addObserver(this, "browser-delayed-startup-finished", false);
}
}

View File

@ -352,7 +352,7 @@ const CustomizableWidgets = [
onViewShowing(aEvent) {
let doc = aEvent.target.ownerDocument;
this._tabsList = doc.getElementById("PanelUI-remotetabs-tabslist");
Services.obs.addObserver(this, SyncedTabs.TOPIC_TABS_CHANGED);
Services.obs.addObserver(this, SyncedTabs.TOPIC_TABS_CHANGED, false);
if (SyncedTabs.isConfiguredToSyncTabs) {
if (SyncedTabs.hasSyncedThisSession) {

View File

@ -109,7 +109,7 @@ function CustomizeMode(aWindow) {
}
if (AppConstants.CAN_DRAW_IN_TITLEBAR) {
this._updateTitlebarButton();
Services.prefs.addObserver(kDrawInTitlebarPref, this);
Services.prefs.addObserver(kDrawInTitlebarPref, this, false);
}
this.window.addEventListener("unload", this);
}
@ -254,7 +254,7 @@ CustomizeMode.prototype = {
}
};
Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished");
Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished", false);
});
}
@ -326,7 +326,7 @@ CustomizeMode.prototype = {
yield this._doTransition(true);
Services.obs.addObserver(this, "lightweight-theme-window-updated");
Services.obs.addObserver(this, "lightweight-theme-window-updated", false);
// Let everybody in this window know that we're about to customize.
CustomizableUI.dispatchToolboxEvent("customizationstarting", {}, window);

View File

@ -58,9 +58,9 @@ const PanelUI = {
this.menuButton.addEventListener("keypress", this);
this._overlayScrollListenerBoundFn = this._overlayScrollListener.bind(this);
Services.obs.addObserver(this, "fullscreen-nav-toolbox");
Services.obs.addObserver(this, "panelUI-notification-main-action");
Services.obs.addObserver(this, "panelUI-notification-dismissed");
Services.obs.addObserver(this, "fullscreen-nav-toolbox", false);
Services.obs.addObserver(this, "panelUI-notification-main-action", false);
Services.obs.addObserver(this, "panelUI-notification-dismissed", false);
window.addEventListener("fullscreen", this);
window.matchMedia("(-moz-overlay-scrollbars)").addListener(this._overlayScrollListenerBoundFn);
@ -349,7 +349,7 @@ const PanelUI = {
resolve();
}
};
Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished");
Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished", false);
});
}

View File

@ -69,7 +69,7 @@ function promiseObserverNotification(aObserver) {
Services.obs.removeObserver(notificationCallback, aObserver);
deferred.reject("Notification '" + aObserver + "' did not happen within 20 seconds.");
}, kTimeoutInMS);
Services.obs.addObserver(notificationCallback, aObserver);
Services.obs.addObserver(notificationCallback, aObserver, false);
return deferred.promise;
}

View File

@ -236,7 +236,7 @@ function promiseObserverNotified(aTopic) {
Services.obs.addObserver(function onNotification(subject, topic, data) {
Services.obs.removeObserver(onNotification, topic);
deferred.resolve({subject, data});
}, aTopic);
}, aTopic, false);
return deferred.promise;
}
@ -250,7 +250,7 @@ function openAndLoadWindow(aOptions, aWaitForDelayedStartup = false) {
}
Services.obs.removeObserver(onDS, "browser-delayed-startup-finished");
deferred.resolve(win);
}, "browser-delayed-startup-finished");
}, "browser-delayed-startup-finished", false);
} else {
win.addEventListener("load", function() {

View File

@ -89,7 +89,7 @@ this.DownloadsTaskbar = {
Services.obs.addObserver(() => {
this._taskbarProgress = null;
gMacTaskbarProgress = null;
}, "quit-application-granted");
}, "quit-application-granted", false);
} else if (gWinTaskbar) {
// On Windows, the indicator is currently hidden because we have no
// previous browser window, thus we should attach the indicator now.

View File

@ -912,7 +912,7 @@ DownloadsPlacesView.prototype = {
let result = history.executeQueries(queries.value, queries.value.length,
options.value);
result.addObserver(this);
result.addObserver(this, false);
return val;
},

View File

@ -22,7 +22,7 @@ function test_deleted_iframe(perSitePref, windowOptions = {}) {
Services.obs.removeObserver(obs, topic);
resolve();
}
}, "dom-window-destroyed");
}, "dom-window-destroyed", false);
});
iframe.remove();
yield promiseIframeWindowGone;

View File

@ -103,7 +103,7 @@ function promiseWindowClosed(win) {
Services.obs.removeObserver(obs, topic);
resolve();
}
}, "domwindowclosed");
}, "domwindowclosed", false);
});
win.close();
return promise;
@ -248,7 +248,7 @@ function task_clearHistory() {
Services.obs.addObserver(function observeCH(aSubject, aTopic, aData) {
Services.obs.removeObserver(observeCH, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
resolve();
}, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
}, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
PlacesUtils.history.clear();
});
}

View File

@ -174,7 +174,7 @@ function decrementListeners() {
function incrementListeners() {
listenerCount++;
if (listenerCount == 1) {
PlacesUtils.bookmarks.addObserver(observer);
PlacesUtils.bookmarks.addObserver(observer, false);
}
}

View File

@ -559,7 +559,7 @@ MenuItem.prototype = {
// for contex-menu events from both content and chrome.
const contextMenuTracker = {
register() {
Services.obs.addObserver(this, "on-build-contextmenu");
Services.obs.addObserver(this, "on-build-contextmenu", false);
for (const window of windowTracker.browserWindows()) {
this.onWindowOpen(window);
}

Some files were not shown because too many files have changed in this diff Show More