diff --git a/accessible/jsat/AccessFu.jsm b/accessible/jsat/AccessFu.jsm index 307894d5259d..be6bf15bba0f 100644 --- a/accessible/jsat/AccessFu.jsm +++ b/accessible/jsat/AccessFu.jsm @@ -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); diff --git a/accessible/jsat/EventManager.jsm b/accessible/jsat/EventManager.jsm index 4efa732e121c..6d4f4a3c8975 100644 --- a/accessible/jsat/EventManager.jsm +++ b/accessible/jsat/EventManager.jsm @@ -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; }, diff --git a/accessible/tests/browser/e10s/events.js b/accessible/tests/browser/e10s/events.js index d7da39d9f49c..39dd743efc17 100644 --- a/accessible/tests/browser/e10s/events.js +++ b/accessible/tests/browser/e10s/events.js @@ -100,7 +100,7 @@ function waitForEvent(eventType, expectedIdOrAcc) { } } }; - Services.obs.addObserver(eventObserver, 'accessible-event'); + Services.obs.addObserver(eventObserver, 'accessible-event', false); }); } diff --git a/accessible/tests/browser/head.js b/accessible/tests/browser/head.js index 58b227073447..0bf862f5da6e 100644 --- a/accessible/tests/browser/head.js +++ b/accessible/tests/browser/head.js @@ -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); }); } diff --git a/accessible/tests/mochitest/browser.js b/accessible/tests/mochitest/browser.js index e49a33b63615..f84f545d8c23 100644 --- a/accessible/tests/mochitest/browser.js +++ b/accessible/tests/mochitest/browser.js @@ -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); } diff --git a/accessible/tests/mochitest/events.js b/accessible/tests/mochitest/events.js index 6cb5fd938548..6d9f73ec2aae 100644 --- a/accessible/tests/mochitest/events.js +++ b/accessible/tests/mochitest/events.js @@ -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. diff --git a/accessible/tests/mochitest/jsat/jsatcommon.js b/accessible/tests/mochitest/jsat/jsatcommon.js index 4cc1faea2239..43d754afa915 100644 --- a/accessible/tests/mochitest/jsat/jsatcommon.js +++ b/accessible/tests/mochitest/jsat/jsatcommon.js @@ -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; }, diff --git a/addon-sdk/source/lib/dev/frame-script.js b/addon-sdk/source/lib/dev/frame-script.js index 639b40060a97..33a19741989f 100644 --- a/addon-sdk/source/lib/dev/frame-script.js +++ b/addon-sdk/source/lib/dev/frame-script.js @@ -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); diff --git a/addon-sdk/source/lib/sdk/context-menu/core.js b/addon-sdk/source/lib/sdk/context-menu/core.js index 2ac1e11f6a84..c64cddfe8695 100644 --- a/addon-sdk/source/lib/sdk/context-menu/core.js +++ b/addon-sdk/source/lib/sdk/context-menu/core.js @@ -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) { diff --git a/addon-sdk/source/lib/sdk/places/events.js b/addon-sdk/source/lib/sdk/places/events.js index a8921cdfa76f..5b098fb9a971 100644 --- a/addon-sdk/source/lib/sdk/places/events.js +++ b/addon-sdk/source/lib/sdk/places/events.js @@ -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); diff --git a/addon-sdk/source/lib/sdk/preferences/event-target.js b/addon-sdk/source/lib/sdk/preferences/event-target.js index 7e45205fe38c..5035ec30bf54 100644 --- a/addon-sdk/source/lib/sdk/preferences/event-target.js +++ b/addon-sdk/source/lib/sdk/preferences/event-target.js @@ -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)); diff --git a/addon-sdk/source/modules/system/Startup.js b/addon-sdk/source/modules/system/Startup.js index 8277b38189cf..ded29b699de5 100644 --- a/addon-sdk/source/modules/system/Startup.js +++ b/addon-sdk/source/modules/system/Startup.js @@ -52,5 +52,5 @@ else { Services.tm.dispatchToMainThread(() => gOnceInitializedDeferred.resolve()); } - Services.obs.addObserver(listener, appStartup); + Services.obs.addObserver(listener, appStartup, false); } diff --git a/addon-sdk/source/python-lib/cuddlefish/mobile-utils/bootstrap.js b/addon-sdk/source/python-lib/cuddlefish/mobile-utils/bootstrap.js index 945ac7c5a3e2..a0120b0be192 100644 --- a/addon-sdk/source/python-lib/cuddlefish/mobile-utils/bootstrap.js +++ b/addon-sdk/source/python-lib/cuddlefish/mobile-utils/bootstrap.js @@ -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); diff --git a/addon-sdk/source/test/leak/leak-utils.js b/addon-sdk/source/test/leak/leak-utils.js index 2c05c1fa4c38..d982b5b62ce6 100644 --- a/addon-sdk/source/test/leak/leak-utils.js +++ b/addon-sdk/source/test/leak/leak-utils.js @@ -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); diff --git a/addon-sdk/source/test/test-system-events.js b/addon-sdk/source/test/test-system-events.js index f9b06ad55f09..d8e45abf2b45 100644 --- a/addon-sdk/source/test/test-system-events.js +++ b/addon-sdk/source/test/test-system-events.js @@ -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" }); diff --git a/b2g/chrome/content/screen.js b/b2g/chrome/content/screen.js index 6c1ab2dcdce2..a893e88442b9 100644 --- a/b2g/chrome/content/screen.js +++ b/b2g/chrome/content/screen.js @@ -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 diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 17eb29989c8c..cce138764dd7 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -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; diff --git a/b2g/chrome/content/test/mochitest/RecordingStatusChromeScript.js b/b2g/chrome/content/test/mochitest/RecordingStatusChromeScript.js index 4ce16df6c306..db0106b6f59f 100644 --- a/b2g/chrome/content/test/mochitest/RecordingStatusChromeScript.js +++ b/b2g/chrome/content/test/mochitest/RecordingStatusChromeScript.js @@ -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) { diff --git a/b2g/components/AlertsHelper.jsm b/b2g/components/AlertsHelper.jsm index 746b99ca2c30..8ba88fed654e 100644 --- a/b2g/components/AlertsHelper.jsm +++ b/b2g/components/AlertsHelper.jsm @@ -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); } diff --git a/b2g/components/AlertsService.js b/b2g/components/AlertsService.js index 8f295525805a..19a164f0ed61 100644 --- a/b2g/components/AlertsService.js +++ b/b2g/components/AlertsService.js @@ -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 = { diff --git a/b2g/components/ErrorPage.jsm b/b2g/components/ErrorPage.jsm index c4ed2ce325be..7f34744cd1c1 100644 --- a/b2g/components/ErrorPage.jsm +++ b/b2g/components/ErrorPage.jsm @@ -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) { diff --git a/b2g/components/Frames.jsm b/b2g/components/Frames.jsm index 31ad46a8f974..dae3618e8b91 100644 --- a/b2g/components/Frames.jsm +++ b/b2g/components/Frames.jsm @@ -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; diff --git a/b2g/components/FxAccountsMgmtService.jsm b/b2g/components/FxAccountsMgmtService.jsm index b1f84913f14c..e51f46ed7fc7 100644 --- a/b2g/components/FxAccountsMgmtService.jsm +++ b/b2g/components/FxAccountsMgmtService.jsm @@ -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); }, diff --git a/b2g/components/LogShake.jsm b/b2g/components/LogShake.jsm index 458be84c0a2a..6e93535e0044 100644 --- a/b2g/components/LogShake.jsm +++ b/b2g/components/LogShake.jsm @@ -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); }, /** diff --git a/b2g/components/ProcessGlobal.js b/b2g/components/ProcessGlobal.js index e7fd2f3a6e2b..94326ad50490 100644 --- a/b2g/components/ProcessGlobal.js +++ b/b2g/components/ProcessGlobal.js @@ -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; diff --git a/b2g/components/SafeMode.jsm b/b2g/components/SafeMode.jsm index 1e0c06be32cf..d79da0f441f4 100644 --- a/b2g/components/SafeMode.jsm +++ b/b2g/components/SafeMode.jsm @@ -50,7 +50,7 @@ this.SafeMode = { } } - Services.prefs.addObserver(kSafeModePref, observer); + Services.prefs.addObserver(kSafeModePref, observer, false); }); }, diff --git a/b2g/components/SignInToWebsite.jsm b/b2g/components/SignInToWebsite.jsm index 892e3e222f82..1cc76d57604b 100644 --- a/b2g/components/SignInToWebsite.jsm +++ b/b2g/components/SignInToWebsite.jsm @@ -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() { diff --git a/b2g/components/SimulatorScreen.js b/b2g/components/SimulatorScreen.js index d52519087edd..c481a06a65ca 100644 --- a/b2g/components/SimulatorScreen.js +++ b/b2g/components/SimulatorScreen.js @@ -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': diff --git a/b2g/components/test/unit/head_identity.js b/b2g/components/test/unit/head_identity.js index 845f798cca77..604a7728486a 100644 --- a/b2g/components/test/unit/head_identity.js +++ b/b2g/components/test/unit/head_identity.js @@ -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 diff --git a/b2g/components/test/unit/test_aboutserviceworkers.js b/b2g/components/test/unit/test_aboutserviceworkers.js index 1ee8fe07aad7..d1a7d41aaad7 100644 --- a/b2g/components/test/unit/test_aboutserviceworkers.js +++ b/b2g/components/test/unit/test_aboutserviceworkers.js @@ -104,7 +104,7 @@ function run_test() { run_next_test(); } - Services.obs.addObserver(onMessage, CHROME_MSG); + Services.obs.addObserver(onMessage, CHROME_MSG, false); attachMocks(); diff --git a/b2g/components/test/unit/test_fxaccounts.js b/b2g/components/test/unit/test_fxaccounts.js index b828f785e3b6..81f23504d694 100644 --- a/b2g/components/test/unit/test_fxaccounts.js +++ b/b2g/components/test/unit/test_fxaccounts.js @@ -151,7 +151,7 @@ add_test(function test_invalidEmailCase_signIn() { } } - Services.obs.addObserver(onMessage, "mozFxAccountsChromeEvent"); + Services.obs.addObserver(onMessage, "mozFxAccountsChromeEvent", false); SystemAppProxy._sendCustomEvent = mockSendCustomEvent; diff --git a/browser/base/content/aboutDialog-appUpdater.js b/browser/base/content/aboutDialog-appUpdater.js index 3f6dba61258e..20c8726f615f 100644 --- a/browser/base/content/aboutDialog-appUpdater.js +++ b/browser/base/content/aboutDialog-appUpdater.js @@ -388,7 +388,7 @@ appUpdater.prototype = return; } Services.obs.removeObserver(arguments.callee, "update-staged"); - }, "update-staged"); + }, "update-staged", false); } else { this.selectPanel("apply"); } diff --git a/browser/base/content/aboutaccounts/aboutaccounts.js b/browser/base/content/aboutaccounts/aboutaccounts.js index 05291067feb6..7a8bb32ae7f1 100644 --- a/browser/base/content/aboutaccounts/aboutaccounts.js +++ b/browser/base/content/aboutaccounts/aboutaccounts.js @@ -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") diff --git a/browser/base/content/browser-captivePortal.js b/browser/base/content/browser-captivePortal.js index df20150cf87c..ad502f8b8e9b 100644 --- a/browser/base/content/browser-captivePortal.js +++ b/browser/base/content/browser-captivePortal.js @@ -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); }, }; diff --git a/browser/base/content/browser-compacttheme.js b/browser/base/content/browser-compacttheme.js index fa692eb079c4..53f5148435c6 100644 --- a/browser/base/content/browser-compacttheme.js +++ b/browser/base/content/browser-compacttheme.js @@ -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); diff --git a/browser/base/content/browser-fxaccounts.js b/browser/base/content/browser-fxaccounts.js index 1d3c8e7e2356..19284e0b7e22 100644 --- a/browser/base/content/browser-fxaccounts.js +++ b/browser/base/content/browser-fxaccounts.js @@ -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); diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 0b8c50359eed..b71cb110393d 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -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() { diff --git a/browser/base/content/browser-social.js b/browser/base/content/browser-social.js index 51bc989d58f4..9c8ef17d9662 100644 --- a/browser/base/content/browser-social.js +++ b/browser/base/content/browser-social.js @@ -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(); diff --git a/browser/base/content/browser-tabsintitlebar.js b/browser/base/content/browser-tabsintitlebar.js index c696c64db05b..1a8065179597 100644 --- a/browser/base/content/browser-tabsintitlebar.js +++ b/browser/base/content/browser-tabsintitlebar.js @@ -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 diff --git a/browser/base/content/browser-thumbnails.js b/browser/base/content/browser-thumbnails.js index 577ce998f203..00ea858ec2ed 100644 --- a/browser/base/content/browser-thumbnails.js +++ b/browser/base/content/browser-thumbnails.js @@ -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); diff --git a/browser/base/content/browser-trackingprotection.js b/browser/base/content/browser-trackingprotection.js index 18ef4e044d5e..527bf25bd8bb 100644 --- a/browser/base/content/browser-trackingprotection.js +++ b/browser/base/content/browser-trackingprotection.js @@ -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"); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index e1b4b484f738..4327f35b72c5 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -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 diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js index 260a070a5b06..494d939c8bf9 100644 --- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -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]; diff --git a/browser/base/content/pageinfo/permissions.js b/browser/base/content/pageinfo/permissions.js index 7fdac0eb76f6..895e8ed6b080 100644 --- a/browser/base/content/pageinfo/permissions.js +++ b/browser/base/content/pageinfo/permissions.js @@ -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 diff --git a/browser/base/content/sanitize.js b/browser/base/content/sanitize.js index ac2e86503496..cbd62bdd96c5 100644 --- a/browser/base/content/sanitize.js +++ b/browser/base/content/sanitize.js @@ -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 diff --git a/browser/base/content/sync/aboutSyncTabs.js b/browser/base/content/sync/aboutSyncTabs.js index 6ed7b4f32404..3a510ad7da04 100644 --- a/browser/base/content/sync/aboutSyncTabs.js +++ b/browser/base/content/sync/aboutSyncTabs.js @@ -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"); diff --git a/browser/base/content/tab-content.js b/browser/base/content/tab-content.js index 8d765f35a657..3225e0f273d0 100644 --- a/browser/base/content/tab-content.js +++ b/browser/base/content/tab-content.js @@ -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() { diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index ebf76644b250..50e3656e1e4c 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -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"); ]]> diff --git a/browser/base/content/test/alerts/browser_notification_remove_permission.js b/browser/base/content/test/alerts/browser_notification_remove_permission.js index 0473b29677e1..2135c3aa1db5 100644 --- a/browser/base/content/test/alerts/browser_notification_remove_permission.js +++ b/browser/base/content/test/alerts/browser_notification_remove_permission.js @@ -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") diff --git a/browser/base/content/test/appUpdate/head.js b/browser/base/content/test/appUpdate/head.js index f9509ca4c602..14742d7da632 100644 --- a/browser/base/content/test/appUpdate/head.js +++ b/browser/base/content/test/appUpdate/head.js @@ -241,7 +241,7 @@ function waitForEvent(topic, status = null) { resolve(innerStatus); } } - }, topic)) + }, topic, false)) } /** diff --git a/browser/base/content/test/captivePortal/head.js b/browser/base/content/test/captivePortal/head.js index 76b4c386f3f8..80da6a3c7b15 100644 --- a/browser/base/content/test/captivePortal/head.js +++ b/browser/base/content/test/captivePortal/head.js @@ -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); }); } diff --git a/browser/base/content/test/general/browser_aboutHome.js b/browser/base/content/test/general/browser_aboutHome.js index cc47f2d5768c..e8febd35d01f 100644 --- a/browser/base/content/test/general/browser_aboutHome.js +++ b/browser/base/content/test/general/browser_aboutHome.js @@ -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); }); diff --git a/browser/base/content/test/general/browser_audioTabIcon.js b/browser/base/content/test/general/browser_audioTabIcon.js index f6511cccce5d..7258adf7b773 100644 --- a/browser/base/content/test/general/browser_audioTabIcon.js +++ b/browser/base/content/test/general/browser_audioTabIcon.js @@ -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(); diff --git a/browser/base/content/test/general/browser_beforeunload_duplicate_dialogs.js b/browser/base/content/test/general/browser_beforeunload_duplicate_dialogs.js index 0f5512500030..91a4a7e9cea2 100644 --- a/browser/base/content/test/general/browser_beforeunload_duplicate_dialogs.js +++ b/browser/base/content/test/general/browser_beforeunload_duplicate_dialogs.js @@ -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"); diff --git a/browser/base/content/test/general/browser_bug435325.js b/browser/base/content/test/general/browser_bug435325.js index b6cf87afea7d..fe1228192c4b 100644 --- a/browser/base/content/test/general/browser_bug435325.js +++ b/browser/base/content/test/general/browser_bug435325.js @@ -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(); diff --git a/browser/base/content/test/general/browser_bug553455.js b/browser/base/content/test/general/browser_bug553455.js index ca2f39ce3bd8..44bc46c98e2d 100644 --- a/browser/base/content/test/general/browser_bug553455.js +++ b/browser/base/content/test/general/browser_bug553455.js @@ -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 diff --git a/browser/base/content/test/general/browser_bug561636.js b/browser/base/content/test/general/browser_bug561636.js index 46c03de253cd..af28ee6ee506 100644 --- a/browser/base/content/test/general/browser_bug561636.js +++ b/browser/base/content/test/general/browser_bug561636.js @@ -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(); diff --git a/browser/base/content/test/general/browser_contentSearchUI.js b/browser/base/content/test/general/browser_contentSearchUI.js index 891282cd4c07..55a3e94372cc 100644 --- a/browser/base/content/test/general/browser_contentSearchUI.js +++ b/browser/base/content/test/general/browser_contentSearchUI.js @@ -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"); diff --git a/browser/base/content/test/general/browser_double_close_tab.js b/browser/base/content/test/general/browser_double_close_tab.js index ffedd68401a7..29242c3f9159 100644 --- a/browser/base/content/test/general/browser_double_close_tab.js +++ b/browser/base/content/test/general/browser_double_close_tab.js @@ -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) { diff --git a/browser/base/content/test/general/browser_fxa_web_channel.js b/browser/base/content/test/general/browser_fxa_web_channel.js index d7d26b916bf8..f5a178712337 100644 --- a/browser/base/content/test/general/browser_fxa_web_channel.js +++ b/browser/base/content/test/general/browser_fxa_web_channel.js @@ -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; } diff --git a/browser/base/content/test/general/browser_fxaccounts.js b/browser/base/content/test/general/browser_fxaccounts.js index 7456edcc8d00..dd373c9d075b 100644 --- a/browser/base/content/test/general/browser_fxaccounts.js +++ b/browser/base/content/test/general/browser_fxaccounts.js @@ -200,7 +200,7 @@ function promiseObserver(topic, count = 1) { resolve(aSubject); } } - Services.obs.addObserver(obs, topic); + Services.obs.addObserver(obs, topic, false); }); } diff --git a/browser/base/content/test/general/browser_homeDrop.js b/browser/base/content/test/general/browser_homeDrop.js index d38c740b459a..ba08d722cb80 100644 --- a/browser/base/content/test/general/browser_homeDrop.js +++ b/browser/base/content/test/general/browser_homeDrop.js @@ -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(); diff --git a/browser/base/content/test/general/browser_keywordSearch_postData.js b/browser/base/content/test/general/browser_keywordSearch_postData.js index 5df5e04d789a..416db5d8e100 100644 --- a/browser/base/content/test/general/browser_keywordSearch_postData.js +++ b/browser/base/content/test/general/browser_keywordSearch_postData.js @@ -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); diff --git a/browser/base/content/test/general/browser_restore_isAppTab.js b/browser/base/content/test/general/browser_restore_isAppTab.js index 1ea4a4cebb59..b7c79379a514 100644 --- a/browser/base/content/test/general/browser_restore_isAppTab.js +++ b/browser/base/content/test/general/browser_restore_isAppTab.js @@ -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"); diff --git a/browser/base/content/test/general/browser_sanitize-timespans.js b/browser/base/content/test/general/browser_sanitize-timespans.js index 63fed30ac0ce..9b3727d68eaf 100644 --- a/browser/base/content/test/general/browser_sanitize-timespans.js +++ b/browser/base/content/test/general/browser_sanitize-timespans.js @@ -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; } diff --git a/browser/base/content/test/general/browser_save_link-perwindowpb.js b/browser/base/content/test/general/browser_save_link-perwindowpb.js index 30e8b930bc0c..e497d8b6f838 100644 --- a/browser/base/content/test/general/browser_save_link-perwindowpb.js +++ b/browser/base/content/test/general/browser_save_link-perwindowpb.js @@ -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. diff --git a/browser/base/content/test/general/browser_save_link_when_window_navigates.js b/browser/base/content/test/general/browser_save_link_when_window_navigates.js index 6432c90d6b4f..854d33714561 100644 --- a/browser/base/content/test/general/browser_save_link_when_window_navigates.js +++ b/browser/base/content/test/general/browser_save_link_when_window_navigates.js @@ -140,7 +140,7 @@ function test() { executeSoon(aCallback); info("whenDelayedStartupFinished found our window"); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } mockTransferRegisterer.register(); diff --git a/browser/base/content/test/general/browser_ssl_error_reports.js b/browser/base/content/test/general/browser_ssl_error_reports.js index 43600ac203fa..f0769e33c0ac 100644 --- a/browser/base/content/test/general/browser_ssl_error_reports.js +++ b/browser/base/content/test/general/browser_ssl_error_reports.js @@ -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); }); } diff --git a/browser/base/content/test/general/browser_syncui.js b/browser/base/content/test/general/browser_syncui.js index 2e9adcf5e794..71074ef5ed97 100644 --- a/browser/base/content/test/general/browser_syncui.js +++ b/browser/base/content/test/general/browser_syncui.js @@ -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); }); } diff --git a/browser/base/content/test/general/browser_unknownContentType_title.js b/browser/base/content/test/general/browser_unknownContentType_title.js index ce5189fdacfb..269406bdb9c0 100644 --- a/browser/base/content/test/general/browser_unknownContentType_title.js +++ b/browser/base/content/test/general/browser_unknownContentType_title.js @@ -10,7 +10,7 @@ function waitForNewWindow() { }); }; - Services.obs.addObserver(listener, "toplevel-window-ready") + Services.obs.addObserver(listener, "toplevel-window-ready", false) }); } diff --git a/browser/base/content/test/general/head.js b/browser/base/content/test/general/head.js index c72956c68ba8..c64a183acd74 100644 --- a/browser/base/content/test/general/head.js +++ b/browser/base/content/test/general/head.js @@ -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); diff --git a/browser/base/content/test/newtab/browser_newtab_background_captures.js b/browser/base/content/test/newtab/browser_newtab_background_captures.js index 15e6da0db3b7..3658077c7308 100644 --- a/browser/base/content/test/newtab/browser_newtab_background_captures.js +++ b/browser/base/content/test/newtab/browser_newtab_background_captures.js @@ -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. diff --git a/browser/base/content/test/pageinfo/browser_pageInfo.js b/browser/base/content/test/pageinfo/browser_pageInfo.js index 7eb90af115ae..3a13793e8878 100644 --- a/browser/base/content/test/pageinfo/browser_pageInfo.js +++ b/browser/base/content/test/pageinfo/browser_pageInfo.js @@ -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 = diff --git a/browser/base/content/test/plugins/browser_pageInfo_plugins.js b/browser/base/content/test/plugins/browser_pageInfo_plugins.js index 984405fab631..5cdf8171170c 100644 --- a/browser/base/content/test/plugins/browser_pageInfo_plugins.js +++ b/browser/base/content/test/plugins/browser_pageInfo_plugins.js @@ -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. diff --git a/browser/base/content/test/plugins/browser_pluginCrashReportNonDeterminism.js b/browser/base/content/test/plugins/browser_pluginCrashReportNonDeterminism.js index ac6caad3c0fb..31e741eb3205 100644 --- a/browser/base/content/test/plugins/browser_pluginCrashReportNonDeterminism.js +++ b/browser/base/content/test/plugins/browser_pluginCrashReportNonDeterminism.js @@ -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(() => { diff --git a/browser/base/content/test/plugins/head.js b/browser/base/content/test/plugins/head.js index f3a847c4a7db..71317a5c9604 100644 --- a/browser/base/content/test/plugins/head.js +++ b/browser/base/content/test/plugins/head.js @@ -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); } diff --git a/browser/base/content/test/popupNotifications/head.js b/browser/base/content/test/popupNotifications/head.js index 2675a8fa76b2..00b33f8492b9 100644 --- a/browser/base/content/test/popupNotifications/head.js +++ b/browser/base/content/test/popupNotifications/head.js @@ -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; } diff --git a/browser/base/content/test/referrer/head.js b/browser/base/content/test/referrer/head.js index a899b5bcd79b..f83bd9fd9fb8 100644 --- a/browser/base/content/test/referrer/head.js +++ b/browser/base/content/test/referrer/head.js @@ -129,7 +129,7 @@ function delayedStartupFinished(aWindow) { Services.obs.removeObserver(observer, aTopic); resolve(); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); }); } diff --git a/browser/base/content/test/siteIdentity/head.js b/browser/base/content/test/siteIdentity/head.js index f4054a21365a..e79d5f694a4a 100644 --- a/browser/base/content/test/siteIdentity/head.js +++ b/browser/base/content/test/siteIdentity/head.js @@ -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); diff --git a/browser/base/content/test/social/head.js b/browser/base/content/test/social/head.js index f9ce5e02a4e1..be33671abff1 100644 --- a/browser/base/content/test/social/head.js +++ b/browser/base/content/test/social/head.js @@ -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(); diff --git a/browser/base/content/test/tabPrompts/browser_multiplePrompts.js b/browser/base/content/test/tabPrompts/browser_multiplePrompts.js index 663455139be5..51b35bfae895 100644 --- a/browser/base/content/test/tabPrompts/browser_multiplePrompts.js +++ b/browser/base/content/test/tabPrompts/browser_multiplePrompts.js @@ -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); diff --git a/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js index 432dbc7011fa..1dfbf0c68674 100644 --- a/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js +++ b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js @@ -125,7 +125,8 @@ function loadTab(tab, url) { Services.obs.removeObserver(observer, aTopic); resolve(); }, - "uri-visit-saved" + "uri-visit-saved", + false ); }); diff --git a/browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js b/browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js index 31875ee50afc..e690d5307410 100644 --- a/browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js +++ b/browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js @@ -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) { diff --git a/browser/base/content/test/webextensions/browser_update_checkForUpdates.js b/browser/base/content/test/webextensions/browser_update_checkForUpdates.js index 298e3b6e0bbc..6642cd7c3bd0 100644 --- a/browser/base/content/test/webextensions/browser_update_checkForUpdates.js +++ b/browser/base/content/test/webextensions/browser_update_checkForUpdates.js @@ -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); }); } diff --git a/browser/base/content/test/webrtc/get_user_media_content_script.js b/browser/base/content/test/webrtc/get_user_media_content_script.js index 2597e6a9d708..bd3c8ef91c48 100644 --- a/browser/base/content/test/webrtc/get_user_media_content_script.js +++ b/browser/base/content/test/webrtc/get_user_media_content_script.js @@ -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", () => { diff --git a/browser/base/content/test/webrtc/head.js b/browser/base/content/test/webrtc/head.js index 4c50be2822de..9ba8d12ee037 100644 --- a/browser/base/content/test/webrtc/head.js +++ b/browser/base/content/test/webrtc/head.js @@ -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); }); } diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml index 2480895e05af..92f8a2e7a38f 100644 --- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -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"); diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 1fa6b291dea1..616d64a67150 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -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); diff --git a/browser/components/customizableui/CustomizableUI.jsm b/browser/components/customizableui/CustomizableUI.jsm index 4e063bd5005b..aee38b72af35 100644 --- a/browser/components/customizableui/CustomizableUI.jsm +++ b/browser/components/customizableui/CustomizableUI.jsm @@ -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); } } diff --git a/browser/components/customizableui/CustomizableWidgets.jsm b/browser/components/customizableui/CustomizableWidgets.jsm index 9a99807dd7c7..6b0ebcfe7f45 100644 --- a/browser/components/customizableui/CustomizableWidgets.jsm +++ b/browser/components/customizableui/CustomizableWidgets.jsm @@ -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) { diff --git a/browser/components/customizableui/CustomizeMode.jsm b/browser/components/customizableui/CustomizeMode.jsm index 3efd66f4e0b2..029ea5c3b001 100644 --- a/browser/components/customizableui/CustomizeMode.jsm +++ b/browser/components/customizableui/CustomizeMode.jsm @@ -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); diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js index 914aa12d922f..23a8ed1b7459 100644 --- a/browser/components/customizableui/content/panelUI.js +++ b/browser/components/customizableui/content/panelUI.js @@ -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); }); } diff --git a/browser/components/customizableui/test/browser_934951_zoom_in_toolbar.js b/browser/components/customizableui/test/browser_934951_zoom_in_toolbar.js index bb27a54a919d..8be447c19b98 100644 --- a/browser/components/customizableui/test/browser_934951_zoom_in_toolbar.js +++ b/browser/components/customizableui/test/browser_934951_zoom_in_toolbar.js @@ -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; } diff --git a/browser/components/customizableui/test/head.js b/browser/components/customizableui/test/head.js index 8e398a264ae5..8097de5f7704 100644 --- a/browser/components/customizableui/test/head.js +++ b/browser/components/customizableui/test/head.js @@ -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() { diff --git a/browser/components/downloads/DownloadsTaskbar.jsm b/browser/components/downloads/DownloadsTaskbar.jsm index 0cb80be67862..0f8b1a2b2ab0 100644 --- a/browser/components/downloads/DownloadsTaskbar.jsm +++ b/browser/components/downloads/DownloadsTaskbar.jsm @@ -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. diff --git a/browser/components/downloads/content/allDownloadsViewOverlay.js b/browser/components/downloads/content/allDownloadsViewOverlay.js index e93ef3ef59a6..1546b6789f5d 100644 --- a/browser/components/downloads/content/allDownloadsViewOverlay.js +++ b/browser/components/downloads/content/allDownloadsViewOverlay.js @@ -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; }, diff --git a/browser/components/downloads/test/browser/browser_iframe_gone_mid_download.js b/browser/components/downloads/test/browser/browser_iframe_gone_mid_download.js index 4f51a4562ac8..35d37e8e2b77 100644 --- a/browser/components/downloads/test/browser/browser_iframe_gone_mid_download.js +++ b/browser/components/downloads/test/browser/browser_iframe_gone_mid_download.js @@ -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; diff --git a/browser/components/downloads/test/browser/head.js b/browser/components/downloads/test/browser/head.js index 2db53ef7028c..55d05456ab46 100644 --- a/browser/components/downloads/test/browser/head.js +++ b/browser/components/downloads/test/browser/head.js @@ -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(); }); } diff --git a/browser/components/extensions/ext-bookmarks.js b/browser/components/extensions/ext-bookmarks.js index f7104333aea7..36557322e812 100644 --- a/browser/components/extensions/ext-bookmarks.js +++ b/browser/components/extensions/ext-bookmarks.js @@ -174,7 +174,7 @@ function decrementListeners() { function incrementListeners() { listenerCount++; if (listenerCount == 1) { - PlacesUtils.bookmarks.addObserver(observer); + PlacesUtils.bookmarks.addObserver(observer, false); } } diff --git a/browser/components/extensions/ext-contextMenus.js b/browser/components/extensions/ext-contextMenus.js index fb43b0369efa..da5b79298018 100644 --- a/browser/components/extensions/ext-contextMenus.js +++ b/browser/components/extensions/ext-contextMenus.js @@ -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); } diff --git a/browser/components/extensions/ext-history.js b/browser/components/extensions/ext-history.js index 0fbe59888001..e7f1859c4cf9 100644 --- a/browser/components/extensions/ext-history.js +++ b/browser/components/extensions/ext-history.js @@ -121,7 +121,7 @@ function getObserver() { }, }; EventEmitter.decorate(_observer); - PlacesUtils.history.addObserver(_observer); + PlacesUtils.history.addObserver(_observer, false); } return _observer; } diff --git a/browser/components/extensions/ext-sessions.js b/browser/components/extensions/ext-sessions.js index d9b86b1ed83a..8fe9766ea00f 100644 --- a/browser/components/extensions/ext-sessions.js +++ b/browser/components/extensions/ext-sessions.js @@ -97,7 +97,7 @@ this.sessions = class extends ExtensionAPI { fire.async(); }; - Services.obs.addObserver(observer, SS_ON_CLOSED_OBJECTS_CHANGED); + Services.obs.addObserver(observer, SS_ON_CLOSED_OBJECTS_CHANGED, false); return () => { Services.obs.removeObserver(observer, SS_ON_CLOSED_OBJECTS_CHANGED); }; diff --git a/browser/components/extensions/ext-tabs.js b/browser/components/extensions/ext-tabs.js index 1a9b053e3b9f..2a4a60430077 100644 --- a/browser/components/extensions/ext-tabs.js +++ b/browser/components/extensions/ext-tabs.js @@ -307,7 +307,7 @@ this.tabs = class extends ExtensionAPI { Services.obs.removeObserver(obs, "browser-delayed-startup-finished"); resolve(window); }; - Services.obs.addObserver(obs, "browser-delayed-startup-finished"); + Services.obs.addObserver(obs, "browser-delayed-startup-finished", false); } else { resolve(window); } diff --git a/browser/components/feeds/WebContentConverter.js b/browser/components/feeds/WebContentConverter.js index 207414e73e48..e5396f0ebf30 100644 --- a/browser/components/feeds/WebContentConverter.js +++ b/browser/components/feeds/WebContentConverter.js @@ -841,7 +841,7 @@ WebContentConverterRegistrar.prototype = { let os = Services.obs; switch (topic) { case "app-startup": - os.addObserver(this, "browser-ui-startup-complete"); + os.addObserver(this, "browser-ui-startup-complete", false); break; case "browser-ui-startup-complete": os.removeObserver(this, "browser-ui-startup-complete"); diff --git a/browser/components/migration/AutoMigrate.jsm b/browser/components/migration/AutoMigrate.jsm index 7d26d0160f12..f9a232cf1cb4 100644 --- a/browser/components/migration/AutoMigrate.jsm +++ b/browser/components/migration/AutoMigrate.jsm @@ -126,8 +126,8 @@ const AutoMigrate = { }; MigrationUtils.initializeUndoData(); - Services.obs.addObserver(migrationObserver, "Migration:Ended"); - Services.obs.addObserver(migrationObserver, "Migration:ItemError"); + Services.obs.addObserver(migrationObserver, "Migration:Ended", false); + Services.obs.addObserver(migrationObserver, "Migration:ItemError", false); migrator.migrate(this.resourceTypesToUse, profileStartup, profileToMigrate); histogram.add(20); }, diff --git a/browser/components/migration/ESEDBReader.jsm b/browser/components/migration/ESEDBReader.jsm index 1e853cef5e5b..84313f8d62d7 100644 --- a/browser/components/migration/ESEDBReader.jsm +++ b/browser/components/migration/ESEDBReader.jsm @@ -231,7 +231,7 @@ function unloadLibraries() { } function loadLibraries() { - Services.obs.addObserver(unloadLibraries, "xpcom-shutdown"); + Services.obs.addObserver(unloadLibraries, "xpcom-shutdown", false); gLibs.ese = ctypes.open("esent.dll"); gLibs.kernel = ctypes.open("kernel32.dll"); KERNEL.FileTimeToSystemTime = gLibs.kernel.declare("FileTimeToSystemTime", diff --git a/browser/components/migration/MigrationUtils.jsm b/browser/components/migration/MigrationUtils.jsm index 3c0832fcda65..d6da54c79498 100644 --- a/browser/components/migration/MigrationUtils.jsm +++ b/browser/components/migration/MigrationUtils.jsm @@ -399,7 +399,7 @@ this.MigratorPrototype = { Services.obs.removeObserver(onPlacesInited, TOPIC_PLACES_DEFAULTS_FINISHED); resolve(); }; - Services.obs.addObserver(onPlacesInited, TOPIC_PLACES_DEFAULTS_FINISHED); + Services.obs.addObserver(onPlacesInited, TOPIC_PLACES_DEFAULTS_FINISHED, false); }); browserGlue.observe(null, TOPIC_DID_IMPORT_BOOKMARKS, ""); yield placesInitedPromise; diff --git a/browser/components/migration/content/migration.js b/browser/components/migration/content/migration.js index 6490d2fe1520..43a9a0f76433 100644 --- a/browser/components/migration/content/migration.js +++ b/browser/components/migration/content/migration.js @@ -24,11 +24,11 @@ var MigrationWizard = { /* exported MigrationWizard */ init() { let os = Services.obs; - os.addObserver(this, "Migration:Started"); - os.addObserver(this, "Migration:ItemBeforeMigrate"); - os.addObserver(this, "Migration:ItemAfterMigrate"); - os.addObserver(this, "Migration:ItemError"); - os.addObserver(this, "Migration:Ended"); + os.addObserver(this, "Migration:Started", false); + os.addObserver(this, "Migration:ItemBeforeMigrate", false); + os.addObserver(this, "Migration:ItemAfterMigrate", false); + os.addObserver(this, "Migration:ItemError", false); + os.addObserver(this, "Migration:Ended", false); this._wiz = document.documentElement; diff --git a/browser/components/migration/tests/browser/browser_undo_notification_multiple_dismissal.js b/browser/components/migration/tests/browser/browser_undo_notification_multiple_dismissal.js index 0063e52d4cdb..90b5d0d083d5 100644 --- a/browser/components/migration/tests/browser/browser_undo_notification_multiple_dismissal.js +++ b/browser/components/migration/tests/browser/browser_undo_notification_multiple_dismissal.js @@ -61,7 +61,7 @@ add_task(function* checkNotificationsDismissed() { } }, }; - PlacesUtils.bookmarks.addObserver(bmObserver); + PlacesUtils.bookmarks.addObserver(bmObserver, false); registerCleanupFunction(() => PlacesUtils.bookmarks.removeObserver(bmObserver)); }); @@ -103,7 +103,7 @@ add_task(function* checkNotificationsDismissed() { "Pref should have been reset"); resolve(); }; - Services.prefs.addObserver(kObservedPref, obs); + Services.prefs.addObserver(kObservedPref, obs, false); }); // Click "Don't keep" button: diff --git a/browser/components/migration/tests/unit/head_migration.js b/browser/components/migration/tests/unit/head_migration.js index e229de9d05c7..c8bf885e1c87 100644 --- a/browser/components/migration/tests/unit/head_migration.js +++ b/browser/components/migration/tests/unit/head_migration.js @@ -40,7 +40,7 @@ function promiseMigration(migrator, resourceType, aProfile = null) { Services.obs.addObserver(function onMigrationEnded() { Services.obs.removeObserver(onMigrationEnded, "Migration:Ended"); resolve(); - }, "Migration:Ended"); + }, "Migration:Ended", false); migrator.migrate(resourceType, null, aProfile); }); diff --git a/browser/components/migration/tests/unit/test_Chrome_bookmarks.js b/browser/components/migration/tests/unit/test_Chrome_bookmarks.js index 100473a26b74..0970e39466af 100644 --- a/browser/components/migration/tests/unit/test_Chrome_bookmarks.js +++ b/browser/components/migration/tests/unit/test_Chrome_bookmarks.js @@ -91,7 +91,7 @@ add_task(function* () { onItemMoved() {}, }; - PlacesUtils.bookmarks.addObserver(bmObserver); + PlacesUtils.bookmarks.addObserver(bmObserver, false); const PROFILE = { id: "Default", name: "Default", diff --git a/browser/components/migration/tests/unit/test_Edge_db_migration.js b/browser/components/migration/tests/unit/test_Edge_db_migration.js index 638bf8dad3ec..6f4ddfaaed3c 100644 --- a/browser/components/migration/tests/unit/test_Edge_db_migration.js +++ b/browser/components/migration/tests/unit/test_Edge_db_migration.js @@ -437,7 +437,7 @@ add_task(function*() { onItemVisited() {}, onItemMoved() {}, }; - PlacesUtils.bookmarks.addObserver(bookmarkObserver); + PlacesUtils.bookmarks.addObserver(bookmarkObserver, false); let migrateResult = yield new Promise(resolve => bookmarksMigrator.migrate(resolve)).catch(ex => { Cu.reportError(ex); @@ -513,7 +513,7 @@ add_task(function*() { onItemVisited() {}, onItemMoved() {}, }; - PlacesUtils.bookmarks.addObserver(bookmarkObserver); + PlacesUtils.bookmarks.addObserver(bookmarkObserver, false); let readingListMigrator = migrator.wrappedJSObject.getReadingListMigratorForTesting(db); Assert.ok(readingListMigrator.exists, "Should recognize db we just created"); diff --git a/browser/components/migration/tests/unit/test_IE_bookmarks.js b/browser/components/migration/tests/unit/test_IE_bookmarks.js index dc1dd0a11fb8..a166c0502091 100644 --- a/browser/components/migration/tests/unit/test_IE_bookmarks.js +++ b/browser/components/migration/tests/unit/test_IE_bookmarks.js @@ -32,7 +32,7 @@ add_task(function* () { onItemVisited() {}, onItemMoved() {}, }; - PlacesUtils.bookmarks.addObserver(bmObserver); + PlacesUtils.bookmarks.addObserver(bmObserver, false); yield promiseMigration(migrator, MigrationUtils.resourceTypes.BOOKMARKS); PlacesUtils.bookmarks.removeObserver(bmObserver); diff --git a/browser/components/migration/tests/unit/test_Safari_bookmarks.js b/browser/components/migration/tests/unit/test_Safari_bookmarks.js index 0306f21f2a2a..b142f2453990 100644 --- a/browser/components/migration/tests/unit/test_Safari_bookmarks.js +++ b/browser/components/migration/tests/unit/test_Safari_bookmarks.js @@ -37,7 +37,7 @@ add_task(function* () { onItemVisited() {}, onItemMoved() {}, }; - PlacesUtils.bookmarks.addObserver(bmObserver); + PlacesUtils.bookmarks.addObserver(bmObserver, false); yield promiseMigration(migrator, MigrationUtils.resourceTypes.BOOKMARKS); PlacesUtils.bookmarks.removeObserver(bmObserver); diff --git a/browser/components/migration/tests/unit/test_automigration.js b/browser/components/migration/tests/unit/test_automigration.js index b176019765a2..78e6b44acb1a 100644 --- a/browser/components/migration/tests/unit/test_automigration.js +++ b/browser/components/migration/tests/unit/test_automigration.js @@ -256,7 +256,7 @@ add_task(function* checkUndoRemoval() { resolve(); }, }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); }); yield MigrationUtils.insertVisitsWrapper([{ uri: visitedURI, @@ -580,7 +580,7 @@ add_task(function* checkUndoVisitsState() { PlacesUtils.history.removeObserver(this); resolve(); } - }); + }, false); }); yield PlacesUtils.history.insertMany([{ url: "http://www.example.com/", @@ -646,7 +646,7 @@ add_task(function* checkUndoVisitsState() { uriDeletedExpected.get(aURI.spec).resolve(); }, }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); yield AutoMigrate._removeSomeVisits(undoVisitData); PlacesUtils.history.removeObserver(observer); diff --git a/browser/components/newtab/NewTabPrefsProvider.jsm b/browser/components/newtab/NewTabPrefsProvider.jsm index 552b2c919067..3baa695a79bd 100644 --- a/browser/components/newtab/NewTabPrefsProvider.jsm +++ b/browser/components/newtab/NewTabPrefsProvider.jsm @@ -88,7 +88,7 @@ PrefsProvider.prototype = { init() { for (let pref of gPrefsMap.keys()) { - Services.prefs.addObserver(pref, this); + Services.prefs.addObserver(pref, this, false); } }, diff --git a/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js b/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js index 003ca14ca5f0..ca4f3cd4c405 100644 --- a/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js +++ b/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js @@ -137,6 +137,6 @@ function nextChangeNotificationPromise(aNewURL, testMessage) { Services.obs.removeObserver(observer, aTopic); Assert.equal(aData, aNewURL, testMessage); resolve(); - }, "newtab-url-changed"); + }, "newtab-url-changed", false); }); } diff --git a/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js b/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js index 7251947dd99e..3e60b282a7ae 100644 --- a/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js +++ b/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js @@ -33,7 +33,7 @@ add_task(function* test_search() { Services.obs.removeObserver(observer, "browser-search-service"); resolve(); } - }, "browser-search-service"); + }, "browser-search-service", false); }); Services.search.init(); yield observerPromise; diff --git a/browser/components/newtab/tests/xpcshell/test_NewTabURL.js b/browser/components/newtab/tests/xpcshell/test_NewTabURL.js index ee126bf9d3cb..1c148c5d8950 100644 --- a/browser/components/newtab/tests/xpcshell/test_NewTabURL.js +++ b/browser/components/newtab/tests/xpcshell/test_NewTabURL.js @@ -47,6 +47,6 @@ function promiseNewtabURLNotification(aNewURL) { Services.obs.removeObserver(observer, aTopic); Assert.equal(aData, aNewURL, "Data for newtab-url-changed notification should be new URL."); resolve(); - }, "newtab-url-changed"); + }, "newtab-url-changed", false); }); } diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 8f0d0f64e8c8..e95968e3249c 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -391,38 +391,38 @@ BrowserGlue.prototype = { // initialization (called on application startup) _init: function BG__init() { let os = Services.obs; - os.addObserver(this, "notifications-open-settings"); - os.addObserver(this, "prefservice:after-app-defaults"); - os.addObserver(this, "final-ui-startup"); - os.addObserver(this, "browser-delayed-startup-finished"); - os.addObserver(this, "sessionstore-windows-restored"); - os.addObserver(this, "browser:purge-session-history"); - os.addObserver(this, "quit-application-requested"); - os.addObserver(this, "quit-application-granted"); + os.addObserver(this, "notifications-open-settings", false); + os.addObserver(this, "prefservice:after-app-defaults", false); + os.addObserver(this, "final-ui-startup", false); + os.addObserver(this, "browser-delayed-startup-finished", false); + os.addObserver(this, "sessionstore-windows-restored", false); + os.addObserver(this, "browser:purge-session-history", false); + os.addObserver(this, "quit-application-requested", false); + os.addObserver(this, "quit-application-granted", false); if (OBSERVE_LASTWINDOW_CLOSE_TOPICS) { - os.addObserver(this, "browser-lastwindow-close-requested"); - os.addObserver(this, "browser-lastwindow-close-granted"); + os.addObserver(this, "browser-lastwindow-close-requested", false); + os.addObserver(this, "browser-lastwindow-close-granted", false); } - os.addObserver(this, "weave:service:ready"); - os.addObserver(this, "fxaccounts:onverified"); - os.addObserver(this, "fxaccounts:device_connected"); - os.addObserver(this, "fxaccounts:device_disconnected"); - os.addObserver(this, "weave:engine:clients:display-uris"); - os.addObserver(this, "session-save"); - os.addObserver(this, "places-init-complete"); + os.addObserver(this, "weave:service:ready", false); + os.addObserver(this, "fxaccounts:onverified", false); + os.addObserver(this, "fxaccounts:device_connected", false); + os.addObserver(this, "fxaccounts:device_disconnected", false); + os.addObserver(this, "weave:engine:clients:display-uris", false); + os.addObserver(this, "session-save", false); + os.addObserver(this, "places-init-complete", false); this._isPlacesInitObserver = true; - os.addObserver(this, "places-database-locked"); + os.addObserver(this, "places-database-locked", false); this._isPlacesLockedObserver = true; - os.addObserver(this, "distribution-customization-complete"); - os.addObserver(this, "handle-xul-text-link"); - os.addObserver(this, "profile-before-change"); + os.addObserver(this, "distribution-customization-complete", false); + os.addObserver(this, "handle-xul-text-link", false); + os.addObserver(this, "profile-before-change", false); if (AppConstants.MOZ_TELEMETRY_REPORTING) { - os.addObserver(this, "keyword-search"); + os.addObserver(this, "keyword-search", false); } - os.addObserver(this, "browser-search-engine-modified"); - os.addObserver(this, "restart-in-safe-mode"); - os.addObserver(this, "flash-plugin-hang"); - os.addObserver(this, "xpi-signature-changed"); + os.addObserver(this, "browser-search-engine-modified", false); + os.addObserver(this, "restart-in-safe-mode", false); + os.addObserver(this, "flash-plugin-hang", false); + os.addObserver(this, "xpi-signature-changed", false); this._flashHangCount = 0; this._firstWindowReady = new Promise(resolve => this._firstWindowLoaded = resolve); diff --git a/browser/components/originattributes/test/browser/browser_clientAuth.js b/browser/components/originattributes/test/browser/browser_clientAuth.js index b288c390d091..48961dce0a94 100644 --- a/browser/components/originattributes/test/browser/browser_clientAuth.js +++ b/browser/components/originattributes/test/browser/browser_clientAuth.js @@ -7,7 +7,7 @@ function onCertDialogLoaded(subject) { subject.acceptDialog(); } -Services.obs.addObserver(onCertDialogLoaded, "cert-dialog-loaded"); +Services.obs.addObserver(onCertDialogLoaded, "cert-dialog-loaded", false); registerCleanupFunction(() => { Services.obs.removeObserver(onCertDialogLoaded, "cert-dialog-loaded"); diff --git a/browser/components/originattributes/test/browser/browser_favicon_firstParty.js b/browser/components/originattributes/test/browser/browser_favicon_firstParty.js index 122d9323a1cc..6dd0f019d0d1 100644 --- a/browser/components/originattributes/test/browser/browser_favicon_firstParty.js +++ b/browser/components/originattributes/test/browser/browser_favicon_firstParty.js @@ -47,7 +47,7 @@ function clearAllPlacesFavicons() { } }; - Services.obs.addObserver(observer, "places-favicons-expired"); + Services.obs.addObserver(observer, "places-favicons-expired", false); faviconService.expireAllFavicons(); }); } @@ -108,7 +108,7 @@ function observeFavicon(aFirstPartyDomain, aExpectedCookie, aPageURI) { } }; - Services.obs.addObserver(observer, "http-on-modify-request"); + Services.obs.addObserver(observer, "http-on-modify-request", false); }); } @@ -138,8 +138,8 @@ function waitOnFaviconResponse(aFaviconURL) { } }; - Services.obs.addObserver(observer, "http-on-examine-response"); - Services.obs.addObserver(observer, "http-on-examine-cached-response"); + Services.obs.addObserver(observer, "http-on-examine-response", false); + Services.obs.addObserver(observer, "http-on-examine-cached-response", false); }); } @@ -156,7 +156,7 @@ function waitOnFaviconLoaded(aFaviconURL) { }, }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); }); } diff --git a/browser/components/originattributes/test/browser/browser_favicon_userContextId.js b/browser/components/originattributes/test/browser/browser_favicon_userContextId.js index 638a3befd468..498e72b1355b 100644 --- a/browser/components/originattributes/test/browser/browser_favicon_userContextId.js +++ b/browser/components/originattributes/test/browser/browser_favicon_userContextId.js @@ -47,7 +47,7 @@ function clearAllPlacesFavicons() { } }; - Services.obs.addObserver(observer, "places-favicons-expired"); + Services.obs.addObserver(observer, "places-favicons-expired", false); faviconService.expireAllFavicons(); }); } @@ -137,7 +137,7 @@ function waitOnFaviconLoaded(aFaviconURL) { }, }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); }); } @@ -176,7 +176,7 @@ function* doTest(aTestPage, aFaviconHost, aFaviconURL) { // Add the observer earlier in case we miss it. let promiseWaitOnFaviconLoaded = waitOnFaviconLoaded(aFaviconURL); - Services.obs.addObserver(observer, "http-on-modify-request"); + Services.obs.addObserver(observer, "http-on-modify-request", false); // Open the tab with the personal container. let tabInfo = yield openTabInUserContext(aTestPage, USER_CONTEXT_ID_PERSONAL); diff --git a/browser/components/originattributes/test/browser/browser_httpauth.js b/browser/components/originattributes/test/browser/browser_httpauth.js index 07efa0cf08df..527b0c6577a3 100644 --- a/browser/components/originattributes/test/browser/browser_httpauth.js +++ b/browser/components/originattributes/test/browser/browser_httpauth.js @@ -35,7 +35,7 @@ function onCommonDialogLoaded(subject) { dialog.ui.button0.click(); } -Services.obs.addObserver(onCommonDialogLoaded, "common-dialog-loaded"); +Services.obs.addObserver(onCommonDialogLoaded, "common-dialog-loaded", false); registerCleanupFunction(() => { Services.obs.removeObserver(onCommonDialogLoaded, "common-dialog-loaded"); diff --git a/browser/components/places/PlacesUIUtils.jsm b/browser/components/places/PlacesUIUtils.jsm index b09f00d5b0a4..2672eed10587 100644 --- a/browser/components/places/PlacesUIUtils.jsm +++ b/browser/components/places/PlacesUIUtils.jsm @@ -201,7 +201,7 @@ let InternalFaviconLoader = { } this._initialized = true; - Services.obs.addObserver(this, "inner-window-destroyed"); + Services.obs.addObserver(this, "inner-window-destroyed", false); Services.ppmm.addMessageListener("Toolkit:inner-window-destroyed", msg => { this.removeRequestsForInner(msg.data); }); diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js index 0a1a10b8cfe7..360857e77a62 100644 --- a/browser/components/places/content/browserPlacesViews.js +++ b/browser/components/places/content/browserPlacesViews.js @@ -60,7 +60,7 @@ PlacesViewBase.prototype = { let result = history.executeQueries(queries.value, queries.value.length, options.value); - result.addObserver(this); + result.addObserver(this, false); return val; }, diff --git a/browser/components/places/content/editBookmarkOverlay.js b/browser/components/places/content/editBookmarkOverlay.js index 76ec7925dd8b..c687f1d1bb8d 100644 --- a/browser/components/places/content/editBookmarkOverlay.js +++ b/browser/components/places/content/editBookmarkOverlay.js @@ -277,7 +277,7 @@ var gEditItemOverlay = { // Observe changes. if (!this._observersAdded) { - PlacesUtils.bookmarks.addObserver(this); + PlacesUtils.bookmarks.addObserver(this, false); window.addEventListener("unload", this); this._observersAdded = true; } diff --git a/browser/components/places/content/tree.xml b/browser/components/places/content/tree.xml index d2197de4c069..020defd56088 100644 --- a/browser/components/places/content/tree.xml +++ b/browser/components/places/content/tree.xml @@ -114,7 +114,7 @@ // Observer removal is done within the view itself. When the tree // goes away, treeboxobject calls view.setTree(null), which then // calls removeObserver. - result.addObserver(treeView); + result.addObserver(treeView, false); this.view = treeView; if (this.getAttribute("selectfirstnode") == "true" && treeView.rowCount > 0) { diff --git a/browser/components/places/tests/browser/browser_library_views_liveupdate.js b/browser/components/places/tests/browser/browser_library_views_liveupdate.js index c1ecd5983225..d84c587bb83d 100644 --- a/browser/components/places/tests/browser/browser_library_views_liveupdate.js +++ b/browser/components/places/tests/browser/browser_library_views_liveupdate.js @@ -32,8 +32,8 @@ function test() { function startTest() { var bs = PlacesUtils.bookmarks; // Add observers. - bs.addObserver(bookmarksObserver); - PlacesUtils.annotations.addObserver(bookmarksObserver); + bs.addObserver(bookmarksObserver, false); + PlacesUtils.annotations.addObserver(bookmarksObserver, false); var addedBookmarks = []; // MENU diff --git a/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js b/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js index 4077c8729cd0..ba49615d51f4 100644 --- a/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js +++ b/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js @@ -27,7 +27,7 @@ add_task(function* test() { deferredRightFrameVisit.resolve(); } }); - }, "uri-visit-saved"); + }, "uri-visit-saved", false); // Open a tab and wait for all the subframes to load. let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, PAGE_URL); diff --git a/browser/components/places/tests/browser/browser_sidebarpanels_click.js b/browser/components/places/tests/browser/browser_sidebarpanels_click.js index 055e7d20782c..c47aa3a98827 100644 --- a/browser/components/places/tests/browser/browser_sidebarpanels_click.js +++ b/browser/components/places/tests/browser/browser_sidebarpanels_click.js @@ -98,8 +98,8 @@ function test() { currentTest.cleanup(postFunc); }); } - Services.obs.addObserver(observer, "common-dialog-loaded"); - Services.obs.addObserver(observer, "tabmodal-dialog-loaded"); + Services.obs.addObserver(observer, "common-dialog-loaded", false); + Services.obs.addObserver(observer, "tabmodal-dialog-loaded", false); let tree = sidebar.contentDocument.getElementById(currentTest.treeName); diff --git a/browser/components/places/tests/browser/browser_views_liveupdate.js b/browser/components/places/tests/browser/browser_views_liveupdate.js index 24b0e33956c1..b7b8468245a4 100644 --- a/browser/components/places/tests/browser/browser_views_liveupdate.js +++ b/browser/components/places/tests/browser/browser_views_liveupdate.js @@ -57,8 +57,8 @@ function fakeOpenPopup(aPopup) { function startTest() { var bs = PlacesUtils.bookmarks; // Add observers. - bs.addObserver(bookmarksObserver); - PlacesUtils.annotations.addObserver(bookmarksObserver); + bs.addObserver(bookmarksObserver, false); + PlacesUtils.annotations.addObserver(bookmarksObserver, false); var addedBookmarks = []; // MENU diff --git a/browser/components/places/tests/browser/head.js b/browser/components/places/tests/browser/head.js index 2c2425b827e8..cf8895d97c6b 100644 --- a/browser/components/places/tests/browser/head.js +++ b/browser/components/places/tests/browser/head.js @@ -178,7 +178,7 @@ function promiseBookmarksNotification(notification, conditionFn) { return () => {}; } }); - PlacesUtils.bookmarks.addObserver(proxifiedObserver); + PlacesUtils.bookmarks.addObserver(proxifiedObserver, false); }); } @@ -199,7 +199,7 @@ function promiseHistoryNotification(notification, conditionFn) { return () => {}; } }); - PlacesUtils.history.addObserver(proxifiedObserver); + PlacesUtils.history.addObserver(proxifiedObserver, false); }); } diff --git a/browser/components/places/tests/chrome/test_bug549192.xul b/browser/components/places/tests/chrome/test_bug549192.xul index 7dfddf180992..043c0f08f25b 100644 --- a/browser/components/places/tests/chrome/test_bug549192.xul +++ b/browser/components/places/tests/chrome/test_bug549192.xul @@ -57,7 +57,7 @@ onDeleteVisits(aURI, aTime) { }, }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); } diff --git a/browser/components/places/tests/unit/test_PUIU_makeTransaction.js b/browser/components/places/tests/unit/test_PUIU_makeTransaction.js index 69db69f15071..669f6d885e13 100644 --- a/browser/components/places/tests/unit/test_PUIU_makeTransaction.js +++ b/browser/components/places/tests/unit/test_PUIU_makeTransaction.js @@ -58,7 +58,7 @@ function waitForBookmarkNotification(aNotification, aCallback, aProperty) { index: aNewIndex, type: aItemType }); } - }); + }, false); } function wrapNodeByIdAndParent(aItemId, aParentId) { diff --git a/browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js b/browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js index d6e9eb58130d..4db21555fef7 100644 --- a/browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js +++ b/browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js @@ -29,5 +29,5 @@ add_task(function* () { Services.obs.addObserver(function observer() { Services.obs.removeObserver(observer, "profile-before-change"); check_bookmarks_html(); - }, "profile-before-change"); + }, "profile-before-change", false); }); diff --git a/browser/components/preferences/cookies.js b/browser/components/preferences/cookies.js index 073bf0992be6..a6a9847a456c 100644 --- a/browser/components/preferences/cookies.js +++ b/browser/components/preferences/cookies.js @@ -26,8 +26,8 @@ var gCookiesWindow = { init() { var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); - os.addObserver(this, "cookie-changed"); - os.addObserver(this, "perm-changed"); + os.addObserver(this, "cookie-changed", false); + os.addObserver(this, "perm-changed", false); this._bundle = document.getElementById("bundlePreferences"); this._tree = document.getElementById("cookiesList"); diff --git a/browser/components/preferences/in-content-old/advanced.js b/browser/components/preferences/in-content-old/advanced.js index fbf792d7b6f9..74af64aad641 100644 --- a/browser/components/preferences/in-content-old/advanced.js +++ b/browser/components/preferences/in-content-old/advanced.js @@ -39,7 +39,7 @@ var gAdvancedPane = { Services.prefs.removeObserver("app.update.", this); }.bind(this); window.addEventListener("unload", onUnload); - Services.prefs.addObserver("app.update.", this); + Services.prefs.addObserver("app.update.", this, false); this.updateReadPrefs(); } if (AppConstants.MOZ_CRASHREPORTER) { @@ -54,8 +54,8 @@ var gAdvancedPane = { this.updateActualCacheSize(); if (Services.prefs.getBoolPref("browser.storageManager.enabled")) { - Services.obs.addObserver(this, "sitedatamanager:sites-updated"); - Services.obs.addObserver(this, "sitedatamanager:updating-sites"); + Services.obs.addObserver(this, "sitedatamanager:sites-updated", false); + Services.obs.addObserver(this, "sitedatamanager:updating-sites", false); let unload = () => { window.removeEventListener("unload", unload); Services.obs.removeObserver(this, "sitedatamanager:sites-updated"); diff --git a/browser/components/preferences/in-content-old/applications.js b/browser/components/preferences/in-content-old/applications.js index d577aa7b1745..2caa8817fc9e 100644 --- a/browser/components/preferences/in-content-old/applications.js +++ b/browser/components/preferences/in-content-old/applications.js @@ -885,22 +885,22 @@ var gApplicationsPane = { // Observe preferences that influence what we display so we can rebuild // the view when they change. - this._prefSvc.addObserver(PREF_SHOW_PLUGINS_IN_LIST, this); - this._prefSvc.addObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_APP, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_WEB, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_ACTION, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_READER, this); + this._prefSvc.addObserver(PREF_SHOW_PLUGINS_IN_LIST, this, false); + this._prefSvc.addObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_APP, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_WEB, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_ACTION, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_READER, this, false); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_APP, this); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_WEB, this); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_ACTION, this); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_READER, this); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_APP, this, false); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_WEB, this, false); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_ACTION, this, false); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_READER, this, false); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_APP, this); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_WEB, this); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_READER, this); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_APP, this, false); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_WEB, this, false); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this, false); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_READER, this, false); setEventListener("focusSearch1", "command", gApplicationsPane.focusFilterBox); diff --git a/browser/components/preferences/in-content-old/search.js b/browser/components/preferences/in-content-old/search.js index 9caefbb26a33..9001f822ae7b 100644 --- a/browser/components/preferences/in-content-old/search.js +++ b/browser/components/preferences/in-content-old/search.js @@ -41,7 +41,7 @@ var gSearchPane = { window.addEventListener("select", this); window.addEventListener("blur", this, true); - Services.obs.addObserver(this, "browser-search-engine-modified"); + Services.obs.addObserver(this, "browser-search-engine-modified", false); window.addEventListener("unload", () => { Services.obs.removeObserver(this, "browser-search-engine-modified"); }); diff --git a/browser/components/preferences/in-content-old/sync.js b/browser/components/preferences/in-content-old/sync.js index 8032fb664338..c724b838caf0 100644 --- a/browser/components/preferences/in-content-old/sync.js +++ b/browser/components/preferences/in-content-old/sync.js @@ -67,7 +67,7 @@ var gSyncPane = { this._init(); }.bind(this); - Services.obs.addObserver(onReady, "weave:service:ready"); + Services.obs.addObserver(onReady, "weave:service:ready", false); window.addEventListener("unload", onUnload); xps.ensureLoaded(); diff --git a/browser/components/preferences/in-content-old/tests/browser_cookies_exceptions.js b/browser/components/preferences/in-content-old/tests/browser_cookies_exceptions.js index 10fd41a0a98f..cc4adeccac59 100644 --- a/browser/components/preferences/in-content-old/tests/browser_cookies_exceptions.js +++ b/browser/components/preferences/in-content-old/tests/browser_cookies_exceptions.js @@ -306,7 +306,7 @@ var testRunner = { let os = Cc["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService); - os.addObserver(permObserver, "perm-changed"); + os.addObserver(permObserver, "perm-changed", false); if (testRunner._currentTest == 0) { is(params.tree.view.rowCount, 0, "no cookie exceptions"); diff --git a/browser/components/preferences/in-content/advanced.js b/browser/components/preferences/in-content/advanced.js index 997529def619..17b99d55e0bd 100644 --- a/browser/components/preferences/in-content/advanced.js +++ b/browser/components/preferences/in-content/advanced.js @@ -31,7 +31,7 @@ var gAdvancedPane = { Services.prefs.removeObserver("app.update.", this); }.bind(this); window.addEventListener("unload", onUnload); - Services.prefs.addObserver("app.update.", this); + Services.prefs.addObserver("app.update.", this, false); this.updateReadPrefs(); } if (AppConstants.MOZ_CRASHREPORTER) { diff --git a/browser/components/preferences/in-content/applications.js b/browser/components/preferences/in-content/applications.js index d5fe4b7bf068..191f7378c90f 100644 --- a/browser/components/preferences/in-content/applications.js +++ b/browser/components/preferences/in-content/applications.js @@ -887,22 +887,22 @@ var gApplicationsPane = { // Observe preferences that influence what we display so we can rebuild // the view when they change. - this._prefSvc.addObserver(PREF_SHOW_PLUGINS_IN_LIST, this); - this._prefSvc.addObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_APP, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_WEB, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_ACTION, this); - this._prefSvc.addObserver(PREF_FEED_SELECTED_READER, this); + this._prefSvc.addObserver(PREF_SHOW_PLUGINS_IN_LIST, this, false); + this._prefSvc.addObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_APP, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_WEB, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_ACTION, this, false); + this._prefSvc.addObserver(PREF_FEED_SELECTED_READER, this, false); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_APP, this); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_WEB, this); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_ACTION, this); - this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_READER, this); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_APP, this, false); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_WEB, this, false); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_ACTION, this, false); + this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_READER, this, false); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_APP, this); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_WEB, this); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this); - this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_READER, this); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_APP, this, false); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_WEB, this, false); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this, false); + this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_READER, this, false); setEventListener("focusSearch1", "command", gApplicationsPane.focusFilterBox); diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js index 265799c1d4ca..f9f7b38a6b57 100644 --- a/browser/components/preferences/in-content/main.js +++ b/browser/components/preferences/in-content/main.js @@ -77,7 +77,7 @@ var gMainPane = { window.addEventListener("select", this); window.addEventListener("blur", this, true); - Services.obs.addObserver(this, "browser-search-engine-modified"); + Services.obs.addObserver(this, "browser-search-engine-modified", false); window.addEventListener("unload", () => { Services.obs.removeObserver(this, "browser-search-engine-modified"); }); diff --git a/browser/components/preferences/in-content/privacy.js b/browser/components/preferences/in-content/privacy.js index 20851fe1a065..d6196781c2fe 100644 --- a/browser/components/preferences/in-content/privacy.js +++ b/browser/components/preferences/in-content/privacy.js @@ -266,8 +266,8 @@ var gPrivacyPane = { } if (Services.prefs.getBoolPref("browser.storageManager.enabled")) { - Services.obs.addObserver(this, "sitedatamanager:sites-updated"); - Services.obs.addObserver(this, "sitedatamanager:updating-sites"); + Services.obs.addObserver(this, "sitedatamanager:sites-updated", false); + Services.obs.addObserver(this, "sitedatamanager:updating-sites", false); let unload = () => { window.removeEventListener("unload", unload); Services.obs.removeObserver(this, "sitedatamanager:sites-updated"); diff --git a/browser/components/preferences/in-content/sync.js b/browser/components/preferences/in-content/sync.js index 8032fb664338..c724b838caf0 100644 --- a/browser/components/preferences/in-content/sync.js +++ b/browser/components/preferences/in-content/sync.js @@ -67,7 +67,7 @@ var gSyncPane = { this._init(); }.bind(this); - Services.obs.addObserver(onReady, "weave:service:ready"); + Services.obs.addObserver(onReady, "weave:service:ready", false); window.addEventListener("unload", onUnload); xps.ensureLoaded(); diff --git a/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js b/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js index 4277b2c8bd8a..772d62d1e316 100644 --- a/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js +++ b/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js @@ -306,7 +306,7 @@ var testRunner = { let os = Cc["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService); - os.addObserver(permObserver, "perm-changed"); + os.addObserver(permObserver, "perm-changed", false); if (testRunner._currentTest == 0) { is(params.tree.view.rowCount, 0, "no cookie exceptions"); diff --git a/browser/components/preferences/permissions.js b/browser/components/preferences/permissions.js index e094baff62c4..34d340beff8e 100644 --- a/browser/components/preferences/permissions.js +++ b/browser/components/preferences/permissions.js @@ -258,7 +258,7 @@ var gPermissionManager = { }); Services.obs.notifyObservers(null, NOTIFICATION_FLUSH_PERMISSIONS, this._type); - Services.obs.addObserver(this, "perm-changed"); + Services.obs.addObserver(this, "perm-changed", false); this._loadPermissions(); diff --git a/browser/components/preferences/translation.js b/browser/components/preferences/translation.js index 7d976f32bba8..24fcfe63927a 100644 --- a/browser/components/preferences/translation.js +++ b/browser/components/preferences/translation.js @@ -108,14 +108,14 @@ var gTranslationExceptions = { this._sites.push(perm.principal.origin); } } - Services.obs.addObserver(this, "perm-changed"); + Services.obs.addObserver(this, "perm-changed", false); this._sites.sort(); this._siteTree = new Tree("sitesTree", this._sites); this.onSiteSelected(); this._langs = this.getLanguageExceptions(); - Services.prefs.addObserver(kLanguagesPref, this); + Services.prefs.addObserver(kLanguagesPref, this, false); this._langTree = new Tree("languagesTree", this._langs); this.onLanguageSelected(); }, diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js index b803e914e580..44c530011f7d 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js @@ -94,7 +94,7 @@ add_task(function* test_toggleTrackingProtection() { resolve(); }, }; - prefBranch.addObserver("enabled", prefObserver); + prefBranch.addObserver("enabled", prefObserver, false); }); let promisePrefChanged = waitForPrefChanged(); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js index 8764462625b4..09c67ab02c9f 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js @@ -38,7 +38,7 @@ function test() { "the permanent checkbox should not be checked when handling the private browsing mode"); win.close(); cleanup(); - }, "cert-exception-ui-ready"); + }, "cert-exception-ui-ready", false); } var win = pbWin.openDialog(EXCEPTIONS_DLG_URL, "", EXCEPTIONS_DLG_FEATURES, params); win.addEventListener("load", testCheckbox); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js index 742c2cae2600..731c6ed58571 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js @@ -40,7 +40,7 @@ function clearAllPlacesFavicons() { } }; - Services.obs.addObserver(observer, "places-favicons-expired"); + Services.obs.addObserver(observer, "places-favicons-expired", false); faviconService.expireAllFavicons(); }); } @@ -110,7 +110,7 @@ function observeFavicon(aIsPrivate, aExpectedCookie, aPageURI) { } }; - Services.obs.addObserver(observer, "http-on-modify-request"); + Services.obs.addObserver(observer, "http-on-modify-request", false); }); } @@ -140,8 +140,8 @@ function waitOnFaviconResponse(aFaviconURL) { } }; - Services.obs.addObserver(observer, "http-on-examine-response"); - Services.obs.addObserver(observer, "http-on-examine-cached-response"); + Services.obs.addObserver(observer, "http-on-examine-response", false); + Services.obs.addObserver(observer, "http-on-examine-cached-response", false); }); } @@ -158,7 +158,7 @@ function waitOnFaviconLoaded(aFaviconURL) { }, }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); }); } diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js index ffe451491565..891ba43b5560 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js @@ -26,8 +26,8 @@ function test() { aCallback(); } }; - Services.obs.addObserver(observerExiting, "last-pb-context-exiting"); - Services.obs.addObserver(observerExited, "last-pb-context-exited"); + Services.obs.addObserver(observerExiting, "last-pb-context-exiting", false); + Services.obs.addObserver(observerExited, "last-pb-context-exited", false); expectedExiting = true; aCloseWindow(newWin); newWin = null; diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js index ca76b48188a6..fe80a26c8a01 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js @@ -32,7 +32,7 @@ add_task(function* test() { QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); } diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js index e4925d36464e..55c238c5f318 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js @@ -57,7 +57,7 @@ add_task(function* test() { onDeleteVisits() {}, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); let win = yield BrowserTestUtils.openNewBrowserWindow(); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_ui.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_ui.js index c721e2fa9a27..1a7b83f06947 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_ui.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_ui.js @@ -42,7 +42,7 @@ function test() { windowsToClose.push(aSubject); aCallback(aSubject); }, {once: true}); - }, "domwindowopened"); + }, "domwindowopened", false); cmd = aWindow.document.getElementById("Tools:PrivateBrowsing"); var func = new Function("", cmd.getAttribute("oncommand")); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js index ca603ab3a866..b67bfc229588 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js @@ -15,7 +15,7 @@ add_task(function* test() { Services.obs.addObserver(function onLocationChange(subj, topic, data) { Services.obs.removeObserver(onLocationChange, topic); resolve(); - }, "browser-fullZoom:location-change"); + }, "browser-fullZoom:location-change", false); }); } diff --git a/browser/components/safebrowsing/content/test/head.js b/browser/components/safebrowsing/content/test/head.js index 10c7182887a7..f57add5c1f38 100644 --- a/browser/components/safebrowsing/content/test/head.js +++ b/browser/components/safebrowsing/content/test/head.js @@ -72,7 +72,7 @@ function waitForDBInit(callback) { ok(true, "Received internal event!"); callbackOnce(); } - Services.obs.addObserver(obsFunc, "mozentries-update-finished"); + Services.obs.addObserver(obsFunc, "mozentries-update-finished", false); // The second part: we might have missed the event. Just do // an internal database lookup to confirm if the url has been diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml index dc52f7004492..2fbd071cb4dd 100644 --- a/browser/components/search/content/search.xml +++ b/browser/components/search/content/search.xml @@ -75,7 +75,7 @@ // Make sure we rebuild the popup in onpopupshowing this._needToBuildPopup = true; - Services.obs.addObserver(this, "browser-search-engine-modified"); + Services.obs.addObserver(this, "browser-search-engine-modified", false); this._initialized = true; @@ -642,7 +642,7 @@ document.getBindingParent(this)._textboxInitialized = true; // Add observer for suggest preference - Services.prefs.addObserver("browser.search.suggest.enabled", this); + Services.prefs.addObserver("browser.search.suggest.enabled", this, false); ]]> { this._reloadCookies(); - }); + }, false); } }, diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm index 6c2bf0afb7ae..cd8b80f51196 100644 --- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -707,7 +707,7 @@ var SessionStoreInternal = { Services.prefs.addObserver("browser.sessionstore.debug", () => { gDebuggingEnabled = this._prefBranch.getBoolPref("sessionstore.debug"); - }); + }, false); this._max_tabs_undo = this._prefBranch.getIntPref("sessionstore.max_tabs_undo"); this._prefBranch.addObserver("sessionstore.max_tabs_undo", this, true); @@ -717,7 +717,7 @@ var SessionStoreInternal = { gResistFingerprintingEnabled = Services.prefs.getBoolPref("privacy.resistFingerprinting"); - Services.prefs.addObserver("privacy.resistFingerprinting", this); + Services.prefs.addObserver("privacy.resistFingerprinting", this, false); }, /** @@ -1282,7 +1282,7 @@ var SessionStoreInternal = { Services.obs.removeObserver(obs, topic); resolve(); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); }); // We are ready for initialization as soon as the session file has been @@ -1603,7 +1603,7 @@ var SessionStoreInternal = { Services.obs.addObserver(function obs(subject, topic) { Services.obs.removeObserver(obs, topic); resolve(); - }, "oop-frameloader-crashed"); + }, "oop-frameloader-crashed", false); }); promises.push(promiseOFC); @@ -1611,7 +1611,7 @@ var SessionStoreInternal = { Services.obs.addObserver(function obs(subject, topic) { Services.obs.removeObserver(obs, topic); resolve(); - }, "ipc:content-shutdown"); + }, "ipc:content-shutdown", false); }); promises.push(promiseICS); @@ -4778,7 +4778,7 @@ var TabRestoreQueue = { } const PREF = "browser.sessionstore.restore_on_demand"; - Services.prefs.addObserver(PREF, updateValue); + Services.prefs.addObserver(PREF, updateValue, false); return updateValue(); }, @@ -4792,7 +4792,7 @@ var TabRestoreQueue = { } const PREF = "browser.sessionstore.restore_pinned_tabs_on_demand"; - Services.prefs.addObserver(PREF, updateValue); + Services.prefs.addObserver(PREF, updateValue, false); return updateValue(); }, @@ -4806,7 +4806,7 @@ var TabRestoreQueue = { } const PREF = "browser.sessionstore.restore_hidden_tabs"; - Services.prefs.addObserver(PREF, updateValue); + Services.prefs.addObserver(PREF, updateValue, false); return updateValue(); } }, diff --git a/browser/components/sessionstore/StartupPerformance.jsm b/browser/components/sessionstore/StartupPerformance.jsm index 40dcac756895..2a6784ace0fe 100644 --- a/browser/components/sessionstore/StartupPerformance.jsm +++ b/browser/components/sessionstore/StartupPerformance.jsm @@ -59,7 +59,7 @@ this.StartupPerformance = { init() { for (let topic of OBSERVED_TOPICS) { - Services.obs.addObserver(this, topic); + Services.obs.addObserver(this, topic, false); } }, @@ -97,7 +97,7 @@ this.StartupPerformance = { Services.obs.removeObserver(this, topic); } - Services.obs.addObserver(this, "sessionstore-single-window-restored"); + Services.obs.addObserver(this, "sessionstore-single-window-restored", false); this._promiseFinished = new Promise(resolve => { this._resolveFinished = resolve; }); diff --git a/browser/components/sessionstore/content/aboutSessionRestore.js b/browser/components/sessionstore/content/aboutSessionRestore.js index 6851f25c152c..158dc0faf12a 100644 --- a/browser/components/sessionstore/content/aboutSessionRestore.js +++ b/browser/components/sessionstore/content/aboutSessionRestore.js @@ -166,7 +166,7 @@ function restoreSession() { var tabbrowser = top.gBrowser; var tabIndex = tabbrowser.getBrowserIndexForDocument(document); tabbrowser.removeTab(tabbrowser.tabs[tabIndex]); - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function startNewSession() { diff --git a/browser/components/sessionstore/content/content-sessionStore.js b/browser/components/sessionstore/content/content-sessionStore.js index 284a872d9dc6..92db67f8e7d8 100644 --- a/browser/components/sessionstore/content/content-sessionStore.js +++ b/browser/components/sessionstore/content/content-sessionStore.js @@ -473,8 +473,8 @@ var FormDataListener = { */ var PageStyleListener = { init() { - Services.obs.addObserver(this, "author-style-disabled-changed"); - Services.obs.addObserver(this, "style-sheet-applicable-state-changed"); + Services.obs.addObserver(this, "author-style-disabled-changed", false); + Services.obs.addObserver(this, "style-sheet-applicable-state-changed", false); gFrameTree.addObserver(this); }, @@ -552,7 +552,7 @@ var DocShellCapabilitiesListener = { var SessionStorageListener = { init() { addEventListener("MozSessionStorageChanged", this, true); - Services.obs.addObserver(this, "browser:purge-domain-data"); + Services.obs.addObserver(this, "browser:purge-domain-data", false); gFrameTree.addObserver(this); }, @@ -766,7 +766,7 @@ var MessageQueue = { this.timeoutDisabled = Services.prefs.getBoolPref(TIMEOUT_DISABLED_PREF); - Services.prefs.addObserver(TIMEOUT_DISABLED_PREF, this); + Services.prefs.addObserver(TIMEOUT_DISABLED_PREF, this, false); }, uninit() { diff --git a/browser/components/sessionstore/test/browser_354894_perwindowpb.js b/browser/components/sessionstore/test/browser_354894_perwindowpb.js index ce64189bcef9..f7ea03a3c0dc 100644 --- a/browser/components/sessionstore/test/browser_354894_perwindowpb.js +++ b/browser/components/sessionstore/test/browser_354894_perwindowpb.js @@ -126,7 +126,7 @@ let setupTest = Task.async(function*(options, testFunction) { } for (let o in observing) { - Services.obs.addObserver(observer, o); + Services.obs.addObserver(observer, o, false); } let private = options.private || false; diff --git a/browser/components/sessionstore/test/browser_394759_purge.js b/browser/components/sessionstore/test/browser_394759_purge.js index 711ea4f9d322..9aa49aab80b1 100644 --- a/browser/components/sessionstore/test/browser_394759_purge.js +++ b/browser/components/sessionstore/test/browser_394759_purge.js @@ -12,7 +12,7 @@ function promiseClearHistory() { resolve(); } }; - Services.obs.addObserver(observer, "browser:purge-domain-data"); + Services.obs.addObserver(observer, "browser:purge-domain-data", false); }); } diff --git a/browser/components/sessionstore/test/browser_464199.js b/browser/components/sessionstore/test/browser_464199.js index 4792fb16cada..eaadab727a32 100644 --- a/browser/components/sessionstore/test/browser_464199.js +++ b/browser/components/sessionstore/test/browser_464199.js @@ -12,7 +12,7 @@ function promiseClearHistory() { resolve(); } }; - Services.obs.addObserver(observer, "browser:purge-domain-data"); + Services.obs.addObserver(observer, "browser:purge-domain-data", false); }); } diff --git a/browser/components/sessionstore/test/browser_526613.js b/browser/components/sessionstore/test/browser_526613.js index dbf6a37dd8e1..9b09a1422ac0 100644 --- a/browser/components/sessionstore/test/browser_526613.js +++ b/browser/components/sessionstore/test/browser_526613.js @@ -64,7 +64,7 @@ function test() { finish(); } } - Services.obs.addObserver(observer, "sessionstore-browser-state-restored"); + Services.obs.addObserver(observer, "sessionstore-browser-state-restored", false); // set browser to test state ss.setBrowserState(JSON.stringify(testState)); diff --git a/browser/components/sessionstore/test/browser_586147.js b/browser/components/sessionstore/test/browser_586147.js index 4b917bc51a7d..79dbaa4ed493 100644 --- a/browser/components/sessionstore/test/browser_586147.js +++ b/browser/components/sessionstore/test/browser_586147.js @@ -7,7 +7,7 @@ function observeOneRestore(callback) { Services.obs.addObserver(function onRestore() { Services.obs.removeObserver(onRestore, topic); callback(); - }, topic); + }, topic, false); } function test() { diff --git a/browser/components/sessionstore/test/browser_589246.js b/browser/components/sessionstore/test/browser_589246.js index 2942a1d3fa3f..5e6e4f1f3a8f 100644 --- a/browser/components/sessionstore/test/browser_589246.js +++ b/browser/components/sessionstore/test/browser_589246.js @@ -143,10 +143,10 @@ function setupForTest(aConditions) { : aConditions.checkWinLin; // Add observers - Services.obs.addObserver(onLastWindowClosed, "browser-lastwindow-close-granted"); + Services.obs.addObserver(onLastWindowClosed, "browser-lastwindow-close-granted", false); // Set the state - Services.obs.addObserver(onStateRestored, "sessionstore-browser-state-restored"); + Services.obs.addObserver(onStateRestored, "sessionstore-browser-state-restored", false); ss.setBrowserState(JSON.stringify(testState)); } diff --git a/browser/components/sessionstore/test/browser_595601-restore_hidden.js b/browser/components/sessionstore/test/browser_595601-restore_hidden.js index 2c56ddccf4b9..d110e8801a88 100644 --- a/browser/components/sessionstore/test/browser_595601-restore_hidden.js +++ b/browser/components/sessionstore/test/browser_595601-restore_hidden.js @@ -58,7 +58,7 @@ function test_loadTabs(restoreHiddenTabs, callback) { var TabsProgressListener = { init(win) { this.window = win; - Services.obs.addObserver(this, "sessionstore-debug-tab-restored"); + Services.obs.addObserver(this, "sessionstore-debug-tab-restored", false); }, uninit() { diff --git a/browser/components/sessionstore/test/browser_636279.js b/browser/components/sessionstore/test/browser_636279.js index 24dbdf156987..3184cd3cbcfd 100644 --- a/browser/components/sessionstore/test/browser_636279.js +++ b/browser/components/sessionstore/test/browser_636279.js @@ -71,7 +71,7 @@ function countTabs() { var TabsProgressListener = { init() { - Services.obs.addObserver(this, "sessionstore-debug-tab-restored"); + Services.obs.addObserver(this, "sessionstore-debug-tab-restored", false); }, uninit() { diff --git a/browser/components/sessionstore/test/browser_637020.js b/browser/components/sessionstore/test/browser_637020.js index ca253bbcffc8..e1d36da8be16 100644 --- a/browser/components/sessionstore/test/browser_637020.js +++ b/browser/components/sessionstore/test/browser_637020.js @@ -34,7 +34,7 @@ add_task(function* test() { Services.obs.addObserver(function onOpened(subject) { Services.obs.removeObserver(onOpened, "domwindowopened"); resolve(subject); - }, "domwindowopened"); + }, "domwindowopened", false); }); // Set the new browser state that will diff --git a/browser/components/sessionstore/test/browser_645428.js b/browser/components/sessionstore/test/browser_645428.js index 4652df5d7204..ed55816582b5 100644 --- a/browser/components/sessionstore/test/browser_645428.js +++ b/browser/components/sessionstore/test/browser_645428.js @@ -13,7 +13,7 @@ function test() { } } - Services.obs.addObserver(observe, NOTIFICATION); + Services.obs.addObserver(observe, NOTIFICATION, false); registerCleanupFunction(function() { Services.obs.removeObserver(observe, NOTIFICATION); }); diff --git a/browser/components/sessionstore/test/browser_aboutSessionRestore.js b/browser/components/sessionstore/test/browser_aboutSessionRestore.js index 846f4b3f2bfc..306b0afcdba7 100644 --- a/browser/components/sessionstore/test/browser_aboutSessionRestore.js +++ b/browser/components/sessionstore/test/browser_aboutSessionRestore.js @@ -50,6 +50,6 @@ function waitForNewWindow() { Services.obs.addObserver(function observe(win, topic) { Services.obs.removeObserver(observe, topic); resolve(win); - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); }); } diff --git a/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_tabs.js b/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_tabs.js index c5d3eb997e93..7d548ad72b0b 100644 --- a/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_tabs.js +++ b/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_tabs.js @@ -60,7 +60,7 @@ add_task(function* test_closedObjectsChangedNotifications() { yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history", 0)); // Add an observer to count the number of notifications. - Services.obs.addObserver(countingObserver, TOPIC); + Services.obs.addObserver(countingObserver, TOPIC, false); // Open a new window. let win = yield openWindow("about:robots"); diff --git a/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_windows.js b/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_windows.js index 650d9cfeb036..1fb02eda8c73 100644 --- a/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_windows.js +++ b/browser/components/sessionstore/test/browser_closed_objects_changed_notifications_windows.js @@ -51,7 +51,7 @@ add_task(function* test_closedObjectsChangedNotifications() { yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history", 0)); // Add an observer to count the number of notifications. - Services.obs.addObserver(countingObserver, TOPIC); + Services.obs.addObserver(countingObserver, TOPIC, false); info("Opening and closing initial window."); yield openAndCloseWindow("about:robots"); diff --git a/browser/components/sessionstore/test/browser_cookies.js b/browser/components/sessionstore/test/browser_cookies.js index c80244f3b9cf..ef11eef8e692 100644 --- a/browser/components/sessionstore/test/browser_cookies.js +++ b/browser/components/sessionstore/test/browser_cookies.js @@ -14,7 +14,7 @@ function waitForCookieChanged() { Services.obs.addObserver(function observer(subj, topic, data) { Services.obs.removeObserver(observer, topic); resolve(); - }, "cookie-changed"); + }, "cookie-changed", false); }); } diff --git a/browser/components/sessionstore/test/browser_cookies_legacy.js b/browser/components/sessionstore/test/browser_cookies_legacy.js index b32757a5efaf..21b95713ee12 100644 --- a/browser/components/sessionstore/test/browser_cookies_legacy.js +++ b/browser/components/sessionstore/test/browser_cookies_legacy.js @@ -35,7 +35,7 @@ function waitForNewCookie({host, name, value}) { Services.obs.removeObserver(observer, topic); resolve(); } - }, "cookie-changed"); + }, "cookie-changed", false); }); } diff --git a/browser/components/sessionstore/test/browser_sessionStoreContainer.js b/browser/components/sessionstore/test/browser_sessionStoreContainer.js index 23995b5c024a..9ea9d27884aa 100644 --- a/browser/components/sessionstore/test/browser_sessionStoreContainer.js +++ b/browser/components/sessionstore/test/browser_sessionStoreContainer.js @@ -91,7 +91,7 @@ function waitForNewCookie() { Services.obs.removeObserver(observer, topic); resolve(); } - }, "cookie-changed"); + }, "cookie-changed", false); }); } diff --git a/browser/components/sessionstore/test/content.js b/browser/components/sessionstore/test/content.js index 2653ae856f52..a395c9f64571 100644 --- a/browser/components/sessionstore/test/content.js +++ b/browser/components/sessionstore/test/content.js @@ -112,7 +112,7 @@ addMessageListener("ss-test:enableStyleSheetsForSet", function(msg) { if (change) { // We don't want to reply until content-sessionStore.js has seen // the change. - Services.obs.addObserver(observer, "style-sheet-applicable-state-changed"); + Services.obs.addObserver(observer, "style-sheet-applicable-state-changed", false); content.document.enableStyleSheetsForSet(msg.data); } else { diff --git a/browser/components/sessionstore/test/head.js b/browser/components/sessionstore/test/head.js index a455ba34b88a..d773e7ba4d6b 100644 --- a/browser/components/sessionstore/test/head.js +++ b/browser/components/sessionstore/test/head.js @@ -230,7 +230,7 @@ function waitForTopic(aTopic, aTimeout, aCallback) { }); observing = true; - Services.obs.addObserver(observer, aTopic); + Services.obs.addObserver(observer, aTopic, false); } /** @@ -348,7 +348,7 @@ var gProgressListener = { _callback: null, setCallback(callback) { - Services.obs.addObserver(this, "sessionstore-debug-tab-restored"); + Services.obs.addObserver(this, "sessionstore-debug-tab-restored", false); this._callback = callback; }, @@ -460,7 +460,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); executeSoon(aCallback); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function promiseDelayedStartupFinished(aWindow) { return new Promise(resolve => whenDelayedStartupFinished(aWindow, resolve)); diff --git a/browser/components/sessionstore/test/unit/head.js b/browser/components/sessionstore/test/unit/head.js index 97465251407c..53fd056b423f 100644 --- a/browser/components/sessionstore/test/unit/head.js +++ b/browser/components/sessionstore/test/unit/head.js @@ -25,8 +25,8 @@ function afterSessionStartupInitialization(cb) { // Start sessionstartup initialization. let startup = Cc["@mozilla.org/browser/sessionstartup;1"]. getService(Ci.nsIObserver); - Services.obs.addObserver(startup, "final-ui-startup"); - Services.obs.addObserver(startup, "quit-application"); + Services.obs.addObserver(startup, "final-ui-startup", false); + Services.obs.addObserver(startup, "quit-application", false); Services.obs.notifyObservers(null, "final-ui-startup", ""); - Services.obs.addObserver(observer, "sessionstore-state-finalized"); + Services.obs.addObserver(observer, "sessionstore-state-finalized", false); } diff --git a/browser/components/shell/content/setDesktopBackground.js b/browser/components/shell/content/setDesktopBackground.js index 076149ee0c2b..0912f96c8911 100644 --- a/browser/components/shell/content/setDesktopBackground.js +++ b/browser/components/shell/content/setDesktopBackground.js @@ -80,7 +80,7 @@ var gSetBackground = { } else { Components.classes["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService) - .addObserver(this, "shell:desktop-background-changed"); + .addObserver(this, "shell:desktop-background-changed", false); var bundle = document.getElementById("backgroundBundle"); var setDesktopBackground = document.getElementById("setDesktopBackground"); diff --git a/browser/components/syncedtabs/SyncedTabsDeckComponent.js b/browser/components/syncedtabs/SyncedTabsDeckComponent.js index 573c01e2b0d5..ce99b10aba67 100644 --- a/browser/components/syncedtabs/SyncedTabsDeckComponent.js +++ b/browser/components/syncedtabs/SyncedTabsDeckComponent.js @@ -70,9 +70,9 @@ SyncedTabsDeckComponent.prototype = { }, init() { - Services.obs.addObserver(this, this._SyncedTabs.TOPIC_TABS_CHANGED); - Services.obs.addObserver(this, FxAccountsCommon.ONLOGIN_NOTIFICATION); - Services.obs.addObserver(this, "weave:service:login:change"); + Services.obs.addObserver(this, this._SyncedTabs.TOPIC_TABS_CHANGED, false); + Services.obs.addObserver(this, FxAccountsCommon.ONLOGIN_NOTIFICATION, false); + Services.obs.addObserver(this, "weave:service:login:change", false); // Go ahead and trigger sync this._SyncedTabs.syncTabs() diff --git a/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js b/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js index aed7be23f637..15bc22d85bb8 100644 --- a/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js +++ b/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js @@ -73,7 +73,7 @@ function waitForObserver() { return new Promise((resolve, reject) => { Services.obs.addObserver((subject, topic) => { resolve(); - }, SyncedTabs.TOPIC_TABS_CHANGED); + }, SyncedTabs.TOPIC_TABS_CHANGED, false); }); } diff --git a/browser/components/uitour/UITour.jsm b/browser/components/uitour/UITour.jsm index a492fa46e36b..6ce134146e1c 100644 --- a/browser/components/uitour/UITour.jsm +++ b/browser/components/uitour/UITour.jsm @@ -679,7 +679,7 @@ this.UITour = { } this.tourBrowsersByWindow.get(window).add(aBrowser); - Services.obs.addObserver(this, "message-manager-close"); + Services.obs.addObserver(this, "message-manager-close", false); window.addEventListener("SSWindowClosing", this); }, diff --git a/browser/components/uitour/test/browser_UITour.js b/browser/components/uitour/test/browser_UITour.js index 4ff5e222131f..501756557ae2 100644 --- a/browser/components/uitour/test/browser_UITour.js +++ b/browser/components/uitour/test/browser_UITour.js @@ -359,7 +359,7 @@ var tests = [ done(); } }; - Services.obs.addObserver(observe, "browser-search-engine-modified"); + Services.obs.addObserver(observe, "browser-search-engine-modified", false); registerCleanupFunction(() => { // Clean up Services.obs.removeObserver(observe, "browser-search-engine-modified"); diff --git a/browser/components/uitour/test/browser_UITour_detach_tab.js b/browser/components/uitour/test/browser_UITour_detach_tab.js index c4f27c543c0e..98e8d8119721 100644 --- a/browser/components/uitour/test/browser_UITour_detach_tab.js +++ b/browser/components/uitour/test/browser_UITour_detach_tab.js @@ -41,7 +41,7 @@ var tests = [ Services.obs.addObserver(function onBrowserDelayedStartup(aWindow) { Services.obs.removeObserver(onBrowserDelayedStartup, "browser-delayed-startup-finished"); browserStartupDeferred.resolve(aWindow); - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); yield ContentTask.spawn(gBrowser.selectedBrowser, myDocIdentifier, contentMyDocIdentifier => { let onVisibilityChange = () => { @@ -86,7 +86,7 @@ var tests = [ gContentAPI.hideMenu("appMenu"); gTestTab = null; - Services.obs.addObserver(onDOMWindowDestroyed, "dom-window-destroyed"); + Services.obs.addObserver(onDOMWindowDestroyed, "dom-window-destroyed", false); gContentWindow.close(); yield windowDestroyedDeferred.promise; diff --git a/browser/experiments/Experiments.jsm b/browser/experiments/Experiments.jsm index e40ef04f5f8a..126664c1ac93 100644 --- a/browser/experiments/Experiments.jsm +++ b/browser/experiments/Experiments.jsm @@ -2144,7 +2144,7 @@ this.Experiments.PreviousExperimentProvider.prototype = Object.freeze({ startup() { this._log.trace("startup()"); - Services.obs.addObserver(this, EXPERIMENTS_CHANGED_TOPIC); + Services.obs.addObserver(this, EXPERIMENTS_CHANGED_TOPIC, false); }, shutdown() { diff --git a/browser/experiments/ExperimentsService.js b/browser/experiments/ExperimentsService.js index da230879e956..28da659bb0a9 100644 --- a/browser/experiments/ExperimentsService.js +++ b/browser/experiments/ExperimentsService.js @@ -78,9 +78,9 @@ ExperimentsService.prototype = { switch (topic) { case "profile-after-change": if (gExperimentsEnabled) { - Services.obs.addObserver(this, "quit-application"); - Services.obs.addObserver(this, "sessionstore-state-finalized"); - Services.obs.addObserver(this, "EM-loaded"); + Services.obs.addObserver(this, "quit-application", false); + Services.obs.addObserver(this, "sessionstore-state-finalized", false); + Services.obs.addObserver(this, "EM-loaded", false); if (gActiveExperiment) { this._initialized = true; diff --git a/browser/experiments/test/xpcshell/test_api.js b/browser/experiments/test/xpcshell/test_api.js index 641cb01024c1..d494f7baa6dd 100644 --- a/browser/experiments/test/xpcshell/test_api.js +++ b/browser/experiments/test/xpcshell/test_api.js @@ -85,7 +85,7 @@ add_task(function* test_getExperiments() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -351,7 +351,7 @@ add_task(function* test_addonAlreadyInstalled() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -630,7 +630,7 @@ add_task(function* test_installFailure() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -761,7 +761,7 @@ add_task(function* test_userDisabledAndUpdated() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -860,7 +860,7 @@ add_task(function* test_updateActiveExperiment() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -951,7 +951,7 @@ add_task(function* test_disableActiveExperiment() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -1044,7 +1044,7 @@ add_task(function* test_freezePendingExperiment() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -1122,7 +1122,7 @@ add_task(function* test_freezeActiveExperiment() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -1202,7 +1202,7 @@ add_task(function* test_removeActiveExperiment() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -1293,7 +1293,7 @@ add_task(function* test_invalidUrl() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. @@ -1349,7 +1349,7 @@ add_task(function* test_unexpectedUninstall() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. diff --git a/browser/experiments/test/xpcshell/test_disableExperiments.js b/browser/experiments/test/xpcshell/test_disableExperiments.js index c8b33ff21d63..9b3fef99366a 100644 --- a/browser/experiments/test/xpcshell/test_disableExperiments.js +++ b/browser/experiments/test/xpcshell/test_disableExperiments.js @@ -63,7 +63,7 @@ add_task(function* test_disableExperiments() { let observerFireCount = 0; let expectedObserverFireCount = 0; let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC); + Services.obs.addObserver(observer, OBSERVER_TOPIC, false); // Dates the following tests are based on. diff --git a/browser/extensions/flyweb/bootstrap.js b/browser/extensions/flyweb/bootstrap.js index 18e65eb01df6..7e63066badd3 100644 --- a/browser/extensions/flyweb/bootstrap.js +++ b/browser/extensions/flyweb/bootstrap.js @@ -39,7 +39,7 @@ function uninstall(aData, aReason) {} function startup(aData, aReason) { // Observe pref changes and enable/disable as necessary. - Services.prefs.addObserver(FLYWEB_ENABLED_PREF, prefObserver); + Services.prefs.addObserver(FLYWEB_ENABLED_PREF, prefObserver, false); // Only initialize if pref is enabled. let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF); diff --git a/browser/extensions/formautofill/FormAutofillContent.jsm b/browser/extensions/formautofill/FormAutofillContent.jsm index 973b36236dd1..aabfe9ef1a70 100644 --- a/browser/extensions/formautofill/FormAutofillContent.jsm +++ b/browser/extensions/formautofill/FormAutofillContent.jsm @@ -178,7 +178,7 @@ let ProfileAutocomplete = { this._factory.register(AutofillProfileAutoCompleteSearch); this._registered = true; - Services.obs.addObserver(this, "autocomplete-will-enter-text"); + Services.obs.addObserver(this, "autocomplete-will-enter-text", false); }, ensureUnregistered() { diff --git a/browser/extensions/formautofill/FormAutofillParent.jsm b/browser/extensions/formautofill/FormAutofillParent.jsm index 7e266c3299a9..d716182c1df2 100644 --- a/browser/extensions/formautofill/FormAutofillParent.jsm +++ b/browser/extensions/formautofill/FormAutofillParent.jsm @@ -75,14 +75,14 @@ FormAutofillParent.prototype = { this._profileStore = new ProfileStorage(storePath); this._profileStore.initialize(); - Services.obs.addObserver(this, "advanced-pane-loaded"); + Services.obs.addObserver(this, "advanced-pane-loaded", false); Services.ppmm.addMessageListener("FormAutofill:GetProfiles", this); Services.ppmm.addMessageListener("FormAutofill:SaveProfile", this); Services.ppmm.addMessageListener("FormAutofill:RemoveProfiles", this); // Observing the pref and storage changes - Services.prefs.addObserver(ENABLED_PREF, this); - Services.obs.addObserver(this, "formautofill-storage-changed"); + Services.prefs.addObserver(ENABLED_PREF, this, false); + Services.obs.addObserver(this, "formautofill-storage-changed", false); // Force to trigger the onStatusChanged function for setting listeners properly // while initizlization diff --git a/browser/extensions/formautofill/content/manageProfiles.js b/browser/extensions/formautofill/content/manageProfiles.js index 61c831dbec16..48811c2003a5 100644 --- a/browser/extensions/formautofill/content/manageProfiles.js +++ b/browser/extensions/formautofill/content/manageProfiles.js @@ -252,7 +252,7 @@ ManageProfileDialog.prototype = { window.addEventListener("unload", this, {once: true}); this._elements.profiles.addEventListener("change", this); this._elements.controlsContainer.addEventListener("click", this); - Services.obs.addObserver(this, "formautofill-storage-changed"); + Services.obs.addObserver(this, "formautofill-storage-changed", false); }, /** diff --git a/browser/extensions/mortar/host/pdf/bootstrap.js b/browser/extensions/mortar/host/pdf/bootstrap.js index 50cde1621fb2..ef2c62bf735b 100644 --- a/browser/extensions/mortar/host/pdf/bootstrap.js +++ b/browser/extensions/mortar/host/pdf/bootstrap.js @@ -83,7 +83,7 @@ function startup(aData) { if (Services.prefs.getBoolPref(prefPdfiumEnable)) { pdfium.init(); } - Services.prefs.addObserver(prefPdfiumEnable, prefObserver); + Services.prefs.addObserver(prefPdfiumEnable, prefObserver, false); Services.ppmm.addMessageListener(messageGenerateRandomBytes, pdfium.generateRandomBytesListener); dump("<< { const prefs = Services.prefs; const prefObserver = { register: function() { - prefs.addObserver(PREF_BRANCH, this); + prefs.addObserver(PREF_BRANCH, this, false); }, unregister: function() { @@ -48,7 +48,7 @@ const prefObserver = { const appStartupObserver = { register: function() { - Services.obs.addObserver(this, "sessionstore-windows-restored"); + Services.obs.addObserver(this, "sessionstore-windows-restored", false); }, unregister: function() { diff --git a/browser/extensions/webcompat-reporter/bootstrap.js b/browser/extensions/webcompat-reporter/bootstrap.js index 1964edeac5d8..e7015b67ccba 100644 --- a/browser/extensions/webcompat-reporter/bootstrap.js +++ b/browser/extensions/webcompat-reporter/bootstrap.js @@ -27,7 +27,7 @@ let prefObserver = function(aSubject, aTopic, aData) { function startup(aData, aReason) { // Observe pref changes and enable/disable as necessary. - Services.prefs.addObserver(PREF_WC_REPORTER_ENABLED, prefObserver); + Services.prefs.addObserver(PREF_WC_REPORTER_ENABLED, prefObserver, false); // Only initialize if pref is enabled. let enabled = Services.prefs.getBoolPref(PREF_WC_REPORTER_ENABLED); diff --git a/browser/extensions/webcompat/bootstrap.js b/browser/extensions/webcompat/bootstrap.js index 05134f849089..6ff35edbd178 100644 --- a/browser/extensions/webcompat/bootstrap.js +++ b/browser/extensions/webcompat/bootstrap.js @@ -58,7 +58,7 @@ this.startup = function({webExtension}) { // breakage by accidentally toggled preferences or by leaving it off after // debugging a site. Services.prefs.clearUserPref(UA_ENABLE_PREF_NAME); - Services.prefs.addObserver(UA_ENABLE_PREF_NAME, UAEnablePrefObserver); + Services.prefs.addObserver(UA_ENABLE_PREF_NAME, UAEnablePrefObserver, false); overrider = new UAOverrider(UAOverrides); overrider.init(); diff --git a/browser/extensions/webcompat/content/lib/ua_overrider.jsm b/browser/extensions/webcompat/content/lib/ua_overrider.jsm index 556601b91f26..5b238d9fd8f9 100644 --- a/browser/extensions/webcompat/content/lib/ua_overrider.jsm +++ b/browser/extensions/webcompat/content/lib/ua_overrider.jsm @@ -35,7 +35,7 @@ class UAOverrider { } init() { - Services.obs.addObserver(this, NS_HTTP_ON_USERAGENT_REQUEST_TOPIC); + Services.obs.addObserver(this, NS_HTTP_ON_USERAGENT_REQUEST_TOPIC, false); } uninit() { diff --git a/browser/modules/BrowserUITelemetry.jsm b/browser/modules/BrowserUITelemetry.jsm index 385113ea313c..c8cc9f8b50a9 100644 --- a/browser/modules/BrowserUITelemetry.jsm +++ b/browser/modules/BrowserUITelemetry.jsm @@ -191,9 +191,9 @@ this.BrowserUITelemetry = { UITelemetry.addSimpleMeasureFunction("syncstate", this.getSyncState.bind(this)); - Services.obs.addObserver(this, "sessionstore-windows-restored"); - Services.obs.addObserver(this, "browser-delayed-startup-finished"); - Services.obs.addObserver(this, "autocomplete-did-enter-text"); + Services.obs.addObserver(this, "sessionstore-windows-restored", false); + Services.obs.addObserver(this, "browser-delayed-startup-finished", false); + Services.obs.addObserver(this, "autocomplete-did-enter-text", false); CustomizableUI.addListener(this); }, diff --git a/browser/modules/BrowserUsageTelemetry.jsm b/browser/modules/BrowserUsageTelemetry.jsm index dbb4266934c9..528f9f47e1cf 100644 --- a/browser/modules/BrowserUsageTelemetry.jsm +++ b/browser/modules/BrowserUsageTelemetry.jsm @@ -280,7 +280,7 @@ let urlbarListener = { let BrowserUsageTelemetry = { init() { - Services.obs.addObserver(this, WINDOWS_RESTORED_TOPIC); + Services.obs.addObserver(this, WINDOWS_RESTORED_TOPIC, false); urlbarListener.init(); }, @@ -470,8 +470,8 @@ let BrowserUsageTelemetry = { */ _setupAfterRestore() { // Make sure to catch new chrome windows and subsession splits. - Services.obs.addObserver(this, DOMWINDOW_OPENED_TOPIC); - Services.obs.addObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC); + Services.obs.addObserver(this, DOMWINDOW_OPENED_TOPIC, false); + Services.obs.addObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC, false); // Attach the tabopen handlers to the existing Windows. let browserEnum = Services.wm.getEnumerator("navigator:browser"); diff --git a/browser/modules/ContentCrashHandlers.jsm b/browser/modules/ContentCrashHandlers.jsm index dd2617df2bc9..0262b82cf115 100644 --- a/browser/modules/ContentCrashHandlers.jsm +++ b/browser/modules/ContentCrashHandlers.jsm @@ -60,8 +60,8 @@ this.TabCrashHandler = { return; this.initialized = true; - Services.obs.addObserver(this, "ipc:content-shutdown"); - Services.obs.addObserver(this, "oop-frameloader-crashed"); + Services.obs.addObserver(this, "ipc:content-shutdown", false); + Services.obs.addObserver(this, "oop-frameloader-crashed", false); this.pageListener = new RemotePages("about:tabcrashed"); // LOAD_BACKGROUND pages don't fire load events, so the about:tabcrashed @@ -579,8 +579,10 @@ this.UnsubmittedCrashHandler = { this.prefs.clearUserPref("suppressUntilDate"); } - Services.obs.addObserver(this, "browser-delayed-startup-finished"); - Services.obs.addObserver(this, "profile-before-change"); + Services.obs.addObserver(this, "browser-delayed-startup-finished", + false); + Services.obs.addObserver(this, "profile-before-change", + false); } }, @@ -901,9 +903,9 @@ this.PluginCrashReporter = { this.initialized = true; this.crashReports = new Map(); - Services.obs.addObserver(this, "plugin-crashed"); - Services.obs.addObserver(this, "gmp-plugin-crash"); - Services.obs.addObserver(this, "profile-after-change"); + Services.obs.addObserver(this, "plugin-crashed", false); + Services.obs.addObserver(this, "gmp-plugin-crash", false); + Services.obs.addObserver(this, "profile-after-change", false); }, uninit() { diff --git a/browser/modules/ContentObservers.js b/browser/modules/ContentObservers.js index f162724b585e..e11975b7c2bb 100644 --- a/browser/modules/ContentObservers.js +++ b/browser/modules/ContentObservers.js @@ -54,8 +54,8 @@ function getMessageManagerForWindow(aContentWindow) { } } -Services.obs.addObserver(gEMEUIObserver, "mediakeys-request"); -Services.obs.addObserver(gDecoderDoctorObserver, "decoder-doctor-notification"); +Services.obs.addObserver(gEMEUIObserver, "mediakeys-request", false); +Services.obs.addObserver(gDecoderDoctorObserver, "decoder-doctor-notification", false); // ContentWebRTC observer registration. @@ -70,11 +70,11 @@ function webRTCObserve(aSubject, aTopic, aData) { } for (let topic of kWebRTCObserverTopics) { - Services.obs.addObserver(webRTCObserve, topic); + Services.obs.addObserver(webRTCObserve, topic, false); } if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) - Services.obs.addObserver(processShutdown, "content-child-shutdown"); + Services.obs.addObserver(processShutdown, "content-child-shutdown", false); function processShutdown() { for (let topic of kWebRTCObserverTopics) { diff --git a/browser/modules/ContentSearch.jsm b/browser/modules/ContentSearch.jsm index 2258db94939a..4ff6f6bbc5e9 100644 --- a/browser/modules/ContentSearch.jsm +++ b/browser/modules/ContentSearch.jsm @@ -112,9 +112,9 @@ this.ContentSearch = { Cc["@mozilla.org/globalmessagemanager;1"]. getService(Ci.nsIMessageListenerManager). addMessageListener(INBOUND_MESSAGE, this); - Services.obs.addObserver(this, "browser-search-engine-modified"); - Services.obs.addObserver(this, "shutdown-leaks-before-check"); - Services.prefs.addObserver("browser.search.hiddenOneOffs", this); + Services.obs.addObserver(this, "browser-search-engine-modified", false); + Services.obs.addObserver(this, "shutdown-leaks-before-check", false); + Services.prefs.addObserver("browser.search.hiddenOneOffs", this, false); this._stringBundle = Services.strings.createBundle("chrome://global/locale/autocomplete.properties"); }, diff --git a/browser/modules/DirectoryLinksProvider.jsm b/browser/modules/DirectoryLinksProvider.jsm index dffc7b5601d7..95fc157b1aaa 100644 --- a/browser/modules/DirectoryLinksProvider.jsm +++ b/browser/modules/DirectoryLinksProvider.jsm @@ -250,7 +250,7 @@ var DirectoryLinksProvider = { _addPrefsObserver: function DirectoryLinksProvider_addObserver() { for (let pref in this._observedPrefs) { let prefName = this._observedPrefs[pref]; - Services.prefs.addObserver(prefName, this); + Services.prefs.addObserver(prefName, this, false); } }, diff --git a/browser/modules/ExtensionsUI.jsm b/browser/modules/ExtensionsUI.jsm index 3519578e4108..9f78fa4ba40e 100644 --- a/browser/modules/ExtensionsUI.jsm +++ b/browser/modules/ExtensionsUI.jsm @@ -38,10 +38,10 @@ this.ExtensionsUI = { init() { this.histogram = Services.telemetry.getHistogramById("EXTENSION_INSTALL_PROMPT_RESULT"); - Services.obs.addObserver(this, "webextension-permission-prompt"); - Services.obs.addObserver(this, "webextension-update-permissions"); - Services.obs.addObserver(this, "webextension-install-notify"); - Services.obs.addObserver(this, "webextension-optional-permission-prompt"); + Services.obs.addObserver(this, "webextension-permission-prompt", false); + Services.obs.addObserver(this, "webextension-update-permissions", false); + Services.obs.addObserver(this, "webextension-install-notify", false); + Services.obs.addObserver(this, "webextension-optional-permission-prompt", false); this._checkForSideloaded(); }, diff --git a/browser/modules/FormSubmitObserver.jsm b/browser/modules/FormSubmitObserver.jsm index df7182679150..3434eedb2186 100644 --- a/browser/modules/FormSubmitObserver.jsm +++ b/browser/modules/FormSubmitObserver.jsm @@ -51,7 +51,7 @@ FormSubmitObserver.prototype = // nsIFormSubmitObserver callback about invalid forms. See HTMLFormElement // for details. - Services.obs.addObserver(this, "invalidformsubmit"); + Services.obs.addObserver(this, "invalidformsubmit", false); this._tab.addEventListener("pageshow", this); this._tab.addEventListener("unload", this); }, diff --git a/browser/modules/FullZoomUI.jsm b/browser/modules/FullZoomUI.jsm index 725bf1dd16ad..7e1942199d88 100644 --- a/browser/modules/FullZoomUI.jsm +++ b/browser/modules/FullZoomUI.jsm @@ -29,7 +29,7 @@ function fullZoomLocationChangeObserver(aSubject, aTopic) { } updateZoomUI(aSubject, false); } -Services.obs.addObserver(fullZoomLocationChangeObserver, "browser-fullZoom:location-change"); +Services.obs.addObserver(fullZoomLocationChangeObserver, "browser-fullZoom:location-change", false); function onEndSwapDocShells(event) { updateZoomUI(event.originalTarget); diff --git a/browser/modules/PluginContent.jsm b/browser/modules/PluginContent.jsm index 39c0185ef5b2..7ec6b7c8d358 100644 --- a/browser/modules/PluginContent.jsm +++ b/browser/modules/PluginContent.jsm @@ -59,7 +59,7 @@ PluginContent.prototype = { global.addMessageListener("BrowserPlugins:CrashReportSubmitted", this); global.addMessageListener("BrowserPlugins:Test:ClearCrashData", this); - Services.obs.addObserver(this, "decoder-doctor-notification"); + Services.obs.addObserver(this, "decoder-doctor-notification", false); }, uninit() { diff --git a/browser/modules/ProcessHangMonitor.jsm b/browser/modules/ProcessHangMonitor.jsm index f3619b29ad78..8f439f4335c6 100644 --- a/browser/modules/ProcessHangMonitor.jsm +++ b/browser/modules/ProcessHangMonitor.jsm @@ -50,9 +50,9 @@ var ProcessHangMonitor = { * Initialize hang reporting. Called once in the parent process. */ init() { - Services.obs.addObserver(this, "process-hang-report"); - Services.obs.addObserver(this, "clear-hang-report"); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "process-hang-report", false); + Services.obs.addObserver(this, "clear-hang-report", false); + Services.obs.addObserver(this, "xpcom-shutdown", false); Services.ww.registerNotification(this); }, diff --git a/browser/modules/SelfSupportBackend.jsm b/browser/modules/SelfSupportBackend.jsm index 15dff65478ec..c9abf4709ba5 100644 --- a/browser/modules/SelfSupportBackend.jsm +++ b/browser/modules/SelfSupportBackend.jsm @@ -83,7 +83,7 @@ var SelfSupportBackendInternal = { this._log.trace("init"); - Services.prefs.addObserver(PREF_BRANCH_LOG, this); + Services.prefs.addObserver(PREF_BRANCH_LOG, this, false); // Only allow to use SelfSupport if Unified Telemetry is enabled. let reportingEnabled = IS_UNIFIED_TELEMETRY; @@ -105,7 +105,7 @@ var SelfSupportBackendInternal = { return; } - Services.obs.addObserver(this, "sessionstore-windows-restored"); + Services.obs.addObserver(this, "sessionstore-windows-restored", false); }, /** diff --git a/browser/modules/SocialService.jsm b/browser/modules/SocialService.jsm index e386ada8c469..253f40d2af3f 100644 --- a/browser/modules/SocialService.jsm +++ b/browser/modules/SocialService.jsm @@ -317,7 +317,7 @@ function initService() { ActiveProviders.flush(); SocialService._providerListeners = null; Services.obs.removeObserver(xpcomShutdown, "xpcom-shutdown"); - }, "xpcom-shutdown"); + }, "xpcom-shutdown", false); try { migrateSettings(); diff --git a/browser/modules/WindowsJumpLists.jsm b/browser/modules/WindowsJumpLists.jsm index c2ad908dc755..8e69d6115c41 100644 --- a/browser/modules/WindowsJumpLists.jsm +++ b/browser/modules/WindowsJumpLists.jsm @@ -493,9 +493,9 @@ this.WinTaskbarJumpList = // If the browser is closed while in private browsing mode, the "exit" // notification is fired on quit-application-granted. // History cleanup can happen at profile-change-teardown. - Services.obs.addObserver(this, "profile-before-change"); - Services.obs.addObserver(this, "browser:purge-session-history"); - _prefs.addObserver("", this); + Services.obs.addObserver(this, "profile-before-change", false); + Services.obs.addObserver(this, "browser:purge-session-history", false); + _prefs.addObserver("", this, false); }, _freeObs: function WTBJL__freeObs() { diff --git a/browser/modules/test/browser/browser_BrowserUITelemetry_syncedtabs.js b/browser/modules/test/browser/browser_BrowserUITelemetry_syncedtabs.js index 5f965ccb6e3a..d9ea70668194 100644 --- a/browser/modules/test/browser/browser_BrowserUITelemetry_syncedtabs.js +++ b/browser/modules/test/browser/browser_BrowserUITelemetry_syncedtabs.js @@ -53,7 +53,7 @@ function promiseTabsUpdated() { Services.obs.addObserver(function onNotification(aSubject, aTopic, aData) { Services.obs.removeObserver(onNotification, aTopic); resolve(); - }, "synced-tabs-menu:test:tabs-updated"); + }, "synced-tabs-menu:test:tabs-updated", false); }); } diff --git a/browser/modules/test/browser/browser_ContentSearch.js b/browser/modules/test/browser/browser_ContentSearch.js index 974aff13702b..e1cda0fcf370 100644 --- a/browser/modules/test/browser/browser_ContentSearch.js +++ b/browser/modules/test/browser/browser_ContentSearch.js @@ -65,7 +65,7 @@ add_task(function* SetCurrentEngine() { Services.obs.removeObserver(obs, "browser-search-engine-modified"); deferred.resolve(); } - }, "browser-search-engine-modified"); + }, "browser-search-engine-modified", false); let searchPromise = waitForTestMsg("CurrentEngine"); info("Waiting for test to observe engine-current..."); yield deferred.promise; @@ -195,7 +195,7 @@ add_task(function* GetSuggestions_AddFormHistoryEntry_RemoveFormHistoryEntry() { Services.obs.removeObserver(onAdd, "satchel-storage-changed"); executeSoon(() => deferred.resolve()); } - }, "satchel-storage-changed"); + }, "satchel-storage-changed", false); yield deferred.promise; // Send GetSuggestions using the test engine. Its suggestions should appear @@ -231,7 +231,7 @@ add_task(function* GetSuggestions_AddFormHistoryEntry_RemoveFormHistoryEntry() { Services.obs.removeObserver(onRemove, "satchel-storage-changed"); executeSoon(() => deferred.resolve()); } - }, "satchel-storage-changed"); + }, "satchel-storage-changed", false); yield deferred.promise; // Send GetSuggestions again. diff --git a/browser/modules/test/browser/browser_UsageTelemetry_private_and_restore.js b/browser/modules/test/browser/browser_UsageTelemetry_private_and_restore.js index a7ca4854e9f2..d22479451a50 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_private_and_restore.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_private_and_restore.js @@ -16,7 +16,7 @@ function promiseBrowserStateRestored() { Services.obs.addObserver(function observer(aSubject, aTopic) { Services.obs.removeObserver(observer, "sessionstore-browser-state-restored"); resolve(); - }, "sessionstore-browser-state-restored"); + }, "sessionstore-browser-state-restored", false); }); } diff --git a/browser/modules/test/unit/social/head.js b/browser/modules/test/unit/social/head.js index 64ec89fb6385..6483c07ed50b 100644 --- a/browser/modules/test/unit/social/head.js +++ b/browser/modules/test/unit/social/head.js @@ -66,7 +66,7 @@ function do_wait_observer(obsTopic, cb) { Services.obs.removeObserver(observer, topic); cb(); } - Services.obs.addObserver(observer, obsTopic); + Services.obs.addObserver(observer, obsTopic, false); } function do_add_providers(cb) { diff --git a/browser/modules/webrtcUI.jsm b/browser/modules/webrtcUI.jsm index 03cd9847bbe2..6d856a977502 100644 --- a/browser/modules/webrtcUI.jsm +++ b/browser/modules/webrtcUI.jsm @@ -34,7 +34,7 @@ this.webrtcUI = { emitter: new EventEmitter(), init() { - Services.obs.addObserver(maybeAddMenuIndicator, "browser-delayed-startup-finished"); + Services.obs.addObserver(maybeAddMenuIndicator, "browser-delayed-startup-finished", false); let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"] .getService(Ci.nsIMessageBroadcaster); diff --git a/devtools/client/aboutdebugging/components/addons/panel.js b/devtools/client/aboutdebugging/components/addons/panel.js index 451335151c89..333aa283cf78 100644 --- a/devtools/client/aboutdebugging/components/addons/panel.js +++ b/devtools/client/aboutdebugging/components/addons/panel.js @@ -43,9 +43,9 @@ module.exports = createClass({ AddonManager.addAddonListener(this); Services.prefs.addObserver(CHROME_ENABLED_PREF, - this.updateDebugStatus); + this.updateDebugStatus, false); Services.prefs.addObserver(REMOTE_ENABLED_PREF, - this.updateDebugStatus); + this.updateDebugStatus, false); this.updateDebugStatus(); this.updateAddonsList(); diff --git a/devtools/client/aboutdebugging/components/workers/panel.js b/devtools/client/aboutdebugging/components/workers/panel.js index 0737dcf807be..ee6d47efb94c 100644 --- a/devtools/client/aboutdebugging/components/workers/panel.js +++ b/devtools/client/aboutdebugging/components/workers/panel.js @@ -58,7 +58,7 @@ module.exports = createClass({ client.addListener("processListChanged", this.updateWorkers); client.addListener("registration-changed", this.updateWorkers); - Services.prefs.addObserver(PROCESS_COUNT_PREF, this.updateMultiE10S); + Services.prefs.addObserver(PROCESS_COUNT_PREF, this.updateMultiE10S, false); this.updateMultiE10S(); this.updateWorkers(); diff --git a/devtools/client/aboutdebugging/test/browser_addons_debug_bootstrapped.js b/devtools/client/aboutdebugging/test/browser_addons_debug_bootstrapped.js index cbe15466accf..4e184849ffde 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_debug_bootstrapped.js +++ b/devtools/client/aboutdebugging/test/browser_addons_debug_bootstrapped.js @@ -46,7 +46,7 @@ add_task(function* () { Services.obs.addObserver(function listener() { Services.obs.removeObserver(listener, "addon-console-works"); done(); - }, "addon-console-works"); + }, "addon-console-works", false); }); // Be careful, this JS function is going to be executed in the addon toolbox, diff --git a/devtools/client/aboutdebugging/test/browser_addons_debug_webextension.js b/devtools/client/aboutdebugging/test/browser_addons_debug_webextension.js index c8aeff5413a0..7928f0305eeb 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_debug_webextension.js +++ b/devtools/client/aboutdebugging/test/browser_addons_debug_webextension.js @@ -33,7 +33,7 @@ add_task(function* testWebExtensionsToolboxWebConsole() { } Services.obs.removeObserver(listener, "console-api-log-event"); done(apiMessage.arguments); - }, "console-api-log-event"); + }, "console-api-log-event", false); }); // Be careful, this JS function is going to be executed in the addon toolbox, diff --git a/devtools/client/aboutdebugging/test/browser_addons_debug_webextension_popup.js b/devtools/client/aboutdebugging/test/browser_addons_debug_webextension_popup.js index 2dda95cd4e09..27db19122ca0 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_debug_webextension_popup.js +++ b/devtools/client/aboutdebugging/test/browser_addons_debug_webextension_popup.js @@ -52,7 +52,7 @@ add_task(function* testWebExtensionsToolboxSwitchToPopup() { Services.obs.removeObserver(listener, "console-api-log-event"); done(); } - }, "console-api-log-event"); + }, "console-api-log-event", false); }); // Be careful, this JS function is going to be executed in the addon toolbox, @@ -156,7 +156,7 @@ add_task(function* testWebExtensionsToolboxSwitchToPopup() { Services.obs.removeObserver(listener, "console-api-log-event"); done(apiMessage.arguments); } - }, "console-api-log-event"); + }, "console-api-log-event", false); }); let onToolboxClose = BrowserToolboxProcess.once("close"); diff --git a/devtools/client/aboutdebugging/test/browser_addons_reload.js b/devtools/client/aboutdebugging/test/browser_addons_reload.js index 0474f9b45055..4fb7a48c21f9 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_reload.js +++ b/devtools/client/aboutdebugging/test/browser_addons_reload.js @@ -125,7 +125,7 @@ add_task(function* reloadButtonReloadsAddon() { Services.obs.removeObserver(listener, ADDON_NAME); info("Add-on was re-installed: " + ADDON_NAME); done(); - }, ADDON_NAME); + }, ADDON_NAME, false); }); reloadButton.click(); diff --git a/devtools/client/aboutdebugging/test/head.js b/devtools/client/aboutdebugging/test/head.js index 6eb248facf22..8ea562fe1d1a 100644 --- a/devtools/client/aboutdebugging/test/head.js +++ b/devtools/client/aboutdebugging/test/head.js @@ -193,7 +193,7 @@ function* installAddon({document, path, name, isWebExtension}) { Services.obs.removeObserver(listener, "test-devtools"); done(); - }, "test-devtools"); + }, "test-devtools", false); }); } // Trigger the file picker by clicking on the button @@ -360,7 +360,7 @@ function waitForDelayedStartupFinished(win) { Services.obs.removeObserver(observer, topic); resolve(); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); }); } diff --git a/devtools/client/commandline/test/browser_cmd_calllog.js b/devtools/client/commandline/test/browser_cmd_calllog.js index eabd70512dd5..ebe10165fa65 100644 --- a/devtools/client/commandline/test/browser_cmd_calllog.js +++ b/devtools/client/commandline/test/browser_cmd_calllog.js @@ -88,7 +88,7 @@ tests.testCallLogExec = function (options) { deferred.resolve(); }); }; - Services.obs.addObserver(onWebConsoleOpen, "web-console-created"); + Services.obs.addObserver(onWebConsoleOpen, "web-console-created", false); helpers.audit(options, [ { diff --git a/devtools/client/commandline/test/browser_cmd_calllog_chrome.js b/devtools/client/commandline/test/browser_cmd_calllog_chrome.js index ddb236f71768..81d2dfd54492 100644 --- a/devtools/client/commandline/test/browser_cmd_calllog_chrome.js +++ b/devtools/client/commandline/test/browser_cmd_calllog_chrome.js @@ -95,7 +95,7 @@ tests.testCallLogExec = function (options) { deferred.resolve(); }); } - Services.obs.addObserver(onWebConsoleOpen, "web-console-created"); + Services.obs.addObserver(onWebConsoleOpen, "web-console-created", false); helpers.audit(options, [ { diff --git a/devtools/client/commandline/test/head.js b/devtools/client/commandline/test/head.js index 7e0a3042365a..a987c37c3a62 100644 --- a/devtools/client/commandline/test/head.js +++ b/devtools/client/commandline/test/head.js @@ -30,7 +30,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); executeSoon(aCallback); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } /** diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js index 2f1716f2040b..39d0dfc35281 100644 --- a/devtools/client/debugger/new/debugger.js +++ b/devtools/client/debugger/new/debugger.js @@ -14548,7 +14548,7 @@ return /******/ (function(modules) { // webpackBootstrap return { register: function() { this._branch = Services.prefs.getBranch(prefsRoot + "."); - this._branch.addObserver("", this); + this._branch.addObserver("", this, false); }, unregister: function() { this._branch.removeObserver("", this); diff --git a/devtools/client/debugger/new/integration-tests.js b/devtools/client/debugger/new/integration-tests.js index 98fdf6d7ef42..b19be55e50f1 100644 --- a/devtools/client/debugger/new/integration-tests.js +++ b/devtools/client/debugger/new/integration-tests.js @@ -865,57 +865,57 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - - const React = __webpack_require__(2); - const ReactDOM = __webpack_require__(31); - const { DOM: dom, PropTypes } = React; - - const Draggable = React.createClass({ - displayName: "Draggable", - - propTypes: { - onMove: PropTypes.func.isRequired, - onStart: PropTypes.func, - onStop: PropTypes.func, - style: PropTypes.object, - className: PropTypes.string - }, - - startDragging(ev) { - ev.preventDefault(); - const doc = ReactDOM.findDOMNode(this).ownerDocument; - doc.addEventListener("mousemove", this.onMove); - doc.addEventListener("mouseup", this.onUp); - this.props.onStart && this.props.onStart(); - }, - - onMove(ev) { - ev.preventDefault(); - // Use screen coordinates so, moving mouse over iframes - // doesn't mangle (relative) coordinates. - this.props.onMove(ev.screenX, ev.screenY); - }, - - onUp(ev) { - ev.preventDefault(); - const doc = ReactDOM.findDOMNode(this).ownerDocument; - doc.removeEventListener("mousemove", this.onMove); - doc.removeEventListener("mouseup", this.onUp); - this.props.onStop && this.props.onStop(); - }, - - render() { - return dom.div({ - style: this.props.style, - className: this.props.className, - onMouseDown: this.startDragging - }); - } - }); - - module.exports = Draggable; + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + + const React = __webpack_require__(2); + const ReactDOM = __webpack_require__(31); + const { DOM: dom, PropTypes } = React; + + const Draggable = React.createClass({ + displayName: "Draggable", + + propTypes: { + onMove: PropTypes.func.isRequired, + onStart: PropTypes.func, + onStop: PropTypes.func, + style: PropTypes.object, + className: PropTypes.string + }, + + startDragging(ev) { + ev.preventDefault(); + const doc = ReactDOM.findDOMNode(this).ownerDocument; + doc.addEventListener("mousemove", this.onMove); + doc.addEventListener("mouseup", this.onUp); + this.props.onStart && this.props.onStart(); + }, + + onMove(ev) { + ev.preventDefault(); + // Use screen coordinates so, moving mouse over iframes + // doesn't mangle (relative) coordinates. + this.props.onMove(ev.screenX, ev.screenY); + }, + + onUp(ev) { + ev.preventDefault(); + const doc = ReactDOM.findDOMNode(this).ownerDocument; + doc.removeEventListener("mousemove", this.onMove); + doc.removeEventListener("mouseup", this.onUp); + this.props.onStop && this.props.onStop(); + }, + + render() { + return dom.div({ + style: this.props.style, + className: this.props.className, + onMouseDown: this.startDragging + }); + } + }); + + module.exports = Draggable; /***/ }, @@ -8874,16 +8874,16 @@ return /******/ (function(modules) { // webpackBootstrap /* 51 */ /***/ function(module, exports) { - module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - module.webpackPolyfill = 1; - } - return module; - } + module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; + } /***/ }, @@ -13386,7 +13386,7 @@ return /******/ (function(modules) { // webpackBootstrap return { register: function() { this._branch = Services.prefs.getBranch(prefsRoot + "."); - this._branch.addObserver("", this); + this._branch.addObserver("", this, false); }, unregister: function() { this._branch.removeObserver("", this); diff --git a/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js b/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js index 0d80f46d2182..fc00b60a1e0e 100644 --- a/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js +++ b/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js @@ -10,4 +10,4 @@ var observer = { once("sdk:loader:destroy", () => observerService.removeObserver(observer, "debuggerAttached")); -observerService.addObserver(observer, "debuggerAttached"); +observerService.addObserver(observer, "debuggerAttached", false); diff --git a/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon4/bootstrap.js b/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon4/bootstrap.js index 8a3fb9cf417a..e8bb9fcce3cd 100644 --- a/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon4/bootstrap.js +++ b/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon4/bootstrap.js @@ -21,7 +21,7 @@ function startup(aParams, aReason) { // Log objects so makeDebuggeeValue can get the global to use console.log({ msg: "Hello from the test add-on" }); - Services.obs.addObserver(notify, "addon-test-ping"); + Services.obs.addObserver(notify, "addon-test-ping", false); } function shutdown(aParams, aReason) { diff --git a/devtools/client/definitions.js b/devtools/client/definitions.js index 6cbc8bcf9f06..f044d52fdb54 100644 --- a/devtools/client/definitions.js +++ b/devtools/client/definitions.js @@ -177,7 +177,8 @@ switchDebugger(); Services.prefs.addObserver( "devtools.debugger.new-debugger-frontend", - { observe: switchDebugger } + { observe: switchDebugger }, + false ); Tools.styleEditor = { diff --git a/devtools/client/devtools-startup.js b/devtools/client/devtools-startup.js index 5e96b712cc7a..87c3f96dce6b 100644 --- a/devtools/client/devtools-startup.js +++ b/devtools/client/devtools-startup.js @@ -58,7 +58,8 @@ DevToolsStartup.prototype = { this.handleDevToolsFlag(window); } }.bind(this); - Services.obs.addObserver(onStartup, "browser-delayed-startup-finished"); + Services.obs.addObserver(onStartup, "browser-delayed-startup-finished", + false); }, initDevTools: function () { @@ -131,7 +132,7 @@ DevToolsStartup.prototype = { devtoolsThreadResumed = true; Services.obs.removeObserver(observe, "devtools-thread-resumed"); }; - Services.obs.addObserver(observe, "devtools-thread-resumed"); + Services.obs.addObserver(observe, "devtools-thread-resumed", false); } const { BrowserToolboxProcess } = Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {}); diff --git a/devtools/client/framework/ToolboxProcess.jsm b/devtools/client/framework/ToolboxProcess.jsm index 486d192c152c..46e7f6b76f8d 100644 --- a/devtools/client/framework/ToolboxProcess.jsm +++ b/devtools/client/framework/ToolboxProcess.jsm @@ -71,7 +71,7 @@ this.BrowserToolboxProcess = function BrowserToolboxProcess(onClose, onRun, opti this._telemetry = new Telemetry(); this.close = this.close.bind(this); - Services.obs.addObserver(this.close, "quit-application"); + Services.obs.addObserver(this.close, "quit-application", false); this._initServer(); this._initProfile(); this._create(); @@ -331,6 +331,6 @@ Services.prefs.addObserver("devtools.debugger.log", { observe: (...args) => { wantLogging = Services.prefs.getBoolPref(args.pop()); } -}); +}, false); Services.obs.notifyObservers(null, "ToolboxProcessLoaded", null); diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js index 51ca8278deb8..105ba39bfa34 100644 --- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -217,7 +217,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { ensurePrefObserver: function () { if (!this._prefObserverRegistered) { this._prefObserverRegistered = true; - Services.prefs.addObserver("devtools.", this); + Services.prefs.addObserver("devtools.", this, false); } }, @@ -867,11 +867,11 @@ gDevTools.on("tool-unregistered", function (ev, toolId) { gDevTools.on("toolbox-ready", gDevToolsBrowser._updateMenuCheckbox); gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox); -Services.obs.addObserver(gDevToolsBrowser, "quit-application"); -Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished"); +Services.obs.addObserver(gDevToolsBrowser, "quit-application", false); +Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished", false); // Watch for module loader unload. Fires when the tools are reloaded. -Services.obs.addObserver(gDevToolsBrowser, "sdk:loader:destroy"); -Services.obs.addObserver(gDevToolsBrowser, "lightweight-theme-changed"); +Services.obs.addObserver(gDevToolsBrowser, "sdk:loader:destroy", false); +Services.obs.addObserver(gDevToolsBrowser, "lightweight-theme-changed", false); // Fake end of browser window load event for all already opened windows // that is already fully loaded. diff --git a/devtools/client/framework/test/browser_browser_toolbox.js b/devtools/client/framework/test/browser_browser_toolbox.js index 6325627a1044..08c8ac190453 100644 --- a/devtools/client/framework/test/browser_browser_toolbox.js +++ b/devtools/client/framework/test/browser_browser_toolbox.js @@ -27,7 +27,7 @@ add_task(function* runTest() { Services.obs.addObserver(function listener() { Services.obs.removeObserver(listener, "browser-toolbox-console-works"); done(); - }, "browser-toolbox-console-works"); + }, "browser-toolbox-console-works", false); }); // Be careful, this JS function is going to be executed in the addon toolbox, diff --git a/devtools/client/framework/test/shared-head.js b/devtools/client/framework/test/shared-head.js index 8faabd264b3d..1d7ad4fe0cce 100644 --- a/devtools/client/framework/test/shared-head.js +++ b/devtools/client/framework/test/shared-head.js @@ -73,7 +73,7 @@ const ConsoleObserver = { } }; -Services.obs.addObserver(ConsoleObserver, "console-api-log-event"); +Services.obs.addObserver(ConsoleObserver, "console-api-log-event", false); registerCleanupFunction(() => { Services.obs.removeObserver(ConsoleObserver, "console-api-log-event"); }); diff --git a/devtools/client/framework/toolbox-options.js b/devtools/client/framework/toolbox-options.js index 393dc217450a..0584252b703d 100644 --- a/devtools/client/framework/toolbox-options.js +++ b/devtools/client/framework/toolbox-options.js @@ -98,8 +98,8 @@ OptionsPanel.prototype = { }), _addListeners: function () { - Services.prefs.addObserver("devtools.cache.disabled", this._prefChanged); - Services.prefs.addObserver("devtools.theme", this._prefChanged); + Services.prefs.addObserver("devtools.cache.disabled", this._prefChanged, false); + Services.prefs.addObserver("devtools.theme", this._prefChanged, false); gDevTools.on("theme-registered", this._themeRegistered); gDevTools.on("theme-unregistered", this._themeUnregistered); }, diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js index eaf64a444493..00c6c57cf412 100644 --- a/devtools/client/framework/toolbox.js +++ b/devtools/client/framework/toolbox.js @@ -422,9 +422,10 @@ Toolbox.prototype = { this.isReady = true; let framesPromise = this._listFrames(); - Services.prefs.addObserver("devtools.cache.disabled", this._applyCacheSettings); + Services.prefs.addObserver("devtools.cache.disabled", this._applyCacheSettings, + false); Services.prefs.addObserver("devtools.serviceWorkers.testing.enabled", - this._applyServiceWorkersTestingSettings); + this._applyServiceWorkersTestingSettings, false); this.textBoxContextMenuPopup = this.doc.getElementById("toolbox-textbox-context-popup"); @@ -2417,7 +2418,7 @@ Toolbox.prototype = { }; let topic = "shutdown-leaks-before-check"; - Services.obs.addObserver(leakCheckObserver, topic); + Services.obs.addObserver(leakCheckObserver, topic, false); this._destroyer.then(() => { Services.obs.removeObserver(leakCheckObserver, topic); }); diff --git a/devtools/client/jsonview/converter-observer.js b/devtools/client/jsonview/converter-observer.js index 17b591a715c2..6f2ff5a6e850 100644 --- a/devtools/client/jsonview/converter-observer.js +++ b/devtools/client/jsonview/converter-observer.js @@ -139,8 +139,8 @@ ConverterObserver.prototype = { this.register(); } - Services.prefs.addObserver(JSON_VIEW_PREF, this); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.prefs.addObserver(JSON_VIEW_PREF, this, false); + Services.obs.addObserver(this, "xpcom-shutdown", false); }, observe: function (subject, topic, data) { diff --git a/devtools/client/performance/test/helpers/event-utils.js b/devtools/client/performance/test/helpers/event-utils.js index d4311b4b6a6d..aa184accc5bb 100644 --- a/devtools/client/performance/test/helpers/event-utils.js +++ b/devtools/client/performance/test/helpers/event-utils.js @@ -109,6 +109,6 @@ exports.observeTimes = function (notificationName, receiveCount, options = {}) { Services.obs.removeObserver(onObserve, topic); resolve(data); } - }, notificationName); + }, notificationName, false); }); }; diff --git a/devtools/client/performance/test/helpers/prefs.js b/devtools/client/performance/test/helpers/prefs.js index ccc77afbca8e..4d17afe12e64 100644 --- a/devtools/client/performance/test/helpers/prefs.js +++ b/devtools/client/performance/test/helpers/prefs.js @@ -58,7 +58,7 @@ exports.whenUnknownPrefChanged = function (branch, callback) { callback(data); } } - Services.prefs.addObserver(branch, onObserve); + Services.prefs.addObserver(branch, onObserve, false); return () => Services.prefs.removeObserver(branch, onObserve); }; diff --git a/devtools/client/projecteditor/test/browser_projecteditor_confirm_unsaved.js b/devtools/client/projecteditor/test/browser_projecteditor_confirm_unsaved.js index 405f80c837e7..72640d243c80 100644 --- a/devtools/client/projecteditor/test/browser_projecteditor_confirm_unsaved.js +++ b/devtools/client/projecteditor/test/browser_projecteditor_confirm_unsaved.js @@ -37,8 +37,8 @@ function checkConfirmYes(projecteditor, container) { aSubject.Dialog.ui.button0.click(); } - Services.obs.addObserver(confirmYes, "common-dialog-loaded"); - Services.obs.addObserver(confirmYes, "tabmodal-dialog-loaded"); + Services.obs.addObserver(confirmYes, "common-dialog-loaded", false); + Services.obs.addObserver(confirmYes, "tabmodal-dialog-loaded", false); ok(projecteditor.hasUnsavedResources, "There are unsaved resources"); ok(projecteditor.confirmUnsaved(), "When there are unsaved changes, clicking OK makes confirmUnsaved() true"); @@ -52,8 +52,8 @@ function checkConfirmNo(projecteditor, container) { aSubject.Dialog.ui.button1.click(); } - Services.obs.addObserver(confirmNo, "common-dialog-loaded"); - Services.obs.addObserver(confirmNo, "tabmodal-dialog-loaded"); + Services.obs.addObserver(confirmNo, "common-dialog-loaded", false); + Services.obs.addObserver(confirmNo, "tabmodal-dialog-loaded", false); ok(projecteditor.hasUnsavedResources, "There are unsaved resources"); ok(!projecteditor.confirmUnsaved(), "When there are unsaved changes, clicking cancel makes confirmUnsaved() false"); diff --git a/devtools/client/projecteditor/test/browser_projecteditor_delete_file.js b/devtools/client/projecteditor/test/browser_projecteditor_delete_file.js index f494dc44146f..446c1dbcbd9f 100644 --- a/devtools/client/projecteditor/test/browser_projecteditor_delete_file.js +++ b/devtools/client/projecteditor/test/browser_projecteditor_delete_file.js @@ -72,8 +72,8 @@ function deleteWithContextMenu(projecteditor, container) { aSubject.Dialog.ui.button0.click(); } - Services.obs.addObserver(onConfirmShown, "common-dialog-loaded"); - Services.obs.addObserver(onConfirmShown, "tabmodal-dialog-loaded"); + Services.obs.addObserver(onConfirmShown, "common-dialog-loaded", false); + Services.obs.addObserver(onConfirmShown, "tabmodal-dialog-loaded", false); deleteCommand.click(); popup.hidePopup(); diff --git a/devtools/client/responsive.html/browser/tunnel.js b/devtools/client/responsive.html/browser/tunnel.js index 2c85726d691c..6d42f05624b2 100644 --- a/devtools/client/responsive.html/browser/tunnel.js +++ b/devtools/client/responsive.html/browser/tunnel.js @@ -474,7 +474,7 @@ MessageManagerTunnel.prototype = { this.tunneledMessageNames.add(name); } - Services.obs.addObserver(this, "message-manager-close"); + Services.obs.addObserver(this, "message-manager-close", false); // Replace the outer browser's messageManager with this tunnel Object.defineProperty(this.outer, "messageManager", { diff --git a/devtools/client/responsive.html/utils/window.js b/devtools/client/responsive.html/utils/window.js index ebe7b4a87e1d..de7b80c62f09 100644 --- a/devtools/client/responsive.html/utils/window.js +++ b/devtools/client/responsive.html/utils/window.js @@ -45,7 +45,7 @@ function startup(window) { Services.obs.removeObserver(listener, "browser-delayed-startup-finished"); resolve(window); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); }); } exports.startup = startup; diff --git a/devtools/client/scratchpad/scratchpad-manager.jsm b/devtools/client/scratchpad/scratchpad-manager.jsm index 99aa81d4ba20..5b4b3bd0ae6c 100644 --- a/devtools/client/scratchpad/scratchpad-manager.jsm +++ b/devtools/client/scratchpad/scratchpad-manager.jsm @@ -165,7 +165,7 @@ var ShutdownObserver = { return; } - Services.obs.addObserver(this, "quit-application-granted"); + Services.obs.addObserver(this, "quit-application-granted", false); this._initialized = true; }, diff --git a/devtools/client/scratchpad/scratchpad.js b/devtools/client/scratchpad/scratchpad.js index 4a9eca77427b..69a58872784c 100644 --- a/devtools/client/scratchpad/scratchpad.js +++ b/devtools/client/scratchpad/scratchpad.js @@ -2391,7 +2391,7 @@ var PreferenceObserver = { } this.branch = Services.prefs.getBranch("devtools.scratchpad."); - this.branch.addObserver("", this); + this.branch.addObserver("", this, false); this._initialized = true; }, @@ -2427,7 +2427,7 @@ var PreferenceObserver = { var CloseObserver = { init: function CO_init() { - Services.obs.addObserver(this, "browser-lastwindow-close-requested"); + Services.obs.addObserver(this, "browser-lastwindow-close-requested", false); }, observe: function CO_observe(aSubject) diff --git a/devtools/client/scratchpad/test/browser_scratchpad_browser_last_window_closing.js b/devtools/client/scratchpad/test/browser_scratchpad_browser_last_window_closing.js index 689e5a616293..cc16e0f9b424 100644 --- a/devtools/client/scratchpad/test/browser_scratchpad_browser_last_window_closing.js +++ b/devtools/client/scratchpad/test/browser_scratchpad_browser_last_window_closing.js @@ -60,7 +60,7 @@ var CloseObserver = { expectedValue: null, init: function () { - Services.obs.addObserver(this, "browser-lastwindow-close-requested"); + Services.obs.addObserver(this, "browser-lastwindow-close-requested", false); }, observe: function (aSubject) diff --git a/devtools/client/scratchpad/test/browser_scratchpad_open_error_console.js b/devtools/client/scratchpad/test/browser_scratchpad_open_error_console.js index ee960995e844..a03ca961a903 100644 --- a/devtools/client/scratchpad/test/browser_scratchpad_open_error_console.js +++ b/devtools/client/scratchpad/test/browser_scratchpad_open_error_console.js @@ -28,7 +28,7 @@ function runTests() is(aSubject.data, hud.hudId, "notification hudId is correct"); HUDService.toggleBrowserConsole().then(finish); - }, "web-console-created"); + }, "web-console-created", false); let hud = HUDService.getBrowserConsole(); ok(!hud, "browser console is not open"); diff --git a/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js b/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js index 7f860c9e7ee2..842698dbdfb4 100644 --- a/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js +++ b/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js @@ -254,7 +254,7 @@ var PreferenceObserver = { } this.branch = Services.prefs.getBranch("devtools.scratchpad."); - this.branch.addObserver("", this); + this.branch.addObserver("", this, false); this._initialized = true; }, diff --git a/devtools/client/shared/devtools-file-watcher.js b/devtools/client/shared/devtools-file-watcher.js index 30a52a0d1004..542d5f34efc7 100644 --- a/devtools/client/shared/devtools-file-watcher.js +++ b/devtools/client/shared/devtools-file-watcher.js @@ -72,7 +72,7 @@ const onPrefChange = function () { Services.prefs.addObserver(HOTRELOAD_PREF, { observe: onPrefChange -}); +}, false); onPrefChange(); EventEmitter.decorate(module.exports); diff --git a/devtools/client/shared/options-view.js b/devtools/client/shared/options-view.js index 3da4dbab0022..bb583eaee964 100644 --- a/devtools/client/shared/options-view.js +++ b/devtools/client/shared/options-view.js @@ -175,7 +175,7 @@ PrefObserver.prototype = { Preferences.set(fullName, value); }, register: function () { - this.branch.addObserver("", this); + this.branch.addObserver("", this, false); }, unregister: function () { this.branch.removeObserver("", this); diff --git a/devtools/client/shared/prefs.js b/devtools/client/shared/prefs.js index fa8b96b41860..b8e0aead9f0d 100644 --- a/devtools/client/shared/prefs.js +++ b/devtools/client/shared/prefs.js @@ -157,7 +157,7 @@ function makeObserver(self, cache, prefsRoot, prefsBlueprint) { return { register: function () { this._branch = Services.prefs.getBranch(prefsRoot + "."); - this._branch.addObserver("", this); + this._branch.addObserver("", this, false); }, unregister: function () { this._branch.removeObserver("", this); @@ -184,7 +184,7 @@ exports.PrefsHelper = PrefsHelper; function PrefObserver(branchName) { this.branchName = branchName; this.branch = Services.prefs.getBranch(branchName); - this.branch.addObserver("", this); + this.branch.addObserver("", this, false); EventEmitter.decorate(this); } diff --git a/devtools/client/shared/shim/test/test_service_prefs.html b/devtools/client/shared/shim/test/test_service_prefs.html index bffa25d939c7..b7954a2ae0e6 100644 --- a/devtools/client/shared/shim/test/test_service_prefs.html +++ b/devtools/client/shared/shim/test/test_service_prefs.html @@ -185,8 +185,8 @@ function do_tests() { }; branch0.addObserver("devtools.branch1", null, null); - branch0.addObserver("devtools.branch1.", observer); - branch1.addObserver("", observer); + branch0.addObserver("devtools.branch1.", observer, false); + branch1.addObserver("", observer, false); Services.prefs.setCharPref("devtools.branch1.somestring", "elf owl"); isDeeply(notifications, { @@ -206,7 +206,7 @@ function do_tests() { }, "removeObserver worked"); clearNotificationList(); - branch0.addObserver("devtools.branch1.somestring", observer); + branch0.addObserver("devtools.branch1.somestring", observer, false); Services.prefs.setCharPref("devtools.branch1.somestring", "northern shoveler"); isDeeply(notifications, { "devtools.branch1.somestring": true, @@ -228,7 +228,7 @@ function do_tests() { // Regression test for bug 1319150. let seen = false; let fnObserver = () => { seen = true; }; - branch0.addObserver("devtools.branch1.somestring", fnObserver); + branch0.addObserver("devtools.branch1.somestring", fnObserver, false); Services.prefs.setCharPref("devtools.branch1.somestring", "common merganser"); ok(seen, "function-style observer was called"); branch0.removeObserver("devtools.branch1.somestring", fnObserver); diff --git a/devtools/client/shared/test/head.js b/devtools/client/shared/test/head.js index 28984a083d62..fbf0e84af39f 100644 --- a/devtools/client/shared/test/head.js +++ b/devtools/client/shared/test/head.js @@ -100,7 +100,7 @@ function oneTimeObserve(name, callback) { } resolve(); }; - Services.obs.addObserver(func, name); + Services.obs.addObserver(func, name, false); }); } diff --git a/devtools/client/shared/theme-switching.js b/devtools/client/shared/theme-switching.js index a41d3a47e39c..29f93c4603ba 100644 --- a/devtools/client/shared/theme-switching.js +++ b/devtools/client/shared/theme-switching.js @@ -175,7 +175,7 @@ } else { switchTheme(Services.prefs.getCharPref("devtools.theme")); - Services.prefs.addObserver("devtools.theme", handlePrefChange); + Services.prefs.addObserver("devtools.theme", handlePrefChange, false); window.addEventListener("unload", function () { Services.prefs.removeObserver("devtools.theme", handlePrefChange); }, { once: true }); diff --git a/devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js b/devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js index 5439c531d7d1..4381704e97f7 100644 --- a/devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js +++ b/devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js @@ -79,7 +79,7 @@ function waitForDelayedStartupFinished(win) { Services.obs.removeObserver(observer, topic); deferred.resolve(); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); return deferred.promise; } diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js index f305244ef37d..54d0f95af0ad 100644 --- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js +++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js @@ -45,6 +45,6 @@ function setupObserver() { }, }; - Services.obs.addObserver(observer, "web-console-created"); - Services.obs.addObserver(observer, "web-console-destroyed"); + Services.obs.addObserver(observer, "web-console-created", false); + Services.obs.addObserver(observer, "web-console-destroyed", false); } diff --git a/devtools/client/webconsole/test/browser_bug_871156_ctrlw_close_tab.js b/devtools/client/webconsole/test/browser_bug_871156_ctrlw_close_tab.js index d5cd9409c1b3..1e15ba6b9f35 100644 --- a/devtools/client/webconsole/test/browser_bug_871156_ctrlw_close_tab.js +++ b/devtools/client/webconsole/test/browser_bug_871156_ctrlw_close_tab.js @@ -66,7 +66,7 @@ add_task(function* () { ok(true, "the Browser Console closed"); deferred.resolve(null); - }, "web-console-destroyed"); + }, "web-console-destroyed", false); waitForFocus(() => { EventUtils.synthesizeKey("w", { accelKey: true }, hud.iframeWindow); diff --git a/devtools/client/webconsole/test/browser_console.js b/devtools/client/webconsole/test/browser_console.js index 93dac79e6ab9..9feb56f308e8 100644 --- a/devtools/client/webconsole/test/browser_console.js +++ b/devtools/client/webconsole/test/browser_console.js @@ -171,7 +171,7 @@ function waitForConsole() { is(aSubject.data, hud.hudId, "notification hudId is correct"); executeSoon(() => deferred.resolve(hud)); - }, "web-console-created"); + }, "web-console-created", false); return deferred.promise; } diff --git a/devtools/client/webconsole/test/browser_console_consolejsm_output.js b/devtools/client/webconsole/test/browser_console_consolejsm_output.js index a61106509b09..1a3617afec42 100644 --- a/devtools/client/webconsole/test/browser_console_consolejsm_output.js +++ b/devtools/client/webconsole/test/browser_console_consolejsm_output.js @@ -302,7 +302,7 @@ add_task(function* testProfile() { profilerEvents.push(event); } - Services.obs.addObserver(observer, "console-api-profiler"); + Services.obs.addObserver(observer, "console-api-profiler", false); console.profile("test"); console.profileEnd("test"); diff --git a/devtools/client/webconsole/test/browser_webconsole_bug_595350_multiple_windows_and_tabs.js b/devtools/client/webconsole/test/browser_webconsole_bug_595350_multiple_windows_and_tabs.js index 476042dc01c9..1951cb366760 100644 --- a/devtools/client/webconsole/test/browser_webconsole_bug_595350_multiple_windows_and_tabs.js +++ b/devtools/client/webconsole/test/browser_webconsole_bug_595350_multiple_windows_and_tabs.js @@ -85,7 +85,7 @@ function closeConsoles() { } } - Services.obs.addObserver(onWebConsoleClose, "web-console-destroyed"); + Services.obs.addObserver(onWebConsoleClose, "web-console-destroyed", false); registerCleanupFunction(() => { Services.obs.removeObserver(onWebConsoleClose, "web-console-destroyed"); diff --git a/devtools/client/webconsole/test/browser_webconsole_notifications.js b/devtools/client/webconsole/test/browser_webconsole_notifications.js index dcebe10d4a09..4bda9192f940 100644 --- a/devtools/client/webconsole/test/browser_webconsole_notifications.js +++ b/devtools/client/webconsole/test/browser_webconsole_notifications.js @@ -65,9 +65,9 @@ function waitForEvents(onConsoleOpened) { }, init: function init() { - Services.obs.addObserver(this, "web-console-created"); - Services.obs.addObserver(this, "web-console-destroyed"); - Services.obs.addObserver(this, "web-console-message-created"); + Services.obs.addObserver(this, "web-console-created", false); + Services.obs.addObserver(this, "web-console-destroyed", false); + Services.obs.addObserver(this, "web-console-message-created", false); } }; diff --git a/devtools/client/webconsole/test/head.js b/devtools/client/webconsole/test/head.js index f46b85f558fc..1a782012cbf7 100644 --- a/devtools/client/webconsole/test/head.js +++ b/devtools/client/webconsole/test/head.js @@ -1351,7 +1351,7 @@ function whenDelayedStartupFinished(win, callback) { Services.obs.removeObserver(observer, topic); executeSoon(callback); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } /** diff --git a/devtools/client/webide/content/prefs.js b/devtools/client/webide/content/prefs.js index f026486a8de0..70ca1f47d6cf 100644 --- a/devtools/client/webide/content/prefs.js +++ b/devtools/client/webide/content/prefs.js @@ -12,7 +12,7 @@ window.addEventListener("load", function () { let inputs = document.querySelectorAll("[data-pref]"); for (let i of inputs) { let pref = i.dataset.pref; - Services.prefs.addObserver(pref, FillForm); + Services.prefs.addObserver(pref, FillForm, false); i.addEventListener("change", SaveForm); } diff --git a/devtools/client/webide/modules/runtimes.js b/devtools/client/webide/modules/runtimes.js index b4aa50c93b12..2df02f497d25 100644 --- a/devtools/client/webide/modules/runtimes.js +++ b/devtools/client/webide/modules/runtimes.js @@ -271,7 +271,7 @@ var WiFiScanner = { init() { this.updateRegistration(); - Services.prefs.addObserver(this.ALLOWED_PREF, this); + Services.prefs.addObserver(this.ALLOWED_PREF, this, false); }, enable() { diff --git a/devtools/server/actors/chrome.js b/devtools/server/actors/chrome.js index 1dba2777205c..3a2ad233b39b 100644 --- a/devtools/server/actors/chrome.js +++ b/devtools/server/actors/chrome.js @@ -120,8 +120,8 @@ ChromeActor.prototype._attach = function () { TabActor.prototype._attach.call(this); // Listen for any new/destroyed chrome docshell - Services.obs.addObserver(this, "chrome-webnavigation-create"); - Services.obs.addObserver(this, "chrome-webnavigation-destroy"); + Services.obs.addObserver(this, "chrome-webnavigation-create", false); + Services.obs.addObserver(this, "chrome-webnavigation-destroy", false); // Iterate over all top-level windows. let e = Services.ww.getWindowEnumerator(); diff --git a/devtools/server/actors/eventlooplag.js b/devtools/server/actors/eventlooplag.js index 2d756711451e..d4789b164091 100644 --- a/devtools/server/actors/eventlooplag.js +++ b/devtools/server/actors/eventlooplag.js @@ -25,7 +25,7 @@ exports.EventLoopLagActor = ActorClassWithSpec(eventLoopLagSpec, { */ start: function () { if (!this._observerAdded) { - Services.obs.addObserver(this, "event-loop-lag"); + Services.obs.addObserver(this, "event-loop-lag", false); this._observerAdded = true; } return Services.appShell.startEventLoopLagTracking(); diff --git a/devtools/server/actors/monitor.js b/devtools/server/actors/monitor.js index beb1da0305c9..60e9f20615db 100644 --- a/devtools/server/actors/monitor.js +++ b/devtools/server/actors/monitor.js @@ -31,7 +31,7 @@ MonitorActor.prototype = { start: function () { if (!this._started) { this._started = true; - Services.obs.addObserver(this, "devtools-monitor-update"); + Services.obs.addObserver(this, "devtools-monitor-update", false); Services.obs.notifyObservers(null, "devtools-monitor-start", ""); this._agents.forEach(agent => this._startAgent(agent)); } diff --git a/devtools/server/actors/storage.js b/devtools/server/actors/storage.js index f3b90addcfaf..c80252239ff6 100644 --- a/devtools/server/actors/storage.js +++ b/devtools/server/actors/storage.js @@ -181,7 +181,7 @@ StorageActors.defaults = function (typeName, observationTopics) { this.populateStoresForHosts(); if (observationTopics) { observationTopics.forEach((observationTopic) => { - Services.obs.addObserver(this, observationTopic); + Services.obs.addObserver(this, observationTopic, false); }); } this.onWindowReady = this.onWindowReady.bind(this); @@ -921,7 +921,7 @@ var cookieHelpers = { }, addCookieObservers() { - Services.obs.addObserver(cookieHelpers, "cookie-changed"); + Services.obs.addObserver(cookieHelpers, "cookie-changed", false); return null; }, @@ -2469,8 +2469,8 @@ let StorageActor = protocol.ActorClassWithSpec(specs.storageSpec, { // Notifications that help us keep track of newly added windows and windows // that got removed - Services.obs.addObserver(this, "content-document-global-created"); - Services.obs.addObserver(this, "inner-window-destroyed"); + Services.obs.addObserver(this, "content-document-global-created", false); + Services.obs.addObserver(this, "inner-window-destroyed", false); this.onPageChange = this.onPageChange.bind(this); let handler = tabActor.chromeEventHandler; diff --git a/devtools/server/actors/tab.js b/devtools/server/actors/tab.js index b76ddf743402..72c97c9f820b 100644 --- a/devtools/server/actors/tab.js +++ b/devtools/server/actors/tab.js @@ -586,9 +586,9 @@ TabActor.prototype = { _watchDocshells() { // In child processes, we watch all docshells living in the process. if (this.listenForNewDocShells) { - Services.obs.addObserver(this, "webnavigation-create"); + Services.obs.addObserver(this, "webnavigation-create", false); } - Services.obs.addObserver(this, "webnavigation-destroy"); + Services.obs.addObserver(this, "webnavigation-destroy", false); // We watch for all child docshells under the current document, this._progressListener.watch(this.docShell); @@ -1482,7 +1482,7 @@ function DebuggerProgressListener(tabActor) { this._onWindowHidden = this.onWindowHidden.bind(this); // Watch for windows destroyed (global observer that will need filtering) - Services.obs.addObserver(this, "inner-window-destroyed"); + Services.obs.addObserver(this, "inner-window-destroyed", false); // XXX: for now we maintain the list of windows we know about in this instance // so that we can discriminate windows we care about when observing diff --git a/devtools/server/actors/utils/webconsole-listeners.js b/devtools/server/actors/utils/webconsole-listeners.js index bf9082937923..d48d27eda08c 100644 --- a/devtools/server/actors/utils/webconsole-listeners.js +++ b/devtools/server/actors/utils/webconsole-listeners.js @@ -233,7 +233,7 @@ ConsoleAPIListener.prototype = init: function () { // Note that the observer is process-wide. We will filter the messages as // needed, see CAL_observe(). - Services.obs.addObserver(this, "console-api-log-event"); + Services.obs.addObserver(this, "console-api-log-event", false); }, /** diff --git a/devtools/server/actors/webaudio.js b/devtools/server/actors/webaudio.js index 91a2603419c6..2b3c12184ff4 100644 --- a/devtools/server/actors/webaudio.js +++ b/devtools/server/actors/webaudio.js @@ -627,7 +627,7 @@ exports.WebAudioActor = protocol.ActorClassWithSpec(webAudioSpec, { * Called on first audio node creation, signifying audio context usage */ _onStartContext: function () { - observerService.addObserver(this, "webaudio-node-demise"); + observerService.addObserver(this, "webaudio-node-demise", false); emit(this, "start-context"); }, diff --git a/devtools/server/actors/webconsole.js b/devtools/server/actors/webconsole.js index a57f73760e9f..79156d33d595 100644 --- a/devtools/server/actors/webconsole.js +++ b/devtools/server/actors/webconsole.js @@ -73,7 +73,7 @@ function WebConsoleActor(aConnection, aParentActor) this._onObserverNotification = this._onObserverNotification.bind(this); if (this.parentActor.isRootActor) { Services.obs.addObserver(this._onObserverNotification, - "last-pb-context-exited"); + "last-pb-context-exited", false); } this.traits = { @@ -193,7 +193,7 @@ WebConsoleActor.prototype = Services.obs.removeObserver(onChromeWindowOpened, "domwindowopened"); this._lastChromeWindow = null; }; - Services.obs.addObserver(onChromeWindowOpened, "domwindowopened"); + Services.obs.addObserver(onChromeWindowOpened, "domwindowopened", false); } this._handleNewWindow(window); diff --git a/devtools/server/actors/webextension-inspected-window.js b/devtools/server/actors/webextension-inspected-window.js index d1fa18f6a650..d12d794c54df 100644 --- a/devtools/server/actors/webextension-inspected-window.js +++ b/devtools/server/actors/webextension-inspected-window.js @@ -68,7 +68,7 @@ CustomizedReload.prototype = { if (this.injectedScript) { // Listen to the newly created document elements only if there is an // injectedScript to evaluate. - Services.obs.addObserver(this, "document-element-inserted"); + Services.obs.addObserver(this, "document-element-inserted", false); } // Watch the loading progress and clear the current CustomizedReload once the diff --git a/devtools/server/actors/window.js b/devtools/server/actors/window.js index e05ca8ff1410..c6c5ff55ba99 100644 --- a/devtools/server/actors/window.js +++ b/devtools/server/actors/window.js @@ -60,7 +60,7 @@ WindowActor.prototype._attach = function () { // Listen for chrome docshells in addition to content docshells if (this.docShell.itemType == Ci.nsIDocShellTreeItem.typeChrome) { - Services.obs.addObserver(this, "chrome-webnavigation-destroy"); + Services.obs.addObserver(this, "chrome-webnavigation-destroy", false); } return true; diff --git a/devtools/server/actors/worker.js b/devtools/server/actors/worker.js index 60f0ed5865e4..bbfeb43cd83d 100644 --- a/devtools/server/actors/worker.js +++ b/devtools/server/actors/worker.js @@ -267,7 +267,7 @@ protocol.ActorClassWithSpec(serviceWorkerRegistrationSpec, { this._waitingWorker = new ServiceWorkerActor(conn, waitingWorker); this._activeWorker = new ServiceWorkerActor(conn, activeWorker); - Services.obs.addObserver(this, PushService.subscriptionModifiedTopic); + Services.obs.addObserver(this, PushService.subscriptionModifiedTopic, false); }, onChange() { diff --git a/devtools/server/content-globals.js b/devtools/server/content-globals.js index 98efc3603a2c..f5f26a44cb7c 100644 --- a/devtools/server/content-globals.js +++ b/devtools/server/content-globals.js @@ -44,5 +44,5 @@ if (!isWorker) { Services.obs.addObserver(function observer(subject, topic, data) { let id = subject.QueryInterface(Ci.nsISupportsPRUint64).data; delete globalsCache[id]; - }, "inner-window-destroyed"); + }, "inner-window-destroyed", false); } diff --git a/devtools/server/main.js b/devtools/server/main.js index f616087168a1..66b8f4e6b7d0 100644 --- a/devtools/server/main.js +++ b/devtools/server/main.js @@ -789,7 +789,7 @@ var DebuggerServer = { } }); Services.obs.addObserver(onMessageManagerClose, - "message-manager-close"); + "message-manager-close", false); events.on(connection, "closed", onClose); @@ -1182,7 +1182,7 @@ var DebuggerServer = { } }; Services.obs.addObserver(onMessageManagerClose, - "message-manager-close"); + "message-manager-close", false); // Listen for connection close to cleanup things // when user unplug the device or we lose the connection somehow. diff --git a/devtools/server/performance/profiler.js b/devtools/server/performance/profiler.js index c7b26d7459f2..1d88978834fa 100644 --- a/devtools/server/performance/profiler.js +++ b/devtools/server/performance/profiler.js @@ -322,7 +322,7 @@ const ProfilerManager = (function () { registerEventListeners: function () { if (!this._eventsRegistered) { PROFILER_SYSTEM_EVENTS.forEach(eventName => - Services.obs.addObserver(this, eventName)); + Services.obs.addObserver(this, eventName, false)); this._eventsRegistered = true; } }, diff --git a/devtools/server/tests/browser/browser_navigateEvents.js b/devtools/server/tests/browser/browser_navigateEvents.js index a63555fab4ce..56aba69273ff 100644 --- a/devtools/server/tests/browser/browser_navigateEvents.js +++ b/devtools/server/tests/browser/browser_navigateEvents.js @@ -90,7 +90,7 @@ var httpObserver = function (subject, topic, state) { assertEvent("request", url); } }; -Services.obs.addObserver(httpObserver, "http-on-modify-request"); +Services.obs.addObserver(httpObserver, "http-on-modify-request", false); function onDOMContentLoaded() { assertEvent("DOMContentLoaded"); @@ -155,7 +155,7 @@ function cleanup() { browser.removeEventListener("DOMContentLoaded", onDOMContentLoaded); browser.removeEventListener("load", onLoad); client.close().then(function () { - Services.obs.addObserver(httpObserver, "http-on-modify-request"); + Services.obs.addObserver(httpObserver, "http-on-modify-request", false); DebuggerServer.destroy(); finish(); }); diff --git a/devtools/server/tests/mochitest/test_getProcess.html b/devtools/server/tests/mochitest/test_getProcess.html index 3351549a1e39..f891ea96fb6b 100644 --- a/devtools/server/tests/mochitest/test_getProcess.html +++ b/devtools/server/tests/mochitest/test_getProcess.html @@ -120,7 +120,7 @@ function runTests() { Services.obs.removeObserver(listener, "sdk:loader:destroy"); sendAsyncMessage("test:getProcess-destroy", null); }; - Services.obs.addObserver(listener, "sdk:loader:destroy"); + Services.obs.addObserver(listener, "sdk:loader:destroy", false); } function closeClient() { diff --git a/devtools/server/tests/mochitest/test_setupInParentChild.html b/devtools/server/tests/mochitest/test_setupInParentChild.html index f4fa916d3d29..d4b1f2071152 100644 --- a/devtools/server/tests/mochitest/test_setupInParentChild.html +++ b/devtools/server/tests/mochitest/test_setupInParentChild.html @@ -83,7 +83,7 @@ function runTests() { cleanup(); }; - Services.obs.addObserver(onParent, "test:setupParent"); + Services.obs.addObserver(onParent, "test:setupParent", false); // Instanciate e10s machinery and call setupInChild DebuggerServer.connectToChild(conn, iframe).then(actor => { diff --git a/devtools/server/tests/unit/test_register_actor.js b/devtools/server/tests/unit/test_register_actor.js index 29b46d719688..818757d11e0e 100644 --- a/devtools/server/tests/unit/test_register_actor.js +++ b/devtools/server/tests/unit/test_register_actor.js @@ -59,7 +59,7 @@ function test_lazy_api() { isActorInstanciated = true; } } - Services.obs.addObserver(onActorEvent, "actor"); + Services.obs.addObserver(onActorEvent, "actor", false); DebuggerServer.registerModule("xpcshell-test/registertestactors-03", { prefix: "lazy", constructor: "LazyActor", diff --git a/devtools/shared/Loader.jsm b/devtools/shared/Loader.jsm index 9154ea54c04f..c416d1432877 100644 --- a/devtools/shared/Loader.jsm +++ b/devtools/shared/Loader.jsm @@ -99,7 +99,7 @@ var gNextLoaderID = 0; this.DevToolsLoader = function DevToolsLoader() { this.require = this.require.bind(this); - Services.obs.addObserver(this, "devtools-unload"); + Services.obs.addObserver(this, "devtools-unload", false); }; DevToolsLoader.prototype = { diff --git a/devtools/shared/content-observer.js b/devtools/shared/content-observer.js index 05fb3eadfce4..e4e23a5b9809 100644 --- a/devtools/shared/content-observer.js +++ b/devtools/shared/content-observer.js @@ -28,9 +28,9 @@ ContentObserver.prototype = { */ startListening: function () { Services.obs.addObserver( - this._onContentGlobalCreated, "content-document-global-created"); + this._onContentGlobalCreated, "content-document-global-created", false); Services.obs.addObserver( - this._onInnerWindowDestroyed, "inner-window-destroyed"); + this._onInnerWindowDestroyed, "inner-window-destroyed", false); }, /** diff --git a/devtools/shared/event-emitter.js b/devtools/shared/event-emitter.js index 4cb312ab8993..3b38b553b78d 100644 --- a/devtools/shared/event-emitter.js +++ b/devtools/shared/event-emitter.js @@ -75,7 +75,7 @@ observe: () => { loggingEnabled = Services.prefs.getBoolPref("devtools.dump.emit"); } - }); + }, false); } /** diff --git a/devtools/shared/tests/mochitest/test_devtools_extensions.html b/devtools/shared/tests/mochitest/test_devtools_extensions.html index e814495abcc5..88e0d76d5ffc 100644 --- a/devtools/shared/tests/mochitest/test_devtools_extensions.html +++ b/devtools/shared/tests/mochitest/test_devtools_extensions.html @@ -75,7 +75,7 @@ runNextTest(); }) } - }, 'inner-window-destroyed'); + }, 'inner-window-destroyed', false); tab.close(); } diff --git a/devtools/shared/webconsole/network-monitor.js b/devtools/shared/webconsole/network-monitor.js index 30ac92eeecca..632cd9f98a95 100644 --- a/devtools/shared/webconsole/network-monitor.js +++ b/devtools/shared/webconsole/network-monitor.js @@ -189,7 +189,7 @@ function StackTraceCollector(filters) { StackTraceCollector.prototype = { init() { - Services.obs.addObserver(this, "http-on-opening-request"); + Services.obs.addObserver(this, "http-on-opening-request", false); ChannelEventSinkFactory.getService().registerCollector(this); }, @@ -782,16 +782,16 @@ NetworkMonitor.prototype = { if (Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT) { gActivityDistributor.addObserver(this); Services.obs.addObserver(this._httpResponseExaminer, - "http-on-examine-response"); + "http-on-examine-response", false); Services.obs.addObserver(this._httpResponseExaminer, - "http-on-examine-cached-response"); + "http-on-examine-cached-response", false); Services.obs.addObserver(this._httpModifyExaminer, - "http-on-modify-request"); + "http-on-modify-request", false); } // In child processes, only watch for service worker requests // everything else only happens in the parent process Services.obs.addObserver(this._serviceWorkerRequest, - "service-worker-synthesized-response"); + "service-worker-synthesized-response", false); }, get throttleData() { diff --git a/devtools/shared/webconsole/server-logger-monitor.js b/devtools/shared/webconsole/server-logger-monitor.js index 653acd23e7a1..70f30aa42bec 100644 --- a/devtools/shared/webconsole/server-logger-monitor.js +++ b/devtools/shared/webconsole/server-logger-monitor.js @@ -102,7 +102,7 @@ var ServerLoggerMonitor = { if (!size) { trace.log("ServerLoggerMonitor.onAttatchChild; Add HTTP Observer"); Services.obs.addObserver(this.onExamineResponse, - "http-on-examine-response"); + "http-on-examine-response", false); } // Collect child loggers. The frame element where the diff --git a/devtools/shared/webconsole/server-logger.js b/devtools/shared/webconsole/server-logger.js index 89734dbb5aa9..70b1b4a11d0d 100644 --- a/devtools/shared/webconsole/server-logger.js +++ b/devtools/shared/webconsole/server-logger.js @@ -87,7 +87,7 @@ var ServerLoggingListener = Class({ this.attachParentProcess(); } else { Services.obs.addObserver(this.onExamineResponse, - "http-on-examine-response"); + "http-on-examine-response", false); } }), diff --git a/docshell/test/browser/browser_bug420605.js b/docshell/test/browser/browser_bug420605.js index 41aaa672c5b1..f07d45e93230 100644 --- a/docshell/test/browser/browser_bug420605.js +++ b/docshell/test/browser/browser_bug420605.js @@ -100,7 +100,7 @@ function test() { throw Cr.NS_ERROR_NO_INTERFACE; } }; - historyService.addObserver(historyObserver); + historyService.addObserver(historyObserver, false); function onPageLoad() { gBrowser.selectedBrowser diff --git a/docshell/test/browser/browser_bug503832.js b/docshell/test/browser/browser_bug503832.js index c3dd7f667207..66904cbae839 100644 --- a/docshell/test/browser/browser_bug503832.js +++ b/docshell/test/browser/browser_bug503832.js @@ -45,7 +45,7 @@ add_task(function* () { } }; - historyService.addObserver(historyObserver); + historyService.addObserver(historyObserver, false); }); /* Queries nsINavHistoryService and returns a single history entry diff --git a/docshell/test/browser/browser_bug655270.js b/docshell/test/browser/browser_bug655270.js index 88d2cf40a56b..275245df8213 100644 --- a/docshell/test/browser/browser_bug655270.js +++ b/docshell/test/browser/browser_bug655270.js @@ -56,5 +56,5 @@ function test() { QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); } diff --git a/docshell/test/browser/browser_onbeforeunload_navigation.js b/docshell/test/browser/browser_onbeforeunload_navigation.js index aa36b076311f..d2feb69d4a28 100644 --- a/docshell/test/browser/browser_onbeforeunload_navigation.js +++ b/docshell/test/browser/browser_onbeforeunload_navigation.js @@ -105,7 +105,7 @@ function onTabModalDialogLoaded(node) { } // Listen for the dialog being created -Services.obs.addObserver(onTabModalDialogLoaded, "tabmodal-dialog-loaded"); +Services.obs.addObserver(onTabModalDialogLoaded, "tabmodal-dialog-loaded", false); function runNextTest() { currentTest++; diff --git a/docshell/test/browser/browser_search_notification.js b/docshell/test/browser/browser_search_notification.js index 5bda5f256d58..b0a4571e589d 100644 --- a/docshell/test/browser/browser_search_notification.js +++ b/docshell/test/browser/browser_search_notification.js @@ -43,7 +43,7 @@ function test() { }); } - Services.obs.addObserver(observer, "keyword-search"); + Services.obs.addObserver(observer, "keyword-search", false); gURLBar.value = "firefox health report"; gURLBar.handleCommand(); diff --git a/docshell/test/chrome/bug293235_window.xul b/docshell/test/chrome/bug293235_window.xul index e05e1f4e3839..002a3cf86730 100644 --- a/docshell/test/chrome/bug293235_window.xul +++ b/docshell/test/chrome/bug293235_window.xul @@ -63,7 +63,7 @@ os.removeObserver(this, URI_VISITED_RESOLUTION_TOPIC); }, }; - os.addObserver(observer, URI_VISITED_RESOLUTION_TOPIC); + os.addObserver(observer, URI_VISITED_RESOLUTION_TOPIC, false); function notified() { return observer.notified; } @@ -117,7 +117,7 @@ maybeRunNextTest(); }, }; - os.addObserver(visitObserver, "uri-visit-saved"); + os.addObserver(visitObserver, "uri-visit-saved", false); // Load the page that the link on the previous page points to. doPageNavigation({ uri: getHttpUrl("bug293235_p2.html"), diff --git a/docshell/test/chrome/bug582176_window.xul b/docshell/test/chrome/bug582176_window.xul index e33e3feb24ec..bc5669232a88 100644 --- a/docshell/test/chrome/bug582176_window.xul +++ b/docshell/test/chrome/bug582176_window.xul @@ -48,7 +48,7 @@ os = Components.classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); - os.addObserver(observer, "content-document-global-created"); + os.addObserver(observer, "content-document-global-created", false); browser.loadURI("http://mochi.test:8888/tests/docshell/test/chrome/582176_dummy.html"); yield undefined; diff --git a/docshell/test/chrome/test_bug608669.xul b/docshell/test/chrome/test_bug608669.xul index f371d1213570..ffcdd7ed6275 100644 --- a/docshell/test/chrome/test_bug608669.xul +++ b/docshell/test/chrome/test_bug608669.xul @@ -68,8 +68,8 @@ function* doTest() { var os = Components.classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); - os.addObserver(observer, "chrome-document-global-created"); - os.addObserver(observer, "content-document-global-created"); + os.addObserver(observer, "chrome-document-global-created", false); + os.addObserver(observer, "content-document-global-created", false); is(notificationCount, 0, "initial count"); diff --git a/docshell/test/chrome/test_private_hidden_window.html b/docshell/test/chrome/test_private_hidden_window.html index d5aa1243e97c..534152776545 100644 --- a/docshell/test/chrome/test_private_hidden_window.html +++ b/docshell/test/chrome/test_private_hidden_window.html @@ -62,7 +62,7 @@ function observer(aSubject, aTopic, aData) { mainWindow.Services.obs.removeObserver(observer, "last-pb-context-exited"); SimpleTest.finish(); } -mainWindow.Services.obs.addObserver(observer, "last-pb-context-exited"); +mainWindow.Services.obs.addObserver(observer, "last-pb-context-exited", false); diff --git a/docshell/test/unit/test_nsIDownloadHistory.js b/docshell/test/unit/test_nsIDownloadHistory.js index 16992d06dd33..2809662163d7 100644 --- a/docshell/test/unit/test_nsIDownloadHistory.js +++ b/docshell/test/unit/test_nsIDownloadHistory.js @@ -35,7 +35,7 @@ function testLinkVistedObserver() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(obs, NS_LINK_VISITED_EVENT_TOPIC); + os.addObserver(obs, NS_LINK_VISITED_EVENT_TOPIC, false); var dh = Components.classesByID[NS_DOWNLOADHISTORY_CID]. getService(Ci.nsIDownloadHistory); diff --git a/docshell/test/unit/test_pb_notification.js b/docshell/test/unit/test_pb_notification.js index 916f854f72ef..82018f58523c 100644 --- a/docshell/test/unit/test_pb_notification.js +++ b/docshell/test/unit/test_pb_notification.js @@ -18,6 +18,6 @@ function run_test() { } }; var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService); - os.addObserver(obs, "last-pb-context-exited"); + os.addObserver(obs, "last-pb-context-exited", false); destroy_transient_docshell(); } diff --git a/docshell/test/unit_ipc/test_pb_notification_ipc.js b/docshell/test/unit_ipc/test_pb_notification_ipc.js index db5dfef6f3f3..1517a479fd89 100644 --- a/docshell/test/unit_ipc/test_pb_notification_ipc.js +++ b/docshell/test/unit_ipc/test_pb_notification_ipc.js @@ -10,7 +10,7 @@ function run_test() { } }; var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService); - os.addObserver(obs, "last-pb-context-exited"); + os.addObserver(obs, "last-pb-context-exited", false); run_test_in_child("../unit/test_pb_notification.js", function() { diff --git a/dom/base/test/browser_bug1011748.js b/dom/base/test/browser_bug1011748.js index f99fc14dc32c..a2158500dfe6 100644 --- a/dom/base/test/browser_bug1011748.js +++ b/dom/base/test/browser_bug1011748.js @@ -15,7 +15,7 @@ add_task(function* () { } }; - Services.obs.addObserver(observer, "http-on-examine-response"); + Services.obs.addObserver(observer, "http-on-examine-response", false); yield new Promise((resolve) => { xhr.addEventListener("load", function() { statusTexts.push(this.statusText); diff --git a/dom/base/test/browser_messagemanager_unload.js b/dom/base/test/browser_messagemanager_unload.js index 8b3354399fde..413e384932d7 100644 --- a/dom/base/test/browser_messagemanager_unload.js +++ b/dom/base/test/browser_messagemanager_unload.js @@ -36,7 +36,7 @@ function frameScript() addEventListener("unload", eventHandler, true); addEventListener("pagehide", eventHandler, false); addEventListener("pagehide", eventHandler, true); - Services.obs.addObserver(onOuterWindowDestroyed, "outer-window-destroyed"); + Services.obs.addObserver(onOuterWindowDestroyed, "outer-window-destroyed", false); sendAsyncMessage("Test:Ready"); }, true); diff --git a/dom/base/test/chrome/test_bug1339722.html b/dom/base/test/chrome/test_bug1339722.html index 05f1d4a6eef3..261055dd8c22 100644 --- a/dom/base/test/chrome/test_bug1339722.html +++ b/dom/base/test/chrome/test_bug1339722.html @@ -33,7 +33,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722 let channel = subject.QueryInterface(Ci.nsIHttpChannel); let win = channel.notificationCallbacks.getInterface(Ci.mozIDOMWindowProxy); } - }, TOPIC); + }, TOPIC, false); let docShell = SpecialPowers.wrap(window) .QueryInterface(Ci.nsIInterfaceRequestor) diff --git a/dom/base/test/test_audioNotification.html b/dom/base/test/test_audioNotification.html index dcea8e4cb82a..a7f42f106b19 100644 --- a/dom/base/test/test_audioNotification.html +++ b/dom/base/test/test_audioNotification.html @@ -31,7 +31,7 @@ audio.src = "audio.ogg"; var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_audioNotificationSilent_audioFile.html b/dom/base/test/test_audioNotificationSilent_audioFile.html index 29e59e4c39ad..60c26c93a67b 100644 --- a/dom/base/test/test_audioNotificationSilent_audioFile.html +++ b/dom/base/test/test_audioNotificationSilent_audioFile.html @@ -32,7 +32,7 @@ function continueTest() { } function audioPlayingStart() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); expectedPlaybackActive = 'active'; diff --git a/dom/base/test/test_audioNotificationSilent_webAudio.html b/dom/base/test/test_audioNotificationSilent_webAudio.html index 1293d2dd0646..6fb461fbaf0a 100644 --- a/dom/base/test/test_audioNotificationSilent_webAudio.html +++ b/dom/base/test/test_audioNotificationSilent_webAudio.html @@ -42,7 +42,7 @@ function playOscillatorNode() { } function audioPlayingStart() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); expectedPlaybackActive = 'active'; diff --git a/dom/base/test/test_audioNotificationStopOnNavigation.html b/dom/base/test/test_audioNotificationStopOnNavigation.html index a0602eec963b..2ca0d7778431 100644 --- a/dom/base/test/test_audioNotificationStopOnNavigation.html +++ b/dom/base/test/test_audioNotificationStopOnNavigation.html @@ -31,7 +31,7 @@ var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"] var tests = [ function() { iframe = document.querySelector("iframe"); - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_audioNotificationStream.html b/dom/base/test/test_audioNotificationStream.html index c76fba8e09bf..f27f99316d0d 100644 --- a/dom/base/test/test_audioNotificationStream.html +++ b/dom/base/test/test_audioNotificationStream.html @@ -31,7 +31,7 @@ audio.srcObject = (new AudioContext()).createMediaStreamDestination().stream; var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_audioNotificationWithEarlyPlay.html b/dom/base/test/test_audioNotificationWithEarlyPlay.html index 566f4b86082e..23b051250f2e 100644 --- a/dom/base/test/test_audioNotificationWithEarlyPlay.html +++ b/dom/base/test/test_audioNotificationWithEarlyPlay.html @@ -32,7 +32,7 @@ audio.preload = "metadata"; var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_domrequesthelper.xul b/dom/base/test/test_domrequesthelper.xul index 820d9824725c..4365e4f0e941 100644 --- a/dom/base/test/test_domrequesthelper.xul +++ b/dom/base/test/test_domrequesthelper.xul @@ -148,7 +148,7 @@ let frame = document.createElement("iframe"); frame.onload = function() { - obs.addObserver(observer, TOPIC); + obs.addObserver(observer, TOPIC, false); // Create dummy DOMRequestHelper specific to checkWindowDestruction() let cwdDummy = new DummyHelperSubclass(); cwdDummy.onuninit = function() { diff --git a/dom/base/test/test_noAudioNotification.html b/dom/base/test/test_noAudioNotification.html index b007afb22d9e..18ac833a8b8a 100644 --- a/dom/base/test/test_noAudioNotification.html +++ b/dom/base/test/test_noAudioNotification.html @@ -39,7 +39,7 @@ video.onplay = video.onpause = function() { var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_noAudioNotificationOnMutedElement.html b/dom/base/test/test_noAudioNotificationOnMutedElement.html index 47b7e72cffc5..e9cdd2759d0a 100644 --- a/dom/base/test/test_noAudioNotificationOnMutedElement.html +++ b/dom/base/test/test_noAudioNotificationOnMutedElement.html @@ -35,7 +35,7 @@ audio.loop = true; var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); audio.src = "audio.ogg"; diff --git a/dom/base/test/test_noAudioNotificationOnMutedOrVolume0Element.html b/dom/base/test/test_noAudioNotificationOnMutedOrVolume0Element.html index ebf1f7f2421d..0e4cc93f03fd 100644 --- a/dom/base/test/test_noAudioNotificationOnMutedOrVolume0Element.html +++ b/dom/base/test/test_noAudioNotificationOnMutedOrVolume0Element.html @@ -35,7 +35,7 @@ audio.loop = true; var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); audio.src = "audio.ogg"; diff --git a/dom/base/test/test_noAudioNotificationOnVolume0Element.html b/dom/base/test/test_noAudioNotificationOnVolume0Element.html index c552cc7318b8..530dc88bfc4e 100644 --- a/dom/base/test/test_noAudioNotificationOnVolume0Element.html +++ b/dom/base/test/test_noAudioNotificationOnVolume0Element.html @@ -35,7 +35,7 @@ audio.loop = true; var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); audio.src = "audio.ogg"; diff --git a/dom/base/test/test_noWebAudioNotification.html b/dom/base/test/test_noWebAudioNotification.html index 70d1f0c772eb..794f92d57756 100644 --- a/dom/base/test/test_noWebAudioNotification.html +++ b/dom/base/test/test_noWebAudioNotification.html @@ -27,7 +27,7 @@ var ac; var tests = [ function() { - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_pluginAudioNotification.html b/dom/base/test/test_pluginAudioNotification.html index 0ace7a73e32e..31898507d1c3 100644 --- a/dom/base/test/test_pluginAudioNotification.html +++ b/dom/base/test/test_pluginAudioNotification.html @@ -32,7 +32,7 @@ var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"] var tests = [ function() { iframe = document.querySelector("iframe"); - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_webaudioNotification.html b/dom/base/test/test_webaudioNotification.html index b6b864568c80..d010e916bff6 100644 --- a/dom/base/test/test_webaudioNotification.html +++ b/dom/base/test/test_webaudioNotification.html @@ -31,7 +31,7 @@ var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"] var tests = [ function() { iframe = document.querySelector("iframe"); - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/base/test/test_webaudioNotificationStopOnNavigation.html b/dom/base/test/test_webaudioNotificationStopOnNavigation.html index 21f6bb464128..237d6740269a 100644 --- a/dom/base/test/test_webaudioNotificationStopOnNavigation.html +++ b/dom/base/test/test_webaudioNotificationStopOnNavigation.html @@ -31,7 +31,7 @@ var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"] var tests = [ function() { iframe = document.querySelector("iframe"); - observerService.addObserver(observer, "audio-playback"); + observerService.addObserver(observer, "audio-playback", false); ok(true, "Observer set"); runTest(); }, diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index 3675a71c1140..87acb29ce030 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -188,7 +188,7 @@ BrowserElementChild.prototype = { }); OBSERVED_EVENTS.forEach((aTopic) => { - Services.obs.addObserver(this, aTopic); + Services.obs.addObserver(this, aTopic, false); }); }, diff --git a/dom/browser-element/mochitest/browserElementTestHelpers.js b/dom/browser-element/mochitest/browserElementTestHelpers.js index ef1ef48c11b6..004b25333dfd 100644 --- a/dom/browser-element/mochitest/browserElementTestHelpers.js +++ b/dom/browser-element/mochitest/browserElementTestHelpers.js @@ -100,7 +100,7 @@ const browserElementTestHelpers = { observe: observerFn }; - SpecialPowers.addObserver(observer, topic); + SpecialPowers.addObserver(observer, topic, /* weak = */ false); this._observers.push([observer, topic]); }, diff --git a/dom/console/ConsoleAPIStorage.js b/dom/console/ConsoleAPIStorage.js index f68ad963fd6a..abcf1f599c66 100644 --- a/dom/console/ConsoleAPIStorage.js +++ b/dom/console/ConsoleAPIStorage.js @@ -76,9 +76,9 @@ ConsoleAPIStorageService.prototype = { /** @private */ init: function CS_init() { - Services.obs.addObserver(this, "xpcom-shutdown"); - Services.obs.addObserver(this, "inner-window-destroyed"); - Services.obs.addObserver(this, "memory-pressure"); + Services.obs.addObserver(this, "xpcom-shutdown", false); + Services.obs.addObserver(this, "inner-window-destroyed", false); + Services.obs.addObserver(this, "memory-pressure", false); }, /** diff --git a/dom/console/tests/test_console_binding.html b/dom/console/tests/test_console_binding.html index 2070dbf5f988..764c9954ff39 100644 --- a/dom/console/tests/test_console_binding.html +++ b/dom/console/tests/test_console_binding.html @@ -10,7 +10,7 @@ diff --git a/dom/indexedDB/test/browser_bug839193.js b/dom/indexedDB/test/browser_bug839193.js index 9633d40ce3bc..eef284794bee 100644 --- a/dom/indexedDB/test/browser_bug839193.js +++ b/dom/indexedDB/test/browser_bug839193.js @@ -34,8 +34,8 @@ function test() { // let's add a dummy pass. ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); - Services.obs.addObserver(onLoad, "bug839193-loaded"); - Services.obs.addObserver(onUnload, "bug839193-unloaded"); + Services.obs.addObserver(onLoad, "bug839193-loaded", false); + Services.obs.addObserver(onUnload, "bug839193-unloaded", false); gBugWindow = window.openDialog(gTestRoot + "bug839193.xul"); } diff --git a/dom/ipc/tests/process_error.xul b/dom/ipc/tests/process_error.xul index a2d8c42f6148..0f57cd72a324 100644 --- a/dom/ipc/tests/process_error.xul +++ b/dom/ipc/tests/process_error.xul @@ -51,7 +51,7 @@ Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown'); p.then(done); } - Services.obs.addObserver(crashObserver, 'ipc:content-shutdown'); + Services.obs.addObserver(crashObserver, 'ipc:content-shutdown', false); document.getElementById('thebrowser') .QueryInterface(Components.interfaces.nsIFrameLoaderOwner) diff --git a/dom/ipc/tests/test_Preallocated.html b/dom/ipc/tests/test_Preallocated.html index 03429106190d..467b8c48405d 100644 --- a/dom/ipc/tests/test_Preallocated.html +++ b/dom/ipc/tests/test_Preallocated.html @@ -24,7 +24,7 @@ function expectProcessCreated() { Services.obs.removeObserver(obs, topic); sendAsyncMessage('process-created'); }} - Services.obs.addObserver(obs, topic); + Services.obs.addObserver(obs, topic, /* weak = */ false); } let helper = SpecialPowers.loadChromeScript(parentExpectProcessCreated); diff --git a/dom/media/test/test_eme_request_notifications.html b/dom/media/test/test_eme_request_notifications.html index ccf48cff6985..15783b8af4b6 100644 --- a/dom/media/test/test_eme_request_notifications.html +++ b/dom/media/test/test_eme_request_notifications.html @@ -22,7 +22,7 @@ function observe() { SpecialPowers.Services.obs.removeObserver(observer, "mediakeys-request"); resolve(JSON.parse(data).status); }; - SpecialPowers.Services.obs.addObserver(observer, "mediakeys-request"); + SpecialPowers.Services.obs.addObserver(observer, "mediakeys-request", false); }); } diff --git a/dom/media/tests/mochitest/test_getUserMedia_scarySources.html b/dom/media/tests/mochitest/test_getUserMedia_scarySources.html index 3dc912455386..1b06ee498263 100644 --- a/dom/media/tests/mochitest/test_getUserMedia_scarySources.html +++ b/dom/media/tests/mochitest/test_getUserMedia_scarySources.html @@ -15,7 +15,7 @@ const { Services } = SpecialPowers.Cu.import('resource://gre/modules/Services.js let observe = topic => new Promise(r => Services.obs.addObserver(function o(...args) { Services.obs.removeObserver(o, topic); r(args); -}, topic)); +}, topic, false)); let getDevices = async constraints => { let [{ windowID, innerWindowID, callID }] = await Promise.race([ diff --git a/dom/media/webaudio/test/test_AudioNodeDevtoolsAPI.html b/dom/media/webaudio/test/test_AudioNodeDevtoolsAPI.html index 6cf04a8be556..49f71505d1a1 100644 --- a/dom/media/webaudio/test/test_AudioNodeDevtoolsAPI.html +++ b/dom/media/webaudio/test/test_AudioNodeDevtoolsAPI.html @@ -42,7 +42,7 @@ } } } - SpecialPowers.addObserver(observer, "webaudio-node-demise"); + SpecialPowers.addObserver(observer, "webaudio-node-demise", false); forceCC(); forceCC(); diff --git a/dom/media/webaudio/test/test_ScriptProcessorCollected1.html b/dom/media/webaudio/test/test_ScriptProcessorCollected1.html index de7c3256af93..931f995dfc7c 100644 --- a/dom/media/webaudio/test/test_ScriptProcessorCollected1.html +++ b/dom/media/webaudio/test/test_ScriptProcessorCollected1.html @@ -19,7 +19,7 @@ var observer = function(subject, topic, data) { } } -SpecialPowers.addObserver(observer, "webaudio-node-demise"); +SpecialPowers.addObserver(observer, "webaudio-node-demise", false); SimpleTest.registerCleanupFunction(function() { if (observer) { diff --git a/dom/network/EthernetManager.js b/dom/network/EthernetManager.js index 24365b24a464..4b11e566663a 100644 --- a/dom/network/EthernetManager.js +++ b/dom/network/EthernetManager.js @@ -135,7 +135,7 @@ function EthernetManager() { // Used to memorize last connection information. this.lastStaticConfig = {}; - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); } EthernetManager.prototype = { diff --git a/dom/notification/NotificationDB.jsm b/dom/notification/NotificationDB.jsm index 93d7a1091e88..863dd2484cf3 100644 --- a/dom/notification/NotificationDB.jsm +++ b/dom/notification/NotificationDB.jsm @@ -55,7 +55,7 @@ var NotificationDB = { this.tasks = []; // read/write operation queue this.runningTask = null; - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); this.registerListeners(); }, diff --git a/dom/notification/NotificationStorage.js b/dom/notification/NotificationStorage.js index 96395c9bb670..7313e10e48d0 100644 --- a/dom/notification/NotificationStorage.js +++ b/dom/notification/NotificationStorage.js @@ -44,7 +44,7 @@ function NotificationStorage() { this._requests = {}; this._requestCount = 0; - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); // Register for message listeners. this.registerListeners(); diff --git a/dom/plugins/test/mochitest/test_privatemode_perwindowpb.xul b/dom/plugins/test/mochitest/test_privatemode_perwindowpb.xul index e60600c26855..b89636bb55b0 100644 --- a/dom/plugins/test/mochitest/test_privatemode_perwindowpb.xul +++ b/dom/plugins/test/mochitest/test_privatemode_perwindowpb.xul @@ -32,7 +32,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); SimpleTest.executeSoon(aCallback); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function runTestsCallback() { diff --git a/dom/plugins/test/mochitest/test_refresh_navigator_plugins.html b/dom/plugins/test/mochitest/test_refresh_navigator_plugins.html index 493785da51e1..e39b3217a547 100644 --- a/dom/plugins/test/mochitest/test_refresh_navigator_plugins.html +++ b/dom/plugins/test/mochitest/test_refresh_navigator_plugins.html @@ -27,7 +27,7 @@ } } }; - obsService.addObserver(observer, "plugin-info-updated"); + obsService.addObserver(observer, "plugin-info-updated", false); var navTestPlugin1 = navigator.plugins.namedItem("Test Plug-in"); ok(navTestPlugin1, "navigator.plugins should have Test Plug-in"); diff --git a/dom/presentation/PresentationDeviceInfoManager.jsm b/dom/presentation/PresentationDeviceInfoManager.jsm index df5cbb07f81d..6b267293fb16 100644 --- a/dom/presentation/PresentationDeviceInfoManager.jsm +++ b/dom/presentation/PresentationDeviceInfoManager.jsm @@ -33,7 +33,7 @@ this.PresentationDeviceInfoService = { log("init"); ppmm.addMessageListener("PresentationDeviceInfoManager:GetAll", this); ppmm.addMessageListener("PresentationDeviceInfoManager:ForceDiscovery", this); - Services.obs.addObserver(this, "presentation-device-change"); + Services.obs.addObserver(this, "presentation-device-change", false); }, getAll: function(aData, aMm) { diff --git a/dom/presentation/provider/PresentationControlService.js b/dom/presentation/provider/PresentationControlService.js index 00d826ebf052..f9398118855b 100644 --- a/dom/presentation/provider/PresentationControlService.js +++ b/dom/presentation/provider/PresentationControlService.js @@ -118,7 +118,7 @@ PresentationControlService.prototype = { DEBUG && log("PresentationControlService - service start on port: " + this._port); // jshint ignore:line // Monitor network interface change to restart server socket. - Services.obs.addObserver(this, "network:offline-status-changed"); + Services.obs.addObserver(this, "network:offline-status-changed", false); this._notifyServerReady(); }, diff --git a/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js b/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js index d5cca570129f..3052bdcb1078 100644 --- a/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js +++ b/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js @@ -467,4 +467,4 @@ obs.addObserver(function observer(aSubject, aTopic, aData) { obs.removeObserver(observer, aTopic); requestPromise = aSubject; -}, 'setup-request-promise'); +}, 'setup-request-promise', false); diff --git a/dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js b/dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js index 2240c0128765..1ab2fe4c42f1 100644 --- a/dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js +++ b/dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js @@ -332,7 +332,7 @@ function initMockAndListener() { obs.removeObserver(setupRequestPromiseHandler, aTopic); mockRequestUIGlue.promise = aSubject; sendAsyncMessage('promise-setup-ready'); - }, 'setup-request-promise'); + }, 'setup-request-promise', false); } function teardown() { diff --git a/dom/presentation/tests/xpcshell/test_presentation_device_manager.js b/dom/presentation/tests/xpcshell/test_presentation_device_manager.js index 8882d5fa3525..68f07df6563b 100644 --- a/dom/presentation/tests/xpcshell/test_presentation_device_manager.js +++ b/dom/presentation/tests/xpcshell/test_presentation_device_manager.js @@ -97,7 +97,7 @@ function addDevice() { Assert.equal(device.type, testDevice.type, 'expected device type'); run_next_test(); - }, 'presentation-device-change'); + }, 'presentation-device-change', false); manager.QueryInterface(Ci.nsIPresentationDeviceListener).addDevice(testDevice); } @@ -122,7 +122,7 @@ function updateDevice() { Assert.equal(device.type, testDevice.type, 'expected device type'); run_next_test(); - }, 'presentation-device-change'); + }, 'presentation-device-change', false); testDevice.name = 'updated-name'; manager.QueryInterface(Ci.nsIPresentationDeviceListener).updateDevice(testDevice); } @@ -151,7 +151,7 @@ function sessionRequest() { Assert.equal(request.presentationId, testPresentationId, 'expected presentation Id'); run_next_test(); - }, 'presentation-session-request'); + }, 'presentation-session-request', false); manager.QueryInterface(Ci.nsIPresentationDeviceListener) .onSessionRequest(testDevice, testUrl, testPresentationId, testControlChannel); } @@ -171,7 +171,7 @@ function terminateRequest() { Assert.equal(request.isFromReceiver, testIsFromReceiver, 'expected isFromReceiver'); run_next_test(); - }, 'presentation-terminate-request'); + }, 'presentation-terminate-request', false); manager.QueryInterface(Ci.nsIPresentationDeviceListener) .onTerminateRequest(testDevice, testPresentationId, testControlChannel, testIsFromReceiver); @@ -191,7 +191,7 @@ function reconnectRequest() { Assert.equal(request.presentationId, testPresentationId, 'expected presentation Id'); run_next_test(); - }, 'presentation-reconnect-request'); + }, 'presentation-reconnect-request', false); manager.QueryInterface(Ci.nsIPresentationDeviceListener) .onReconnectRequest(testDevice, testUrl, testPresentationId, testControlChannel); } @@ -212,7 +212,7 @@ function removeDevice() { Assert.equal(devices.length, 0, 'expect 0 available device'); run_next_test(); - }, 'presentation-device-change'); + }, 'presentation-device-change', false); manager.QueryInterface(Ci.nsIPresentationDeviceListener).removeDevice(testDevice); } diff --git a/dom/push/PushService.jsm b/dom/push/PushService.jsm index 3ca350494835..5bf5640529a5 100644 --- a/dom/push/PushService.jsm +++ b/dom/push/PushService.jsm @@ -483,7 +483,7 @@ this.PushService = { this._setState(PUSH_SERVICE_ACTIVATING); prefs.observe("serverURL", this); - Services.obs.addObserver(this, "quit-application"); + Services.obs.addObserver(this, "quit-application", false); if (options.serverURI) { // this is use for xpcshell test. @@ -506,22 +506,22 @@ this.PushService = { return; } - Services.obs.addObserver(this, "clear-origin-attributes-data"); + Services.obs.addObserver(this, "clear-origin-attributes-data", false); // The offline-status-changed event is used to know // when to (dis)connect. It may not fire if the underlying OS changes // networks; in such a case we rely on timeout. - Services.obs.addObserver(this, "network:offline-status-changed"); + Services.obs.addObserver(this, "network:offline-status-changed", false); // Used to monitor if the user wishes to disable Push. prefs.observe("connection.enabled", this); // Prunes expired registrations and notifies dormant service workers. - Services.obs.addObserver(this, "idle-daily"); + Services.obs.addObserver(this, "idle-daily", false); // Prunes registrations for sites for which the user revokes push // permissions. - Services.obs.addObserver(this, "perm-changed"); + Services.obs.addObserver(this, "perm-changed", false); }, _startService(service, serverURI, options) { diff --git a/dom/push/PushServiceAndroidGCM.jsm b/dom/push/PushServiceAndroidGCM.jsm index 4cc9fadeb06f..0b5b8e0d7992 100644 --- a/dom/push/PushServiceAndroidGCM.jsm +++ b/dom/push/PushServiceAndroidGCM.jsm @@ -149,7 +149,7 @@ this.PushServiceAndroidGCM = { this._serverURI = serverURL; prefs.observe("debug", this); - Services.obs.addObserver(this, "PushServiceAndroidGCM:ReceivedPushMessage"); + Services.obs.addObserver(this, "PushServiceAndroidGCM:ReceivedPushMessage", false); return this._configure(serverURL, !!prefs.get("debug")).then(() => { EventDispatcher.instance.sendRequestForResult({ diff --git a/dom/push/test/test_serviceworker_lifetime.html b/dom/push/test/test_serviceworker_lifetime.html index 143c882b728e..b447d393a97c 100644 --- a/dom/push/test/test_serviceworker_lifetime.html +++ b/dom/push/test/test_serviceworker_lifetime.html @@ -194,7 +194,7 @@ res(ctx); } } - SpecialPowers.addObserver(ctx.observer, "service-worker-shutdown"); + SpecialPowers.addObserver(ctx.observer, "service-worker-shutdown", false); }); return ctx; diff --git a/dom/push/test/test_try_registering_offline_disabled.html b/dom/push/test/test_try_registering_offline_disabled.html index ff37eb5d308f..d0d16e39cd21 100644 --- a/dom/push/test/test_try_registering_offline_disabled.html +++ b/dom/push/test/test_try_registering_offline_disabled.html @@ -121,7 +121,8 @@ http://creativecommons.org/licenses/publicdomain/ var obsService = SpecialPowers.Cc["@mozilla.org/observer-service;1"] .getService(SpecialPowers.Ci.nsIObserverService); obsService.addObserver(SpecialPowers.wrapCallbackObject(new offlineObserver(res)), - "network:offline-status-changed"); + "network:offline-status-changed", + false); chromeScript.sendAsyncMessage("change-status", offline); }); } diff --git a/dom/push/test/xpcshell/PushServiceHandler.js b/dom/push/test/xpcshell/PushServiceHandler.js index 054d3fba917a..d63f32c9789a 100644 --- a/dom/push/test/xpcshell/PushServiceHandler.js +++ b/dom/push/test/xpcshell/PushServiceHandler.js @@ -14,9 +14,9 @@ function PushServiceHandler() { this.wrappedJSObject = this; // Register a push observer. this.observed = []; - Services.obs.addObserver(this, pushService.pushTopic); - Services.obs.addObserver(this, pushService.subscriptionChangeTopic); - Services.obs.addObserver(this, pushService.subscriptionModifiedTopic); + Services.obs.addObserver(this, pushService.pushTopic, false); + Services.obs.addObserver(this, pushService.subscriptionChangeTopic, false); + Services.obs.addObserver(this, pushService.subscriptionModifiedTopic, false); } PushServiceHandler.prototype = { diff --git a/dom/push/test/xpcshell/head.js b/dom/push/test/xpcshell/head.js index 48e8355bb589..4ddc2eefa399 100644 --- a/dom/push/test/xpcshell/head.js +++ b/dom/push/test/xpcshell/head.js @@ -48,7 +48,7 @@ Services.obs.addObserver(function observe(subject, topic, data) { Cu.reportError(e); } } -}, 'profile-change-net-teardown'); +}, 'profile-change-net-teardown', false); /** * Gates a function so that it is called only after the wrapper is called a @@ -94,7 +94,7 @@ function promiseObserverNotification(topic, matchFunc) { } Services.obs.removeObserver(observe, topic); resolve({subject, data}); - }, topic); + }, topic, false); }); } diff --git a/dom/push/test/xpcshell/test_notification_incomplete.js b/dom/push/test/xpcshell/test_notification_incomplete.js index 4a8705ec61ab..ed2cec98630b 100644 --- a/dom/push/test/xpcshell/test_notification_incomplete.js +++ b/dom/push/test/xpcshell/test_notification_incomplete.js @@ -56,7 +56,7 @@ add_task(function* test_notification_incomplete() { } do_register_cleanup(() => Services.obs.removeObserver(observeMessage, PushServiceComponent.pushTopic)); - Services.obs.addObserver(observeMessage, PushServiceComponent.pushTopic); + Services.obs.addObserver(observeMessage, PushServiceComponent.pushTopic, false); let notificationDone; let notificationPromise = new Promise(resolve => notificationDone = after(2, resolve)); diff --git a/dom/secureelement/gonk/SecureElement.js b/dom/secureelement/gonk/SecureElement.js index e5277b1237d9..3b5809caefe7 100644 --- a/dom/secureelement/gonk/SecureElement.js +++ b/dom/secureelement/gonk/SecureElement.js @@ -198,7 +198,7 @@ XPCOMUtils.defineLazyGetter(this, "gMap", function() { function SecureElementManager() { this._registerMessageListeners(); this._registerSEListeners(); - Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); + Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); this._acEnforcer = Cc["@mozilla.org/secureelement/access-control/ace;1"] .getService(Ci.nsIAccessControlEnforcer); diff --git a/dom/secureelement/gonk/UiccConnector.js b/dom/secureelement/gonk/UiccConnector.js index 828a4522e880..517303de29a7 100644 --- a/dom/secureelement/gonk/UiccConnector.js +++ b/dom/secureelement/gonk/UiccConnector.js @@ -85,7 +85,7 @@ UiccConnector.prototype = { _isPresent: false, _init: function() { - Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); + Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); let icc = iccService.getIccByServiceId(PREFERRED_UICC_CLIENTID); icc.registerListener(this); diff --git a/dom/security/test/csp/browser_manifest-src-override-default-src.js b/dom/security/test/csp/browser_manifest-src-override-default-src.js index 74ac9754822c..0c4c7b7bc0de 100644 --- a/dom/security/test/csp/browser_manifest-src-override-default-src.js +++ b/dom/security/test/csp/browser_manifest-src-override-default-src.js @@ -103,6 +103,6 @@ function createNetObserver(test) { success = true; }, }; - SpecialPowers.addObserver(observer, "csp-on-violate-policy"); + SpecialPowers.addObserver(observer, "csp-on-violate-policy", false); return observer; } diff --git a/dom/security/test/csp/browser_test_web_manifest.js b/dom/security/test/csp/browser_test_web_manifest.js index 0658f37d4445..df23770ba691 100644 --- a/dom/security/test/csp/browser_test_web_manifest.js +++ b/dom/security/test/csp/browser_test_web_manifest.js @@ -219,6 +219,6 @@ function waitForNetObserver(aTest) { resolve(); }, }; - SpecialPowers.addObserver(observer, "csp-on-violate-policy"); + SpecialPowers.addObserver(observer, "csp-on-violate-policy", false); }); } diff --git a/dom/security/test/csp/file_report_chromescript.js b/dom/security/test/csp/file_report_chromescript.js index b9375a4dead5..bf4f70edbbc0 100644 --- a/dom/security/test/csp/file_report_chromescript.js +++ b/dom/security/test/csp/file_report_chromescript.js @@ -51,4 +51,4 @@ var openingObserver = { } }; -Services.obs.addObserver(openingObserver, 'http-on-opening-request'); +Services.obs.addObserver(openingObserver, 'http-on-opening-request', false); diff --git a/dom/security/test/csp/test_301_redirect.html b/dom/security/test/csp/test_301_redirect.html index 75a122f4d572..8b625a4017c4 100644 --- a/dom/security/test/csp/test_301_redirect.html +++ b/dom/security/test/csp/test_301_redirect.html @@ -22,8 +22,8 @@ Test that CSP violation reports are not sent when a 301 redirect is encountered // This is used to watch the redirect of the report POST get blocked function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_302_redirect.html b/dom/security/test/csp/test_302_redirect.html index 13dca82dcbc1..616ecd9eb7d7 100644 --- a/dom/security/test/csp/test_302_redirect.html +++ b/dom/security/test/csp/test_302_redirect.html @@ -22,8 +22,8 @@ Test that CSP violation reports are not sent when a 302 redirect is encountered // This is used to watch the redirect of the report POST get blocked function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_303_redirect.html b/dom/security/test/csp/test_303_redirect.html index 94dd59198097..9e59a18f6aa6 100644 --- a/dom/security/test/csp/test_303_redirect.html +++ b/dom/security/test/csp/test_303_redirect.html @@ -22,8 +22,8 @@ Test that CSP violation reports are not sent when a 303 redirect is encountered // This is used to watch the redirect of the report POST get blocked function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_307_redirect.html b/dom/security/test/csp/test_307_redirect.html index f9c72e4bde37..5e30b1b86f84 100644 --- a/dom/security/test/csp/test_307_redirect.html +++ b/dom/security/test/csp/test_307_redirect.html @@ -22,8 +22,8 @@ Test that CSP violation reports are not sent when a 307 redirect is encountered // This is used to watch the redirect of the report POST get blocked function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_CSP.html b/dom/security/test/csp/test_CSP.html index 074e2eb68ed5..1cde9902d138 100644 --- a/dom/security/test/csp/test_CSP.html +++ b/dom/security/test/csp/test_CSP.html @@ -64,8 +64,8 @@ window.tests = { // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_bug1229639.html b/dom/security/test/csp/test_bug1229639.html index c8a1be6bbd2e..cd322d36d491 100644 --- a/dom/security/test/csp/test_bug1229639.html +++ b/dom/security/test/csp/test_bug1229639.html @@ -16,8 +16,8 @@ // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_bug836922_npolicies.html b/dom/security/test/csp/test_bug836922_npolicies.html index 47c085a9d75e..140ff91635f7 100644 --- a/dom/security/test/csp/test_bug836922_npolicies.html +++ b/dom/security/test/csp/test_bug836922_npolicies.html @@ -35,8 +35,8 @@ window.violation_reports = { // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. This also watches for violation reports to go out. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_bug886164.html b/dom/security/test/csp/test_bug886164.html index 41e7bae66318..8322c046a84f 100644 --- a/dom/security/test/csp/test_bug886164.html +++ b/dom/security/test/csp/test_bug886164.html @@ -92,8 +92,8 @@ function ok_wrapper(result, desc) { // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_bug909029.html b/dom/security/test/csp/test_bug909029.html index 499d5e3b2266..a0f82660876f 100644 --- a/dom/security/test/csp/test_bug909029.html +++ b/dom/security/test/csp/test_bug909029.html @@ -25,8 +25,8 @@ window.tests = { } function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_bug941404.html b/dom/security/test/csp/test_bug941404.html index a43009f22249..07f45d176959 100644 --- a/dom/security/test/csp/test_bug941404.html +++ b/dom/security/test/csp/test_bug941404.html @@ -32,8 +32,8 @@ window.tests = { // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_connect-src.html b/dom/security/test/csp/test_connect-src.html index a91c29c3c4f8..5e42d9838141 100644 --- a/dom/security/test/csp/test_connect-src.html +++ b/dom/security/test/csp/test_connect-src.html @@ -70,8 +70,8 @@ function checkResult(aResult) { // that are blocked by CSP and bubble up the result to the including iframe // document (parent). function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_form-action.html b/dom/security/test/csp/test_form-action.html index 41c21c3dd992..b909ca701969 100644 --- a/dom/security/test/csp/test_form-action.html +++ b/dom/security/test/csp/test_form-action.html @@ -47,8 +47,8 @@ function checkResult(aResult) { // that are blocked by CSP and bubble up the result to the including iframe // document (parent). function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_frameancestors.html b/dom/security/test/csp/test_frameancestors.html index 0490892cdc42..e2f96fc5be51 100644 --- a/dom/security/test/csp/test_frameancestors.html +++ b/dom/security/test/csp/test_frameancestors.html @@ -54,7 +54,7 @@ var expectedViolationsLeft = 8; // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_iframe_sandbox_srcdoc.html b/dom/security/test/csp/test_iframe_sandbox_srcdoc.html index 8d93e4f53024..53beafcacd9c 100644 --- a/dom/security/test/csp/test_iframe_sandbox_srcdoc.html +++ b/dom/security/test/csp/test_iframe_sandbox_srcdoc.html @@ -14,7 +14,7 @@ // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_iframe_srcdoc.html b/dom/security/test/csp/test_iframe_srcdoc.html index 7d8f87277e20..95b924a5e387 100644 --- a/dom/security/test/csp/test_iframe_srcdoc.html +++ b/dom/security/test/csp/test_iframe_srcdoc.html @@ -86,7 +86,7 @@ function receiveMessage(event) { } function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_inlinescript.html b/dom/security/test/csp/test_inlinescript.html index cb64105396de..8c142a2127be 100644 --- a/dom/security/test/csp/test_inlinescript.html +++ b/dom/security/test/csp/test_inlinescript.html @@ -39,7 +39,7 @@ var curTest; // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_leading_wildcard.html b/dom/security/test/csp/test_leading_wildcard.html index b0aedc3a2992..81c9f58ecedf 100644 --- a/dom/security/test/csp/test_leading_wildcard.html +++ b/dom/security/test/csp/test_leading_wildcard.html @@ -42,8 +42,8 @@ function finishTest() { // We use the examiner to identify requests that hit the wire and requests // that are blocked by CSP. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_multi_policy_injection_bypass.html b/dom/security/test/csp/test_multi_policy_injection_bypass.html index bea3ff7604a1..83a9fa26506f 100644 --- a/dom/security/test/csp/test_multi_policy_injection_bypass.html +++ b/dom/security/test/csp/test_multi_policy_injection_bypass.html @@ -39,8 +39,8 @@ window.tests = { // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_nonce_source.html b/dom/security/test/csp/test_nonce_source.html index 97ea7a25d092..05b8fda7ec88 100644 --- a/dom/security/test/csp/test_nonce_source.html +++ b/dom/security/test/csp/test_nonce_source.html @@ -18,8 +18,8 @@ var totalTests = 20; // This is used to watch the blocked data bounce off CSP function examiner() { - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); - SpecialPowers.addObserver(this, "csp-on-violate-policy"); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_ping.html b/dom/security/test/csp/test_ping.html index 260bc7dde254..a896794e1df1 100644 --- a/dom/security/test/csp/test_ping.html +++ b/dom/security/test/csp/test_ping.html @@ -45,8 +45,8 @@ function checkResult(aResult) { // that are blocked by CSP and bubble up the result to the including iframe // document (parent). function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_redirects.html b/dom/security/test/csp/test_redirects.html index c2ec1aa797d9..df01e3b41738 100644 --- a/dom/security/test/csp/test_redirects.html +++ b/dom/security/test/csp/test_redirects.html @@ -27,8 +27,8 @@ function log(s) { // used to watch if requests are blocked by CSP or allowed through function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/csp/test_sandbox.html b/dom/security/test/csp/test_sandbox.html index b6c9c6a72fc8..af0765b31cea 100644 --- a/dom/security/test/csp/test_sandbox.html +++ b/dom/security/test/csp/test_sandbox.html @@ -180,8 +180,8 @@ function runTest(test) { // This is used to watch the blocked data bounce off CSP and allowed data // get sent out to the wire. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); - SpecialPowers.addObserver(this, "specialpowers-http-notify-request"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); + SpecialPowers.addObserver(this, "specialpowers-http-notify-request", false); } examiner.prototype = { diff --git a/dom/security/test/csp/test_shouldprocess.html b/dom/security/test/csp/test_shouldprocess.html index ac56ede8f955..5d09251677b0 100644 --- a/dom/security/test/csp/test_shouldprocess.html +++ b/dom/security/test/csp/test_shouldprocess.html @@ -60,7 +60,7 @@ function checkResults(aURI) { // used to watch that shouldProcess blocks TYPE_OBJECT function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); } examiner.prototype = { observe: function(subject, topic, data) { diff --git a/dom/security/test/general/test_bug1277803.xul b/dom/security/test/general/test_bug1277803.xul index 0f7e8a245de0..a62285f8aff8 100644 --- a/dom/security/test/general/test_bug1277803.xul +++ b/dom/security/test/general/test_bug1277803.xul @@ -81,7 +81,7 @@ } } } - os.addObserver(observer, "http-on-modify-request"); + os.addObserver(observer, "http-on-modify-request", false); // Now that the observer is set up, trigger a favicon load with navigation testWindow = window.open(LOADING_URI); diff --git a/dom/security/test/hsts/browser_hsts-priming_allow_active.js b/dom/security/test/hsts/browser_hsts-priming_allow_active.js index 3360d146d87e..a932b31b3515 100644 --- a/dom/security/test/hsts/browser_hsts-priming_allow_active.js +++ b/dom/security/test/hsts/browser_hsts-priming_allow_active.js @@ -8,8 +8,8 @@ //jscs:disable add_task(function*() { //jscs:enable - Services.obs.addObserver(Observer, "console-api-log-event"); - Services.obs.addObserver(Observer, "http-on-examine-response"); + Services.obs.addObserver(Observer, "console-api-log-event", false); + Services.obs.addObserver(Observer, "http-on-examine-response", false); registerCleanupFunction(do_cleanup); let which = "allow_active"; diff --git a/dom/security/test/hsts/browser_hsts-priming_allow_display.js b/dom/security/test/hsts/browser_hsts-priming_allow_display.js index 9308043ea99c..06546ca65568 100644 --- a/dom/security/test/hsts/browser_hsts-priming_allow_display.js +++ b/dom/security/test/hsts/browser_hsts-priming_allow_display.js @@ -8,8 +8,8 @@ //jscs:disable add_task(function*() { //jscs:enable - Services.obs.addObserver(Observer, "console-api-log-event"); - Services.obs.addObserver(Observer, "http-on-examine-response"); + Services.obs.addObserver(Observer, "console-api-log-event", false); + Services.obs.addObserver(Observer, "http-on-examine-response", false); registerCleanupFunction(do_cleanup); let which = "allow_display"; diff --git a/dom/security/test/hsts/browser_hsts-priming_block_active.js b/dom/security/test/hsts/browser_hsts-priming_block_active.js index 3ce07ae5f07a..a5478b18562d 100644 --- a/dom/security/test/hsts/browser_hsts-priming_block_active.js +++ b/dom/security/test/hsts/browser_hsts-priming_block_active.js @@ -8,8 +8,8 @@ //jscs:disable add_task(function*() { //jscs:enable - Services.obs.addObserver(Observer, "console-api-log-event"); - Services.obs.addObserver(Observer, "http-on-examine-response"); + Services.obs.addObserver(Observer, "console-api-log-event", false); + Services.obs.addObserver(Observer, "http-on-examine-response", false); registerCleanupFunction(do_cleanup); let which = "block_active"; diff --git a/dom/security/test/hsts/browser_hsts-priming_block_active_css.js b/dom/security/test/hsts/browser_hsts-priming_block_active_css.js index fbd888b2e03e..340d114834d9 100644 --- a/dom/security/test/hsts/browser_hsts-priming_block_active_css.js +++ b/dom/security/test/hsts/browser_hsts-priming_block_active_css.js @@ -8,8 +8,8 @@ //jscs:disable add_task(function*() { //jscs:enable - Services.obs.addObserver(Observer, "console-api-log-event"); - Services.obs.addObserver(Observer, "http-on-examine-response"); + Services.obs.addObserver(Observer, "console-api-log-event", false); + Services.obs.addObserver(Observer, "http-on-examine-response", false); registerCleanupFunction(do_cleanup); let which = "block_active_css"; diff --git a/dom/security/test/hsts/browser_hsts-priming_block_active_with_redir_same.js b/dom/security/test/hsts/browser_hsts-priming_block_active_with_redir_same.js index 54aaa93dde8c..130a3d5ec266 100644 --- a/dom/security/test/hsts/browser_hsts-priming_block_active_with_redir_same.js +++ b/dom/security/test/hsts/browser_hsts-priming_block_active_with_redir_same.js @@ -8,8 +8,8 @@ //jscs:disable add_task(function*() { //jscs:enable - Services.obs.addObserver(Observer, "console-api-log-event"); - Services.obs.addObserver(Observer, "http-on-examine-response"); + Services.obs.addObserver(Observer, "console-api-log-event", false); + Services.obs.addObserver(Observer, "http-on-examine-response", false); registerCleanupFunction(do_cleanup); let which = "block_active_with_redir_same"; diff --git a/dom/security/test/hsts/browser_hsts-priming_block_display.js b/dom/security/test/hsts/browser_hsts-priming_block_display.js index d316c2e2ac96..4eca6271836a 100644 --- a/dom/security/test/hsts/browser_hsts-priming_block_display.js +++ b/dom/security/test/hsts/browser_hsts-priming_block_display.js @@ -8,8 +8,8 @@ //jscs:disable add_task(function*() { //jscs:enable - Services.obs.addObserver(Observer, "console-api-log-event"); - Services.obs.addObserver(Observer, "http-on-examine-response"); + Services.obs.addObserver(Observer, "console-api-log-event", false); + Services.obs.addObserver(Observer, "http-on-examine-response", false); registerCleanupFunction(do_cleanup); let which = "block_display"; diff --git a/dom/security/test/hsts/browser_hsts-priming_hsts_after_mixed.js b/dom/security/test/hsts/browser_hsts-priming_hsts_after_mixed.js index 96e9b66567b8..89ea6fbebada 100644 --- a/dom/security/test/hsts/browser_hsts-priming_hsts_after_mixed.js +++ b/dom/security/test/hsts/browser_hsts-priming_hsts_after_mixed.js @@ -8,8 +8,8 @@ //jscs:disable add_task(function*() { //jscs:enable - Services.obs.addObserver(Observer, "console-api-log-event"); - Services.obs.addObserver(Observer, "http-on-examine-response"); + Services.obs.addObserver(Observer, "console-api-log-event", false); + Services.obs.addObserver(Observer, "http-on-examine-response", false); registerCleanupFunction(do_cleanup); let which = "hsts_after_mixed"; diff --git a/dom/security/test/hsts/head.js b/dom/security/test/hsts/head.js index 46dff9c857d8..34fcbc53909c 100644 --- a/dom/security/test/hsts/head.js +++ b/dom/security/test/hsts/head.js @@ -263,9 +263,9 @@ var Observer = { throw "Can't handle topic "+topic; }, add_observers: function (services, include_on_modify = false) { - services.obs.addObserver(Observer, "console-api-log-event"); - services.obs.addObserver(Observer, "http-on-examine-response"); - services.obs.addObserver(Observer, "http-on-modify-request"); + services.obs.addObserver(Observer, "console-api-log-event", false); + services.obs.addObserver(Observer, "http-on-examine-response", false); + services.obs.addObserver(Observer, "http-on-modify-request", false); }, cleanup: function () { this.listeners = {}; diff --git a/dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html b/dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html index 6b4434ed317c..5cfd95984156 100644 --- a/dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html +++ b/dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html @@ -25,7 +25,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=841850 } } } - os.addObserver(observer, "content-document-global-created"); + os.addObserver(observer, "content-document-global-created", false); diff --git a/dom/security/test/mixedcontentblocker/file_main_bug803225.html b/dom/security/test/mixedcontentblocker/file_main_bug803225.html index d96951526356..c612ded202ea 100644 --- a/dom/security/test/mixedcontentblocker/file_main_bug803225.html +++ b/dom/security/test/mixedcontentblocker/file_main_bug803225.html @@ -134,7 +134,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225 } } }; - os.addObserver(observer, "content-document-global-created"); + os.addObserver(observer, "content-document-global-created", false); } Services.ppmm.loadProcessScript(pScript, true); diff --git a/dom/system/gonk/DataCallInterfaceService.js b/dom/system/gonk/DataCallInterfaceService.js index 65353d032d79..f5d7aa5b34cb 100644 --- a/dom/system/gonk/DataCallInterfaceService.js +++ b/dom/system/gonk/DataCallInterfaceService.js @@ -79,8 +79,8 @@ function DataCallInterfaceService() { this._dataCallInterfaces.push(new DataCallInterface(i)); } - Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN); - Services.prefs.addObserver(PREF_RIL_DEBUG_ENABLED, this); + Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN, false); + Services.prefs.addObserver(PREF_RIL_DEBUG_ENABLED, this, false); } DataCallInterfaceService.prototype = { classID: DATACALLINTERFACESERVICE_CID, diff --git a/dom/system/gonk/DataCallManager.js b/dom/system/gonk/DataCallManager.js index 4e52c4fb0df0..a050452fbe8d 100644 --- a/dom/system/gonk/DataCallManager.js +++ b/dom/system/gonk/DataCallManager.js @@ -107,9 +107,9 @@ function DataCallManager() { // Read the default client id for data call. lock.get("ril.data.defaultServiceId", this); - Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN); - Services.obs.addObserver(this, TOPIC_MOZSETTINGS_CHANGED); - Services.prefs.addObserver(PREF_RIL_DEBUG_ENABLED, this); + Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN, false); + Services.obs.addObserver(this, TOPIC_MOZSETTINGS_CHANGED, false); + Services.prefs.addObserver(PREF_RIL_DEBUG_ENABLED, this, false); } DataCallManager.prototype = { classID: DATACALLMANAGER_CID, diff --git a/dom/system/gonk/NetworkManager.js b/dom/system/gonk/NetworkManager.js index 1a51507b2c20..72478f0c9cef 100644 --- a/dom/system/gonk/NetworkManager.js +++ b/dom/system/gonk/NetworkManager.js @@ -177,9 +177,9 @@ function NetworkManager() { } catch(ex) { // Ignore. } - Services.prefs.addObserver(PREF_MANAGE_OFFLINE_STATUS, this); - Services.prefs.addObserver(PREF_NETWORK_DEBUG_ENABLED, this); - Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN); + Services.prefs.addObserver(PREF_MANAGE_OFFLINE_STATUS, this, false); + Services.prefs.addObserver(PREF_NETWORK_DEBUG_ENABLED, this, false); + Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN, false); this.setAndConfigureActive(); diff --git a/dom/system/gonk/NetworkService.js b/dom/system/gonk/NetworkService.js index a5c8d24d09b5..83fcf890e1b7 100644 --- a/dom/system/gonk/NetworkService.js +++ b/dom/system/gonk/NetworkService.js @@ -147,8 +147,8 @@ function NetworkService() { this.netWorkerRequestQueue = new NetworkWorkerRequestQueue(this); this.shutdown = false; - Services.prefs.addObserver(PREF_NETWORK_DEBUG_ENABLED, this); - Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN); + Services.prefs.addObserver(PREF_NETWORK_DEBUG_ENABLED, this, false); + Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN, false); } NetworkService.prototype = { diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 54c65edd4ad7..03aa5d92d089 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -404,8 +404,8 @@ function RadioInterfaceLayer() { this.radioInterfaces.push(new RadioInterface(clientId, workerMessenger)); } - Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); - Services.prefs.addObserver(kPrefRilDebuggingEnabled, this); + Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); + Services.prefs.addObserver(kPrefRilDebuggingEnabled, this, false); gRadioEnabledController.init(this); } @@ -649,11 +649,11 @@ function RadioInterface(aClientId, aWorkerMessenger) { // Set "time.timezone.automatic-update.available" to false when starting up. this.setTimezoneAutoUpdateAvailable(false); - Services.obs.addObserver(this, kMozSettingsChangedObserverTopic); - Services.obs.addObserver(this, kSysClockChangeObserverTopic); - Services.obs.addObserver(this, kScreenStateChangedTopic); + Services.obs.addObserver(this, kMozSettingsChangedObserverTopic, false); + Services.obs.addObserver(this, kSysClockChangeObserverTopic, false); + Services.obs.addObserver(this, kScreenStateChangedTopic, false); - Services.obs.addObserver(this, kNetworkConnStateChangedTopic); + Services.obs.addObserver(this, kNetworkConnStateChangedTopic, false); this._sntp = new Sntp(this.setClockBySntp.bind(this), Services.prefs.getIntPref("network.sntp.maxRetryCount"), diff --git a/dom/system/gonk/TetheringService.js b/dom/system/gonk/TetheringService.js index 383142a6448a..e7a22f3cab5e 100644 --- a/dom/system/gonk/TetheringService.js +++ b/dom/system/gonk/TetheringService.js @@ -122,11 +122,11 @@ function updateDebug() { updateDebug(); function TetheringService() { - Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN); - Services.obs.addObserver(this, TOPIC_MOZSETTINGS_CHANGED); - Services.obs.addObserver(this, TOPIC_CONNECTION_STATE_CHANGED); - Services.prefs.addObserver(PREF_NETWORK_DEBUG_ENABLED, this); - Services.prefs.addObserver(PREF_MANAGE_OFFLINE_STATUS, this); + Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN, false); + Services.obs.addObserver(this, TOPIC_MOZSETTINGS_CHANGED, false); + Services.obs.addObserver(this, TOPIC_CONNECTION_STATE_CHANGED, false); + Services.prefs.addObserver(PREF_NETWORK_DEBUG_ENABLED, this, false); + Services.prefs.addObserver(PREF_MANAGE_OFFLINE_STATUS, this, false); try { this._manageOfflineStatus = diff --git a/dom/system/gonk/tests/marionette/head.js b/dom/system/gonk/tests/marionette/head.js index 854f5a634932..5a6ee1272da5 100644 --- a/dom/system/gonk/tests/marionette/head.js +++ b/dom/system/gonk/tests/marionette/head.js @@ -190,7 +190,7 @@ function waitForObserverEvent(aTopic) { obs.removeObserver(observer, aTopic); deferred.resolve(subject); } - }, aTopic); + }, aTopic, false); return deferred.promise; } diff --git a/dom/tests/browser/browser_ConsoleAPI_originAttributes.js b/dom/tests/browser/browser_ConsoleAPI_originAttributes.js index ec0e27fa817e..77c357aa2b3f 100644 --- a/dom/tests/browser/browser_ConsoleAPI_originAttributes.js +++ b/dom/tests/browser/browser_ConsoleAPI_originAttributes.js @@ -14,7 +14,7 @@ const ConsoleObserver = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), init() { - Services.obs.addObserver(this, "console-api-log-event"); + Services.obs.addObserver(this, "console-api-log-event", false); }, uninit() { diff --git a/dom/tests/browser/browser_ConsoleStorageAPITests.js b/dom/tests/browser/browser_ConsoleStorageAPITests.js index 3a535b2d064f..742f6f877c3e 100644 --- a/dom/tests/browser/browser_ConsoleStorageAPITests.js +++ b/dom/tests/browser/browser_ConsoleStorageAPITests.js @@ -53,7 +53,7 @@ add_task(function*() } }; - Services.obs.addObserver(ConsoleObserver, "console-storage-cache-event"); + Services.obs.addObserver(ConsoleObserver, "console-storage-cache-event", false); // Redirect the browser to the test URI content.window.location = TEST_URI; diff --git a/dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js b/dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js index e3874e66d965..6044a4114f48 100644 --- a/dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js +++ b/dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js @@ -46,7 +46,7 @@ function test() { }; aWindow.Services.obs.addObserver( - consoleObserver, "console-api-log-event"); + consoleObserver, "console-api-log-event", false); aWindow.nativeConsole.log("foo bar baz (private: " + aIsPrivateMode + ")"); }, {capture: true, once: true}); diff --git a/dom/tests/browser/browser_allocateGigabyte.js b/dom/tests/browser/browser_allocateGigabyte.js index 1bef37dbff46..b291afe49f87 100644 --- a/dom/tests/browser/browser_allocateGigabyte.js +++ b/dom/tests/browser/browser_allocateGigabyte.js @@ -13,7 +13,7 @@ function expectProcessCreated() { ok(true, "Expect process created"); resolve(); } - os.addObserver(observer, topic); + os.addObserver(observer, topic, /* weak = */ false); }); } diff --git a/dom/tests/browser/browser_bug1004814.js b/dom/tests/browser/browser_bug1004814.js index f5711f7775dc..d69d86deaccb 100644 --- a/dom/tests/browser/browser_bug1004814.js +++ b/dom/tests/browser/browser_bug1004814.js @@ -24,7 +24,7 @@ add_task(function*() { } }; - Services.obs.addObserver(ConsoleObserver, "console-api-log-event"); + Services.obs.addObserver(ConsoleObserver, "console-api-log-event", false); // Redirect the browser to the correct document to start the test content.document.location = TEST_URI; diff --git a/dom/tests/browser/helper_largeAllocation.js b/dom/tests/browser/helper_largeAllocation.js index 8cbc55d66869..2f61835e808d 100644 --- a/dom/tests/browser/helper_largeAllocation.js +++ b/dom/tests/browser/helper_largeAllocation.js @@ -15,7 +15,7 @@ function expectProcessCreated() { ok(true, "Expect process created"); resolve(); } - os.addObserver(observer, topic); + os.addObserver(observer, topic, /* weak = */ false); kill = () => { os.removeObserver(observer, topic); ok(true, "Expect process created killed"); @@ -33,7 +33,7 @@ function expectNoProcess() { ok(false, "A process was created!"); os.removeObserver(observer, topic); } - os.addObserver(observer, topic); + os.addObserver(observer, topic, /* weak = */ false); return () => os.removeObserver(observer, topic); } diff --git a/dom/tests/mochitest/beacon/test_beaconCookies.html b/dom/tests/mochitest/beacon/test_beaconCookies.html index bc81647291ef..e2c4f3b7d56e 100644 --- a/dom/tests/mochitest/beacon/test_beaconCookies.html +++ b/dom/tests/mochitest/beacon/test_beaconCookies.html @@ -33,7 +33,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(options, callback) { @@ -60,7 +60,7 @@ function beginTest() { Services.obs.removeObserver(waitCookie, "cookie-changed"); ok(true, "cookie set by beacon request in normal window"); testOnPrivateWindow(); - }, "cookie-changed"); + }, "cookie-changed", false); aNormalWindow.gBrowser.selectedBrowser.loadURI(baseURL + "file_beaconCookies.html"); }); } @@ -71,7 +71,7 @@ function testOnPrivateWindow() { Services.obs.removeObserver(waitCookie, "private-cookie-changed"); ok(true, "private cookie set by beacon request in private window"); cleanup(); - }, "private-cookie-changed"); + }, "private-cookie-changed", false); aPrivateWindow.gBrowser.selectedBrowser.loadURI(baseURL + "file_beaconCookies.html"); }); } diff --git a/dom/tests/mochitest/bugs/test_bug534149.html b/dom/tests/mochitest/bugs/test_bug534149.html index aab1513e548a..0e874ae413f8 100644 --- a/dom/tests/mochitest/bugs/test_bug534149.html +++ b/dom/tests/mochitest/bugs/test_bug534149.html @@ -57,8 +57,8 @@ var innerObserver = { }; function removeFrame(iframe) { - SpecialPowers.addObserver(outerObserver, "outer-window-destroyed"); - SpecialPowers.addObserver(innerObserver, "inner-window-destroyed"); + SpecialPowers.addObserver(outerObserver, "outer-window-destroyed", false); + SpecialPowers.addObserver(innerObserver, "inner-window-destroyed", false); iframe.remove(); } diff --git a/dom/tests/mochitest/bugs/utils_bug260264.js b/dom/tests/mochitest/bugs/utils_bug260264.js index 108129393da9..1222c52bd48d 100644 --- a/dom/tests/mochitest/bugs/utils_bug260264.js +++ b/dom/tests/mochitest/bugs/utils_bug260264.js @@ -46,7 +46,7 @@ function send(element, event, handler) { } }; - SpecialPowers.addObserver(observer, "outer-window-destroyed"); + SpecialPowers.addObserver(observer, "outer-window-destroyed", false); }); })(win)); win.close(); diff --git a/dom/tests/mochitest/chrome/test_cyclecollector.xul b/dom/tests/mochitest/chrome/test_cyclecollector.xul index f7284054a00e..28bb5e7a9545 100644 --- a/dom/tests/mochitest/chrome/test_cyclecollector.xul +++ b/dom/tests/mochitest/chrome/test_cyclecollector.xul @@ -45,7 +45,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id= SpecialPowers.finishCC(); SpecialPowers.ccSlice(1); - obs.addObserver(observer, "cycle-collector-begin"); + obs.addObserver(observer, "cycle-collector-begin", false); SpecialPowers.DOMWindowUtils.cycleCollect(); diff --git a/dom/tests/mochitest/localstorage/localStorageCommon.js b/dom/tests/mochitest/localstorage/localStorageCommon.js index 5d5601f54164..2b1a0adbc228 100644 --- a/dom/tests/mochitest/localstorage/localStorageCommon.js +++ b/dom/tests/mochitest/localstorage/localStorageCommon.js @@ -7,7 +7,7 @@ function localStorageFlush(cb) cb(); } }; - os().addObserver(ob, "domstorage-test-flushed"); + os().addObserver(ob, "domstorage-test-flushed", false); notify("domstorage-test-flush-force"); } diff --git a/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html b/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html index fcb784016ab6..e02af83baf82 100644 --- a/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html +++ b/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html @@ -164,7 +164,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { aWindow.gBrowser.loadURI(CONTENT_PAGE); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(aIsPrivate, callback) { diff --git a/dom/tests/mochitest/storageevent/test_storageNotifications.html b/dom/tests/mochitest/storageevent/test_storageNotifications.html index 2f9ec51a8c09..f35954ad305a 100644 --- a/dom/tests/mochitest/storageevent/test_storageNotifications.html +++ b/dom/tests/mochitest/storageevent/test_storageNotifications.html @@ -52,7 +52,7 @@ function* Tests() // Listen for dom-storage2-changed notification SpecialPowers.Services.obs.addObserver(onStorageChanged, - "dom-storage2-changed"); + "dom-storage2-changed", false); // add an empty-value key localStorage.setItem("empty", ""); diff --git a/dom/tests/unit/test_geolocation_provider.js b/dom/tests/unit/test_geolocation_provider.js index 03294ac74162..06451b6b9895 100644 --- a/dom/tests/unit/test_geolocation_provider.js +++ b/dom/tests/unit/test_geolocation_provider.js @@ -85,7 +85,7 @@ function run_test() var obs = Cc["@mozilla.org/observer-service;1"].getService(); obs = obs.QueryInterface(Ci.nsIObserverService); - obs.addObserver(observer, "geolocation-device-events"); + obs.addObserver(observer, "geolocation-device-events", false); geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports); watchID = geolocation.watchPosition(successCallback, errorCallback); diff --git a/dom/workers/test/extensions/traditional/WorkerTest.js b/dom/workers/test/extensions/traditional/WorkerTest.js index 0cc36f2b240c..5890c0d4c68d 100644 --- a/dom/workers/test/extensions/traditional/WorkerTest.js +++ b/dom/workers/test/extensions/traditional/WorkerTest.js @@ -89,7 +89,7 @@ WorkerTest.prototype = { switch(topic) { case "profile-after-change": gWorkerAndCallback.start(); - Services.obs.addObserver(this, "profile-before-change"); + Services.obs.addObserver(this, "profile-before-change", false); break; case "profile-before-change": gWorkerAndCallback.stop(); diff --git a/dom/workers/test/serviceworkers/chrome_helpers.js b/dom/workers/test/serviceworkers/chrome_helpers.js index 42ce6cd9ef27..a438333e2791 100644 --- a/dom/workers/test/serviceworkers/chrome_helpers.js +++ b/dom/workers/test/serviceworkers/chrome_helpers.js @@ -69,6 +69,6 @@ function waitForServiceWorkerShutdown() { resolve(); } }; - SpecialPowers.addObserver(observer, "service-worker-shutdown"); + SpecialPowers.addObserver(observer, "service-worker-shutdown", false); }); } diff --git a/dom/workers/test/serviceworkers/test_devtools_serviceworker_interception.html b/dom/workers/test/serviceworkers/test_devtools_serviceworker_interception.html index b5c24b030ba7..d49ebb2c9363 100644 --- a/dom/workers/test/serviceworkers/test_devtools_serviceworker_interception.html +++ b/dom/workers/test/serviceworkers/test_devtools_serviceworker_interception.html @@ -140,7 +140,7 @@ function fetchAndCheckTimedChannel(aWindow, aIntercepted, aFetch, aURL) { resolveFunction(); } - SpecialPowers.addObserver(observer, topic); + SpecialPowers.addObserver(observer, topic, false); // return promise; return Promise.all([aWindow.fetch(aURL), promise]); diff --git a/dom/workers/test/test_WorkerDebugger_console.xul b/dom/workers/test/test_WorkerDebugger_console.xul index b3a362e00b73..0852002ea278 100644 --- a/dom/workers/test/test_WorkerDebugger_console.xul +++ b/dom/workers/test/test_WorkerDebugger_console.xul @@ -23,7 +23,7 @@ consoleMessagesReceived = 0; function test() { function consoleListener() { - SpecialPowers.addObserver(this, "console-api-log-event"); + SpecialPowers.addObserver(this, "console-api-log-event", false); } consoleListener.prototype = { diff --git a/dom/workers/test/test_consoleAndBlobs.html b/dom/workers/test/test_consoleAndBlobs.html index 67ec2ed524c0..e765500fa6c3 100644 --- a/dom/workers/test/test_consoleAndBlobs.html +++ b/dom/workers/test/test_consoleAndBlobs.html @@ -14,7 +14,7 @@ diff --git a/js/xpconnect/tests/mochitest/test_bug1158558.html b/js/xpconnect/tests/mochitest/test_bug1158558.html index 2bb6ef588e7a..3d142e44a65a 100644 --- a/js/xpconnect/tests/mochitest/test_bug1158558.html +++ b/js/xpconnect/tests/mochitest/test_bug1158558.html @@ -38,7 +38,7 @@ var observer = { } }; -SpecialPowers.addObserver(observer, "cycle-collector-begin"); +SpecialPowers.addObserver(observer, "cycle-collector-begin", false); SpecialPowers.Cu.forceCC(); diff --git a/layout/base/tests/browser_disableDialogs_onbeforeunload.js b/layout/base/tests/browser_disableDialogs_onbeforeunload.js index a5ea5a25987a..c9385f670cf9 100644 --- a/layout/base/tests/browser_disableDialogs_onbeforeunload.js +++ b/layout/base/tests/browser_disableDialogs_onbeforeunload.js @@ -20,7 +20,7 @@ add_task(function* enableDialogs() { dismissButton.click(); } let obsName = "tabmodal-dialog-loaded"; - Services.obs.addObserver(onDialogShown, obsName); + Services.obs.addObserver(onDialogShown, obsName, false); yield openPage(true); Services.obs.removeObserver(onDialogShown, obsName); Assert.ok(dialogShown); @@ -44,7 +44,7 @@ function* openPage(enableDialogs) { content.QueryInterface(Ci.nsIInterfaceRequestor). getInterface(Ci.nsIDOMWindowUtils)[name](); } - }, "document-element-inserted"); + }, "document-element-inserted", false); }); // Load the page. yield BrowserTestUtils.loadURI(browser, PAGE_URL); diff --git a/layout/base/tests/browser_onbeforeunload_only_after_interaction.js b/layout/base/tests/browser_onbeforeunload_only_after_interaction.js index ba6f4807342d..d079bcb380c9 100644 --- a/layout/base/tests/browser_onbeforeunload_only_after_interaction.js +++ b/layout/base/tests/browser_onbeforeunload_only_after_interaction.js @@ -20,7 +20,7 @@ add_task(function* doClick() { dismissButton.click(); } let obsName = "tabmodal-dialog-loaded"; - Services.obs.addObserver(onDialogShown, obsName); + Services.obs.addObserver(onDialogShown, obsName, false); yield* openPage(true); Services.obs.removeObserver(onDialogShown, obsName); Assert.ok(dialogShown, "Should have shown dialog."); diff --git a/layout/base/tests/browser_onbeforeunload_only_after_interaction_in_frame.js b/layout/base/tests/browser_onbeforeunload_only_after_interaction_in_frame.js index 17f110058bcf..34dbf230891f 100644 --- a/layout/base/tests/browser_onbeforeunload_only_after_interaction_in_frame.js +++ b/layout/base/tests/browser_onbeforeunload_only_after_interaction_in_frame.js @@ -23,7 +23,7 @@ add_task(function* doClick() { dismissButton.click(); } let obsName = "tabmodal-dialog-loaded"; - Services.obs.addObserver(onDialogShown, obsName); + Services.obs.addObserver(onDialogShown, obsName, false); yield* openPage(true); Services.obs.removeObserver(onDialogShown, obsName); Assert.ok(dialogShown, "Should have shown dialog."); diff --git a/layout/forms/test/test_bug536567_perwindowpb.html b/layout/forms/test/test_bug536567_perwindowpb.html index e0b3710b6395..a5b35519157f 100644 --- a/layout/forms/test/test_bug536567_perwindowpb.html +++ b/layout/forms/test/test_bug536567_perwindowpb.html @@ -145,7 +145,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(aIsPrivate, aCallback) { diff --git a/layout/tools/reftest/reftest-content.js b/layout/tools/reftest/reftest-content.js index 20e87f1748ef..29b174771798 100644 --- a/layout/tools/reftest/reftest-content.js +++ b/layout/tools/reftest/reftest-content.js @@ -586,7 +586,7 @@ function WaitForTestEnd(contentRootElement, inPrintMode, spellCheckedElements) { state = STATE_WAITING_TO_FINISH; MakeProgress(); }; - os.addObserver(flushWaiter, "apz-repaints-flushed"); + os.addObserver(flushWaiter, "apz-repaints-flushed", false); var willSnapshot = (gCurrentTestType != TYPE_SCRIPT) && (gCurrentTestType != TYPE_LOAD); diff --git a/layout/tools/reftest/reftest.jsm b/layout/tools/reftest/reftest.jsm index 7843a6d47687..1086b98f704f 100644 --- a/layout/tools/reftest/reftest.jsm +++ b/layout/tools/reftest/reftest.jsm @@ -2084,8 +2084,8 @@ function RegisterProcessCrashObservers() { var os = CC[NS_OBSERVER_SERVICE_CONTRACTID] .getService(CI.nsIObserverService); - os.addObserver(OnProcessCrashed, "plugin-crashed"); - os.addObserver(OnProcessCrashed, "ipc:content-shutdown"); + os.addObserver(OnProcessCrashed, "plugin-crashed", false); + os.addObserver(OnProcessCrashed, "ipc:content-shutdown", false); } function RecvExpectProcessCrash() diff --git a/mobile/android/chrome/content/CastingApps.js b/mobile/android/chrome/content/CastingApps.js index aa69915c4420..6d7f228d93ff 100644 --- a/mobile/android/chrome/content/CastingApps.js +++ b/mobile/android/chrome/content/CastingApps.js @@ -93,10 +93,10 @@ var CastingApps = { "Casting:Stop", ]); - Services.obs.addObserver(this, "ssdp-service-found"); - Services.obs.addObserver(this, "ssdp-service-lost"); - Services.obs.addObserver(this, "application-background"); - Services.obs.addObserver(this, "application-foreground"); + Services.obs.addObserver(this, "ssdp-service-found", false); + Services.obs.addObserver(this, "ssdp-service-lost", false); + Services.obs.addObserver(this, "application-background", false); + Services.obs.addObserver(this, "application-foreground", false); BrowserApp.deck.addEventListener("TabSelect", this, true); BrowserApp.deck.addEventListener("pageshow", this, true); diff --git a/mobile/android/chrome/content/PresentationView.js b/mobile/android/chrome/content/PresentationView.js index f4f5e226d9d9..4f7e02870c48 100644 --- a/mobile/android/chrome/content/PresentationView.js +++ b/mobile/android/chrome/content/PresentationView.js @@ -27,7 +27,7 @@ let PresentationView = { // Listen "presentation-receiver:launch" sent from // PresentationRequestUIGlue. - Services.obs.addObserver(this,TOPIC_PRESENTATION_RECEIVER_LAUNCH); + Services.obs.addObserver(this,TOPIC_PRESENTATION_RECEIVER_LAUNCH, false); // Notify PresentationView is ready. Services.obs.notifyObservers(null, TOPIC_PRESENTATION_VIEW_READY, this._id); diff --git a/mobile/android/chrome/content/RemoteDebugger.js b/mobile/android/chrome/content/RemoteDebugger.js index dac83bf9fa17..66a75062acbe 100644 --- a/mobile/android/chrome/content/RemoteDebugger.js +++ b/mobile/android/chrome/content/RemoteDebugger.js @@ -199,7 +199,7 @@ RemoteDebugger.receiveOOB = var USBRemoteDebugger = { init() { - Services.prefs.addObserver("devtools.", this); + Services.prefs.addObserver("devtools.", this, false); if (this.isEnabled) { this.start(); @@ -279,7 +279,7 @@ var USBRemoteDebugger = { var WiFiRemoteDebugger = { init() { - Services.prefs.addObserver("devtools.", this); + Services.prefs.addObserver("devtools.", this, false); if (this.isEnabled) { this.start(); diff --git a/mobile/android/chrome/content/WebcompatReporter.js b/mobile/android/chrome/content/WebcompatReporter.js index 82c68d6d3830..913f41d8d08a 100644 --- a/mobile/android/chrome/content/WebcompatReporter.js +++ b/mobile/android/chrome/content/WebcompatReporter.js @@ -16,8 +16,8 @@ var WebcompatReporter = { menuItemEnabled: null, init: function() { GlobalEventDispatcher.registerListener(this, "DesktopMode:Change"); - Services.obs.addObserver(this, "chrome-document-global-created"); - Services.obs.addObserver(this, "content-document-global-created"); + Services.obs.addObserver(this, "chrome-document-global-created", false); + Services.obs.addObserver(this, "content-document-global-created", false); let visible = true; if ("@mozilla.org/parental-controls-service;1" in Cc) { diff --git a/mobile/android/chrome/content/aboutHealthReport.js b/mobile/android/chrome/content/aboutHealthReport.js index 362abf846c7b..4584ff2c470c 100644 --- a/mobile/android/chrome/content/aboutHealthReport.js +++ b/mobile/android/chrome/content/aboutHealthReport.js @@ -39,8 +39,8 @@ var healthReportWrapper = { iframe.src = report.spec; console.log("AboutHealthReport: loading content from " + report.spec); - sharedPrefs.addObserver(PREF_UPLOAD_ENABLED, this); - Services.obs.addObserver(this, EVENT_HEALTH_RESPONSE); + sharedPrefs.addObserver(PREF_UPLOAD_ENABLED, this, false); + Services.obs.addObserver(this, EVENT_HEALTH_RESPONSE, false); }, observe: function (subject, topic, data) { diff --git a/mobile/android/chrome/content/aboutLogins.js b/mobile/android/chrome/content/aboutLogins.js index 5b85ba0bbdf4..62c185798a8d 100644 --- a/mobile/android/chrome/content/aboutLogins.js +++ b/mobile/android/chrome/content/aboutLogins.js @@ -154,7 +154,7 @@ var Logins = { init: function () { window.addEventListener("popstate", this); - Services.obs.addObserver(this, "passwordmgr-storage-changed"); + Services.obs.addObserver(this, "passwordmgr-storage-changed", false); document.getElementById("update-btn").addEventListener("click", this._onSaveEditLogin.bind(this)); document.getElementById("password-btn").addEventListener("click", this._onPasswordBtn.bind(this)); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 9087f07d3780..a8cac699b259 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -175,11 +175,11 @@ lazilyLoadedObserverScripts.forEach(function (aScript) { }); let observer = (s, t, d) => { Services.obs.removeObserver(observer, t); - Services.obs.addObserver(window[name], t); + Services.obs.addObserver(window[name], t, false); window[name].observe(s, t, d); // Explicitly notify new observer }; notifications.forEach((notification) => { - Services.obs.addObserver(observer, notification); + Services.obs.addObserver(observer, notification, false); }); }); @@ -420,13 +420,13 @@ var BrowserApp = { // Provide compatibility for add-ons like QuitNow that send "Browser:Quit" // as an observer notification. Services.obs.addObserver((subject, topic, data) => - this.quit(data ? JSON.parse(data) : undefined), "Browser:Quit"); + this.quit(data ? JSON.parse(data) : undefined), "Browser:Quit", false); - Services.obs.addObserver(this, "android-get-pref"); - Services.obs.addObserver(this, "android-set-pref"); - Services.obs.addObserver(this, "gather-telemetry"); - Services.obs.addObserver(this, "keyword-search"); - Services.obs.addObserver(this, "Vibration:Request"); + Services.obs.addObserver(this, "android-get-pref", false); + Services.obs.addObserver(this, "android-set-pref", false); + Services.obs.addObserver(this, "gather-telemetry", false); + Services.obs.addObserver(this, "keyword-search", false); + Services.obs.addObserver(this, "Vibration:Request", false); window.addEventListener("fullscreen", function() { WindowEventDispatcher.sendRequest({ @@ -1617,7 +1617,7 @@ var BrowserApp = { let paintDone = function() { window.removeEventListener("MozAfterPaint", paintDone); if (dwu.flushApzRepaints()) { - Services.obs.addObserver(apzFlushDone, "apz-repaints-flushed"); + Services.obs.addObserver(apzFlushDone, "apz-repaints-flushed", false); } else { apzFlushDone(); } @@ -3651,9 +3651,9 @@ Tab.prototype = { this.browser.addEventListener("VideoBindingAttached", this, true, true); this.browser.addEventListener("VideoBindingCast", this, true, true); - Services.obs.addObserver(this, "before-first-paint"); - Services.obs.addObserver(this, "media-playback"); - Services.obs.addObserver(this, "media-playback-resumed"); + Services.obs.addObserver(this, "before-first-paint", false); + Services.obs.addObserver(this, "media-playback", false); + Services.obs.addObserver(this, "media-playback-resumed", false); // Always initialise new tabs with basic session store data to avoid // problems with functions that always expect it to be present @@ -4694,8 +4694,8 @@ Tab.prototype = { var BrowserEventHandler = { init: function init() { this._clickInZoomedView = false; - Services.obs.addObserver(this, "Gesture:SingleTap"); - Services.obs.addObserver(this, "Gesture:ClickInZoomedView"); + Services.obs.addObserver(this, "Gesture:SingleTap", false); + Services.obs.addObserver(this, "Gesture:ClickInZoomedView", false); BrowserApp.deck.addEventListener("touchend", this, true); @@ -5004,8 +5004,8 @@ var FormAssistant = { "FormAssist:Remove", ]); - Services.obs.addObserver(this, "invalidformsubmit"); - Services.obs.addObserver(this, "PanZoom:StateChange"); + Services.obs.addObserver(this, "invalidformsubmit", false); + Services.obs.addObserver(this, "PanZoom:StateChange", false); // We need to use a capturing listener for focus events BrowserApp.deck.addEventListener("focus", this, true); @@ -5351,12 +5351,12 @@ var FormAssistant = { var XPInstallObserver = { init: function() { - Services.obs.addObserver(this, "addon-install-origin-blocked"); - Services.obs.addObserver(this, "addon-install-disabled"); - Services.obs.addObserver(this, "addon-install-blocked"); - Services.obs.addObserver(this, "addon-install-started"); - Services.obs.addObserver(this, "xpi-signature-changed"); - Services.obs.addObserver(this, "browser-delayed-startup-finished"); + Services.obs.addObserver(this, "addon-install-origin-blocked", false); + Services.obs.addObserver(this, "addon-install-disabled", false); + Services.obs.addObserver(this, "addon-install-blocked", false); + Services.obs.addObserver(this, "addon-install-started", false); + Services.obs.addObserver(this, "xpi-signature-changed", false); + Services.obs.addObserver(this, "browser-delayed-startup-finished", false); AddonManager.addInstallListener(this); }, @@ -5727,7 +5727,7 @@ var IndexedDB = { _permissionsResponse: "indexedDB-permissions-response", init: function IndexedDB_init() { - Services.obs.addObserver(this, this._permissionsPrompt); + Services.obs.addObserver(this, this._permissionsPrompt, false); }, observe: function IndexedDB_observe(subject, topic, data) { @@ -6171,7 +6171,7 @@ var SearchEngines = { "SearchEngines:RestoreDefaults", "SearchEngines:SetDefault", ]); - Services.obs.addObserver(this, "browser-search-engine-modified"); + Services.obs.addObserver(this, "browser-search-engine-modified", false); }, // Fetch list of search engines. all ? All engines : Visible engines only. @@ -6492,8 +6492,8 @@ var SearchEngines = { var ActivityObserver = { init: function ao_init() { - Services.obs.addObserver(this, "application-background"); - Services.obs.addObserver(this, "application-foreground"); + Services.obs.addObserver(this, "application-background", false); + Services.obs.addObserver(this, "application-foreground", false); }, observe: function ao_observe(aSubject, aTopic, aData) { @@ -6734,7 +6734,7 @@ var Distribution = { "Distribution:Changed", "Distribution:Set", ]); - Services.obs.addObserver(this, "prefservice:after-app-defaults"); + Services.obs.addObserver(this, "prefservice:after-app-defaults", false); // Look for file outside the APK: // /data/data/org.mozilla.xxx/distribution.json @@ -6962,7 +6962,7 @@ var Tabs = { if (BrowserApp.isOnLowMemoryPlatform) { this._enableTabExpiration = true; } else { - Services.obs.addObserver(this, "memory-pressure"); + Services.obs.addObserver(this, "memory-pressure", false); } GlobalEventDispatcher.registerListener(this, [ @@ -6972,7 +6972,7 @@ var Tabs = { // Track the network connection so we can efficiently use the cache // for possible offline rendering. - Services.obs.addObserver(this, "network:link-status-changed"); + Services.obs.addObserver(this, "network:link-status-changed", false); let network = Cc["@mozilla.org/network/network-link-service;1"].getService(Ci.nsINetworkLinkService); this.useCache = !network.isLinkUp; diff --git a/mobile/android/chrome/content/config.js b/mobile/android/chrome/content/config.js index 9e5a085775ea..fc5c9969027c 100644 --- a/mobile/android/chrome/content/config.js +++ b/mobile/android/chrome/content/config.js @@ -219,7 +219,7 @@ var AboutConfig = { this.bufferFilterInput(); // Setup the prefs observers - Services.prefs.addObserver("", this); + Services.prefs.addObserver("", this, false); }, // Uninit the main AboutConfig dialog diff --git a/mobile/android/components/FxAccountsPush.js b/mobile/android/components/FxAccountsPush.js index f83c3235b153..28b1bc48b404 100644 --- a/mobile/android/components/FxAccountsPush.js +++ b/mobile/android/components/FxAccountsPush.js @@ -23,7 +23,7 @@ const FXA_PUSH_SCOPE = "chrome://fxa-push"; const Log = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.bind("FxAccountsPush"); function FxAccountsPush() { - Services.obs.addObserver(this, "FxAccountsPush:ReceivedPushMessageToDecode"); + Services.obs.addObserver(this, "FxAccountsPush:ReceivedPushMessageToDecode", false); EventDispatcher.instance.sendRequestForResult({ type: "FxAccountsPush:Initialized" diff --git a/mobile/android/components/ImageBlockingPolicy.js b/mobile/android/components/ImageBlockingPolicy.js index 2c243d385969..2444bda0669c 100644 --- a/mobile/android/components/ImageBlockingPolicy.js +++ b/mobile/android/components/ImageBlockingPolicy.js @@ -32,7 +32,7 @@ const OPTION_WIFI_ONLY = 2; * Content policy for blocking images */ function ImageBlockingPolicy() { - Services.obs.addObserver(this, TOPIC_GATHER_TELEMETRY); + Services.obs.addObserver(this, TOPIC_GATHER_TELEMETRY, false); } ImageBlockingPolicy.prototype = { diff --git a/mobile/android/components/PresentationRequestUIGlue.js b/mobile/android/components/PresentationRequestUIGlue.js index b9e2fa8124fc..af252c875915 100644 --- a/mobile/android/components/PresentationRequestUIGlue.js +++ b/mobile/android/components/PresentationRequestUIGlue.js @@ -65,7 +65,8 @@ PresentationRequestUIGlue.prototype = { }; Services.obs.addObserver(handleObserve, - TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE); + TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE, + false); let data = { url: aURL, diff --git a/mobile/android/components/SessionStore.js b/mobile/android/components/SessionStore.js index 469847a62e89..e8a1de540630 100644 --- a/mobile/android/components/SessionStore.js +++ b/mobile/android/components/SessionStore.js @@ -114,18 +114,18 @@ SessionStore.prototype = { this._updateMaxTabsUndo(); Services.prefs.addObserver(PREFS_MAX_TABS_UNDO, () => { this._updateMaxTabsUndo(); - }); + }, false); // Copy changes in Gecko settings to their Java counterparts, // so the startup code can access them Services.prefs.addObserver(PREFS_RESTORE_FROM_CRASH, function() { SharedPreferences.forApp().setBoolPref(PREFS_RESTORE_FROM_CRASH, Services.prefs.getBoolPref(PREFS_RESTORE_FROM_CRASH)); - }); + }, false); Services.prefs.addObserver(PREFS_MAX_CRASH_RESUMES, function() { SharedPreferences.forApp().setIntPref(PREFS_MAX_CRASH_RESUMES, Services.prefs.getIntPref(PREFS_MAX_CRASH_RESUMES)); - }); + }, false); }, _updateMaxTabsUndo: function ss_updateMaxTabsUndo() { @@ -191,7 +191,7 @@ SessionStore.prototype = { this._startupRestoreFinished = true; log("startupRestoreFinished = true (through notification)"); }).bind(this); - Services.obs.addObserver(restoreCleanup, "sessionstore-windows-restored"); + Services.obs.addObserver(restoreCleanup, "sessionstore-windows-restored", false); // Do a restore, triggered by Java this.restoreLastSession(data.sessionString); diff --git a/mobile/android/extensions/flyweb/bootstrap.js b/mobile/android/extensions/flyweb/bootstrap.js index d1493b08afe5..bf437bc7be3d 100644 --- a/mobile/android/extensions/flyweb/bootstrap.js +++ b/mobile/android/extensions/flyweb/bootstrap.js @@ -134,7 +134,7 @@ function uninstall(aData, aReason) {} function startup(aData, aReason) { // Observe pref changes and enable/disable as necessary. - Services.prefs.addObserver(FLYWEB_ENABLED_PREF, prefObserver); + Services.prefs.addObserver(FLYWEB_ENABLED_PREF, prefObserver, false); // Only initialize if pref is enabled. let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF); diff --git a/mobile/android/modules/LightweightThemeConsumer.jsm b/mobile/android/modules/LightweightThemeConsumer.jsm index a2d98eb7deea..4b2c683edb1f 100644 --- a/mobile/android/modules/LightweightThemeConsumer.jsm +++ b/mobile/android/modules/LightweightThemeConsumer.jsm @@ -15,8 +15,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "EventDispatcher", function LightweightThemeConsumer(aDocument) { this._doc = aDocument; - Services.obs.addObserver(this, "lightweight-theme-styling-update"); - Services.obs.addObserver(this, "lightweight-theme-apply"); + Services.obs.addObserver(this, "lightweight-theme-styling-update", false); + Services.obs.addObserver(this, "lightweight-theme-apply", false); this._update(LightweightThemeManager.currentThemeForDisplay); } diff --git a/mobile/android/tests/browser/chrome/head.js b/mobile/android/tests/browser/chrome/head.js index 9bddecfbeb29..573fe36495a5 100644 --- a/mobile/android/tests/browser/chrome/head.js +++ b/mobile/android/tests/browser/chrome/head.js @@ -45,7 +45,7 @@ function promiseNotification(topic) { Services.obs.removeObserver(observe, topic); resolve(); } - Services.obs.addObserver(observe, topic); + Services.obs.addObserver(observe, topic, false); info("Now waiting for " + topic + " notification from Gecko"); }); } @@ -66,7 +66,7 @@ function promiseLinkVisit(url) { Services.obs.removeObserver(observe, topic); resolve(); }; - Services.obs.addObserver(observe, topic); + Services.obs.addObserver(observe, topic, false); info("Now waiting for " + topic + " notification from Gecko with URL " + url); }); } diff --git a/mobile/android/tests/browser/chrome/head_search.js b/mobile/android/tests/browser/chrome/head_search.js index 60e538a3fa2b..b6fb9444943f 100644 --- a/mobile/android/tests/browser/chrome/head_search.js +++ b/mobile/android/tests/browser/chrome/head_search.js @@ -36,7 +36,7 @@ var addTestEngines = Task.async(function* (aItems) { } catch (ex) { reject(ex); } - }, "browser-search-engine-modified"); + }, "browser-search-engine-modified", false); Services.search.addEngineWithDetails(item.name, ...item.details); }); diff --git a/mobile/android/tests/browser/chrome/test_device_search_engine.html b/mobile/android/tests/browser/chrome/test_device_search_engine.html index c7049e2940a8..9405ce61513c 100644 --- a/mobile/android/tests/browser/chrome/test_device_search_engine.html +++ b/mobile/android/tests/browser/chrome/test_device_search_engine.html @@ -55,7 +55,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186 SimpleTest.registerCleanupFunction(function() { Services.obs.removeObserver(search_observer, "browser-search-engine-modified"); }); - Services.obs.addObserver(search_observer, "browser-search-engine-modified"); + Services.obs.addObserver(search_observer, "browser-search-engine-modified", false); info("Loading search engine"); Services.search.addEngine("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/devicesearch.xml", Ci.nsISearchEngine.DATA_XML, null, false); diff --git a/mobile/android/tests/browser/chrome/test_get_last_visited.html b/mobile/android/tests/browser/chrome/test_get_last_visited.html index 56732b466b09..e0c58fee6663 100644 --- a/mobile/android/tests/browser/chrome/test_get_last_visited.html +++ b/mobile/android/tests/browser/chrome/test_get_last_visited.html @@ -38,7 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1214366 var uri = subject.QueryInterface(Ci.nsIURI); info("Witnessed " + topic + " notification from Gecko with URI " + uri.spec); } - Services.obs.addObserver(observe, "link-visited"); + Services.obs.addObserver(observe, "link-visited", false); SimpleTest.registerCleanupFunction(function cleanup() { BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser)); diff --git a/mobile/android/tests/browser/chrome/test_migrate_ui.html b/mobile/android/tests/browser/chrome/test_migrate_ui.html index be3076cfb0e6..9ade58f4a04c 100644 --- a/mobile/android/tests/browser/chrome/test_migrate_ui.html +++ b/mobile/android/tests/browser/chrome/test_migrate_ui.html @@ -38,7 +38,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186 Services.obs.removeObserver(searchObserver, "default-search-engine-migrated"); is(Services.search.defaultEngine.name, engines[0].name, "found expected default search engine"); } - Services.obs.addObserver(searchObserver, "default-search-engine-migrated"); + Services.obs.addObserver(searchObserver, "default-search-engine-migrated", false); }); diff --git a/mobile/android/tests/browser/chrome/test_offline_page.html b/mobile/android/tests/browser/chrome/test_offline_page.html index f7385a186711..5ace877fc522 100644 --- a/mobile/android/tests/browser/chrome/test_offline_page.html +++ b/mobile/android/tests/browser/chrome/test_offline_page.html @@ -30,7 +30,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186 Services.obs.removeObserver(observe, "network:offline-status-changed"); resolve(); } - Services.obs.addObserver(observe, "network:offline-status-changed"); + Services.obs.addObserver(observe, "network:offline-status-changed", false); Services.io.offline = isOffline; }); } diff --git a/mobile/android/tests/browser/chrome/test_settings_fontinflation.html b/mobile/android/tests/browser/chrome/test_settings_fontinflation.html index f3a2be40cbab..00859a4c459d 100644 --- a/mobile/android/tests/browser/chrome/test_settings_fontinflation.html +++ b/mobile/android/tests/browser/chrome/test_settings_fontinflation.html @@ -187,7 +187,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1328868 // Flipping the Android pref "on" should enable font inflation let observer = makeObserver(_observerId++); - Services.prefs.addObserver(GECKO_PREF_FONT_INFLATION, observer); + Services.prefs.addObserver(GECKO_PREF_FONT_INFLATION, observer, false); try { sharedPrefs.setBoolPref(ANDROID_PREF, true); @@ -202,7 +202,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1328868 // ... and turning it back off should disable it again. observer = makeObserver(_observerId++); - Services.prefs.addObserver(GECKO_PREF_FONT_INFLATION, observer); + Services.prefs.addObserver(GECKO_PREF_FONT_INFLATION, observer, false); try { sharedPrefs.setBoolPref(ANDROID_PREF, false); diff --git a/mobile/android/tests/browser/chrome/test_simple_discovery.html b/mobile/android/tests/browser/chrome/test_simple_discovery.html index f0c1d3296b75..a625970009f4 100644 --- a/mobile/android/tests/browser/chrome/test_simple_discovery.html +++ b/mobile/android/tests/browser/chrome/test_simple_discovery.html @@ -50,7 +50,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186 Services.obs.removeObserver(discovery_observer, "ssdp-service-found"); }); - Services.obs.addObserver(discovery_observer, "ssdp-service-found"); + Services.obs.addObserver(discovery_observer, "ssdp-service-found", false); // We need to register a device or processService will ignore us SimpleServiceDiscovery.registerDevice(testDevice); diff --git a/mobile/android/tests/browser/robocop/testHistoryService.js b/mobile/android/tests/browser/robocop/testHistoryService.js index 962889efd568..3160d0233c31 100644 --- a/mobile/android/tests/browser/robocop/testHistoryService.js +++ b/mobile/android/tests/browser/robocop/testHistoryService.js @@ -73,7 +73,7 @@ add_test(function setup_browser() { BrowserApp.closeTab(BrowserApp.getTabForBrowser(gBrowser)); }); - Services.obs.addObserver(visitObserver, "link-visited"); + Services.obs.addObserver(visitObserver, "link-visited", false); // Load a blank page let url = "about:blank"; diff --git a/modules/libpref/test/unit/test_bug345529.js b/modules/libpref/test/unit/test_bug345529.js index 192509e8448b..2e4616a6bd46 100644 --- a/modules/libpref/test/unit/test_bug345529.js +++ b/modules/libpref/test/unit/test_bug345529.js @@ -22,7 +22,7 @@ function run_test() { prefs.removeObserver(PREF_NAME, observer); } } - prefs.addObserver(PREF_NAME, observer); + prefs.addObserver(PREF_NAME, observer, false); prefs.setCharPref(PREF_NAME, "test0") // This second call isn't needed on a clean profile: it makes sure diff --git a/modules/libpref/test/unit/test_bug577950.js b/modules/libpref/test/unit/test_bug577950.js index ca8191671dba..b4f28e9021e6 100644 --- a/modules/libpref/test/unit/test_bug577950.js +++ b/modules/libpref/test/unit/test_bug577950.js @@ -23,6 +23,6 @@ function run_test() { } /* Set the same pref twice. This shouldn't leak. */ - pb.addObserver("UserPref.nonexistent.setIntPref", observer); - pb.addObserver("UserPref.nonexistent.setIntPref", observer); + pb.addObserver("UserPref.nonexistent.setIntPref", observer, false); + pb.addObserver("UserPref.nonexistent.setIntPref", observer, false); } diff --git a/modules/libpref/test/unit/test_libPrefs.js b/modules/libpref/test/unit/test_libPrefs.js index 339643a0ef1f..e3ebb36d5c41 100644 --- a/modules/libpref/test/unit/test_libPrefs.js +++ b/modules/libpref/test/unit/test_libPrefs.js @@ -365,7 +365,7 @@ function run_test() { this.name = expectedName; this.value = expectedValue; - prefBranch.addObserver(expectedName, this); + prefBranch.addObserver(expectedName, this, false); } QueryInterface(aIID) { diff --git a/modules/libpref/test/unit/test_stickyprefs.js b/modules/libpref/test/unit/test_stickyprefs.js index ecc8ecb831d2..c2c5a7c4b74e 100644 --- a/modules/libpref/test/unit/test_stickyprefs.js +++ b/modules/libpref/test/unit/test_stickyprefs.js @@ -163,7 +163,7 @@ add_test(function observerFires() { ps.removeObserver("testPref.sticky.bool", observe); run_next_test(); } - ps.addObserver("testPref.sticky.bool", observe); + ps.addObserver("testPref.sticky.bool", observe, false); ps.setBoolPref("testPref.sticky.bool", ps.getBoolPref("testPref.sticky.bool")); // and the observer will fire triggering the next text. diff --git a/netwerk/cookie/test/unit/test_bug1155169.js b/netwerk/cookie/test/unit/test_bug1155169.js index b16433dc3eff..448f11eabf44 100644 --- a/netwerk/cookie/test/unit/test_bug1155169.js +++ b/netwerk/cookie/test/unit/test_bug1155169.js @@ -60,7 +60,7 @@ function setCookie(value, expected) { do_check_eq(cookie.isHttpOnly, expected.isHttpOnly); } - Services.obs.addObserver(observer, "cookie-changed"); + Services.obs.addObserver(observer, "cookie-changed", false); cs.setCookieStringFromHttp(URI, null, null, value, null, null); Services.obs.removeObserver(observer, "cookie-changed"); } diff --git a/netwerk/dns/mdns/libmdns/fallback/MulticastDNS.jsm b/netwerk/dns/mdns/libmdns/fallback/MulticastDNS.jsm index 99785015e291..f43dfd5f8aac 100644 --- a/netwerk/dns/mdns/libmdns/fallback/MulticastDNS.jsm +++ b/netwerk/dns/mdns/libmdns/fallback/MulticastDNS.jsm @@ -129,7 +129,7 @@ class MulticastDNS { if (!this._isNetworkLinkObserverAttached) { DEBUG && debug('Attaching observer ' + NS_NETWORK_LINK_TOPIC); - observerService.addObserver(this._networkLinkObserver, NS_NETWORK_LINK_TOPIC); + observerService.addObserver(this._networkLinkObserver, NS_NETWORK_LINK_TOPIC, false); this._isNetworkLinkObserverAttached = true; } } diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm index dc3b908d91d0..af38d8831077 100644 --- a/netwerk/protocol/http/UserAgentOverrides.jsm +++ b/netwerk/protocol/http/UserAgentOverrides.jsm @@ -35,12 +35,12 @@ this.UserAgentOverrides = { return; gPrefBranch = Services.prefs.getBranch("general.useragent.override."); - gPrefBranch.addObserver("", buildOverrides); + gPrefBranch.addObserver("", buildOverrides, false); - Services.prefs.addObserver(PREF_OVERRIDES_ENABLED, buildOverrides); + Services.prefs.addObserver(PREF_OVERRIDES_ENABLED, buildOverrides, false); try { - Services.obs.addObserver(HTTP_on_useragent_request, "http-on-useragent-request"); + Services.obs.addObserver(HTTP_on_useragent_request, "http-on-useragent-request", false); } catch (x) { // The http-on-useragent-request notification is disallowed in content processes. } diff --git a/netwerk/protocol/http/UserAgentUpdates.jsm b/netwerk/protocol/http/UserAgentUpdates.jsm index 57ea0dab859d..602705ebe780 100644 --- a/netwerk/protocol/http/UserAgentUpdates.jsm +++ b/netwerk/protocol/http/UserAgentUpdates.jsm @@ -100,7 +100,7 @@ this.UserAgentUpdates = { this._lastUpdated = 0; this._applySavedUpdate(); - Services.prefs.addObserver(PREF_UPDATES, this); + Services.prefs.addObserver(PREF_UPDATES, this, false); }, uninit: function() { diff --git a/netwerk/test/browser/browser_child_resource.js b/netwerk/test/browser/browser_child_resource.js index ca45a3d69440..cd7d39ffbd10 100644 --- a/netwerk/test/browser/browser_child_resource.js +++ b/netwerk/test/browser/browser_child_resource.js @@ -49,7 +49,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'); diff --git a/netwerk/test/mochitests/test_rel_preconnect.html b/netwerk/test/mochitests/test_rel_preconnect.html index 8c5db3f01916..4e94fb4cee01 100644 --- a/netwerk/test/mochitests/test_rel_preconnect.html +++ b/netwerk/test/mochitests/test_rel_preconnect.html @@ -28,7 +28,7 @@ function doTest() SimpleTest.finish(); } }); - SpecialPowers.addObserver(observer, "speculative-connect-request"); + SpecialPowers.addObserver(observer, "speculative-connect-request", false); // test the link rel=preconnect element in the head for both normal // and crossOrigin=anonymous diff --git a/netwerk/test/mochitests/test_user_agent_updates.html b/netwerk/test/mochitests/test_user_agent_updates.html index b4820e2846b3..04182f04d670 100644 --- a/netwerk/test/mochitests/test_user_agent_updates.html +++ b/netwerk/test/mochitests/test_user_agent_updates.html @@ -241,7 +241,7 @@ const chromeScript = SpecialPowers.loadChromeScript(_ => { _notifyOnUpdate = false; // Only notify once, for the first update. sendAsyncMessage("useragent-update-complete"); } - }); + } , false); var OVERRIDES = null; diff --git a/netwerk/test/unit/test_bug482601.js b/netwerk/test/unit/test_bug482601.js index 9887d28af338..fde70f005e47 100644 --- a/netwerk/test/unit/test_bug482601.js +++ b/netwerk/test/unit/test_bug482601.js @@ -51,9 +51,9 @@ function run_test() { var obs = Cc["@mozilla.org/observer-service;1"].getService(); obs = obs.QueryInterface(Ci.nsIObserverService); - obs.addObserver(observer, "http-on-examine-response"); - obs.addObserver(observer, "http-on-examine-merged-response"); - obs.addObserver(observer, "http-on-examine-cached-response"); + obs.addObserver(observer, "http-on-examine-response", false); + obs.addObserver(observer, "http-on-examine-merged-response", false); + obs.addObserver(observer, "http-on-examine-cached-response", false); do_timeout(0, do_test); do_test_pending(); diff --git a/netwerk/test/unit/test_bug767025.js b/netwerk/test/unit/test_bug767025.js index 26a3ccbce889..374b57fd1fb6 100644 --- a/netwerk/test/unit/test_bug767025.js +++ b/netwerk/test/unit/test_bug767025.js @@ -117,7 +117,7 @@ function watch_update(update, stateChangeHandler, cacheAvailHandler) { updateStateChanged: stateChangeHandler, applicationCacheAvailable: cacheAvailHandler };~ - update.addObserver(observer); + update.addObserver(observer, false); return update; } diff --git a/netwerk/test/unit/test_cache2-30c-pinning-deferred-doom.js b/netwerk/test/unit/test_cache2-30c-pinning-deferred-doom.js index ff919cc2f291..91c621ce5958 100644 --- a/netwerk/test/unit/test_cache2-30c-pinning-deferred-doom.js +++ b/netwerk/test/unit/test_cache2-30c-pinning-deferred-doom.js @@ -127,7 +127,7 @@ function run_test() mc.fired(); // Finishes this test } - }, "cacheservice:purge-memory-pools"); + }, "cacheservice:purge-memory-pools", false); do_test_pending(); diff --git a/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js b/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js index da2630485c5b..07105d535fc8 100644 --- a/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js +++ b/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js @@ -106,7 +106,7 @@ function run_test() mc.fired(); // Finishes this test } - }, "cacheservice:purge-memory-pools"); + }, "cacheservice:purge-memory-pools", false); do_test_pending(); diff --git a/netwerk/test/unit/test_dns_proxy_bypass.js b/netwerk/test/unit/test_dns_proxy_bypass.js index 1920b5df1bfe..9f38ad67eee0 100644 --- a/netwerk/test/unit/test_dns_proxy_bypass.js +++ b/netwerk/test/unit/test_dns_proxy_bypass.js @@ -16,7 +16,7 @@ var dnsRequestObserver = { register: function() { this.obs = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - this.obs.addObserver(this, "dns-resolution-request"); + this.obs.addObserver(this, "dns-resolution-request", false); }, unregister: function() { diff --git a/netwerk/test/unit/test_fallback_no-cache-entry_canceled.js b/netwerk/test/unit/test_fallback_no-cache-entry_canceled.js index ad24f6c6de2f..2611a94424af 100644 --- a/netwerk/test/unit/test_fallback_no-cache-entry_canceled.js +++ b/netwerk/test/unit/test_fallback_no-cache-entry_canceled.js @@ -97,7 +97,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_fallback_no-cache-entry_passing.js b/netwerk/test/unit/test_fallback_no-cache-entry_passing.js index 3da11b0cb414..17f5be722098 100644 --- a/netwerk/test/unit/test_fallback_no-cache-entry_passing.js +++ b/netwerk/test/unit/test_fallback_no-cache-entry_passing.js @@ -95,7 +95,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js b/netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js index 57a9deec7095..4878fa02bacb 100644 --- a/netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js +++ b/netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js @@ -100,7 +100,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js b/netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js index c04157375f33..51b403ca048e 100644 --- a/netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js +++ b/netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js @@ -99,7 +99,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_fallback_request-error_canceled.js b/netwerk/test/unit/test_fallback_request-error_canceled.js index 48d70a586707..e97be3a51727 100644 --- a/netwerk/test/unit/test_fallback_request-error_canceled.js +++ b/netwerk/test/unit/test_fallback_request-error_canceled.js @@ -106,7 +106,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_fallback_request-error_passing.js b/netwerk/test/unit/test_fallback_request-error_passing.js index c37aa3b17007..ca88421dd1dc 100644 --- a/netwerk/test/unit/test_fallback_request-error_passing.js +++ b/netwerk/test/unit/test_fallback_request-error_passing.js @@ -104,7 +104,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_fallback_response-error_canceled.js b/netwerk/test/unit/test_fallback_response-error_canceled.js index 52f965d63394..164c19ce1cc9 100644 --- a/netwerk/test/unit/test_fallback_response-error_canceled.js +++ b/netwerk/test/unit/test_fallback_response-error_canceled.js @@ -101,7 +101,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_fallback_response-error_passing.js b/netwerk/test/unit/test_fallback_response-error_passing.js index e20034dd31d3..bbb4694af49e 100644 --- a/netwerk/test/unit/test_fallback_response-error_passing.js +++ b/netwerk/test/unit/test_fallback_response-error_passing.js @@ -99,7 +99,7 @@ function run_test() var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - os.addObserver(cacheUpdateObserver, "offline-cache-update-completed"); + os.addObserver(cacheUpdateObserver, "offline-cache-update-completed", false); var us = Cc["@mozilla.org/offlinecacheupdate-service;1"]. getService(Ci.nsIOfflineCacheUpdateService); diff --git a/netwerk/test/unit/test_httpcancel.js b/netwerk/test/unit/test_httpcancel.js index 255ca51597ab..cf19c5866603 100644 --- a/netwerk/test/unit/test_httpcancel.js +++ b/netwerk/test/unit/test_httpcancel.js @@ -91,7 +91,7 @@ function execute_test() { var obs = Components.classes["@mozilla.org/observer-service;1"].getService(); obs = obs.QueryInterface(Components.interfaces.nsIObserverService); - obs.addObserver(observer, "http-on-modify-request"); + obs.addObserver(observer, "http-on-modify-request", false); chan.asyncOpen2(listener); } diff --git a/netwerk/test/unit/test_offlinecache_custom-directory.js b/netwerk/test/unit/test_offlinecache_custom-directory.js index b0b233c6dd72..1b6c624731f4 100644 --- a/netwerk/test/unit/test_offlinecache_custom-directory.js +++ b/netwerk/test/unit/test_offlinecache_custom-directory.js @@ -145,7 +145,7 @@ function run_test() applicationCacheAvailable: function(appCache) { } - }); + }, false); do_test_pending(); } diff --git a/netwerk/test/unit/test_pinned_app_cache.js b/netwerk/test/unit/test_pinned_app_cache.js index acb464b9a67b..ffc249dc7d55 100644 --- a/netwerk/test/unit/test_pinned_app_cache.js +++ b/netwerk/test/unit/test_pinned_app_cache.js @@ -155,7 +155,7 @@ function watch_update(update, stateChangeHandler, cacheAvailHandler) { updateStateChanged: stateChangeHandler, applicationCacheAvailable: cacheAvailHandler }; - update.addObserver(observer); + update.addObserver(observer, false); return update; } diff --git a/netwerk/test/unit/test_predictor.js b/netwerk/test/unit/test_predictor.js index 1adb49bdd4d6..a2af56eed87e 100644 --- a/netwerk/test/unit/test_predictor.js +++ b/netwerk/test/unit/test_predictor.js @@ -531,7 +531,7 @@ var observer = { }; function registerObserver() { - Services.obs.addObserver(observer, "predictor-reset-complete"); + Services.obs.addObserver(observer, "predictor-reset-complete", false); } function unregisterObserver() { diff --git a/netwerk/test/unit/test_private_cookie_changed.js b/netwerk/test/unit/test_private_cookie_changed.js index 036563c2b6d8..6c6f31de4779 100644 --- a/netwerk/test/unit/test_private_cookie_changed.js +++ b/netwerk/test/unit/test_private_cookie_changed.js @@ -20,8 +20,8 @@ function run_test() { let publicNotifications = 0; let privateNotifications = 0; - Services.obs.addObserver(function() {publicNotifications++;}, "cookie-changed"); - Services.obs.addObserver(function() {privateNotifications++;}, "private-cookie-changed"); + Services.obs.addObserver(function() {publicNotifications++;}, "cookie-changed", false); + Services.obs.addObserver(function() {privateNotifications++;}, "private-cookie-changed", false); let uri = NetUtil.newURI("http://foo.com/"); let publicChan = makeChan(uri, false); diff --git a/netwerk/test/unit/test_protocolproxyservice.js b/netwerk/test/unit/test_protocolproxyservice.js index a1a7d274df14..f3d29cfb3bc0 100644 --- a/netwerk/test/unit/test_protocolproxyservice.js +++ b/netwerk/test/unit/test_protocolproxyservice.js @@ -879,7 +879,7 @@ function failed_script_callback(pi) // test that on-modify-request contains the proxy info too var obs = Components.classes["@mozilla.org/observer-service;1"].getService(); obs = obs.QueryInterface(Components.interfaces.nsIObserverService); - obs.addObserver(directFilterListener, "http-on-modify-request"); + obs.addObserver(directFilterListener, "http-on-modify-request", false); var chan = NetUtil.newChannel({ uri: "http://127.0.0.1:7247", diff --git a/netwerk/test/unit/test_suspend_channel_before_connect.js b/netwerk/test/unit/test_suspend_channel_before_connect.js index 38bc741ec37a..f41932a46700 100644 --- a/netwerk/test/unit/test_suspend_channel_before_connect.js +++ b/netwerk/test/unit/test_suspend_channel_before_connect.js @@ -87,7 +87,7 @@ add_test(function testNoConnectChannelCanceledEarly() { serv = new TestServer(); - obs.addObserver(requestListenerObserver, "http-on-modify-request"); + obs.addObserver(requestListenerObserver, "http-on-modify-request", false); var chan = NetUtil.newChannel({ uri:"http://localhost:" + serv.port, loadUsingSystemPrincipal: true diff --git a/netwerk/test/unit_ipc/test_channel_id.js b/netwerk/test/unit_ipc/test_channel_id.js index ba2ac2bd4b2c..d82e5f5df682 100644 --- a/netwerk/test/unit_ipc/test_channel_id.js +++ b/netwerk/test/unit_ipc/test_channel_id.js @@ -76,7 +76,7 @@ function observer(subject, topic, data) { function run_test() { startHttpServer(); - Services.obs.addObserver(observer, "http-on-modify-request"); + Services.obs.addObserver(observer, "http-on-modify-request", false); run_test_in_child("child_channel_id.js", makeRequests); } diff --git a/security/manager/pki/resources/content/certManager.js b/security/manager/pki/resources/content/certManager.js index 4e3f3d9a2417..b229705b4079 100644 --- a/security/manager/pki/resources/content/certManager.js +++ b/security/manager/pki/resources/content/certManager.js @@ -68,8 +68,8 @@ function DeregisterSmartCardObservers() { } function LoadCerts() { - Services.obs.addObserver(smartCardObserver, "smartcard-insert"); - Services.obs.addObserver(smartCardObserver, "smartcard-remove"); + Services.obs.addObserver(smartCardObserver, "smartcard-insert", false); + Services.obs.addObserver(smartCardObserver, "smartcard-remove", false); certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB); var certcache = certdb.getCerts(); diff --git a/security/manager/pki/resources/content/device_manager.js b/security/manager/pki/resources/content/device_manager.js index a4bdd9b5ee19..efba5dba53a6 100644 --- a/security/manager/pki/resources/content/device_manager.js +++ b/security/manager/pki/resources/content/device_manager.js @@ -38,8 +38,8 @@ function DeregisterSmartCardObservers() { function LoadModules() { bundle = document.getElementById("pippki_bundle"); secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB); - Services.obs.addObserver(smartCardObserver, "smartcard-insert"); - Services.obs.addObserver(smartCardObserver, "smartcard-remove"); + Services.obs.addObserver(smartCardObserver, "smartcard-insert", false); + Services.obs.addObserver(smartCardObserver, "smartcard-remove", false); RefreshDeviceList(); } diff --git a/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html b/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html index 080a0211a7f5..a07ab67fce2f 100644 --- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html +++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html @@ -66,7 +66,7 @@ SpecialPowers.Services.obs.removeObserver(observer, aTopic); SimpleTest.executeSoon(aCallback); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(aIsPrivate, aCallback) { diff --git a/security/manager/ssl/tests/unit/test_cert_blocklist.js b/security/manager/ssl/tests/unit/test_cert_blocklist.js index 2e3743f5ff40..7b36e2d977fa 100644 --- a/security/manager/ssl/tests/unit/test_cert_blocklist.js +++ b/security/manager/ssl/tests/unit/test_cert_blocklist.js @@ -181,7 +181,7 @@ function fetch_blocklist(blocklistPath) { } }; - Services.obs.addObserver(certblockObserver, "blocklist-updated"); + Services.obs.addObserver(certblockObserver, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", `http://localhost:${port}/${blocklistPath}`); let blocklist = Cc["@mozilla.org/extensions/blocklist;1"] diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic.js b/security/manager/ssl/tests/unit/test_pinning_dynamic.js index 2457725adc69..640c85163299 100644 --- a/security/manager/ssl/tests/unit/test_pinning_dynamic.js +++ b/security/manager/ssl/tests/unit/test_pinning_dynamic.js @@ -65,7 +65,7 @@ function run_test() { writeLine(`a.preload.example.com:HPKP\t0\t0\t${now + 100000},1,1,${PINNING_ROOT_KEY_HASH}\n`, outputStream); outputStream.close(); - Services.obs.addObserver(checkStateRead, "data-storage-ready"); + Services.obs.addObserver(checkStateRead, "data-storage-ready", false); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); diff --git a/security/manager/ssl/tests/unit/test_pkcs11_insert_remove.js b/security/manager/ssl/tests/unit/test_pkcs11_insert_remove.js index 89d4436e24dd..9ad2957c7904 100644 --- a/security/manager/ssl/tests/unit/test_pkcs11_insert_remove.js +++ b/security/manager/ssl/tests/unit/test_pkcs11_insert_remove.js @@ -33,9 +33,9 @@ SmartcardObserver.prototype = { function run_test() { Services.obs.addObserver(new SmartcardObserver("smartcard-insert"), - "smartcard-insert"); + "smartcard-insert", false); Services.obs.addObserver(new SmartcardObserver("smartcard-remove"), - "smartcard-remove"); + "smartcard-remove", false); loadPKCS11TestModule(false); } diff --git a/security/manager/ssl/tests/unit/test_pkcs11_no_events_after_removal.js b/security/manager/ssl/tests/unit/test_pkcs11_no_events_after_removal.js index f3aaa5b8854b..f31d1d494c6e 100644 --- a/security/manager/ssl/tests/unit/test_pkcs11_no_events_after_removal.js +++ b/security/manager/ssl/tests/unit/test_pkcs11_no_events_after_removal.js @@ -20,10 +20,10 @@ function run_test() { pkcs11.deleteModule("PKCS11 Test Module"); Services.obs.addObserver(function() { ok(false, "smartcard-insert event should not have been emitted"); - }, "smartcard-insert"); + }, "smartcard-insert", false); Services.obs.addObserver(function() { ok(false, "smartcard-remove event should not have been emitted"); - }, "smartcard-remove"); + }, "smartcard-remove", false); do_timeout(500, do_test_finished); do_test_pending(); } diff --git a/security/manager/ssl/tests/unit/test_sss_eviction.js b/security/manager/ssl/tests/unit/test_sss_eviction.js index 1ad21d47ef92..ddf581032256 100644 --- a/security/manager/ssl/tests/unit/test_sss_eviction.js +++ b/security/manager/ssl/tests/unit/test_sss_eviction.js @@ -61,7 +61,7 @@ function do_state_read(aSubject, aTopic, aData) { "max-age=1000", sslStatus, 0); } do_test_pending(); - Services.obs.addObserver(do_state_written, "data-storage-written"); + Services.obs.addObserver(do_state_written, "data-storage-written", false); do_test_finished(); } @@ -78,7 +78,7 @@ function run_test() { let line = "frequentlyused.example.com:HSTS\t4\t0\t" + (now + 100000) + ",1,0\n"; outputStream.write(line, line.length); outputStream.close(); - Services.obs.addObserver(do_state_read, "data-storage-ready"); + Services.obs.addObserver(do_state_read, "data-storage-ready", false); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); diff --git a/security/manager/ssl/tests/unit/test_sss_readstate.js b/security/manager/ssl/tests/unit/test_sss_readstate.js index 6015991e4d60..b11d4a1ce550 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate.js @@ -88,7 +88,7 @@ function run_test() { // This overrides an entry on the preload list. writeLine("includesubdomains2.preloaded.test:HSTS\t0\t0\t0,2,0\n", outputStream); outputStream.close(); - Services.obs.addObserver(checkStateRead, "data-storage-ready"); + Services.obs.addObserver(checkStateRead, "data-storage-ready", false); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_child.js b/security/manager/ssl/tests/unit/test_sss_readstate_child.js index 50d79037e764..80f00c31a757 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_child.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_child.js @@ -33,7 +33,7 @@ function run_test() { // This overrides an entry on the preload list. writeLine("includesubdomains2.preloaded.test:HSTS\t0\t0\t0,2,0\n", outputStream); outputStream.close(); - Services.obs.addObserver(start_test_in_child, "data-storage-ready"); + Services.obs.addObserver(start_test_in_child, "data-storage-ready", false); do_test_pending(); let SSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_empty.js b/security/manager/ssl/tests/unit/test_sss_readstate_empty.js index abd01e3fcff2..bd51defb9ee4 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_empty.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_empty.js @@ -35,7 +35,7 @@ function run_test() { ok(stateFile.exists()); // Initialize nsISiteSecurityService after do_get_profile() so it // can read the state file. - Services.obs.addObserver(checkStateRead, "data-storage-ready"); + Services.obs.addObserver(checkStateRead, "data-storage-ready", false); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js b/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js index c3b69fedefe4..281cc7932b4b 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js @@ -51,7 +51,7 @@ function run_test() { writeLine("example3.example.com:HSTS\t0\t\t\t\t\t\t\n", outputStream); writeLine("example2.example.com:HSTS\t0\t0\t" + (now + 100000) + ",1,0\n", outputStream); outputStream.close(); - Services.obs.addObserver(checkStateRead, "data-storage-ready"); + Services.obs.addObserver(checkStateRead, "data-storage-ready", false); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_huge.js b/security/manager/ssl/tests/unit/test_sss_readstate_huge.js index 549a99377746..cb76e66f26a9 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_huge.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_huge.js @@ -59,7 +59,7 @@ function run_test() { writeLine("example" + i + ".example.com:HSTS\t0000000000000000000000000000000000000000000000000\t00000000000000000000000000000000000000\t" + (now + 100000) + ",1,0000000000000000000000000000000000000000000000000000000000000000000000000\n", outputStream); } outputStream.close(); - Services.obs.addObserver(checkStateRead, "data-storage-ready"); + Services.obs.addObserver(checkStateRead, "data-storage-ready", false); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); diff --git a/security/manager/ssl/tests/unit/test_sss_savestate.js b/security/manager/ssl/tests/unit/test_sss_savestate.js index b40b42145769..5890ab9b596c 100644 --- a/security/manager/ssl/tests/unit/test_sss_savestate.js +++ b/security/manager/ssl/tests/unit/test_sss_savestate.js @@ -122,5 +122,5 @@ function run_test() { } do_test_pending(); - Services.obs.addObserver(checkStateWritten, "data-storage-written"); + Services.obs.addObserver(checkStateWritten, "data-storage-written", false); } diff --git a/security/manager/ssl/tests/unit/test_sts_preloadlist_perwindowpb.js b/security/manager/ssl/tests/unit/test_sts_preloadlist_perwindowpb.js index 71847b39a6c1..23eea3cb5137 100644 --- a/security/manager/ssl/tests/unit/test_sts_preloadlist_perwindowpb.js +++ b/security/manager/ssl/tests/unit/test_sts_preloadlist_perwindowpb.js @@ -22,7 +22,7 @@ function cleanup() { function run_test() { do_register_cleanup(cleanup); - Services.obs.addObserver(gObserver, "last-pb-context-exited"); + Services.obs.addObserver(gObserver, "last-pb-context-exited", false); add_test(test_part1); add_test(test_private_browsing1); diff --git a/services/cloudsync/CloudSyncAdapters.jsm b/services/cloudsync/CloudSyncAdapters.jsm index 219f32714771..acf413cd6aa6 100644 --- a/services/cloudsync/CloudSyncAdapters.jsm +++ b/services/cloudsync/CloudSyncAdapters.jsm @@ -25,7 +25,7 @@ this.Adapters = function() { let resume = function() { if (suspended) { - Services.obs.addObserver(observer, "cloudsync:user-sync"); + Services.obs.addObserver(observer, "cloudsync:user-sync", false); suspended = false; } }; diff --git a/services/cloudsync/CloudSyncBookmarks.jsm b/services/cloudsync/CloudSyncBookmarks.jsm index 2815f98e4cc4..4cb0bc7a7f60 100644 --- a/services/cloudsync/CloudSyncBookmarks.jsm +++ b/services/cloudsync/CloudSyncBookmarks.jsm @@ -232,7 +232,7 @@ var RootFolder = function(rootId, rootName) { let resume = function() { if (suspended) { - PlacesUtils.bookmarks.addObserver(observer); + PlacesUtils.bookmarks.addObserver(observer, false); suspended = false; } }; diff --git a/services/common/async.js b/services/common/async.js index 90dc3b541360..0f17df0068c0 100644 --- a/services/common/async.js +++ b/services/common/async.js @@ -124,7 +124,7 @@ this.Async = { exception.appIsShuttingDown = true; throw exception; }; - }, "quit-application"); + }, "quit-application", false); // In the common case, checkAppReady just returns true return (Async.checkAppReady = function() { return true; })(); }, diff --git a/services/common/hawkrequest.js b/services/common/hawkrequest.js index 8f158d881a47..a2fd9029f07d 100644 --- a/services/common/hawkrequest.js +++ b/services/common/hawkrequest.js @@ -158,7 +158,7 @@ this.Intl = function Intl() { this.Intl.prototype = { init() { - Services.prefs.addObserver("intl.accept_languages", this); + Services.prefs.addObserver("intl.accept_languages", this, false); }, uninit() { diff --git a/services/common/tests/unit/test_hawkrequest.js b/services/common/tests/unit/test_hawkrequest.js index c416fd7f5925..cad627094ba7 100644 --- a/services/common/tests/unit/test_hawkrequest.js +++ b/services/common/tests/unit/test_hawkrequest.js @@ -49,7 +49,7 @@ add_test(function test_intl_accept_language() { let hawk = new HAWKAuthenticatedRESTRequest("https://example.com"); - Services.prefs.addObserver("intl.accept_languages", checkLanguagePref); + Services.prefs.addObserver("intl.accept_languages", checkLanguagePref, false); setLanguagePref(languages[testCount]); function checkLanguagePref() { diff --git a/services/crypto/modules/WeaveCrypto.js b/services/crypto/modules/WeaveCrypto.js index 12905497e31b..39a4dcf37e80 100644 --- a/services/crypto/modules/WeaveCrypto.js +++ b/services/crypto/modules/WeaveCrypto.js @@ -49,7 +49,7 @@ WeaveCrypto.prototype = { init() { // Preferences. Add observer so we get notified of changes. this.prefBranch = Services.prefs.getBranch("services.sync.log."); - this.prefBranch.addObserver("cryptoDebug", this.observer); + this.prefBranch.addObserver("cryptoDebug", this.observer, false); this.observer._self = this; this.debug = this.prefBranch.getBoolPref("cryptoDebug", false); XPCOMUtils.defineLazyGetter(this, "encoder", () => new TextEncoder(UTF_LABEL)); diff --git a/services/fxaccounts/FxAccountsManager.jsm b/services/fxaccounts/FxAccountsManager.jsm index f63bc4d9a242..c5bdbbd29704 100644 --- a/services/fxaccounts/FxAccountsManager.jsm +++ b/services/fxaccounts/FxAccountsManager.jsm @@ -28,8 +28,8 @@ XPCOMUtils.defineLazyServiceGetter(this, "permissionManager", this.FxAccountsManager = { init() { - Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION); - Services.obs.addObserver(this, ON_FXA_UPDATE_NOTIFICATION); + Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION, false); + Services.obs.addObserver(this, ON_FXA_UPDATE_NOTIFICATION, false); }, observe(aSubject, aTopic, aData) { diff --git a/services/fxaccounts/FxAccountsPush.js b/services/fxaccounts/FxAccountsPush.js index c45c3b6fc326..8aa831fad6a3 100644 --- a/services/fxaccounts/FxAccountsPush.js +++ b/services/fxaccounts/FxAccountsPush.js @@ -79,9 +79,9 @@ FxAccountsPushService.prototype = { } // listen to new push messages, push changes and logout events - Services.obs.addObserver(this, this.pushService.pushTopic); - Services.obs.addObserver(this, this.pushService.subscriptionChangeTopic); - Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION); + Services.obs.addObserver(this, this.pushService.pushTopic, false); + Services.obs.addObserver(this, this.pushService.subscriptionChangeTopic, false); + Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION, false); this.log.debug("FxAccountsPush initialized"); return true; diff --git a/services/fxaccounts/tests/xpcshell/test_accounts.js b/services/fxaccounts/tests/xpcshell/test_accounts.js index 4c519be9eda3..4d415304e5a0 100644 --- a/services/fxaccounts/tests/xpcshell/test_accounts.js +++ b/services/fxaccounts/tests/xpcshell/test_accounts.js @@ -1531,7 +1531,7 @@ function makeObserver(aObserveTopic, aObserveFunc) { Services.obs.removeObserver(observer, aObserveTopic); } - Services.obs.addObserver(observer, aObserveTopic); + Services.obs.addObserver(observer, aObserveTopic, false); return removeMe; } diff --git a/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js b/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js index e87eafc9a509..1224531f25d4 100644 --- a/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js +++ b/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js @@ -17,7 +17,7 @@ function promiseNotification(topic) { Services.obs.removeObserver(observe, topic); resolve(); } - Services.obs.addObserver(observe, topic); + Services.obs.addObserver(observe, topic, false); }); } diff --git a/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js b/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js index 1ff6660c8942..59d79148761e 100644 --- a/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js +++ b/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js @@ -16,7 +16,7 @@ function promiseNotification(topic) { Services.obs.removeObserver(observe, topic); resolve(); } - Services.obs.addObserver(observe, topic); + Services.obs.addObserver(observe, topic, false); }); } diff --git a/services/fxaccounts/tests/xpcshell/test_profile.js b/services/fxaccounts/tests/xpcshell/test_profile.js index 7d26934fe5a2..e53f33df10b1 100644 --- a/services/fxaccounts/tests/xpcshell/test_profile.js +++ b/services/fxaccounts/tests/xpcshell/test_profile.js @@ -473,6 +473,6 @@ function makeObserver(aObserveTopic, aObserveFunc) { Services.obs.removeObserver(callback, aObserveTopic); } - Services.obs.addObserver(callback, aObserveTopic); + Services.obs.addObserver(callback, aObserveTopic, false); return removeMe; } diff --git a/services/fxaccounts/tests/xpcshell/test_push_service.js b/services/fxaccounts/tests/xpcshell/test_push_service.js index 5c0bcfc63f85..d8e6639747f3 100644 --- a/services/fxaccounts/tests/xpcshell/test_push_service.js +++ b/services/fxaccounts/tests/xpcshell/test_push_service.js @@ -163,7 +163,7 @@ add_test(function observePushTopicDeviceConnected() { Services.obs.removeObserver(obs, topic); run_next_test(); }; - Services.obs.addObserver(obs, ON_DEVICE_CONNECTED_NOTIFICATION); + Services.obs.addObserver(obs, ON_DEVICE_CONNECTED_NOTIFICATION, false); let pushService = new FxAccountsPushService({ pushService: mockPushService, @@ -218,7 +218,7 @@ add_test(function observePushTopicProfileUpdated() { Services.obs.removeObserver(obs, topic); run_next_test(); }; - Services.obs.addObserver(obs, ON_PROFILE_CHANGE_NOTIFICATION); + Services.obs.addObserver(obs, ON_PROFILE_CHANGE_NOTIFICATION, false); let pushService = new FxAccountsPushService({ pushService: mockPushService, diff --git a/services/fxaccounts/tests/xpcshell/test_web_channel.js b/services/fxaccounts/tests/xpcshell/test_web_channel.js index c20457131470..67b58fb73c05 100644 --- a/services/fxaccounts/tests/xpcshell/test_web_channel.js +++ b/services/fxaccounts/tests/xpcshell/test_web_channel.js @@ -463,7 +463,7 @@ function makeObserver(aObserveTopic, aObserveFunc) { Services.obs.removeObserver(callback, aObserveTopic); } - Services.obs.addObserver(callback, aObserveTopic); + Services.obs.addObserver(callback, aObserveTopic, false); return removeMe; } diff --git a/services/sync/Weave.js b/services/sync/Weave.js index b0b9492c40cc..02552c4ef304 100644 --- a/services/sync/Weave.js +++ b/services/sync/Weave.js @@ -87,7 +87,7 @@ WeaveService.prototype = { Services.obs.addObserver(function onReady() { Services.obs.removeObserver(onReady, "weave:service:ready"); deferred.resolve(); - }, "weave:service:ready"); + }, "weave:service:ready", false); this.ensureLoaded(); return deferred.promise; }, diff --git a/services/sync/modules/SyncedTabs.jsm b/services/sync/modules/SyncedTabs.jsm index 41bf0c5a37c2..01a02d637286 100644 --- a/services/sync/modules/SyncedTabs.jsm +++ b/services/sync/modules/SyncedTabs.jsm @@ -228,12 +228,12 @@ let SyncedTabsInternal = { }, }; -Services.obs.addObserver(SyncedTabsInternal, "weave:engine:sync:finish"); -Services.obs.addObserver(SyncedTabsInternal, "weave:service:start-over"); +Services.obs.addObserver(SyncedTabsInternal, "weave:engine:sync:finish", false); +Services.obs.addObserver(SyncedTabsInternal, "weave:service:start-over", false); // Observe the pref the indicates the state of the tabs engine has changed. // This will force consumers to re-evaluate the state of sync and update // accordingly. -Services.prefs.addObserver("services.sync.engine.tabs", SyncedTabsInternal); +Services.prefs.addObserver("services.sync.engine.tabs", SyncedTabsInternal, false); // The public interface. this.SyncedTabs = { diff --git a/services/sync/modules/browserid_identity.js b/services/sync/modules/browserid_identity.js index 8fbae8ee51d2..25dbaa1153ae 100644 --- a/services/sync/modules/browserid_identity.js +++ b/services/sync/modules/browserid_identity.js @@ -122,7 +122,7 @@ this.BrowserIDManager.prototype = { initialize() { for (let topic of OBSERVER_TOPICS) { - Services.obs.addObserver(this, topic); + Services.obs.addObserver(this, topic, false); } }, diff --git a/services/sync/modules/engines/prefs.js b/services/sync/modules/engines/prefs.js index 98355845ad0b..6f2a0309f8dd 100644 --- a/services/sync/modules/engines/prefs.js +++ b/services/sync/modules/engines/prefs.js @@ -239,7 +239,7 @@ PrefTracker.prototype = { }, startTracking() { - Services.prefs.addObserver("", this); + Services.prefs.addObserver("", this, false); }, stopTracking() { diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index eb0b8d7215fd..8a8e4c377bc6 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -308,7 +308,7 @@ Sync11Service.prototype = { Svc.Obs.add("weave:service:setup-complete", this); Svc.Obs.add("sync:collection_changed", this); // Pulled from FxAccountsCommon - Services.prefs.addObserver(PREFS_BRANCH + "engine.", this); + Services.prefs.addObserver(PREFS_BRANCH + "engine.", this, false); this.scheduler = new SyncScheduler(this); diff --git a/services/sync/tests/unit/test_history_tracker.js b/services/sync/tests/unit/test_history_tracker.js index 9e291a6a3cb3..afb762f02de9 100644 --- a/services/sync/tests/unit/test_history_tracker.js +++ b/services/sync/tests/unit/test_history_tracker.js @@ -45,7 +45,7 @@ async function promiseVisit(expectedType, expectedURI) { onPageChanged() {}, onDeleteVisits() {}, }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); }); } @@ -223,7 +223,7 @@ add_task(async function test_dont_track_expiration() { Services.obs.removeObserver(onExpiration, aTopic); // Remove the remaining page to update its score. PlacesUtils.history.remove(uriToRemove); - }, PlacesUtils.TOPIC_EXPIRATION_FINISHED); + }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false); // Force expiration of 1 entry. Services.prefs.setIntPref("places.history.expiration.max_pages", 0); diff --git a/services/sync/tps/extensions/mozmill/resource/modules/frame.js b/services/sync/tps/extensions/mozmill/resource/modules/frame.js index 10c6e944d225..dae8276b620d 100644 --- a/services/sync/tps/extensions/mozmill/resource/modules/frame.js +++ b/services/sync/tps/extensions/mozmill/resource/modules/frame.js @@ -417,7 +417,7 @@ try { function AppQuitObserver() { this.runner = null; - Services.obs.addObserver(this, "quit-application-requested"); + Services.obs.addObserver(this, "quit-application-requested", false); } AppQuitObserver.prototype = { diff --git a/services/sync/tps/extensions/mozmill/resource/modules/windows.js b/services/sync/tps/extensions/mozmill/resource/modules/windows.js index 870b17066158..12da33764d59 100644 --- a/services/sync/tps/extensions/mozmill/resource/modules/windows.js +++ b/services/sync/tps/extensions/mozmill/resource/modules/windows.js @@ -284,9 +284,9 @@ function init() { // Activate observer for new top level windows var observerService = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); - observerService.addObserver(windowReadyObserver, "toplevel-window-ready"); - observerService.addObserver(windowCloseObserver, "outer-window-destroyed"); - observerService.addObserver(enterLeavePrivateBrowsingObserver, "private-browsing"); + observerService.addObserver(windowReadyObserver, "toplevel-window-ready", false); + observerService.addObserver(windowCloseObserver, "outer-window-destroyed", false); + observerService.addObserver(enterLeavePrivateBrowsingObserver, "private-browsing", false); handleAttachEventListeners(); } diff --git a/storage/test/unit/test_vacuum.js b/storage/test/unit/test_vacuum.js index c4f37d5975ff..b42e46a1e311 100644 --- a/storage/test/unit/test_vacuum.js +++ b/storage/test/unit/test_vacuum.js @@ -90,7 +90,7 @@ const TESTS = [ Services.obs.addObserver(function onVacuum(aSubject, aTopic, aData) { Services.obs.removeObserver(onVacuum, aTopic); beginVacuumReceived = true; - }, "test-begin-vacuum"); + }, "test-begin-vacuum", false); // Wait for heavy IO notifications. let heavyIOTaskBeginReceived = false; @@ -105,7 +105,7 @@ const TESTS = [ } else if (aData == "vacuum-end") { heavyIOTaskEndReceived = true; } - }, "heavy-io-task"); + }, "heavy-io-task", false); // Wait for VACUUM end. Services.obs.addObserver(function onVacuum(aSubject, aTopic, aData) { @@ -117,7 +117,7 @@ const TESTS = [ do_check_true(heavyIOTaskEndReceived); print("Received onEndVacuum"); run_next_test(); - }, "test-end-vacuum"); + }, "test-end-vacuum", false); synthesize_idle_daily(); }, @@ -135,7 +135,7 @@ const TESTS = [ }, QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]) }; - Services.obs.addObserver(vacuumObserver, "test-begin-vacuum"); + Services.obs.addObserver(vacuumObserver, "test-begin-vacuum", false); // Check after a couple seconds that no VACUUM has been run. do_timeout(2000, function() { @@ -179,7 +179,7 @@ const TESTS = [ }, QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]) }; - Services.obs.addObserver(vacuumObserver, "test-begin-vacuum"); + Services.obs.addObserver(vacuumObserver, "test-begin-vacuum", false); // Check after a couple seconds that no VACUUM has been run. do_timeout(2000, function() { @@ -271,7 +271,7 @@ const TESTS = [ }, QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]) }; - Services.obs.addObserver(vacuumObserver, "test-begin-vacuum"); + Services.obs.addObserver(vacuumObserver, "test-begin-vacuum", false); // Check after a couple seconds that no VACUUM has been run. do_timeout(2000, function() { diff --git a/storage/test/unit/vacuumParticipant.js b/storage/test/unit/vacuumParticipant.js index 146f0f5edfd2..1e51a943a1e6 100644 --- a/storage/test/unit/vacuumParticipant.js +++ b/storage/test/unit/vacuumParticipant.js @@ -31,7 +31,7 @@ function getDatabase(aFile) { function vacuumParticipant() { this._dbConn = getDatabase(new_db_file("testVacuum")); - Services.obs.addObserver(this, "test-options"); + Services.obs.addObserver(this, "test-options", false); } vacuumParticipant.prototype = diff --git a/testing/marionette/components/marionette.js b/testing/marionette/components/marionette.js index 7639830a9db7..17c316fd7a36 100644 --- a/testing/marionette/components/marionette.js +++ b/testing/marionette/components/marionette.js @@ -134,7 +134,7 @@ function MarionetteComponent() { this.finalUIStartup = false; this.logger = this.setupLogger(prefs.logLevel); - Services.prefs.addObserver(PREF_ENABLED, this); + Services.prefs.addObserver(PREF_ENABLED, this, false); if (Preferences.isSet(PREF_ENABLED_FALLBACK)) { this.logger.warn(`Deprecated preference ${PREF_ENABLED_FALLBACK} detected, ` + @@ -197,7 +197,7 @@ MarionetteComponent.prototype.observe = function (subject, topic, data) { case "profile-after-change": // Using sessionstore-windows-restored as the xpcom category doesn't // seem to work, so we wait for that by adding an observer here. - Services.obs.addObserver(this, "sessionstore-windows-restored"); + Services.obs.addObserver(this, "sessionstore-windows-restored", false); prefs.readFromEnvironment(ENV_PREF_VAR); @@ -205,7 +205,7 @@ MarionetteComponent.prototype.observe = function (subject, topic, data) { // We want to suppress the modal dialog that's shown // when starting up in safe-mode to enable testing. if (Services.appinfo.inSafeMode) { - Services.obs.addObserver(this, "domwindowopened"); + Services.obs.addObserver(this, "domwindowopened", false); } } break; @@ -214,7 +214,7 @@ MarionetteComponent.prototype.observe = function (subject, topic, data) { if (this.gfxWindow === null || subject === this.gfxWindow) { Services.obs.removeObserver(this, topic); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); this.finalUIStartup = true; this.init(); } @@ -241,9 +241,9 @@ MarionetteComponent.prototype.observe = function (subject, topic, data) { } if (this.gfxWindow) { - Services.obs.addObserver(this, "domwindowclosed"); + Services.obs.addObserver(this, "domwindowclosed", false); } else { - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); this.finalUIStartup = true; this.init(); } diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js index 5a21a79023ff..1d4303e006d8 100644 --- a/testing/marionette/driver.js +++ b/testing/marionette/driver.js @@ -68,7 +68,7 @@ const globalMessageManager = Cc["@mozilla.org/globalmessagemanager;1"] var systemMessageListenerReady = false; Services.obs.addObserver(function() { systemMessageListenerReady = true; -}, "system-message-listener-ready"); +}, "system-message-listener-ready", false); this.Context = { CHROME: "chrome", @@ -2777,7 +2777,8 @@ GeckoDriver.prototype.quit = function* (cmd, resp) { let quitApplication = new Promise(resolve => { Services.obs.addObserver( (subject, topic, data) => resolve(data), - "quit-application"); + "quit-application", + false); }); Services.startup.quit(mode); diff --git a/testing/marionette/modal.js b/testing/marionette/modal.js index bf3dc1dc729c..95d3910f1c5a 100644 --- a/testing/marionette/modal.js +++ b/testing/marionette/modal.js @@ -44,7 +44,7 @@ modal.addHandler = function (handler) { Object.keys(this.handlers).map(topic => { this.handlers[topic].add(handler); - Services.obs.addObserver(handler, topic); + Services.obs.addObserver(handler, topic, false); }); }; diff --git a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm index f944617b2f87..be2cc1f02b59 100644 --- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm +++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm @@ -989,7 +989,7 @@ this.BrowserTestUtils = { }); }; - Services.obs.addObserver(observer, 'ipc:content-shutdown'); + Services.obs.addObserver(observer, 'ipc:content-shutdown', false); }); expectedPromises.push(crashCleanupPromise); diff --git a/testing/mochitest/browser-test.js b/testing/mochitest/browser-test.js index aabc86ecffb3..b559ddb992f8 100644 --- a/testing/mochitest/browser-test.js +++ b/testing/mochitest/browser-test.js @@ -33,8 +33,8 @@ var TabDestroyObserver = { promiseResolver: null, init: function() { - Services.obs.addObserver(this, "message-manager-close"); - Services.obs.addObserver(this, "message-manager-disconnect"); + Services.obs.addObserver(this, "message-manager-close", false); + Services.obs.addObserver(this, "message-manager-disconnect", false); }, destroy: function() { diff --git a/testing/mochitest/jetpack-addon-harness.js b/testing/mochitest/jetpack-addon-harness.js index 12a9cadc4fcd..99f16879cb06 100644 --- a/testing/mochitest/jetpack-addon-harness.js +++ b/testing/mochitest/jetpack-addon-harness.js @@ -115,7 +115,7 @@ function waitForResults() { Services.obs.removeObserver(arguments.callee, "sdk:test:results"); resolve(JSON.parse(data)); - }, "sdk:test:results"); + }, "sdk:test:results", false); }); } diff --git a/testing/mochitest/tests/Harness_sanity/specialPowers_framescript.js b/testing/mochitest/tests/Harness_sanity/specialPowers_framescript.js index ca67b5a0ea3c..da1b87782a49 100644 --- a/testing/mochitest/tests/Harness_sanity/specialPowers_framescript.js +++ b/testing/mochitest/tests/Harness_sanity/specialPowers_framescript.js @@ -10,4 +10,4 @@ var permChangedObs = { } }; -Services.obs.addObserver(permChangedObs, 'perm-changed'); +Services.obs.addObserver(permChangedObs, 'perm-changed', false); diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js index ad289238b2d0..08226bc759b7 100644 --- a/testing/mochitest/tests/SimpleTest/EventUtils.js +++ b/testing/mochitest/tests/SimpleTest/EventUtils.js @@ -620,7 +620,7 @@ function sendWheelAndPaint(aTarget, aOffsetX, aOffsetY, aEvent, aCallback, aWind }); } - SpecialPowers.Services.obs.addObserver(waitForPaints, "apz-repaints-flushed"); + SpecialPowers.Services.obs.addObserver(waitForPaints, "apz-repaints-flushed", false); if (!utils.flushApzRepaints(aWindow)) { waitForPaints(); } diff --git a/testing/modules/TestUtils.jsm b/testing/modules/TestUtils.jsm index e87cb9d5aa7c..52f18b2d169b 100644 --- a/testing/modules/TestUtils.jsm +++ b/testing/modules/TestUtils.jsm @@ -58,7 +58,7 @@ this.TestUtils = { Services.obs.removeObserver(observer, topic); reject(ex); } - }, topic); + }, topic, false); }); }, }; diff --git a/testing/specialpowers/content/SpecialPowersObserver.jsm b/testing/specialpowers/content/SpecialPowersObserver.jsm index 5a6537a65be6..6e20a184ca5a 100644 --- a/testing/specialpowers/content/SpecialPowersObserver.jsm +++ b/testing/specialpowers/content/SpecialPowersObserver.jsm @@ -108,7 +108,7 @@ SpecialPowersObserver.prototype._receiveMessage = function(aMessage) { SpecialPowersObserver.prototype.init = function() { var obs = Services.obs; - obs.addObserver(this, "chrome-document-global-created"); + obs.addObserver(this, "chrome-document-global-created", false); // Register special testing modules. var testsURI = Cc["@mozilla.org/file/directory_service;1"]. @@ -123,7 +123,7 @@ SpecialPowersObserver.prototype.init = function() Components.manager.QueryInterface(Ci.nsIComponentRegistrar). autoRegister(manifestFile); - obs.addObserver(this, "http-on-modify-request"); + obs.addObserver(this, "http-on-modify-request", false); this._loadFrameScript(); }; @@ -174,8 +174,8 @@ SpecialPowersObserver.prototype._addProcessCrashObservers = function() { var obs = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); - obs.addObserver(this, "plugin-crashed"); - obs.addObserver(this, "ipc:content-shutdown"); + obs.addObserver(this, "plugin-crashed", false); + obs.addObserver(this, "ipc:content-shutdown", false); this._processCrashObserversRegistered = true; }; @@ -198,7 +198,7 @@ SpecialPowersObserver.prototype._registerObservers = { _add: function(topic) { if (this._topics.indexOf(topic) < 0) { this._topics.push(topic); - Services.obs.addObserver(this, topic); + Services.obs.addObserver(this, topic, false); } }, observe: function (aSubject, aTopic, aData) { diff --git a/testing/specialpowers/content/specialpowers.js b/testing/specialpowers/content/specialpowers.js index c51b01f62564..dae858469084 100644 --- a/testing/specialpowers/content/specialpowers.js +++ b/testing/specialpowers/content/specialpowers.js @@ -62,7 +62,7 @@ function SpecialPowers(window) { ; } } - }, "inner-window-destroyed"); + }, "inner-window-destroyed", false); } SpecialPowers.prototype = new SpecialPowersAPI(); @@ -219,7 +219,7 @@ SpecialPowers.prototype.nestedFrameSetup = function() { let frameScript = "SpecialPowers.prototype.IsInNestedFrame=true;"; mm.loadFrameScript("data:," + frameScript, false); } - }, "remote-browser-shown"); + }, "remote-browser-shown", false); }; SpecialPowers.prototype.isServiceWorkerRegistered = function() { diff --git a/testing/specialpowers/content/specialpowersAPI.js b/testing/specialpowers/content/specialpowersAPI.js index 84be7155c618..896974ec2904 100644 --- a/testing/specialpowers/content/specialpowersAPI.js +++ b/testing/specialpowers/content/specialpowersAPI.js @@ -825,7 +825,7 @@ SpecialPowersAPI.prototype = { // main-process) and get signals from it. if (this.isMainProcess()) { this.permissionObserverProxy._specialPowersAPI = this; - Services.obs.addObserver(this.permissionObserverProxy, "perm-changed"); + Services.obs.addObserver(this.permissionObserverProxy, "perm-changed", false); } else { this.registerObservers("perm-changed"); // bind() is used to set 'this' to SpecialPowersAPI itself. @@ -1173,7 +1173,7 @@ SpecialPowersAPI.prototype = { // Now apply any prefs that may have been queued while we were applying self._applyPrefs(); }); - }); + }, false); for (var idx in pendingActions) { var pref = pendingActions[idx]; diff --git a/testing/talos/talos/pageloader/chrome/memory.js b/testing/talos/talos/pageloader/chrome/memory.js index 81110dd1ce1c..13af9e872357 100644 --- a/testing/talos/talos/pageloader/chrome/memory.js +++ b/testing/talos/talos/pageloader/chrome/memory.js @@ -20,9 +20,9 @@ function initializeMemoryCollector(callback, args) { memTimer = null; os.removeObserver(arguments.callee, "child-memory-reporter-update"); - os.addObserver(collectAndReport, "child-memory-reporter-update"); + os.addObserver(collectAndReport, "child-memory-reporter-update", false); gMemCallback(); - }, "child-memory-reporter-update"); + }, "child-memory-reporter-update", false); /* * Assume we have a child process, but if timer fires before we call the observer diff --git a/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js b/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js index 204f05986a88..a838de18211f 100644 --- a/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js +++ b/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js @@ -68,7 +68,7 @@ nsSessionRestoreTalosTest.prototype = { || sessionStartup.sessionType == Ci.nsISessionStartup.DEFER_SESSION) { this.onReady(false); } else { - Services.obs.addObserver(this, StartupPerformance.RESTORED_TOPIC); + Services.obs.addObserver(this, StartupPerformance.RESTORED_TOPIC, false); } }); } diff --git a/testing/talos/talos/talos-powers/components/TalosPowersService.js b/testing/talos/talos/talos-powers/components/TalosPowersService.js index 3267758c5174..1eb56f50af87 100644 --- a/testing/talos/talos/talos-powers/components/TalosPowersService.js +++ b/testing/talos/talos/talos-powers/components/TalosPowersService.js @@ -42,7 +42,7 @@ TalosPowersService.prototype = { Services.mm.addMessageListener("TalosPowersContent:ForceCCAndGC", this); Services.mm.addMessageListener("TalosPowersContent:GetStartupInfo", this); Services.mm.addMessageListener("TalosPowers:ParentExec:QueryMsg", this); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); }, uninit() { @@ -255,7 +255,7 @@ TalosPowersService.prototype = { mm.sendAsyncMessage("TalosPowersContent:GetStartupInfo:Result", startupInfo); }; - Services.obs.addObserver(obs, "widget-first-paint"); + Services.obs.addObserver(obs, "widget-first-paint", false); } else { mm.sendAsyncMessage("TalosPowersContent:GetStartupInfo:Result", startupInfo); diff --git a/testing/xpcshell/example/unit/check_profile.js b/testing/xpcshell/example/unit/check_profile.js index 8b7de5b38497..b2451c5f98b2 100644 --- a/testing/xpcshell/example/unit/check_profile.js +++ b/testing/xpcshell/example/unit/check_profile.js @@ -31,7 +31,7 @@ function check_do_get_profile(fireProfileAfterChange) obs.addObserver(() => { let val = observedTopics.get(topic) + 1; observedTopics.set(topic, val); - }, topic); + }, topic, false); } // Trigger profile creation. diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index a3f5be5f0318..9b4c179879a3 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -441,7 +441,7 @@ function _setupDebuggerServer(breakpointFiles, callback) { }; for (let topic of TOPICS) { - obsSvc.addObserver(observe, topic); + obsSvc.addObserver(observe, topic, false); } return DebuggerServer; } diff --git a/toolkit/components/aboutperformance/content/aboutPerformance.js b/toolkit/components/aboutperformance/content/aboutPerformance.js index a3727e39ee6e..efd0c5586cb8 100644 --- a/toolkit/components/aboutperformance/content/aboutPerformance.js +++ b/toolkit/components/aboutperformance/content/aboutPerformance.js @@ -990,7 +990,7 @@ var go = Task.async(function*() { Control._setOptions(options); Control.update(); }; - Services.obs.addObserver(testUpdate, TEST_DRIVER_TOPIC); + Services.obs.addObserver(testUpdate, TEST_DRIVER_TOPIC, false); window.addEventListener("unload", () => Services.obs.removeObserver(testUpdate, TEST_DRIVER_TOPIC)); yield Control.update(); diff --git a/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js b/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js index 1ae94d219cbf..dfd5a1c20efe 100644 --- a/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js +++ b/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js @@ -61,7 +61,7 @@ function frameScript() { } } } - Services.obs.addObserver(observer, "about:performance-update-complete"); + Services.obs.addObserver(observer, "about:performance-update-complete", false); Services.obs.notifyObservers(null, "test-about:performance-test-driver", JSON.stringify(options)); }); @@ -183,7 +183,7 @@ function frameScript() { sendAsyncMessage("aboutperformance-test:hasItems", {hasTitleInWebpages, mode}); } } - Services.obs.addObserver(observer, "about:performance-update-complete"); + Services.obs.addObserver(observer, "about:performance-update-complete", false); Services.obs.notifyObservers(null, "test-about:performance-test-driver", JSON.stringify(options)); }); } diff --git a/toolkit/components/addoncompat/Prefetcher.jsm b/toolkit/components/addoncompat/Prefetcher.jsm index d3a5bd4e71a8..c7737485d8c3 100644 --- a/toolkit/components/addoncompat/Prefetcher.jsm +++ b/toolkit/components/addoncompat/Prefetcher.jsm @@ -349,8 +349,8 @@ var Prefetcher = { } this.prefetchingEnabled = Preferences.get(PREF_PREFETCHING_ENABLED, false); - Services.prefs.addObserver(PREF_PREFETCHING_ENABLED, this); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.prefs.addObserver(PREF_PREFETCHING_ENABLED, this, false); + Services.obs.addObserver(this, "xpcom-shutdown", false); }, observe(subject, topic, data) { diff --git a/toolkit/components/addoncompat/RemoteAddonsChild.jsm b/toolkit/components/addoncompat/RemoteAddonsChild.jsm index 7c225b84b7c6..86939c1b7f58 100644 --- a/toolkit/components/addoncompat/RemoteAddonsChild.jsm +++ b/toolkit/components/addoncompat/RemoteAddonsChild.jsm @@ -483,7 +483,7 @@ var ObserverChild = { track(path, register) { let topic = path[1]; if (register) { - Services.obs.addObserver(this, topic); + Services.obs.addObserver(this, topic, false); } else { Services.obs.removeObserver(this, topic); } diff --git a/toolkit/components/addoncompat/tests/addon/bootstrap.js b/toolkit/components/addoncompat/tests/addon/bootstrap.js index 1fcf8af8ff5d..150474dfe9c9 100644 --- a/toolkit/components/addoncompat/tests/addon/bootstrap.js +++ b/toolkit/components/addoncompat/tests/addon/bootstrap.js @@ -181,7 +181,7 @@ function testObserver() { Services.obs.removeObserver(observer, "document-element-inserted"); observerFired++; } - Services.obs.addObserver(observer, "document-element-inserted"); + Services.obs.addObserver(observer, "document-element-inserted", false); let count = 0; const url = baseURL + "browser_addonShims_testpage.html"; diff --git a/toolkit/components/asyncshutdown/AsyncShutdown.jsm b/toolkit/components/asyncshutdown/AsyncShutdown.jsm index e16aebb8abc3..b20dd2b27518 100644 --- a/toolkit/components/asyncshutdown/AsyncShutdown.jsm +++ b/toolkit/components/asyncshutdown/AsyncShutdown.jsm @@ -83,7 +83,7 @@ var DELAY_CRASH_MS = Services.prefs.getIntPref(PREF_DELAY_CRASH_MS, 60 * 1000); // One minute Services.prefs.addObserver(PREF_DELAY_CRASH_MS, function() { DELAY_CRASH_MS = Services.prefs.getIntPref(PREF_DELAY_CRASH_MS); -}); +}, false); /** * A set of Promise that supports waiting. @@ -206,7 +206,7 @@ const PREF_DEBUG_LOG = "toolkit.asyncshutdown.log"; var DEBUG_LOG = Services.prefs.getBoolPref(PREF_DEBUG_LOG, false); Services.prefs.addObserver(PREF_DEBUG_LOG, function() { DEBUG_LOG = Services.prefs.getBoolPref(PREF_DEBUG_LOG); -}); +}, false); function debug(msg, error = null) { if (DEBUG_LOG) { @@ -470,7 +470,7 @@ function getPhase(topic) { function Spinner(topic) { this._barrier = new Barrier(topic); this._topic = topic; - Services.obs.addObserver(this, topic); + Services.obs.addObserver(this, topic, false); } Spinner.prototype = { diff --git a/toolkit/components/captivedetect/test/unit/test_abort.js b/toolkit/components/captivedetect/test/unit/test_abort.js index 6a385684bcc8..043f827928f4 100644 --- a/toolkit/components/captivedetect/test/unit/test_abort.js +++ b/toolkit/components/captivedetect/test/unit/test_abort.js @@ -26,7 +26,7 @@ function fakeUIResponse() { if (topic === "captive-portal-login") { do_throw("should not receive captive-portal-login event"); } - }, "captive-portal-login"); + }, "captive-portal-login", false); } function test_abort() { diff --git a/toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js b/toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js index 778161af661e..ea1e7ac341f1 100644 --- a/toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js +++ b/toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js @@ -34,14 +34,14 @@ function fakeUIResponse() { requestId = JSON.parse(data).id; gCaptivePortalDetector.abort(kInterfaceName); } - }, "captive-portal-login"); + }, "captive-portal-login", false); Services.obs.addObserver(function observe(subject, topic, data) { if (topic === "captive-portal-login-abort") { do_check_eq(++step, 3); do_check_eq(JSON.parse(data).id, requestId); gServer.stop(do_test_finished); } - }, "captive-portal-login-abort"); + }, "captive-portal-login-abort", false); } function test_abort() { diff --git a/toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js b/toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js index 7e173f1bed74..2931840bec07 100644 --- a/toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js +++ b/toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js @@ -32,7 +32,7 @@ function fakeUIResponse() { loginFinished = true; do_check_eq(++step, 3); } - }, "captive-portal-login"); + }, "captive-portal-login", false); } function test_multiple_requests_abort() { diff --git a/toolkit/components/captivedetect/test/unit/test_abort_pending_request.js b/toolkit/components/captivedetect/test/unit/test_abort_pending_request.js index b3193ae6f915..85064a9e2c11 100644 --- a/toolkit/components/captivedetect/test/unit/test_abort_pending_request.js +++ b/toolkit/components/captivedetect/test/unit/test_abort_pending_request.js @@ -32,7 +32,7 @@ function fakeUIResponse() { loginFinished = true; do_check_eq(++step, 2); } - }, "captive-portal-login"); + }, "captive-portal-login", false); } function test_abort() { diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_found.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_found.js index a8fa239a51a4..ca7ef28f3a52 100644 --- a/toolkit/components/captivedetect/test/unit/test_captive_portal_found.js +++ b/toolkit/components/captivedetect/test/unit/test_captive_portal_found.js @@ -31,14 +31,14 @@ function fakeUIResponse() { loginFinished = true; do_check_eq(++step, 2); } - }, "captive-portal-login"); + }, "captive-portal-login", false); Services.obs.addObserver(function observe(subject, topic, data) { if (topic === "captive-portal-login-success") { do_check_eq(++step, 4); gServer.stop(do_test_finished); } - }, "captive-portal-login-success"); + }, "captive-portal-login-success", false); } function test_portal_found() { diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js index d9d4def506d0..2f9005cd00bc 100644 --- a/toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js +++ b/toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js @@ -35,7 +35,7 @@ function fakeUIResponse() { loginFinished = true; do_check_eq(++step, 2); } - }, "captive-portal-login"); + }, "captive-portal-login", false); Services.obs.addObserver(function observe(subject, topic, data) { if (topic === "captive-portal-login-success") { @@ -44,7 +44,7 @@ function fakeUIResponse() { gRedirectServer.stop(do_test_finished); }); } - }, "captive-portal-login-success"); + }, "captive-portal-login-success", false); } function test_portal_found() { diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js index 4766d64288d4..6158537bfe5b 100644 --- a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js +++ b/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js @@ -24,7 +24,7 @@ function fakeUIResponse() { if (topic == "captive-portal-login") { do_throw("should not receive captive-portal-login event"); } - }, "captive-portal-login"); + }, "captive-portal-login", false); } function test_portal_not_found() { diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js index b4b3bba2588a..0af769b1532d 100644 --- a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js +++ b/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js @@ -21,7 +21,7 @@ function fakeUIResponse() { if (topic === "captive-portal-login") { do_throw("should not receive captive-portal-login event"); } - }, "captive-portal-login"); + }, "captive-portal-login", false); } function test_portal_not_found() { diff --git a/toolkit/components/captivedetect/test/unit/test_multiple_requests.js b/toolkit/components/captivedetect/test/unit/test_multiple_requests.js index 6eb5e6d46d6c..a4d5a432a5da 100644 --- a/toolkit/components/captivedetect/test/unit/test_multiple_requests.js +++ b/toolkit/components/captivedetect/test/unit/test_multiple_requests.js @@ -33,7 +33,7 @@ function fakeUIResponse() { loginFinished = true; do_check_eq(++step, 2); } - }, "captive-portal-login"); + }, "captive-portal-login", false); Services.obs.addObserver(function observe(subject, topic, data) { if (topic === "captive-portal-login-success") { @@ -43,7 +43,7 @@ function fakeUIResponse() { } do_check_eq(++step, 4); } - }, "captive-portal-login-success"); + }, "captive-portal-login-success", false); } function test_multiple_requests() { diff --git a/toolkit/components/captivedetect/test/unit/test_user_cancel.js b/toolkit/components/captivedetect/test/unit/test_user_cancel.js index 21f631b5fdc2..0027002e5d83 100644 --- a/toolkit/components/captivedetect/test/unit/test_user_cancel.js +++ b/toolkit/components/captivedetect/test/unit/test_user_cancel.js @@ -27,7 +27,7 @@ function fakeUIResponse() { let details = JSON.parse(data); gCaptivePortalDetector.cancelLogin(details.id); } - }, "captive-portal-login"); + }, "captive-portal-login", false); } function test_cancel() { diff --git a/toolkit/components/contentprefs/nsContentPrefService.js b/toolkit/components/contentprefs/nsContentPrefService.js index 62eae4cf6336..90693d271c25 100644 --- a/toolkit/components/contentprefs/nsContentPrefService.js +++ b/toolkit/components/contentprefs/nsContentPrefService.js @@ -24,10 +24,10 @@ function ContentPrefService() { // was due to a temporary condition (like being out of disk space). this._dbInit(); - this._observerSvc.addObserver(this, "last-pb-context-exited"); + this._observerSvc.addObserver(this, "last-pb-context-exited", false); // Observe shutdown so we can shut down the database connection. - this._observerSvc.addObserver(this, "xpcom-shutdown"); + this._observerSvc.addObserver(this, "xpcom-shutdown", false); } Cu.import("resource://gre/modules/ContentPrefStore.jsm"); diff --git a/toolkit/components/crashmonitor/CrashMonitor.jsm b/toolkit/components/crashmonitor/CrashMonitor.jsm index 1dd5d44daaee..2ee173527507 100644 --- a/toolkit/components/crashmonitor/CrashMonitor.jsm +++ b/toolkit/components/crashmonitor/CrashMonitor.jsm @@ -166,7 +166,7 @@ this.CrashMonitor = { CrashMonitorInternal.checkpoints["profile-after-change"] = true; NOTIFICATIONS.forEach(function(aTopic) { - Services.obs.addObserver(this, aTopic); + Services.obs.addObserver(this, aTopic, false); }, this); // Add shutdown blocker for profile-before-change diff --git a/toolkit/components/extensions/Extension.jsm b/toolkit/components/extensions/Extension.jsm index c9f10b2d48fd..e080ac30ea8d 100644 --- a/toolkit/components/extensions/Extension.jsm +++ b/toolkit/components/extensions/Extension.jsm @@ -649,7 +649,7 @@ this.Extension = class extends ExtensionData { Services.ppmm.addMessageListener(this.MESSAGE_EMIT_EVENT, this); if (addonData.cleanupFile) { - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); this.cleanupFile = addonData.cleanupFile || null; delete addonData.cleanupFile; } @@ -856,8 +856,8 @@ this.Extension = class extends ExtensionData { } }; ppmm.addMessageListener(msg + "Complete", listener); - Services.obs.addObserver(observer, "message-manager-close"); - Services.obs.addObserver(observer, "message-manager-disconnect"); + Services.obs.addObserver(observer, "message-manager-close", false); + Services.obs.addObserver(observer, "message-manager-disconnect", false); ppmm.broadcastAsyncMessage(msg, data); }); diff --git a/toolkit/components/extensions/ExtensionContent.jsm b/toolkit/components/extensions/ExtensionContent.jsm index 8dfb7f3cb099..47a39e1aee2d 100644 --- a/toolkit/components/extensions/ExtensionContent.jsm +++ b/toolkit/components/extensions/ExtensionContent.jsm @@ -646,12 +646,12 @@ DocumentManager = { init() { if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) { - Services.obs.addObserver(this, "http-on-opening-request"); + Services.obs.addObserver(this, "http-on-opening-request", false); } - Services.obs.addObserver(this, "content-document-global-created"); - Services.obs.addObserver(this, "document-element-inserted"); - Services.obs.addObserver(this, "inner-window-destroyed"); - Services.obs.addObserver(this, "memory-pressure"); + Services.obs.addObserver(this, "content-document-global-created", false); + Services.obs.addObserver(this, "document-element-inserted", false); + Services.obs.addObserver(this, "inner-window-destroyed", false); + Services.obs.addObserver(this, "memory-pressure", false); }, uninit() { diff --git a/toolkit/components/extensions/ExtensionManagement.jsm b/toolkit/components/extensions/ExtensionManagement.jsm index a109df1e8e6d..3ae2dfbcaab9 100644 --- a/toolkit/components/extensions/ExtensionManagement.jsm +++ b/toolkit/components/extensions/ExtensionManagement.jsm @@ -255,7 +255,7 @@ let cacheInvalidated = 0; function onCacheInvalidate() { cacheInvalidated++; } -Services.obs.addObserver(onCacheInvalidate, "startupcache-invalidate"); +Services.obs.addObserver(onCacheInvalidate, "startupcache-invalidate", false); ExtensionManagement = { get cacheInvalidated() { diff --git a/toolkit/components/extensions/ExtensionParent.jsm b/toolkit/components/extensions/ExtensionParent.jsm index 14f41e84476d..047ff30a2fdf 100644 --- a/toolkit/components/extensions/ExtensionParent.jsm +++ b/toolkit/components/extensions/ExtensionParent.jsm @@ -475,7 +475,7 @@ ParentAPIManager = { proxyContexts: new Map(), init() { - Services.obs.addObserver(this, "message-manager-close"); + Services.obs.addObserver(this, "message-manager-close", false); Services.mm.addMessageListener("API:CreateProxyContext", this); Services.mm.addMessageListener("API:CloseProxyContext", this, true); diff --git a/toolkit/components/extensions/ExtensionStorage.jsm b/toolkit/components/extensions/ExtensionStorage.jsm index 2c6d4764dc19..9e4f3838d27d 100644 --- a/toolkit/components/extensions/ExtensionStorage.jsm +++ b/toolkit/components/extensions/ExtensionStorage.jsm @@ -234,8 +234,8 @@ this.ExtensionStorage = { if (Services.appinfo.processType != Services.appinfo.PROCESS_TYPE_DEFAULT) { return; } - Services.obs.addObserver(this, "extension-invalidate-storage-cache"); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "extension-invalidate-storage-cache", false); + Services.obs.addObserver(this, "xpcom-shutdown", false); }, observe(subject, topic, data) { diff --git a/toolkit/components/extensions/ExtensionUtils.jsm b/toolkit/components/extensions/ExtensionUtils.jsm index d6c6a62b30f3..db78a449fb69 100644 --- a/toolkit/components/extensions/ExtensionUtils.jsm +++ b/toolkit/components/extensions/ExtensionUtils.jsm @@ -164,7 +164,7 @@ let StartupCache = { }, }; -Services.obs.addObserver(StartupCache, "startupcache-invalidate"); +Services.obs.addObserver(StartupCache, "startupcache-invalidate", false); class CacheStore { constructor(storeName) { @@ -1061,7 +1061,7 @@ function promiseObserved(topic, test = () => true) { resolve({subject, data}); } }; - Services.obs.addObserver(observer, topic); + Services.obs.addObserver(observer, topic, false); }); } diff --git a/toolkit/components/extensions/MessageChannel.jsm b/toolkit/components/extensions/MessageChannel.jsm index f1fedd3f87e6..9ea515d1d182 100644 --- a/toolkit/components/extensions/MessageChannel.jsm +++ b/toolkit/components/extensions/MessageChannel.jsm @@ -280,8 +280,8 @@ const MESSAGE_RESPONSE = "MessageChannel:Response"; this.MessageChannel = { init() { - Services.obs.addObserver(this, "message-manager-close"); - Services.obs.addObserver(this, "message-manager-disconnect"); + Services.obs.addObserver(this, "message-manager-close", false); + Services.obs.addObserver(this, "message-manager-disconnect", false); this.messageManagers = new FilteringMessageManagerMap( MESSAGE_MESSAGE, this._handleMessage.bind(this)); diff --git a/toolkit/components/extensions/ext-cookies.js b/toolkit/components/extensions/ext-cookies.js index a11bdf2d68ac..e2474d788bd9 100644 --- a/toolkit/components/extensions/ext-cookies.js +++ b/toolkit/components/extensions/ext-cookies.js @@ -420,8 +420,8 @@ this.cookies = class extends ExtensionAPI { } }; - Services.obs.addObserver(observer, "cookie-changed"); - Services.obs.addObserver(observer, "private-cookie-changed"); + Services.obs.addObserver(observer, "cookie-changed", false); + Services.obs.addObserver(observer, "private-cookie-changed", false); return () => { Services.obs.removeObserver(observer, "cookie-changed"); Services.obs.removeObserver(observer, "private-cookie-changed"); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html b/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html index 3c9ce1dcc33f..3f28fb9033d0 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html @@ -237,7 +237,7 @@ add_task(function* test_web_accessible_resources_csp() { // This is used to watch the blocked data bounce off CSP. function examiner() { - SpecialPowers.addObserver(this, "csp-on-violate-policy"); + SpecialPowers.addObserver(this, "csp-on-violate-policy", false); } let cspEventCount = 0; diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html index cf58dd58b3b3..b010e81f072a 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html @@ -269,7 +269,7 @@ add_task(function* test_webRequest_auth_nonblocking_forwardAuthProvider() { }, }; }; - Services.obs.addObserver(observer, "http-on-modify-request"); + Services.obs.addObserver(observer, "http-on-modify-request", false); sendAsyncMessage("chrome-ready"); }); yield chromeScript.promiseOneMessage("chrome-ready"); @@ -324,7 +324,7 @@ add_task(function* test_webRequest_auth_nonblocking_forwardAuthPrompt2() { }, }; }; - Services.obs.addObserver(observer, "http-on-modify-request"); + Services.obs.addObserver(observer, "http-on-modify-request", false); sendAsyncMessage("chrome-ready"); }); yield chromeScript.promiseOneMessage("chrome-ready"); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_suspend.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_suspend.html index 70235e6667b4..f562dc35ac7b 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_suspend.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_suspend.html @@ -84,7 +84,7 @@ add_task(function* test_error_resume() { } }; - Services.obs.addObserver(observer, "http-on-modify-request"); + Services.obs.addObserver(observer, "http-on-modify-request", false); }); let extension = ExtensionTestUtils.loadExtension({ diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js b/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js index 0a2a884fc184..fef3598c717e 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js @@ -131,8 +131,8 @@ add_task(function* test_experiments_api() { } }; - Services.obs.addObserver(observer, "webext-api-loaded"); - Services.obs.addObserver(observer, "webext-api-hello"); + Services.obs.addObserver(observer, "webext-api-loaded", false); + Services.obs.addObserver(observer, "webext-api-hello", false); do_register_cleanup(() => { Services.obs.removeObserver(observer, "webext-api-loaded"); Services.obs.removeObserver(observer, "webext-api-hello"); diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js b/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js index 4cd9beec0348..dc72088c0cfc 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js @@ -43,7 +43,7 @@ add_task(async function test_permissions() { }; Services.prefs.setBoolPref("extensions.webextOptionalPermissionPrompts", true); - Services.obs.addObserver(observer, "webextension-optional-permission-prompt"); + Services.obs.addObserver(observer, "webextension-optional-permission-prompt", false); do_register_cleanup(() => { Services.obs.removeObserver(observer, "webextension-optional-permission-prompt"); Services.prefs.clearUserPref("extensions.webextOptionalPermissionPrompts"); diff --git a/toolkit/components/formautofill/test/head_common.js b/toolkit/components/formautofill/test/head_common.js index bc3a089d83c5..6ea3be2c3ca3 100644 --- a/toolkit/components/formautofill/test/head_common.js +++ b/toolkit/components/formautofill/test/head_common.js @@ -85,7 +85,7 @@ var TestUtils = { function observe(aSubject, aTopic, aData) { Services.obs.removeObserver(observe, aTopic); resolve([aSubject, aData]); - }, aTopic)); + }, aTopic, false)); }, /** diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index 64f892b2692f..eb35f379fce7 100644 --- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm +++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm @@ -855,7 +855,7 @@ this.DownloadIntegration = { if (!DownloadObserver.observersAdded) { DownloadObserver.observersAdded = true; for (let topic of kObserverTopics) { - Services.obs.addObserver(DownloadObserver, topic); + Services.obs.addObserver(DownloadObserver, topic, false); } } return Promise.resolve(); @@ -1111,7 +1111,7 @@ this.DownloadObserver = { this.DownloadHistoryObserver = function (aList) { this._list = aList; - PlacesUtils.history.addObserver(this); + PlacesUtils.history.addObserver(this, false); } this.DownloadHistoryObserver.prototype = { diff --git a/toolkit/components/jsdownloads/test/unit/head.js b/toolkit/components/jsdownloads/test/unit/head.js index 9c37d2c7ed6c..a8585ce8ae40 100644 --- a/toolkit/components/jsdownloads/test/unit/head.js +++ b/toolkit/components/jsdownloads/test/unit/head.js @@ -212,7 +212,7 @@ function promiseWaitForVisit(aUrl) { onClearHistory() {}, onPageChanged() {}, onDeleteVisits() {}, - }); + }, false); return deferred.promise; } diff --git a/toolkit/components/narrate/test/NarrateTestUtils.jsm b/toolkit/components/narrate/test/NarrateTestUtils.jsm index 3a030497d23d..51efbf5588bd 100644 --- a/toolkit/components/narrate/test/NarrateTestUtils.jsm +++ b/toolkit/components/narrate/test/NarrateTestUtils.jsm @@ -103,7 +103,7 @@ this.NarrateTestUtils = { if (window.document.body.classList.contains("loaded")) { resolve(); } else { - Services.obs.addObserver(observeReady, "AboutReader:Ready"); + Services.obs.addObserver(observeReady, "AboutReader:Ready", false); } }); }, @@ -121,7 +121,7 @@ this.NarrateTestUtils = { resolve(Preferences.get(pref)); } - Services.prefs.addObserver(pref, observeChange); + Services.prefs.addObserver(pref, observeChange, false); }); }, diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 0ee6e28409a3..29d8a3d65cb2 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -491,13 +491,13 @@ Services.prefs.addObserver(PREF_OSFILE_LOG, // Don't start the worker just to set this preference. Scheduler.post("SET_DEBUG", [SharedAll.Config.DEBUG]); } - }); + }, false); SharedAll.Config.DEBUG = readDebugPref(PREF_OSFILE_LOG, false); Services.prefs.addObserver(PREF_OSFILE_LOG_REDIRECT, function prefObserver(aSubject, aTopic, aData) { SharedAll.Config.TEST = readDebugPref(PREF_OSFILE_LOG_REDIRECT, OS.Shared.TEST); - }); + }, false); SharedAll.Config.TEST = readDebugPref(PREF_OSFILE_LOG_REDIRECT, false); @@ -510,7 +510,7 @@ const PREF_OSFILE_NATIVE = "toolkit.osfile.native"; Services.prefs.addObserver(PREF_OSFILE_NATIVE, function prefObserver(aSubject, aTopic, aData) { nativeWheneverAvailable = readDebugPref(PREF_OSFILE_NATIVE, nativeWheneverAvailable); - }); + }, false); // Update worker's DEBUG flag if it's true. @@ -563,7 +563,7 @@ Services.prefs.addObserver(PREF_OSFILE_TEST_SHUTDOWN_OBSERVER, () => Scheduler.kill({shutdown: false, reset: false}) ); } - }); + }, false); /** * Representation of a file, with asynchronous methods. diff --git a/toolkit/components/passwordmgr/LoginHelper.jsm b/toolkit/components/passwordmgr/LoginHelper.jsm index c63b598e44a1..2b71e986aca3 100644 --- a/toolkit/components/passwordmgr/LoginHelper.jsm +++ b/toolkit/components/passwordmgr/LoginHelper.jsm @@ -58,11 +58,11 @@ this.LoginHelper = { this.schemeUpgrades = Services.prefs.getBoolPref("signon.schemeUpgrades"); this.insecureAutofill = Services.prefs.getBoolPref("signon.autofillForms.http"); logger.maxLogLevel = getMaxLogLevel(); - }); + }, false); Services.prefs.addObserver("security.insecure_field_warning.", () => { this.showInsecureFieldWarning = Services.prefs.getBoolPref("security.insecure_field_warning.contextual.enabled"); - }); + }, false); return logger; }, diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index abb23b8f65ea..cef4f2de9b85 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -145,9 +145,9 @@ var observer = { }, }; -Services.obs.addObserver(observer, "earlyformsubmit"); +Services.obs.addObserver(observer, "earlyformsubmit", false); var prefBranch = Services.prefs.getBranch("signon."); -prefBranch.addObserver("", observer.onPrefChange); +prefBranch.addObserver("", observer.onPrefChange, false); observer.onPrefChange(); // read initial values diff --git a/toolkit/components/passwordmgr/LoginManagerParent.jsm b/toolkit/components/passwordmgr/LoginManagerParent.jsm index e624e814b8b1..62038503b0f7 100644 --- a/toolkit/components/passwordmgr/LoginManagerParent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm @@ -197,8 +197,8 @@ var LoginManagerParent = { // never return). We should guarantee that at least one of these // will fire. // See bug XXX. - Services.obs.addObserver(observer, "passwordmgr-crypto-login"); - Services.obs.addObserver(observer, "passwordmgr-crypto-loginCanceled"); + Services.obs.addObserver(observer, "passwordmgr-crypto-login", false); + Services.obs.addObserver(observer, "passwordmgr-crypto-loginCanceled", false); return; } diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index 7bc95563c050..f4cfc25dc549 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -67,7 +67,7 @@ let dateAndTimeFormatter = Services.intl.createDateTimeFormat(undefined, function Startup() { // be prepared to reload the display if anything changes - Services.obs.addObserver(signonReloadDisplay, "passwordmgr-storage-changed"); + Services.obs.addObserver(signonReloadDisplay, "passwordmgr-storage-changed", false); signonsTree = document.getElementById("signonsTree"); kSignonBundle = document.getElementById("signonBundle"); diff --git a/toolkit/components/passwordmgr/nsLoginManager.js b/toolkit/components/passwordmgr/nsLoginManager.js index bfb1706c85a1..0ade84abcc12 100644 --- a/toolkit/components/passwordmgr/nsLoginManager.js +++ b/toolkit/components/passwordmgr/nsLoginManager.js @@ -91,23 +91,24 @@ LoginManager.prototype = { // Preferences. Add observer so we get notified of changes. this._prefBranch = Services.prefs.getBranch("signon."); - this._prefBranch.addObserver("rememberSignons", this._observer); + this._prefBranch.addObserver("rememberSignons", this._observer, false); this._remember = this._prefBranch.getBoolPref("rememberSignons"); this._autoCompleteLookupPromise = null; // Form submit observer checks forms for new logins and pw changes. - Services.obs.addObserver(this._observer, "xpcom-shutdown"); + Services.obs.addObserver(this._observer, "xpcom-shutdown", false); if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_DEFAULT) { - Services.obs.addObserver(this._observer, "passwordmgr-storage-replace"); + Services.obs.addObserver(this._observer, "passwordmgr-storage-replace", + false); // Initialize storage so that asynchronous data loading can start. this._initStorage(); } - Services.obs.addObserver(this._observer, "gather-telemetry"); + Services.obs.addObserver(this._observer, "gather-telemetry", false); }, diff --git a/toolkit/components/passwordmgr/storage-mozStorage.js b/toolkit/components/passwordmgr/storage-mozStorage.js index 80f5c5862afa..0fb902e1b0dd 100644 --- a/toolkit/components/passwordmgr/storage-mozStorage.js +++ b/toolkit/components/passwordmgr/storage-mozStorage.js @@ -852,7 +852,7 @@ LoginManagerStorage_mozStorage.prototype = { throw e; } - Services.obs.addObserver(this, "profile-before-change"); + Services.obs.addObserver(this, "profile-before-change", false); return isFirstRun; }, diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js index 209895d9451b..64a5c5d133fb 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js +++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js @@ -91,7 +91,7 @@ add_task(function* test() { function startTest() { Services.obs.addObserver( - testObserver, "passwordmgr-dialog-updated"); + testObserver, "passwordmgr-dialog-updated", false); is(countLogins(), 0, "Verify starts with 0 logins"); createLogins(); runNextTest(); diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js index 5b5f1c266658..63e84d0eda51 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js +++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js @@ -91,7 +91,7 @@ add_task(function* test() { Services.obs.removeObserver(arguments.callee, aTopic); func(); } - }, "passwordmgr-password-toggle-complete"); + }, "passwordmgr-password-toggle-complete", false); EventUtils.synthesizeMouse(toggleButton, 1, 1, {}, win); } diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js index 48f32fa44a5a..872ac42fe63d 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js +++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js @@ -102,7 +102,7 @@ add_task(function* test() { Services.obs.removeObserver(arguments.callee, aTopic); func(); } - }, "passwordmgr-password-toggle-complete"); + }, "passwordmgr-password-toggle-complete", false); EventUtils.synthesizeMouse(toggleButton, 1, 1, {}, win); } diff --git a/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html b/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html index 31feee078de3..63fd0d44069b 100644 --- a/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html +++ b/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html @@ -101,7 +101,7 @@ function loadNextTest() { observer = SpecialPowers.wrapCallback(function(subject, topic, data) { SimpleTest.executeSoon(() => { iframe.contentWindow.postMessage("go", "*"); }); }); - SpecialPowers.addObserver(observer, "passwordmgr-processed-form"); + SpecialPowers.addObserver(observer, "passwordmgr-processed-form", false); } ok(true, "Starting test #" + testNum); @@ -209,7 +209,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(obs, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(aIsPrivate, aCallback) { diff --git a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html index 0577448a559c..ad4a41cdb25c 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html @@ -126,7 +126,7 @@ sendAsyncMessage("promptAccepted"); } - Services.obs.addObserver(dialogObserver, dialogObserverTopic); + Services.obs.addObserver(dialogObserver, dialogObserverTopic, false); addMessageListener("cleanup", message => { Services.obs.removeObserver(dialogObserver, dialogObserverTopic); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html index 93cc9bcd5fce..ac91992f48d6 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html @@ -118,7 +118,7 @@ function* reinitializeForm(index) { SpecialPowers.removeObserver(observer, "passwordmgr-processed-form"); resolve(); }); - SpecialPowers.addObserver(observer, "passwordmgr-processed-form"); + SpecialPowers.addObserver(observer, "passwordmgr-processed-form", false); }); yield SimpleTest.promiseFocus(window); diff --git a/toolkit/components/passwordmgr/test/pwmgr_common.js b/toolkit/components/passwordmgr/test/pwmgr_common.js index 1c69fa1fb79a..334f1ac6da4a 100644 --- a/toolkit/components/passwordmgr/test/pwmgr_common.js +++ b/toolkit/components/passwordmgr/test/pwmgr_common.js @@ -194,7 +194,7 @@ function registerRunTests() { resolve(); }); }); - SpecialPowers.addObserver(observer, "passwordmgr-processed-form"); + SpecialPowers.addObserver(observer, "passwordmgr-processed-form", false); document.body.appendChild(form); }); @@ -283,7 +283,7 @@ function promiseFormsProcessed(expectedCount = 1) { resolve(SpecialPowers.Cu.waiveXrays(subject), data); } } - SpecialPowers.addObserver(onProcessedForm, "passwordmgr-processed-form"); + SpecialPowers.addObserver(onProcessedForm, "passwordmgr-processed-form", false); }); } @@ -384,7 +384,7 @@ if (this.addMessageListener) { data, }); } - Services.obs.addObserver(onStorageChanged, "passwordmgr-storage-changed"); + Services.obs.addObserver(onStorageChanged, "passwordmgr-storage-changed", false); function onPrompt(subject, topic, data) { sendAsyncMessage("promptShown", { @@ -392,8 +392,8 @@ if (this.addMessageListener) { data, }); } - Services.obs.addObserver(onPrompt, "passwordmgr-prompt-change"); - Services.obs.addObserver(onPrompt, "passwordmgr-prompt-save"); + Services.obs.addObserver(onPrompt, "passwordmgr-prompt-change", false); + Services.obs.addObserver(onPrompt, "passwordmgr-prompt-save", false); addMessageListener("setupParent", ({selfFilling = false} = {selfFilling: false}) => { // Force LoginManagerParent to init for the tests since it's normally delayed diff --git a/toolkit/components/passwordmgr/test/test_master_password.html b/toolkit/components/passwordmgr/test/test_master_password.html index d25a93a758c5..11f825853a9d 100644 --- a/toolkit/components/passwordmgr/test/test_master_password.html +++ b/toolkit/components/passwordmgr/test/test_master_password.html @@ -114,7 +114,7 @@ function handleDialog(doc, testNumber) { didDialog = true; if (!doNothing) { - SpecialPowers.addObserver(outerWindowObserver, "outer-window-destroyed"); + SpecialPowers.addObserver(outerWindowObserver, "outer-window-destroyed", false); if (clickOK) dialog.acceptDialog(); else diff --git a/toolkit/components/passwordmgr/test/test_prompt_async.html b/toolkit/components/passwordmgr/test/test_prompt_async.html index 6c5caa8f5a0e..57a099366472 100644 --- a/toolkit/components/passwordmgr/test/test_prompt_async.html +++ b/toolkit/components/passwordmgr/test/test_prompt_async.html @@ -22,8 +22,8 @@ function dialogMonitor() { var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService); - observerService.addObserver(this, "domwindowopened"); - observerService.addObserver(this, "domwindowclosed"); + observerService.addObserver(this, "domwindowopened", false); + observerService.addObserver(this, "domwindowclosed", false); } /* diff --git a/toolkit/components/passwordmgr/test/unit/test_notifications.js b/toolkit/components/passwordmgr/test/unit/test_notifications.js index 24a7564b6d39..f5eedf61b659 100644 --- a/toolkit/components/passwordmgr/test/unit/test_notifications.js +++ b/toolkit/components/passwordmgr/test/unit/test_notifications.js @@ -62,7 +62,7 @@ var testuser1 = new LoginInfo("http://testhost1", "", null, var testuser2 = new LoginInfo("http://testhost2", "", null, "dummydude2", "itsasecret2", "put_user2_here", "put_pw2_here"); -Services.obs.addObserver(TestObserver, "passwordmgr-storage-changed"); +Services.obs.addObserver(TestObserver, "passwordmgr-storage-changed", false); /* ========== 1 ========== */ diff --git a/toolkit/components/perfmonitoring/PerformanceStats.jsm b/toolkit/components/perfmonitoring/PerformanceStats.jsm index 66815596f204..dfdd11aa700a 100644 --- a/toolkit/components/perfmonitoring/PerformanceStats.jsm +++ b/toolkit/components/perfmonitoring/PerformanceStats.jsm @@ -566,7 +566,7 @@ PerformanceMonitor.makeId = function() { // release the probes unless `dispose()` has already been called. Services.obs.addObserver(function(subject, topic, value) { PerformanceMonitor.dispose(value); -}, FINALIZATION_TOPIC); +}, FINALIZATION_TOPIC, false); // Public API this.PerformanceStats = { diff --git a/toolkit/components/places/PlacesCategoriesStarter.js b/toolkit/components/places/PlacesCategoriesStarter.js index 561a9cb474ba..a7e4ca91e011 100644 --- a/toolkit/components/places/PlacesCategoriesStarter.js +++ b/toolkit/components/places/PlacesCategoriesStarter.js @@ -29,8 +29,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesDBUtils", * certain categories are invoked. */ function PlacesCategoriesStarter() { - Services.obs.addObserver(this, TOPIC_GATHER_TELEMETRY); - Services.obs.addObserver(this, PlacesUtils.TOPIC_SHUTDOWN); + Services.obs.addObserver(this, TOPIC_GATHER_TELEMETRY, false); + Services.obs.addObserver(this, PlacesUtils.TOPIC_SHUTDOWN, false); // nsINavBookmarkObserver implementation. let notify = () => { diff --git a/toolkit/components/places/PlacesDBUtils.jsm b/toolkit/components/places/PlacesDBUtils.jsm index f487026b8524..04073e673429 100644 --- a/toolkit/components/places/PlacesDBUtils.jsm +++ b/toolkit/components/places/PlacesDBUtils.jsm @@ -759,7 +759,7 @@ this.PlacesDBUtils = { Services.obs.removeObserver(arguments.callee, aTopic); tasks.log("+ Database cleaned up"); PlacesDBUtils._executeTasks(tasks); - }, PlacesUtils.TOPIC_EXPIRATION_FINISHED); + }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false); // Force an orphans expiration step. expiration.observe(null, "places-debug-start-expiration", 0); diff --git a/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm b/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm index 03c96325f19c..c3bc501eb27d 100644 --- a/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm +++ b/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm @@ -104,11 +104,11 @@ function observe(subject, topic, data) { } } -Services.obs.addObserver(observe, "weave:engine:sync:finish"); -Services.obs.addObserver(observe, "weave:service:start-over"); +Services.obs.addObserver(observe, "weave:engine:sync:finish", false); +Services.obs.addObserver(observe, "weave:service:start-over", false); // Observe the pref for showing remote icons and prime our bool that reflects its value. -Services.prefs.addObserver(PREF_SHOW_REMOTE_ICONS, observe); +Services.prefs.addObserver(PREF_SHOW_REMOTE_ICONS, observe, false); observe(null, "nsPref:changed", PREF_SHOW_REMOTE_ICONS); // This public object is a static singleton. diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm index 42956163ee89..4486c1bec345 100644 --- a/toolkit/components/places/PlacesUtils.jsm +++ b/toolkit/components/places/PlacesUtils.jsm @@ -591,7 +591,7 @@ this.PlacesUtils = { registerShutdownFunction: function PU_registerShutdownFunction(aFunc) { // If this is the first registered function, add the shutdown observer. if (this._shutdownFunctions.length == 0) { - Services.obs.addObserver(this, this.TOPIC_SHUTDOWN); + Services.obs.addObserver(this, this.TOPIC_SHUTDOWN, false); } this._shutdownFunctions.push(aFunc); }, @@ -2459,7 +2459,7 @@ XPCOMUtils.defineLazyGetter(this, "gKeywordsCachePromise", () => }), }; - PlacesUtils.bookmarks.addObserver(observer); + PlacesUtils.bookmarks.addObserver(observer, false); PlacesUtils.registerShutdownFunction(() => { PlacesUtils.bookmarks.removeObserver(observer); }); @@ -2601,7 +2601,7 @@ var GuidHelper = { onItemVisited() {}, onItemMoved() {}, }; - PlacesUtils.bookmarks.addObserver(this.observer); + PlacesUtils.bookmarks.addObserver(this.observer, false); PlacesUtils.registerShutdownFunction(() => { PlacesUtils.bookmarks.removeObserver(this.observer); }); diff --git a/toolkit/components/places/UnifiedComplete.js b/toolkit/components/places/UnifiedComplete.js index 591a88436ac9..0a6d9f9dfbe5 100644 --- a/toolkit/components/places/UnifiedComplete.js +++ b/toolkit/components/places/UnifiedComplete.js @@ -527,7 +527,7 @@ XPCOMUtils.defineLazyGetter(this, "Prefs", () => { syncEnabledPref(); loadPrefs(); - Services.prefs.addObserver(PREF_BRANCH, store); + Services.prefs.addObserver(PREF_BRANCH, store, false); Services.prefs.addObserver("keyword.enabled", store, true); return Object.seal(store); diff --git a/toolkit/components/places/nsTaggingService.js b/toolkit/components/places/nsTaggingService.js index db9caa0aa9a9..4c212dda98f1 100644 --- a/toolkit/components/places/nsTaggingService.js +++ b/toolkit/components/places/nsTaggingService.js @@ -20,10 +20,10 @@ const TOPIC_SHUTDOWN = "places-shutdown"; */ function TaggingService() { // Observe bookmarks changes. - PlacesUtils.bookmarks.addObserver(this); + PlacesUtils.bookmarks.addObserver(this, false); // Cleanup on shutdown. - Services.obs.addObserver(this, TOPIC_SHUTDOWN); + Services.obs.addObserver(this, TOPIC_SHUTDOWN, false); } TaggingService.prototype = { diff --git a/toolkit/components/places/tests/PlacesTestUtils.jsm b/toolkit/components/places/tests/PlacesTestUtils.jsm index 6289ade8c07e..512dfeb94d8c 100644 --- a/toolkit/components/places/tests/PlacesTestUtils.jsm +++ b/toolkit/components/places/tests/PlacesTestUtils.jsm @@ -91,7 +91,7 @@ this.PlacesTestUtils = Object.freeze({ Services.obs.addObserver(function observe(subj, topic, data) { Services.obs.removeObserver(observe, topic); resolve(); - }, PlacesUtils.TOPIC_EXPIRATION_FINISHED); + }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false); }); return Promise.all([expirationFinished, PlacesUtils.history.clear()]); diff --git a/toolkit/components/places/tests/bookmarks/test_393498.js b/toolkit/components/places/tests/bookmarks/test_393498.js index f27c259f789f..c922d0a24721 100644 --- a/toolkit/components/places/tests/bookmarks/test_393498.js +++ b/toolkit/components/places/tests/bookmarks/test_393498.js @@ -19,7 +19,7 @@ var observer = { this._itemChangedValue = value; } }; -PlacesUtils.bookmarks.addObserver(observer); +PlacesUtils.bookmarks.addObserver(observer, false); do_register_cleanup(function() { PlacesUtils.bookmarks.removeObserver(observer); diff --git a/toolkit/components/places/tests/bookmarks/test_async_observers.js b/toolkit/components/places/tests/bookmarks/test_async_observers.js index 1c8c1cfcf652..2e9f05e729d2 100644 --- a/toolkit/components/places/tests/bookmarks/test_async_observers.js +++ b/toolkit/components/places/tests/bookmarks/test_async_observers.js @@ -65,7 +65,7 @@ var observer = { Ci.nsINavBookmarkObserver, ]) }; -PlacesUtils.bookmarks.addObserver(observer); +PlacesUtils.bookmarks.addObserver(observer, false); add_task(function* test_add_visit() { let observerPromise = observer.setupCompletionPromise(); @@ -141,7 +141,7 @@ add_task(function* shutdown() { "test", "test"); deferred.resolve(promiseTopicObserved("places-connection-closed")); }); - }, "places-will-close-connection"); + }, "places-will-close-connection", false); shutdownPlaces(); yield deferred.promise; diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks.js b/toolkit/components/places/tests/bookmarks/test_bookmarks.js index 50b949a73f8e..8e2ac651e74d 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks.js @@ -81,7 +81,7 @@ function run_test() { } add_task(function* test_bookmarks() { - bs.addObserver(bookmarksObserver); + bs.addObserver(bookmarksObserver, false); // test special folders do_check_true(bs.placesRoot > 0); diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_insertTree.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_insertTree.js index d5a109f28f8f..08f78e65ab54 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks_insertTree.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_insertTree.js @@ -216,7 +216,7 @@ add_task(function* create_hierarchy() { Assert.greater(itemId, 0, "Should have a valid itemId"); }, }; - PlacesUtils.bookmarks.addObserver(obs); + PlacesUtils.bookmarks.addObserver(obs, false); let bms = yield PlacesUtils.bookmarks.insertTree({children: [{ type: PlacesUtils.bookmarks.TYPE_FOLDER, title: "Root item", @@ -283,7 +283,7 @@ add_task(function* insert_many_non_nested() { Assert.greater(itemId, 0, "Should have a valid itemId"); }, }; - PlacesUtils.bookmarks.addObserver(obs); + PlacesUtils.bookmarks.addObserver(obs, false); let bms = yield PlacesUtils.bookmarks.insertTree({children: [{ url: "http://www.example.com/1", title: "Item 1", diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js index 5e0368956c95..de8cdde66496 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js @@ -518,7 +518,7 @@ function expectNotifications() { return undefined; } }); - PlacesUtils.bookmarks.addObserver(observer); + PlacesUtils.bookmarks.addObserver(observer, false); return observer; } diff --git a/toolkit/components/places/tests/bookmarks/test_keywords.js b/toolkit/components/places/tests/bookmarks/test_keywords.js index a89ece853c0d..2354d0906969 100644 --- a/toolkit/components/places/tests/bookmarks/test_keywords.js +++ b/toolkit/components/places/tests/bookmarks/test_keywords.js @@ -61,7 +61,7 @@ function expectNotifications() { return target[name]; } }); - PlacesUtils.bookmarks.addObserver(observer); + PlacesUtils.bookmarks.addObserver(observer, false); return observer; } diff --git a/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js b/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js index a4b13602bd0d..2eb482f1dcb6 100644 --- a/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js +++ b/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js @@ -100,8 +100,8 @@ var gBookmarkSkipObserver = { add_task(function setup() { - PlacesUtils.bookmarks.addObserver(gBookmarksObserver); - PlacesUtils.bookmarks.addObserver(gBookmarkSkipObserver); + PlacesUtils.bookmarks.addObserver(gBookmarksObserver, false); + PlacesUtils.bookmarks.addObserver(gBookmarkSkipObserver, false); }); add_task(function* batch() { diff --git a/toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js b/toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js index 3666e53c548f..537974b38ab8 100644 --- a/toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js +++ b/toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js @@ -38,7 +38,7 @@ add_task(function* test_removeFolderTransaction_reinsert() { notifications.push(["onItemRemoved", itemId, parentId, guid, parentGuid]); }, }; - PlacesUtils.bookmarks.addObserver(observer); + PlacesUtils.bookmarks.addObserver(observer, false); PlacesUtils.registerShutdownFunction(function() { PlacesUtils.bookmarks.removeObserver(observer); }); diff --git a/toolkit/components/places/tests/browser/browser_bug399606.js b/toolkit/components/places/tests/browser/browser_bug399606.js index d9052cd8d984..488cb369956c 100644 --- a/toolkit/components/places/tests/browser/browser_bug399606.js +++ b/toolkit/components/places/tests/browser/browser_bug399606.js @@ -38,7 +38,7 @@ function test() { onDeleteVisits() {}, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - hs.addObserver(historyObserver); + hs.addObserver(historyObserver, false); function confirm_results() { gBrowser.removeCurrentTab(); diff --git a/toolkit/components/places/tests/browser/browser_bug461710.js b/toolkit/components/places/tests/browser/browser_bug461710.js index 93097218d649..12af87a0645f 100644 --- a/toolkit/components/places/tests/browser/browser_bug461710.js +++ b/toolkit/components/places/tests/browser/browser_bug461710.js @@ -50,7 +50,7 @@ add_task(function* () { Services.obs.removeObserver(observe, test.topic); resolve(); } - }, test.topic); + }, test.topic, false); }); ContentTask.spawn(test.win.gBrowser.selectedBrowser, prefix + test.subtest, function* (aSrc) { content.document.getElementById("iframe").src = aSrc; diff --git a/toolkit/components/places/tests/browser/browser_bug646422.js b/toolkit/components/places/tests/browser/browser_bug646422.js index 5beef4e9ac37..580ba14c4b95 100644 --- a/toolkit/components/places/tests/browser/browser_bug646422.js +++ b/toolkit/components/places/tests/browser/browser_bug646422.js @@ -31,7 +31,7 @@ add_task(function* () { QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); }); yield ContentTask.spawn(tab.linkedBrowser, null, function* () { diff --git a/toolkit/components/places/tests/browser/browser_double_redirect.js b/toolkit/components/places/tests/browser/browser_double_redirect.js index c7411771346d..76e418a17f0f 100644 --- a/toolkit/components/places/tests/browser/browser_double_redirect.js +++ b/toolkit/components/places/tests/browser/browser_double_redirect.js @@ -45,7 +45,7 @@ add_task(function* () { resolve(); }); } - }); + }, false); }); PlacesUtils.history.markPageAsTyped(TEST_URI); diff --git a/toolkit/components/places/tests/browser/browser_multi_redirect_frecency.js b/toolkit/components/places/tests/browser/browser_multi_redirect_frecency.js index b85c9fbb6f6d..b4d6e40e2520 100644 --- a/toolkit/components/places/tests/browser/browser_multi_redirect_frecency.js +++ b/toolkit/components/places/tests/browser/browser_multi_redirect_frecency.js @@ -55,7 +55,7 @@ function promiseVisitedURIObserver(redirectURI, targetURI, expectedTargetFrecenc onDeleteVisits() {}, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); } diff --git a/toolkit/components/places/tests/browser/browser_notfound.js b/toolkit/components/places/tests/browser/browser_notfound.js index 78204e60cdf6..90b44fafb696 100644 --- a/toolkit/components/places/tests/browser/browser_notfound.js +++ b/toolkit/components/places/tests/browser/browser_notfound.js @@ -35,7 +35,7 @@ add_task(function* () { onDeleteVisits() {}, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); let newTabPromise = BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL); diff --git a/toolkit/components/places/tests/browser/browser_onvisit_title_null_for_navigation.js b/toolkit/components/places/tests/browser/browser_onvisit_title_null_for_navigation.js index 1e8899d0f77a..2139fa05d134 100644 --- a/toolkit/components/places/tests/browser/browser_onvisit_title_null_for_navigation.js +++ b/toolkit/components/places/tests/browser/browser_onvisit_title_null_for_navigation.js @@ -20,7 +20,7 @@ add_task(function* checkTitleNotificationForNavigation() { } }, }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); }); let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, EXPECTED_URL.spec); yield promiseTitleChanged; diff --git a/toolkit/components/places/tests/browser/browser_redirect.js b/toolkit/components/places/tests/browser/browser_redirect.js index 174677dffae3..f075d485fe4a 100644 --- a/toolkit/components/places/tests/browser/browser_redirect.js +++ b/toolkit/components/places/tests/browser/browser_redirect.js @@ -68,7 +68,7 @@ function promiseVisitedWithFrecency(expectedRedirectFrecency, expectedTargetFrec onDeleteVisits() {}, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); } diff --git a/toolkit/components/places/tests/browser/browser_settitle.js b/toolkit/components/places/tests/browser/browser_settitle.js index 1cef42a2e810..d35759dd1bc4 100644 --- a/toolkit/components/places/tests/browser/browser_settitle.js +++ b/toolkit/components/places/tests/browser/browser_settitle.js @@ -46,7 +46,7 @@ add_task(function* () { onDeleteVisits() {}, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); const url1 = "http://example.com/tests/toolkit/components/places/tests/browser/title1.html"; diff --git a/toolkit/components/places/tests/browser/browser_visited_notfound.js b/toolkit/components/places/tests/browser/browser_visited_notfound.js index 43e4b2809da8..865bdbcebca8 100644 --- a/toolkit/components/places/tests/browser/browser_visited_notfound.js +++ b/toolkit/components/places/tests/browser/browser_visited_notfound.js @@ -28,7 +28,7 @@ add_task(function* test() { resolve(); } }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); gBrowser.selectedBrowser.loadURI(TEST_URL); yield promiseVisit; diff --git a/toolkit/components/places/tests/browser/browser_visituri.js b/toolkit/components/places/tests/browser/browser_visituri.js index 8abed643dea6..99e1bc82f726 100644 --- a/toolkit/components/places/tests/browser/browser_visituri.js +++ b/toolkit/components/places/tests/browser/browser_visituri.js @@ -8,7 +8,7 @@ function promiseObserve(name, checkFn) { Services.obs.removeObserver(observer, name); resolve(); } - }, name); + }, name, false); }); } diff --git a/toolkit/components/places/tests/browser/browser_visituri_nohistory.js b/toolkit/components/places/tests/browser/browser_visituri_nohistory.js index 7c921bc158df..dbba30a2dd94 100644 --- a/toolkit/components/places/tests/browser/browser_visituri_nohistory.js +++ b/toolkit/components/places/tests/browser/browser_visituri_nohistory.js @@ -14,7 +14,7 @@ function promiseObserve(name) { Services.obs.addObserver(function observer(subject) { Services.obs.removeObserver(observer, name); resolve(subject); - }, name); + }, name, false); }); } diff --git a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js b/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js index bfb5c9cee044..044eef7e6b36 100644 --- a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js +++ b/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js @@ -36,7 +36,7 @@ function test() { } }; - aWindow.Services.obs.addObserver(observer, "uri-visit-saved"); + aWindow.Services.obs.addObserver(observer, "uri-visit-saved", false); BrowserTestUtils.browserLoaded(aWindow.gBrowser.selectedBrowser).then(aCallback); aWindow.gBrowser.selectedBrowser.loadURI(aTestURI); diff --git a/toolkit/components/places/tests/browser/head.js b/toolkit/components/places/tests/browser/head.js index 172279bb3081..33091af4ad6f 100644 --- a/toolkit/components/places/tests/browser/head.js +++ b/toolkit/components/places/tests/browser/head.js @@ -123,7 +123,7 @@ function waitForFaviconChanged(aExpectedPageURI, aExpectedFaviconURI, aWindow, } } }; - aWindow.PlacesUtils.history.addObserver(historyObserver); + aWindow.PlacesUtils.history.addObserver(historyObserver, false); } /** @@ -284,7 +284,7 @@ function DBConn(aForceNewConnection) { Services.obs.addObserver(function DBCloseCallback(aSubject, aTopic, aData) { Services.obs.removeObserver(DBCloseCallback, aTopic); dbConn.asyncClose(); - }, "profile-before-change"); + }, "profile-before-change", false); } return gDBConn.connectionReady ? gDBConn : null; diff --git a/toolkit/components/places/tests/chrome/test_371798.xul b/toolkit/components/places/tests/chrome/test_371798.xul index 51d8339d3a7a..241db75c3ced 100644 --- a/toolkit/components/places/tests/chrome/test_371798.xul +++ b/toolkit/components/places/tests/chrome/test_371798.xul @@ -40,7 +40,7 @@ function promiseOnItemChanged() { }, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]) - }); + }, false); }); } diff --git a/toolkit/components/places/tests/expiration/test_idle_daily.js b/toolkit/components/places/tests/expiration/test_idle_daily.js index 985cb8f7e200..05e5a8125a64 100644 --- a/toolkit/components/places/tests/expiration/test_idle_daily.js +++ b/toolkit/components/places/tests/expiration/test_idle_daily.js @@ -13,7 +13,7 @@ function run_test() { Services.obs.removeObserver(observeExpiration, PlacesUtils.TOPIC_EXPIRATION_FINISHED); do_test_finished(); - }, PlacesUtils.TOPIC_EXPIRATION_FINISHED); + }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false); let expire = Cc["@mozilla.org/places/expiration;1"]. getService(Ci.nsIObserver); diff --git a/toolkit/components/places/tests/expiration/test_notifications.js b/toolkit/components/places/tests/expiration/test_notifications.js index 4efe729091a1..a2fc2a62f7db 100644 --- a/toolkit/components/places/tests/expiration/test_notifications.js +++ b/toolkit/components/places/tests/expiration/test_notifications.js @@ -19,7 +19,7 @@ var gObserver = { this.notifications++; } }; -os.addObserver(gObserver, PlacesUtils.TOPIC_EXPIRATION_FINISHED); +os.addObserver(gObserver, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false); function run_test() { // Set interval to a large value so we don't expire on it. diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js index b780e38d0910..46215bbd94f5 100644 --- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js +++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js @@ -93,7 +93,7 @@ add_task(function* test_notifications_onDeleteURI() { onPageChanged() {}, onDeleteVisits(aURI, aTime) { }, }; - hs.addObserver(historyObserver); + hs.addObserver(historyObserver, false); // Expire now. yield promiseForceExpirationStep(-1); diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js index 57198feb1245..f06e34e3c09e 100644 --- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js +++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js @@ -121,7 +121,7 @@ add_task(function* test_notifications_onDeleteVisits() { do_check_eq(aReason, Ci.nsINavHistoryObserver.REASON_EXPIRED); }, }; - hs.addObserver(historyObserver); + hs.addObserver(historyObserver, false); // Expire now. yield promiseForceExpirationStep(currentTest.limitExpiration); diff --git a/toolkit/components/places/tests/expiration/test_outdated_analyze.js b/toolkit/components/places/tests/expiration/test_outdated_analyze.js index 8d0940cc8a7a..6ae8f7356f8c 100644 --- a/toolkit/components/places/tests/expiration/test_outdated_analyze.js +++ b/toolkit/components/places/tests/expiration/test_outdated_analyze.js @@ -68,5 +68,5 @@ function run_test() { } }); stmt.finalize(); - }, PlacesUtils.TOPIC_EXPIRATION_FINISHED); + }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false); } diff --git a/toolkit/components/places/tests/expiration/test_pref_maxpages.js b/toolkit/components/places/tests/expiration/test_pref_maxpages.js index f1abb21c0eff..836b52027198 100644 --- a/toolkit/components/places/tests/expiration/test_pref_maxpages.js +++ b/toolkit/components/places/tests/expiration/test_pref_maxpages.js @@ -102,7 +102,7 @@ add_task(function* test_pref_maxpages() { print("onDeleteVisits " + aURI.spec + " " + aTime); }, }; - hs.addObserver(historyObserver); + hs.addObserver(historyObserver, false); setMaxPages(currentTest.maxPages); diff --git a/toolkit/components/places/tests/favicons/head_favicons.js b/toolkit/components/places/tests/favicons/head_favicons.js index 38535022e014..f8c3bf9e0142 100644 --- a/toolkit/components/places/tests/favicons/head_favicons.js +++ b/toolkit/components/places/tests/favicons/head_favicons.js @@ -55,7 +55,7 @@ function waitForFaviconChanged(aExpectedPageURI, aExpectedFaviconURI, aCallback(); } }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); } /** diff --git a/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js b/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js index e93d2010cb65..df61c22cd0ed 100644 --- a/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js +++ b/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js @@ -48,7 +48,7 @@ add_task(function* test_query_result_favicon_changed_on_child() { " not for the containing query."); } }; - result.addObserver(resultObserver); + result.addObserver(resultObserver, false); // Open the container and wait for containerStateChanged. We should start // observing before setting |containerOpen| as that's caused by the diff --git a/toolkit/components/places/tests/head_common.js b/toolkit/components/places/tests/head_common.js index ac7fe3ed3074..c6ac8988cb79 100644 --- a/toolkit/components/places/tests/head_common.js +++ b/toolkit/components/places/tests/head_common.js @@ -374,7 +374,7 @@ function promiseTopicObserved(aTopic) { Services.obs.addObserver(function observe(aObsSubject, aObsTopic, aObsData) { Services.obs.removeObserver(observe, aObsTopic); resolve([aObsSubject, aObsData]); - }, aTopic); + }, aTopic, false); }); } @@ -384,7 +384,7 @@ function promiseTopicObserved(aTopic) { var shutdownPlaces = function() { do_print("shutdownPlaces: starting"); let promise = new Promise(resolve => { - Services.obs.addObserver(resolve, "places-connection-closed"); + Services.obs.addObserver(resolve, "places-connection-closed", false); }); let hs = PlacesUtils.history.QueryInterface(Ci.nsIObserver); hs.observe(null, "profile-change-teardown", null); diff --git a/toolkit/components/places/tests/history/test_async_history_api.js b/toolkit/components/places/tests/history/test_async_history_api.js index 5bd800722b61..06a1b9bb40f2 100644 --- a/toolkit/components/places/tests/history/test_async_history_api.js +++ b/toolkit/components/places/tests/history/test_async_history_api.js @@ -948,7 +948,7 @@ add_task(function* test_title_change_notifies() { do_throw("unexpected callback!"); }); - PlacesUtils.history.addObserver(silentObserver); + PlacesUtils.history.addObserver(silentObserver, false); let placesResult = yield promiseUpdatePlaces(place); if (placesResult.errors.length > 0) { do_throw("Unexpected error."); @@ -970,7 +970,7 @@ add_task(function* test_title_change_notifies() { resolve(); } }); - PlacesUtils.history.addObserver(titleChangeObserver); + PlacesUtils.history.addObserver(titleChangeObserver, false); }); let visitPromise = new Promise(resolve => { @@ -980,7 +980,7 @@ add_task(function* test_title_change_notifies() { PlacesUtils.history.removeObserver(this); resolve(); } - }); + }, false); }); PlacesUtils.asyncHistory.updatePlaces(place); yield visitPromise; @@ -1026,7 +1026,7 @@ add_task(function* test_visit_notifies() { PlacesUtils.history.removeObserver(visitObserver); finisher(); }); - PlacesUtils.history.addObserver(visitObserver); + PlacesUtils.history.addObserver(visitObserver, false); let observer = function(aSubject, aTopic, aData) { do_print("observe(" + aSubject + ", " + aTopic + ", " + aData + ")"); do_check_true(aSubject instanceof Ci.nsIURI); @@ -1035,7 +1035,7 @@ add_task(function* test_visit_notifies() { Services.obs.removeObserver(observer, URI_VISIT_SAVED); finisher(); }; - Services.obs.addObserver(observer, URI_VISIT_SAVED); + Services.obs.addObserver(observer, URI_VISIT_SAVED, false); PlacesUtils.asyncHistory.updatePlaces(place); }); } @@ -1134,7 +1134,7 @@ add_task(function* test_omit_frecency_notifications() { resolve(); }, }; - PlacesUtils.history.addObserver(frecencyObserverCheck); + PlacesUtils.history.addObserver(frecencyObserverCheck, false); }); yield promiseUpdatePlaces(places, {}, true); yield promiseFrecenciesChanged; @@ -1266,7 +1266,7 @@ add_task(function* test_title_on_initial_visit() { PlacesUtils.history.removeObserver(visitObserver); resolve(); }); - PlacesUtils.history.addObserver(visitObserver); + PlacesUtils.history.addObserver(visitObserver, false); }); yield promiseUpdatePlaces(place); yield visitPromise; @@ -1290,7 +1290,7 @@ add_task(function* test_title_on_initial_visit() { PlacesUtils.history.removeObserver(visitObserver); resolve(); }); - PlacesUtils.history.addObserver(visitObserver); + PlacesUtils.history.addObserver(visitObserver, false); }); yield promiseUpdatePlaces(place); yield visitPromise; @@ -1313,7 +1313,7 @@ add_task(function* test_title_on_initial_visit() { PlacesUtils.history.removeObserver(visitObserver); resolve(); }); - PlacesUtils.history.addObserver(visitObserver); + PlacesUtils.history.addObserver(visitObserver, false); }); yield promiseUpdatePlaces(place); yield visitPromise; diff --git a/toolkit/components/places/tests/history/test_insertMany.js b/toolkit/components/places/tests/history/test_insertMany.js index 88b8c6d966f1..3ad7d18c1acd 100644 --- a/toolkit/components/places/tests/history/test_insertMany.js +++ b/toolkit/components/places/tests/history/test_insertMany.js @@ -64,7 +64,7 @@ add_task(function* test_insertMany() { PlacesUtils.history.removeObserver(obs); reject(); }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); }); } diff --git a/toolkit/components/places/tests/history/test_remove.js b/toolkit/components/places/tests/history/test_remove.js index e18fd5747ec9..cb622c734412 100644 --- a/toolkit/components/places/tests/history/test_remove.js +++ b/toolkit/components/places/tests/history/test_remove.js @@ -84,7 +84,7 @@ add_task(function* test_remove_single() { } }; }); - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); do_print("Performing removal"); let removed = false; @@ -238,7 +238,7 @@ add_task(function* test_remove_many() { origin.onDeleteVisitsCalled = true; } }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); do_print("Removing the pages and checking the callbacks"); let removed = yield PlacesUtils.history.remove(keys, page => { diff --git a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js b/toolkit/components/places/tests/history/test_removeVisitsByFilter.js index 65767b916cb1..1544f467b231 100644 --- a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js +++ b/toolkit/components/places/tests/history/test_removeVisitsByFilter.js @@ -168,7 +168,7 @@ add_task(function* test_removeVisitsByFilter() { // Not sure we can test anything. } }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); let cbarg; if (options.useCallback) { diff --git a/toolkit/components/places/tests/history/test_sameUri_titleChanged.js b/toolkit/components/places/tests/history/test_sameUri_titleChanged.js index c4b59541cbd4..e12cca65d41f 100644 --- a/toolkit/components/places/tests/history/test_sameUri_titleChanged.js +++ b/toolkit/components/places/tests/history/test_sameUri_titleChanged.js @@ -16,7 +16,7 @@ add_task(function* test() { } } }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); }); // This repeats the url on purpose, don't merge it into a single place entry. diff --git a/toolkit/components/places/tests/queries/test_async.js b/toolkit/components/places/tests/queries/test_async.js index 0c025891aaed..138116e21b02 100644 --- a/toolkit/components/places/tests/queries/test_async.js +++ b/toolkit/components/places/tests/queries/test_async.js @@ -211,7 +211,7 @@ Test.prototype = { } }, }; - this.result.addObserver(this.observer); + this.result.addObserver(this.observer, false); print("Opening container"); this.result.root.containerOpen = true; diff --git a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js index 78fa4a03b023..1c7c83918b06 100644 --- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js +++ b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js @@ -454,7 +454,7 @@ function* addTestEngine(basename, httpServer = undefined) { Services.obs.removeObserver(obs, "browser-search-engine-modified"); do_register_cleanup(() => Services.search.removeEngine(engine)); resolve(engine); - }, "browser-search-engine-modified"); + }, "browser-search-engine-modified", false); do_print("Adding engine from URL: " + dataUrl + basename); Services.search.addEngine(dataUrl + basename, null, null, false); diff --git a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js b/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js index 0d80b712299a..724d5567d30b 100644 --- a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js +++ b/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js @@ -20,7 +20,7 @@ function promiseURIDeleted(testURI) { Assert.equal(uri.spec, testURI.spec, "Deleted URI should be the expected one"); resolve(); }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); }); } diff --git a/toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js b/toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js index 2bfc83b5656f..960bd631c2d1 100644 --- a/toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js +++ b/toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js @@ -48,7 +48,7 @@ var observer = { } }; -bmSvc.addObserver(observer); +bmSvc.addObserver(observer, false); function add_bookmarks() { // This is the folder we will cleanup diff --git a/toolkit/components/places/tests/unit/test_452777.js b/toolkit/components/places/tests/unit/test_452777.js index 3bec4c14a386..49a51e9fe9f2 100644 --- a/toolkit/components/places/tests/unit/test_452777.js +++ b/toolkit/components/places/tests/unit/test_452777.js @@ -29,6 +29,6 @@ function run_test() { do_check_eq(aItemId, id); do_check_eq(aTitle, TITLE); } - }); + }, false); transaction.undoTransaction(); } diff --git a/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js b/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js index 3f5dcf5b267a..1280ce3e7976 100644 --- a/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js +++ b/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js @@ -128,6 +128,6 @@ function promiseSearchTopic(expectedVerb) { Services.obs.removeObserver(observe, "browser-search-engine-modified"); deferred.resolve(); } - }, "browser-search-engine-modified"); + }, "browser-search-engine-modified", false); return deferred.promise; } diff --git a/toolkit/components/places/tests/unit/test_adaptive.js b/toolkit/components/places/tests/unit/test_adaptive.js index 158082ab61cd..e039571c7aaf 100644 --- a/toolkit/components/places/tests/unit/test_adaptive.js +++ b/toolkit/components/places/tests/unit/test_adaptive.js @@ -180,7 +180,7 @@ var observer = { ensure_results(this.results, this.search); } }; -Services.obs.addObserver(observer, PlacesUtils.TOPIC_FEEDBACK_UPDATED); +Services.obs.addObserver(observer, PlacesUtils.TOPIC_FEEDBACK_UPDATED, false); /** * Make the result object for a given URI that will be passed to ensure_results. diff --git a/toolkit/components/places/tests/unit/test_adaptive_bug527311.js b/toolkit/components/places/tests/unit/test_adaptive_bug527311.js index 6e107ef0f5ab..550c9528df5f 100644 --- a/toolkit/components/places/tests/unit/test_adaptive_bug527311.js +++ b/toolkit/components/places/tests/unit/test_adaptive_bug527311.js @@ -106,7 +106,7 @@ function addAdaptiveFeedback(aUrl, aSearch, aCallback) { do_timeout(0, aCallback); } }; - os.addObserver(observer, PLACES_AUTOCOMPLETE_FEEDBACK_UPDATED_TOPIC); + os.addObserver(observer, PLACES_AUTOCOMPLETE_FEEDBACK_UPDATED_TOPIC, false); let thing = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput, diff --git a/toolkit/components/places/tests/unit/test_async_transactions.js b/toolkit/components/places/tests/unit/test_async_transactions.js index 14cc331514ec..1c114c2dce91 100644 --- a/toolkit/components/places/tests/unit/test_async_transactions.js +++ b/toolkit/components/places/tests/unit/test_async_transactions.js @@ -104,7 +104,7 @@ observer.reset(); var bmStartIndex = 0; function run_test() { - bmsvc.addObserver(observer); + bmsvc.addObserver(observer, false); do_register_cleanup(function() { bmsvc.removeObserver(observer); }); diff --git a/toolkit/components/places/tests/unit/test_bookmark_catobs.js b/toolkit/components/places/tests/unit/test_bookmark_catobs.js index f85918d78510..e2b589090f2c 100644 --- a/toolkit/components/places/tests/unit/test_bookmark_catobs.js +++ b/toolkit/components/places/tests/unit/test_bookmark_catobs.js @@ -14,11 +14,11 @@ add_task(function* test_observers() { Services.obs.addObserver(function created() { Services.obs.removeObserver(created, "dummy-observer-created"); dummyCreated = true; - }, "dummy-observer-created"); + }, "dummy-observer-created", false); Services.obs.addObserver(function added() { Services.obs.removeObserver(added, "dummy-observer-item-added"); dummyReceivedOnItemAdded = true; - }, "dummy-observer-item-added"); + }, "dummy-observer-item-added", false); let initialObservers = PlacesUtils.bookmarks.getObservers(); @@ -44,7 +44,7 @@ add_task(function* test_observers() { Assert.ok(dummyReceivedOnItemAdded); resolve(); } - }); + }, false); }); // Add a bookmark diff --git a/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js b/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js index a8402d1dd4db..a7ad1257adef 100644 --- a/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js +++ b/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js @@ -15,7 +15,7 @@ add_task(function* () { Ci.nsIAnnotationObserver ]), }; - PlacesUtils.annotations.addObserver(annoObserver); + PlacesUtils.annotations.addObserver(annoObserver, false); }); diff --git a/toolkit/components/places/tests/unit/test_download_history.js b/toolkit/components/places/tests/unit/test_download_history.js index a45122591796..4d4cf3c7be34 100644 --- a/toolkit/components/places/tests/unit/test_download_history.js +++ b/toolkit/components/places/tests/unit/test_download_history.js @@ -27,7 +27,7 @@ function waitForOnVisit(aCallback) { aCallback.apply(null, arguments); } }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); } /** @@ -44,7 +44,7 @@ function waitForOnDeleteURI(aCallback) { aCallback.apply(null, arguments); } }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); } /** @@ -61,7 +61,7 @@ function waitForOnDeleteVisits(aCallback) { aCallback.apply(null, arguments); } }; - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); } function run_test() { @@ -257,8 +257,8 @@ add_test(function test_dh_details() { onDeleteVisits() {} }; - PlacesUtils.annotations.addObserver(annoObserver); - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.annotations.addObserver(annoObserver, false); + PlacesUtils.history.addObserver(historyObserver, false); // Both null values and remote URIs should not cause errors. gDownloadHistory.addDownload(SOURCE_URI, null, Date.now() * 1000); diff --git a/toolkit/components/places/tests/unit/test_frecency_decay.js b/toolkit/components/places/tests/unit/test_frecency_decay.js index 27614abd4c89..f7f0aec40f64 100644 --- a/toolkit/components/places/tests/unit/test_frecency_decay.js +++ b/toolkit/components/places/tests/unit/test_frecency_decay.js @@ -20,7 +20,7 @@ function promiseFrecencyChanged(expectedURI, expectedFrecency) { Assert.equal(newFrecency, expectedFrecency, "Frecency should be the expected one"); deferred.resolve(); }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); return deferred.promise; } @@ -37,7 +37,7 @@ function promiseManyFrecenciesChanged() { Assert.ok(true); deferred.resolve(); }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); return deferred.promise; } diff --git a/toolkit/components/places/tests/unit/test_frecency_observers.js b/toolkit/components/places/tests/unit/test_frecency_observers.js index 4115334673be..7fadd4ae92ce 100644 --- a/toolkit/components/places/tests/unit/test_frecency_observers.js +++ b/toolkit/components/places/tests/unit/test_frecency_observers.js @@ -67,7 +67,7 @@ function onFrecencyChanged(expectedURI) { do_check_true(uri.equals(expectedURI)); deferred.resolve(); }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); return deferred.promise; } @@ -79,6 +79,6 @@ function onManyFrecenciesChanged() { do_check_true(true); deferred.resolve(); }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); return deferred.promise; } diff --git a/toolkit/components/places/tests/unit/test_history_catobs.js b/toolkit/components/places/tests/unit/test_history_catobs.js index 261e0507ec8c..e0a81d67bc30 100644 --- a/toolkit/components/places/tests/unit/test_history_catobs.js +++ b/toolkit/components/places/tests/unit/test_history_catobs.js @@ -15,11 +15,11 @@ add_task(function* () { Services.obs.addObserver(function created() { Services.obs.removeObserver(created, "dummy-observer-created"); dummyCreated = true; - }, "dummy-observer-created"); + }, "dummy-observer-created", false); Services.obs.addObserver(function visited() { Services.obs.removeObserver(visited, "dummy-observer-visited"); dummyReceivedOnVisit = true; - }, "dummy-observer-visited"); + }, "dummy-observer-visited", false); let initialObservers = PlacesUtils.history.getObservers(); @@ -45,7 +45,7 @@ add_task(function* () { Assert.ok(dummyReceivedOnVisit); resolve(); } - }); + }, false); }); // Add a visit. diff --git a/toolkit/components/places/tests/unit/test_history_clear.js b/toolkit/components/places/tests/unit/test_history_clear.js index 5f4c31de6224..a36400fe29d0 100644 --- a/toolkit/components/places/tests/unit/test_history_clear.js +++ b/toolkit/components/places/tests/unit/test_history_clear.js @@ -27,7 +27,7 @@ function promiseOnClearHistoryObserved() { Ci.nsINavHistoryObserver, ]) } - PlacesUtils.history.addObserver(historyObserver); + PlacesUtils.history.addObserver(historyObserver, false); return deferred.promise; } diff --git a/toolkit/components/places/tests/unit/test_history_observer.js b/toolkit/components/places/tests/unit/test_history_observer.js index 86b750779ce4..503c41b44e4c 100644 --- a/toolkit/components/places/tests/unit/test_history_observer.js +++ b/toolkit/components/places/tests/unit/test_history_observer.js @@ -32,7 +32,7 @@ function onNotify(callback) { callback.apply(this, arguments); resolve(); }; - PlacesUtils.history.addObserver(obs); + PlacesUtils.history.addObserver(obs, false); }); } @@ -132,7 +132,7 @@ add_task(function* test_multiple_onVisit() { } } }; - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); }); yield PlacesTestUtils.addVisits([ { uri: testuri, transition: TRANSITION_LINK }, diff --git a/toolkit/components/places/tests/unit/test_keywords.js b/toolkit/components/places/tests/unit/test_keywords.js index 511acecc1cfb..9a2f36a3caf0 100644 --- a/toolkit/components/places/tests/unit/test_keywords.js +++ b/toolkit/components/places/tests/unit/test_keywords.js @@ -75,7 +75,7 @@ function expectBookmarkNotifications() { return undefined; } }); - PlacesUtils.bookmarks.addObserver(observer); + PlacesUtils.bookmarks.addObserver(observer, false); return observer; } diff --git a/toolkit/components/places/tests/unit/test_markpageas.js b/toolkit/components/places/tests/unit/test_markpageas.js index dab2b7e6c3fe..5a5c789cf967 100644 --- a/toolkit/components/places/tests/unit/test_markpageas.js +++ b/toolkit/components/places/tests/unit/test_markpageas.js @@ -34,7 +34,7 @@ add_task(function* test_execute() { }; }); - PlacesUtils.history.addObserver(observer); + PlacesUtils.history.addObserver(observer, false); for (var visit of gVisits) { if (visit.transition == TRANSITION_TYPED) diff --git a/toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js b/toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js index 86212423b92b..3aa82d1876ec 100644 --- a/toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js +++ b/toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js @@ -165,7 +165,7 @@ add_task(function* test_addLivemark_parentId_succeeds() { do_check_eq(aItemType, Ci.nsINavBookmarksService.TYPE_FOLDER); do_check_eq(aTitle, "test"); } - }); + }, false); yield PlacesUtils.livemarks.addLivemark( { title: "test" diff --git a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js b/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js index aa214851e135..b45b33abeed3 100644 --- a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js +++ b/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js @@ -87,7 +87,7 @@ add_test(function check_history_query() { options.resultType = options.RESULTS_AS_VISIT; var query = PlacesUtils.history.getNewQuery(); var result = PlacesUtils.history.executeQuery(query, options); - result.addObserver(resultObserver); + result.addObserver(resultObserver, false); var root = result.root; root.containerOpen = true; @@ -158,7 +158,7 @@ add_test(function check_bookmarks_query() { var query = PlacesUtils.history.getNewQuery(); query.setFolders([PlacesUtils.bookmarks.bookmarksMenuFolder], 1); var result = PlacesUtils.history.executeQuery(query, options); - result.addObserver(resultObserver); + result.addObserver(resultObserver, false); var root = result.root; root.containerOpen = true; @@ -230,7 +230,7 @@ add_test(function check_mixed_query() { var query = PlacesUtils.history.getNewQuery(); query.onlyBookmarked = true; var result = PlacesUtils.history.executeQuery(query, options); - result.addObserver(resultObserver); + result.addObserver(resultObserver, false); var root = result.root; root.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_onItemChanged_tags.js b/toolkit/components/places/tests/unit/test_onItemChanged_tags.js index 83e3218057e5..0a9fc15626d5 100644 --- a/toolkit/components/places/tests/unit/test_onItemChanged_tags.js +++ b/toolkit/components/places/tests/unit/test_onItemChanged_tags.js @@ -44,7 +44,7 @@ function run_test() { onItemVisited() {}, onItemMoved() {}, }; - PlacesUtils.bookmarks.addObserver(bookmarksObserver); + PlacesUtils.bookmarks.addObserver(bookmarksObserver, false); PlacesUtils.tagging.tagURI(uri, ["d"]); PlacesUtils.tagging.tagURI(uri, ["e"]); diff --git a/toolkit/components/places/tests/unit/test_placesTxn.js b/toolkit/components/places/tests/unit/test_placesTxn.js index c532b7f00ed4..254d85e9a07f 100644 --- a/toolkit/components/places/tests/unit/test_placesTxn.js +++ b/toolkit/components/places/tests/unit/test_placesTxn.js @@ -111,7 +111,7 @@ var bmStartIndex = 0; var root = PlacesUtils.bookmarksMenuFolderId; add_task(function* init() { - bmsvc.addObserver(observer); + bmsvc.addObserver(observer, false); do_register_cleanup(function() { bmsvc.removeObserver(observer); }); diff --git a/toolkit/components/places/tests/unit/test_result_sort.js b/toolkit/components/places/tests/unit/test_result_sort.js index 7652ef4bba59..35405ac506aa 100644 --- a/toolkit/components/places/tests/unit/test_result_sort.js +++ b/toolkit/components/places/tests/unit/test_result_sort.js @@ -19,7 +19,7 @@ function promiseOnItemVisited() { do_execute_soon(defer.resolve); } }; - PlacesUtils.bookmarks.addObserver(bookmarksObserver); + PlacesUtils.bookmarks.addObserver(bookmarksObserver, false); return defer.promise; } diff --git a/toolkit/components/processsingleton/ContentProcessSingleton.js b/toolkit/components/processsingleton/ContentProcessSingleton.js index 245af5cd72da..eaf6949fd70f 100644 --- a/toolkit/components/processsingleton/ContentProcessSingleton.js +++ b/toolkit/components/processsingleton/ContentProcessSingleton.js @@ -47,8 +47,8 @@ ContentProcessSingleton.prototype = { observe(subject, topic, data) { switch (topic) { case "app-startup": { - Services.obs.addObserver(this, "console-api-log-event"); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "console-api-log-event", false); + Services.obs.addObserver(this, "xpcom-shutdown", false); cpmm.addMessageListener("DevTools:InitDebuggerServer", this); TelemetryController.observe(null, topic, null); break; diff --git a/toolkit/components/processsingleton/MainProcessSingleton.js b/toolkit/components/processsingleton/MainProcessSingleton.js index ef163ace686d..2dafe89c3963 100644 --- a/toolkit/components/processsingleton/MainProcessSingleton.js +++ b/toolkit/components/processsingleton/MainProcessSingleton.js @@ -67,7 +67,7 @@ MainProcessSingleton.prototype = { observe(subject, topic, data) { switch (topic) { case "app-startup": { - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); // Load this script early so that console.* is initialized // before other frame scripts. diff --git a/toolkit/components/reader/AboutReader.jsm b/toolkit/components/reader/AboutReader.jsm index c3385cdb1f24..2ed011cb170c 100644 --- a/toolkit/components/reader/AboutReader.jsm +++ b/toolkit/components/reader/AboutReader.jsm @@ -73,7 +73,7 @@ var AboutReader = function(mm, win, articlePromise) { win.addEventListener("scroll", this); win.addEventListener("resize", this); - Services.obs.addObserver(this, "inner-window-destroyed"); + Services.obs.addObserver(this, "inner-window-destroyed", false); doc.addEventListener("visibilitychange", this); diff --git a/toolkit/components/reader/ReaderMode.jsm b/toolkit/components/reader/ReaderMode.jsm index b659807a7252..44024007557a 100644 --- a/toolkit/components/reader/ReaderMode.jsm +++ b/toolkit/components/reader/ReaderMode.jsm @@ -51,7 +51,7 @@ this.ReaderMode = { get maxElemsToParse() { delete this.parseNodeLimit; - Services.prefs.addObserver("reader.parse-node-limit", this); + Services.prefs.addObserver("reader.parse-node-limit", this, false); return this.parseNodeLimit = Services.prefs.getIntPref("reader.parse-node-limit"); }, @@ -59,7 +59,7 @@ this.ReaderMode = { delete this.isEnabledForParseOnLoad; // Listen for future pref changes. - Services.prefs.addObserver("reader.parse-on-load.", this); + Services.prefs.addObserver("reader.parse-on-load.", this, false); return this.isEnabledForParseOnLoad = this._getStateForParseOnLoad(); }, diff --git a/toolkit/components/satchel/formSubmitListener.js b/toolkit/components/satchel/formSubmitListener.js index 513a5adcabba..0ac4361461e7 100644 --- a/toolkit/components/satchel/formSubmitListener.js +++ b/toolkit/components/satchel/formSubmitListener.js @@ -24,8 +24,8 @@ var satchelFormListener = { saveHttpsForms: true, init() { - Services.obs.addObserver(this, "earlyformsubmit"); - Services.prefs.addObserver("browser.formfill.", this); + Services.obs.addObserver(this, "earlyformsubmit", false); + Services.prefs.addObserver("browser.formfill.", this, false); this.updatePrefs(); addEventListener("unload", this, false); }, diff --git a/toolkit/components/satchel/test/parent_utils.js b/toolkit/components/satchel/test/parent_utils.js index 97ba52499968..5f5731c749d3 100644 --- a/toolkit/components/satchel/test/parent_utils.js +++ b/toolkit/components/satchel/test/parent_utils.js @@ -142,7 +142,7 @@ addMessageListener("getPopupState", () => { }); addMessageListener("addObserver", () => { - Services.obs.addObserver(ParentUtils, "satchel-storage-changed"); + Services.obs.addObserver(ParentUtils, "satchel-storage-changed", false); }); addMessageListener("removeObserver", () => { Services.obs.removeObserver(ParentUtils, "satchel-storage-changed"); diff --git a/toolkit/components/satchel/test/unit/test_notify.js b/toolkit/components/satchel/test/unit/test_notify.js index 7df7196e72d8..6ae6d77965d7 100644 --- a/toolkit/components/satchel/test/unit/test_notify.js +++ b/toolkit/components/satchel/test/unit/test_notify.js @@ -64,7 +64,7 @@ yield countEntries(null, null, function(num) { do_check_false(num, "Checking ini // Add the observer var os = Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService); -os.addObserver(TestObserver, "satchel-storage-changed"); +os.addObserver(TestObserver, "satchel-storage-changed", false); /* ========== 2 ========== */ testnum++; diff --git a/toolkit/components/search/SearchSuggestionController.jsm b/toolkit/components/search/SearchSuggestionController.jsm index b4227d7e653f..b18f3f41281b 100644 --- a/toolkit/components/search/SearchSuggestionController.jsm +++ b/toolkit/components/search/SearchSuggestionController.jsm @@ -27,7 +27,7 @@ const REMOTE_TIMEOUT_DEFAULT = 500; // maximum time (ms) to wait before giving u var gRemoteSuggestionsEnabled = Services.prefs.getBoolPref(BROWSER_SUGGEST_PREF); Services.prefs.addObserver(BROWSER_SUGGEST_PREF, function(aSubject, aTopic, aData) { gRemoteSuggestionsEnabled = Services.prefs.getBoolPref(BROWSER_SUGGEST_PREF); -}); +}, false); /** * SearchSuggestionController.jsm exists as a helper module to allow multiple consumers to request and display diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index 7e568efadcb3..a421165720c9 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -4674,11 +4674,11 @@ SearchService.prototype = { } this._observersAdded = true; - Services.obs.addObserver(this, SEARCH_ENGINE_TOPIC); - Services.obs.addObserver(this, QUIT_APPLICATION_TOPIC); + Services.obs.addObserver(this, SEARCH_ENGINE_TOPIC, false); + Services.obs.addObserver(this, QUIT_APPLICATION_TOPIC, false); if (AppConstants.MOZ_BUILD_APP == "mobile/android") { - Services.prefs.addObserver(LOCALE_PREF, this); + Services.prefs.addObserver(LOCALE_PREF, this, false); } // The current stage of shutdown. Used to help analyze crash diff --git a/toolkit/components/search/tests/xpcshell/head_search.js b/toolkit/components/search/tests/xpcshell/head_search.js index d36cab4fbdc3..4ee6a6bb5078 100644 --- a/toolkit/components/search/tests/xpcshell/head_search.js +++ b/toolkit/components/search/tests/xpcshell/head_search.js @@ -394,7 +394,7 @@ var addTestEngines = Task.async(function* (aItems) { } catch (ex) { reject(ex); } - }, "browser-search-engine-modified"); + }, "browser-search-engine-modified", false); if (item.xmlFileName) { Services.search.addEngine(gDataUrl + item.xmlFileName, @@ -492,7 +492,7 @@ function waitForSearchNotification(aExpectedData) { Services.obs.removeObserver(observer, SEARCH_SERVICE_TOPIC); resolve(aSubject); - }, SEARCH_SERVICE_TOPIC); + }, SEARCH_SERVICE_TOPIC, false); }); } diff --git a/toolkit/components/search/tests/xpcshell/test_engineUpdate.js b/toolkit/components/search/tests/xpcshell/test_engineUpdate.js index 27ae29daa682..3c0a20ff272c 100644 --- a/toolkit/components/search/tests/xpcshell/test_engineUpdate.js +++ b/toolkit/components/search/tests/xpcshell/test_engineUpdate.js @@ -39,7 +39,7 @@ add_task(function* test_engineUpdate() { Services.obs.removeObserver(obs, TOPIC); resolve(); } - }, TOPIC); + }, TOPIC, false); // set last update to 8 days ago, since the default interval is 7, then // trigger an update diff --git a/toolkit/components/search/tests/xpcshell/test_json_cache.js b/toolkit/components/search/tests/xpcshell/test_json_cache.js index 60da243fcb09..f23812bb1e3f 100644 --- a/toolkit/components/search/tests/xpcshell/test_json_cache.js +++ b/toolkit/components/search/tests/xpcshell/test_json_cache.js @@ -135,7 +135,7 @@ add_test(function test_cache_write() { }); } }; - Services.obs.addObserver(cacheWriteObserver, "browser-search-service"); + Services.obs.addObserver(cacheWriteObserver, "browser-search-service", false); Services.search.QueryInterface(Ci.nsIObserver).observe(null, "browser-search-engine-modified", "engine-removed"); }); diff --git a/toolkit/components/search/tests/xpcshell/test_notifications.js b/toolkit/components/search/tests/xpcshell/test_notifications.js index 7191f22fe9d0..77d6425a5bb9 100644 --- a/toolkit/components/search/tests/xpcshell/test_notifications.js +++ b/toolkit/components/search/tests/xpcshell/test_notifications.js @@ -65,7 +65,7 @@ function run_test() { do_test_pending(); - Services.obs.addObserver(search_observer, "browser-search-engine-modified"); + Services.obs.addObserver(search_observer, "browser-search-engine-modified", false); Services.search.addEngine(gDataUrl + "engine.xml", null, null, false); } diff --git a/toolkit/components/search/tests/xpcshell/test_sync_delay_fallback.js b/toolkit/components/search/tests/xpcshell/test_sync_delay_fallback.js index 71366e87fd78..1b41a71bf033 100644 --- a/toolkit/components/search/tests/xpcshell/test_sync_delay_fallback.js +++ b/toolkit/components/search/tests/xpcshell/test_sync_delay_fallback.js @@ -48,5 +48,5 @@ function run_test() { do_check_true(Services.search.isInitialized); } - }, "browser-search-service"); + }, "browser-search-service", false); } diff --git a/toolkit/components/telemetry/GCTelemetry.jsm b/toolkit/components/telemetry/GCTelemetry.jsm index eae6b6b0f4b9..43a4ea9ca780 100644 --- a/toolkit/components/telemetry/GCTelemetry.jsm +++ b/toolkit/components/telemetry/GCTelemetry.jsm @@ -168,7 +168,7 @@ var GCTelemetry = { } this.initialized = true; - Services.obs.addObserver(this, "garbage-collection-statistics"); + Services.obs.addObserver(this, "garbage-collection-statistics", false); if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_DEFAULT) { Services.ppmm.addMessageListener("Telemetry:GCStatistics", this); diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm index 8ad138a1e24e..6bd68e37ceb4 100644 --- a/toolkit/components/telemetry/TelemetryEnvironment.jsm +++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm @@ -491,7 +491,7 @@ EnvironmentAddonBuilder.prototype = { watchForChanges() { this._loaded = true; AddonManager.addAddonListener(this); - Services.obs.addObserver(this, EXPERIMENTS_CHANGED_TOPIC); + Services.obs.addObserver(this, EXPERIMENTS_CHANGED_TOPIC, false); }, // AddonListener @@ -1005,12 +1005,12 @@ EnvironmentCache.prototype = { _addObservers() { // Watch the search engine change and service topics. - Services.obs.addObserver(this, COMPOSITOR_CREATED_TOPIC); - Services.obs.addObserver(this, COMPOSITOR_PROCESS_ABORTED_TOPIC); - Services.obs.addObserver(this, DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC); - Services.obs.addObserver(this, GFX_FEATURES_READY_TOPIC); - Services.obs.addObserver(this, SEARCH_ENGINE_MODIFIED_TOPIC); - Services.obs.addObserver(this, SEARCH_SERVICE_TOPIC); + Services.obs.addObserver(this, COMPOSITOR_CREATED_TOPIC, false); + Services.obs.addObserver(this, COMPOSITOR_PROCESS_ABORTED_TOPIC, false); + Services.obs.addObserver(this, DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC, false); + Services.obs.addObserver(this, GFX_FEATURES_READY_TOPIC, false); + Services.obs.addObserver(this, SEARCH_ENGINE_MODIFIED_TOPIC, false); + Services.obs.addObserver(this, SEARCH_SERVICE_TOPIC, false); }, _removeObservers() { diff --git a/toolkit/components/telemetry/TelemetryReportingPolicy.jsm b/toolkit/components/telemetry/TelemetryReportingPolicy.jsm index 737c08db6a59..268ba5cc85c0 100644 --- a/toolkit/components/telemetry/TelemetryReportingPolicy.jsm +++ b/toolkit/components/telemetry/TelemetryReportingPolicy.jsm @@ -327,7 +327,7 @@ var TelemetryReportingPolicyImpl = { this._migratePreferences(); // Add the event observers. - Services.obs.addObserver(this, "sessionstore-windows-restored"); + Services.obs.addObserver(this, "sessionstore-windows-restored", false); }, /** diff --git a/toolkit/components/telemetry/TelemetrySend.jsm b/toolkit/components/telemetry/TelemetrySend.jsm index 10778e95b374..c7df0761a0d3 100644 --- a/toolkit/components/telemetry/TelemetrySend.jsm +++ b/toolkit/components/telemetry/TelemetrySend.jsm @@ -613,7 +613,7 @@ var TelemetrySendImpl = { this._testMode = testing; this._sendingEnabled = true; - Services.obs.addObserver(this, TOPIC_IDLE_DAILY); + Services.obs.addObserver(this, TOPIC_IDLE_DAILY, false); this._server = Preferences.get(PREF_SERVER, undefined); diff --git a/toolkit/components/telemetry/TelemetrySession.jsm b/toolkit/components/telemetry/TelemetrySession.jsm index 8d5d71c7ec75..6f1d7d243797 100644 --- a/toolkit/components/telemetry/TelemetrySession.jsm +++ b/toolkit/components/telemetry/TelemetrySession.jsm @@ -300,7 +300,7 @@ var TelemetryScheduler = { this._rescheduleTimeout(); idleService.addIdleObserver(this, IDLE_TIMEOUT_SECONDS); - Services.obs.addObserver(this, "wake_notification"); + Services.obs.addObserver(this, "wake_notification", false); }, /** @@ -1443,9 +1443,9 @@ var Impl = { attachObservers: function attachObservers() { if (!this._initialized) return; - Services.obs.addObserver(this, "idle-daily"); + Services.obs.addObserver(this, "idle-daily", false); if (Telemetry.canRecordExtended) { - Services.obs.addObserver(this, TOPIC_CYCLE_COLLECTOR_BEGIN); + Services.obs.addObserver(this, TOPIC_CYCLE_COLLECTOR_BEGIN, false); } }, @@ -1505,11 +1505,11 @@ var Impl = { Preferences.set(PREF_PREVIOUS_BUILDID, thisBuildID); } - Services.obs.addObserver(this, "sessionstore-windows-restored"); + Services.obs.addObserver(this, "sessionstore-windows-restored", false); if (AppConstants.platform === "android") { - Services.obs.addObserver(this, "application-background"); + Services.obs.addObserver(this, "application-background", false); } - Services.obs.addObserver(this, "xul-window-visible"); + Services.obs.addObserver(this, "xul-window-visible", false); this._hasWindowRestoredObserver = true; this._hasXulWindowVisibleObserver = true; @@ -1600,7 +1600,7 @@ var Impl = { return; } - Services.obs.addObserver(this, "content-child-shutdown"); + Services.obs.addObserver(this, "content-child-shutdown", false); cpml.addMessageListener(MESSAGE_TELEMETRY_GET_CHILD_THREAD_HANGS, this); cpml.addMessageListener(MESSAGE_TELEMETRY_GET_CHILD_USS, this); diff --git a/toolkit/components/telemetry/ThirdPartyCookieProbe.jsm b/toolkit/components/telemetry/ThirdPartyCookieProbe.jsm index 698fe2ede9bf..286d782a78a5 100644 --- a/toolkit/components/telemetry/ThirdPartyCookieProbe.jsm +++ b/toolkit/components/telemetry/ThirdPartyCookieProbe.jsm @@ -47,9 +47,9 @@ this.ThirdPartyCookieProbe = function() { this.ThirdPartyCookieProbe.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), init() { - Services.obs.addObserver(this, "profile-before-change"); - Services.obs.addObserver(this, "third-party-cookie-accepted"); - Services.obs.addObserver(this, "third-party-cookie-rejected"); + Services.obs.addObserver(this, "profile-before-change", false); + Services.obs.addObserver(this, "third-party-cookie-accepted", false); + Services.obs.addObserver(this, "third-party-cookie-rejected", false); }, dispose() { Services.obs.removeObserver(this, "profile-before-change"); diff --git a/toolkit/components/telemetry/UITelemetry.jsm b/toolkit/components/telemetry/UITelemetry.jsm index b0829ad6c76b..8f71e1bddf9d 100644 --- a/toolkit/components/telemetry/UITelemetry.jsm +++ b/toolkit/components/telemetry/UITelemetry.jsm @@ -32,8 +32,8 @@ this.UITelemetry = { } // Set an observer to watch for changes at runtime. - Services.prefs.addObserver(PREF_ENABLED, this); - Services.obs.addObserver(this, "profile-before-change"); + Services.prefs.addObserver(PREF_ENABLED, this, false); + Services.obs.addObserver(this, "profile-before-change", false); // Pick up the current value. this._enabled = Services.prefs.getBoolPref(PREF_ENABLED, false); diff --git a/toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js b/toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js index 3ce0a7aa4cd2..d800020887bb 100644 --- a/toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js +++ b/toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js @@ -151,7 +151,7 @@ add_task(function* test() { Services.obs.removeObserver(obs, "garbage-collection-statistics"); resolve(); } - Services.obs.addObserver(obs, "garbage-collection-statistics"); + Services.obs.addObserver(obs, "garbage-collection-statistics", false); }); let remotePromise; diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js b/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js index bacf7b9e7f27..ca5d1820b3cb 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js @@ -49,7 +49,7 @@ add_task(function* testSendPendingOnIdleDaily() { gHttpServer.registerPrefixHandler("/submit/telemetry/", request => resolve(request))); let gatherPromise = PromiseUtils.defer(); - Services.obs.addObserver(gatherPromise.resolve, "gather-telemetry"); + Services.obs.addObserver(gatherPromise.resolve, "gather-telemetry", false); // Check that we are correctly receiving the gather-telemetry notification. TelemetrySession.observe(null, "idle-daily", null); diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js index c844b028e765..c5dab412a84b 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js @@ -1440,7 +1440,7 @@ add_task(function* test_defaultSearchEngine() { } catch (ex) { reject(ex); } - }, "browser-search-engine-modified"); + }, "browser-search-engine-modified", false); Services.search.addEngine("file://" + do_get_cwd().path + "/engine.xml", null, null, false); }); diff --git a/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js b/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js index a91ed73f5833..1c16395b3590 100644 --- a/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js +++ b/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js @@ -54,7 +54,8 @@ add_task(function* test_reload() { Services.obs.removeObserver(observer, TOPIC); resolve(); }, - TOPIC)); + TOPIC, + false)); do_print("Starting nsTerminatorTelemetry"); let tt = Cc["@mozilla.org/toolkit/shutdown-terminator-telemetry;1"]. diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm index 9f6f2b554436..defe37a9404a 100644 --- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm +++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm @@ -120,8 +120,8 @@ const BackgroundPageThumbs = { Services.obs.removeObserver(observe, "page-thumbnail:error"); } } - Services.obs.addObserver(observe, "page-thumbnail:create"); - Services.obs.addObserver(observe, "page-thumbnail:error"); + Services.obs.addObserver(observe, "page-thumbnail:create", false); + Services.obs.addObserver(observe, "page-thumbnail:error", false); }); try { this.capture(url, options); @@ -336,7 +336,8 @@ Services.prefs.addObserver(ABOUT_NEWTAB_SEGREGATION_PREF, if (aTopic == "nsPref:changed" && aData == ABOUT_NEWTAB_SEGREGATION_PREF) { BackgroundPageThumbs.renewThumbnailBrowser(); } - }); + }, + false); Object.defineProperty(this, "BackgroundPageThumbs", { value: BackgroundPageThumbs, diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js index 205ec8e0f2ec..cd1f1c5c22e0 100644 --- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js +++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js @@ -8,7 +8,7 @@ function* runTests() { numNotifications += 1; } - Services.obs.addObserver(observe, "page-thumbnail:create"); + Services.obs.addObserver(observe, "page-thumbnail:create", false); let url = "http://example.com/"; let file = thumbnailFile(url); diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js index 6f4deb8c9893..8ff6a35093f7 100644 --- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js +++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js @@ -29,7 +29,7 @@ function* runTests() { next(); }}); }); - }, "oop-frameloader-crashed"); + }, "oop-frameloader-crashed", false); // Nothing is pending - crash the process. info("Crashing the thumbnail content process."); diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_update.js b/toolkit/components/thumbnails/test/browser_thumbnails_update.js index 3193abfff70e..19ca8924eb59 100644 --- a/toolkit/components/thumbnails/test/browser_thumbnails_update.js +++ b/toolkit/components/thumbnails/test/browser_thumbnails_update.js @@ -56,7 +56,7 @@ function* simpleCaptureTest() { } } - Services.obs.addObserver(observe, "page-thumbnail:create"); + Services.obs.addObserver(observe, "page-thumbnail:create", false); // Create a tab - we don't care what the content is. yield addTab(URL); let browser = gBrowser.selectedBrowser; diff --git a/toolkit/components/thumbnails/test/head.js b/toolkit/components/thumbnails/test/head.js index 6237ca1e9619..5056eca6c749 100644 --- a/toolkit/components/thumbnails/test/head.js +++ b/toolkit/components/thumbnails/test/head.js @@ -297,8 +297,8 @@ function bgAddPageThumbObserver(url) { Services.obs.removeObserver(observe, "page-thumbnail:error"); } } - Services.obs.addObserver(observe, "page-thumbnail:create"); - Services.obs.addObserver(observe, "page-thumbnail:error"); + Services.obs.addObserver(observe, "page-thumbnail:create", false); + Services.obs.addObserver(observe, "page-thumbnail:error", false); }); } @@ -328,7 +328,7 @@ function bgAddCrashObserver() { removeFile(minidumpDirectory, dumpID + ".dmp"); removeFile(minidumpDirectory, dumpID + ".extra"); } - }, "ipc:content-shutdown"); + }, "ipc:content-shutdown", false); return { get crashed() { return crashed; diff --git a/toolkit/components/timermanager/nsUpdateTimerManager.js b/toolkit/components/timermanager/nsUpdateTimerManager.js index 0b6df03d7d30..b0f1ba07bf6c 100644 --- a/toolkit/components/timermanager/nsUpdateTimerManager.js +++ b/toolkit/components/timermanager/nsUpdateTimerManager.js @@ -57,7 +57,7 @@ function LOG(string) { * @constructor */ function TimerManager() { - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); } TimerManager.prototype = { /** diff --git a/toolkit/components/url-classifier/SafeBrowsing.jsm b/toolkit/components/url-classifier/SafeBrowsing.jsm index 373d0acf82dc..8e7bd549dc9d 100644 --- a/toolkit/components/url-classifier/SafeBrowsing.jsm +++ b/toolkit/components/url-classifier/SafeBrowsing.jsm @@ -58,10 +58,10 @@ this.SafeBrowsing = { return; } - Services.prefs.addObserver("browser.safebrowsing", this); - Services.prefs.addObserver("privacy.trackingprotection", this); - Services.prefs.addObserver("urlclassifier", this); - Services.prefs.addObserver("plugins.flashBlock.enabled", this); + Services.prefs.addObserver("browser.safebrowsing", this, false); + Services.prefs.addObserver("privacy.trackingprotection", this, false); + Services.prefs.addObserver("urlclassifier", this, false); + Services.prefs.addObserver("plugins.flashBlock.enabled", this, false); this.readPrefs(); this.addMozEntries(); @@ -458,6 +458,6 @@ this.SafeBrowsing = { } resolve(); }; - Services.obs.addObserver(finished, "mozentries-update-finished"); + Services.obs.addObserver(finished, "mozentries-update-finished", false); }), }; diff --git a/toolkit/components/url-classifier/content/moz/observer.js b/toolkit/components/url-classifier/content/moz/observer.js index 9eb0f7fc9e5f..a9d22ee2177e 100644 --- a/toolkit/components/url-classifier/content/moz/observer.js +++ b/toolkit/components/url-classifier/content/moz/observer.js @@ -81,7 +81,7 @@ function G_ObserverServiceObserver(topic, observeFunction, opt_onlyOnce) { BindToObject(this.observe_, this)); this.observerService_ = Cc["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService); - this.observerService_.addObserver(this.observer_, this.topic_); + this.observerService_.addObserver(this.observer_, this.topic_, false); } /** @@ -126,7 +126,7 @@ this.TEST_G_Observer = function TEST_G_Observer() { var topic = "google-observer-test"; var o1 = new G_ObserverWrapper(topic, regularObserver); - service.addObserver(o1, topic); + service.addObserver(o1, topic, false); new G_ObserverServiceObserver(topic, observerServiceObserver, true /* once */); diff --git a/toolkit/components/url-classifier/content/moz/preferences.js b/toolkit/components/url-classifier/content/moz/preferences.js index 344e5d9a5d29..30105ab344f0 100644 --- a/toolkit/components/url-classifier/content/moz/preferences.js +++ b/toolkit/components/url-classifier/content/moz/preferences.js @@ -160,7 +160,7 @@ G_Preferences.prototype.addObserver = function(which, callback) { var observer = new G_PreferenceObserver(callback); this.observers_[which].callbacks.push(callback); this.observers_[which].observers.push(observer); - this.prefs_.addObserver(which, observer /* strong reference */); + this.prefs_.addObserver(which, observer, false /* strong reference */); } } diff --git a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js index 159abc71af40..5279f7943655 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js +++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js @@ -180,7 +180,7 @@ function HashCompleter() { // A map of gethash URLs to next gethash time in miliseconds this._nextGethashTimeMs = {}; - Services.obs.addObserver(this, "quit-application"); + Services.obs.addObserver(this, "quit-application", false); } @@ -382,7 +382,7 @@ HashCompleterRequest.prototype = { return; } - Services.obs.addObserver(this, "quit-application"); + Services.obs.addObserver(this, "quit-application", false); // V4 requires table states to build the request so we need // a async call to retrieve the table states from disk. diff --git a/toolkit/components/url-classifier/tests/browser/classifierHelper.js b/toolkit/components/url-classifier/tests/browser/classifierHelper.js index 73b6670b87f9..83fb5ef26f00 100644 --- a/toolkit/components/url-classifier/tests/browser/classifierHelper.js +++ b/toolkit/components/url-classifier/tests/browser/classifierHelper.js @@ -51,7 +51,7 @@ classifierHelper.waitForInit = function() { return new Promise(function(resolve, reject) { observerService.addObserver(function() { resolve(); - }, "mozentries-update-finished"); + }, "mozentries-update-finished", false); let listener = { QueryInterface: function(iid) diff --git a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js b/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js index d0310a78f1fc..71cb9d58c47e 100644 --- a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js +++ b/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js @@ -66,7 +66,7 @@ function waitForInit() { observerService.addObserver(function() { sendAsyncMessage("safeBrowsingInited"); - }, "mozentries-update-finished"); + }, "mozentries-update-finished", false); // This url must sync with the table, url in SafeBrowsing.jsm addMozEntries const table = "test-phish-simple"; diff --git a/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html b/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html index 7f1e27d110b4..5012f0ab1da3 100644 --- a/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html +++ b/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html @@ -81,7 +81,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function executeTest(test) { diff --git a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html index fdbfca74a3bc..59b9ef17e865 100644 --- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html +++ b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html @@ -36,7 +36,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(aPrivate, aCallback) { diff --git a/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html b/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html index 68644e3199ef..03d7c0c0696a 100644 --- a/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html +++ b/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html @@ -72,7 +72,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(aTestData, aCallback, aTestCreater) { diff --git a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html index f64baa654112..78a331e400ab 100644 --- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html +++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html @@ -36,7 +36,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(aCallback) { diff --git a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html index 6484a78a16a1..9908053cdd59 100644 --- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html +++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html @@ -37,7 +37,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) { Services.obs.removeObserver(observer, aTopic); setTimeout(aCallback, 0); } - }, "browser-delayed-startup-finished"); + }, "browser-delayed-startup-finished", false); } function testOnWindow(contentPage, aCallback) { diff --git a/toolkit/components/viewconfig/content/config.js b/toolkit/components/viewconfig/content/config.js index e88307882983..06708ee16618 100644 --- a/toolkit/components/viewconfig/content/config.js +++ b/toolkit/components/viewconfig/content/config.js @@ -346,7 +346,7 @@ function ShowPrefs() { gSortFunction = gSortFunctions[gSortedColumn]; gPrefArray.sort(gSortFunction); - gPrefBranch.addObserver("", gPrefListener); + gPrefBranch.addObserver("", gPrefListener, false); var configTree = document.getElementById("configTree"); configTree.view = view; diff --git a/toolkit/content/browser-content.js b/toolkit/content/browser-content.js index bcc1f7fa394d..c9842048ae5e 100644 --- a/toolkit/content/browser-content.js +++ b/toolkit/content/browser-content.js @@ -970,9 +970,9 @@ var AudioPlaybackListener = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), init() { - Services.obs.addObserver(this, "audio-playback"); - Services.obs.addObserver(this, "AudioFocusChanged"); - Services.obs.addObserver(this, "MediaControl"); + Services.obs.addObserver(this, "audio-playback", false); + Services.obs.addObserver(this, "AudioFocusChanged", false); + Services.obs.addObserver(this, "MediaControl", false); addMessageListener("AudioPlayback", this); addEventListener("unload", () => { diff --git a/toolkit/content/process-content.js b/toolkit/content/process-content.js index 38eee0e0a7d5..2ff8f908a956 100644 --- a/toolkit/content/process-content.js +++ b/toolkit/content/process-content.js @@ -30,7 +30,7 @@ if (gInContentProcess) { init() { for (let topic of this.TOPICS) { - Services.obs.addObserver(this, topic); + Services.obs.addObserver(this, topic, false); Services.cpmm.addMessageListener("Memory:GetSummary", this); } }, diff --git a/toolkit/content/widgets/findbar.xml b/toolkit/content/widgets/findbar.xml index c1710a7e46cc..14dcd3390a08 100644 --- a/toolkit/content/widgets/findbar.xml +++ b/toolkit/content/widgets/findbar.xml @@ -375,14 +375,14 @@ this._useModalHighlight = prefsvc.getBoolPref("findbar.modalHighlight"); prefsvc.addObserver("accessibility.typeaheadfind", - this._observer); + this._observer, false); prefsvc.addObserver("accessibility.typeaheadfind.linksonly", - this._observer); + this._observer, false); prefsvc.addObserver("accessibility.typeaheadfind.casesensitive", - this._observer); - prefsvc.addObserver("findbar.entireword", this._observer); - prefsvc.addObserver("findbar.highlightAll", this._observer); - prefsvc.addObserver("findbar.modalHighlight", this._observer); + this._observer, false); + prefsvc.addObserver("findbar.entireword", this._observer, false); + prefsvc.addObserver("findbar.highlightAll", this._observer, false); + prefsvc.addObserver("findbar.modalHighlight", this._observer, false); this._findAsYouType = prefsvc.getBoolPref("accessibility.typeaheadfind"); diff --git a/toolkit/content/widgets/preferences.xml b/toolkit/content/widgets/preferences.xml index 81f22e53f74c..d3b355c3c798 100644 --- a/toolkit/content/widgets/preferences.xml +++ b/toolkit/content/widgets/preferences.xml @@ -127,7 +127,7 @@ return; this.preferences.rootBranchInternal - .addObserver(this.name, this.preferences); + .addObserver(this.name, this.preferences, false); // In non-instant apply mode, we must try and use the last saved state // from any previous opens of a child dialog instead of the value from // preferences, to pick up any edits a user may have made. diff --git a/toolkit/content/widgets/remote-browser.xml b/toolkit/content/widgets/remote-browser.xml index 88c3c7e0bada..1e4f729dd084 100644 --- a/toolkit/content/widgets/remote-browser.xml +++ b/toolkit/content/widgets/remote-browser.xml @@ -337,7 +337,7 @@ mm.sendAsyncMessage("PermitUnload", {id}); mm.addMessageListener("PermitUnload", msgListener); - Services.obs.addObserver(observer, "message-manager-close"); + Services.obs.addObserver(observer, "message-manager-close", false); let timedOut = false; function timeout() { diff --git a/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js b/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js index 12264a974e62..8fd64ba0792e 100644 --- a/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js +++ b/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js @@ -15,7 +15,7 @@ function run_test() { var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); - observerService.addObserver(crashWhileReporting, "memory-pressure"); + observerService.addObserver(crashWhileReporting, "memory-pressure", false); Components.utils.getJSTestingFunctions().reportLargeAllocationFailure(); }, function(mdump, extra) { diff --git a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js index c2b821b735dc..7a1380a5cde6 100644 --- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js +++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js @@ -387,7 +387,7 @@ function waitForPurgeNotification() { }); } }; - Services.obs.addObserver(observer, "browser:purge-domain-data"); + Services.obs.addObserver(observer, "browser:purge-domain-data", false); return deferred.promise; } @@ -521,7 +521,7 @@ function* test_cache_cleared() { do_test_finished(); } }; - os.addObserver(observer, "cacheservice:empty-cache"); + os.addObserver(observer, "cacheservice:empty-cache", false); yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); do_test_pending(); } diff --git a/toolkit/modules/Console.jsm b/toolkit/modules/Console.jsm index ac3745fdc855..e6e0a705d3f3 100644 --- a/toolkit/modules/Console.jsm +++ b/toolkit/modules/Console.jsm @@ -623,7 +623,7 @@ function ConsoleAPI(aConsoleOptions = {}) { if (aConsoleOptions.maxLogLevelPref) { updateMaxLogLevel(); - Services.prefs.addObserver(aConsoleOptions.maxLogLevelPref, updateMaxLogLevel); + Services.prefs.addObserver(aConsoleOptions.maxLogLevelPref, updateMaxLogLevel, false); } // Bind all the functions to this object. diff --git a/toolkit/modules/Deprecated.jsm b/toolkit/modules/Deprecated.jsm index e27f109175d3..e4a850290be5 100644 --- a/toolkit/modules/Deprecated.jsm +++ b/toolkit/modules/Deprecated.jsm @@ -18,7 +18,7 @@ var logWarnings = Services.prefs.getBoolPref(PREF_DEPRECATION_WARNINGS); Services.prefs.addObserver(PREF_DEPRECATION_WARNINGS, function(aSubject, aTopic, aData) { logWarnings = Services.prefs.getBoolPref(PREF_DEPRECATION_WARNINGS); - }); + }, false); /** * Build a callstack log message. diff --git a/toolkit/modules/HiddenFrame.jsm b/toolkit/modules/HiddenFrame.jsm index 4848b9fd31cc..eb023052f968 100644 --- a/toolkit/modules/HiddenFrame.jsm +++ b/toolkit/modules/HiddenFrame.jsm @@ -24,7 +24,7 @@ function ensureCleanupRegistered() { for (let hiddenFrame of ChromeUtils.nondeterministicGetWeakSetKeys(gAllHiddenFrames)) { hiddenFrame.destroy(); } - }, "xpcom-shutdown"); + }, "xpcom-shutdown", false); } } diff --git a/toolkit/modules/LightweightThemeConsumer.jsm b/toolkit/modules/LightweightThemeConsumer.jsm index 4b16569fdc4c..199ac6a84f53 100644 --- a/toolkit/modules/LightweightThemeConsumer.jsm +++ b/toolkit/modules/LightweightThemeConsumer.jsm @@ -22,7 +22,7 @@ this.LightweightThemeConsumer = this._lastScreenWidth = screen.width; this._lastScreenHeight = screen.height; - Services.obs.addObserver(this, "lightweight-theme-styling-update"); + Services.obs.addObserver(this, "lightweight-theme-styling-update", false); var temp = {}; Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp); diff --git a/toolkit/modules/NewTabUtils.jsm b/toolkit/modules/NewTabUtils.jsm index c8431559b9b8..3ce9e9ba8dd9 100644 --- a/toolkit/modules/NewTabUtils.jsm +++ b/toolkit/modules/NewTabUtils.jsm @@ -344,8 +344,8 @@ var GridPrefs = { * Initializes object. Adds a preference observer */ init: function GridPrefs_init() { - Services.prefs.addObserver(PREF_NEWTAB_ROWS, this); - Services.prefs.addObserver(PREF_NEWTAB_COLUMNS, this); + Services.prefs.addObserver(PREF_NEWTAB_ROWS, this, false); + Services.prefs.addObserver(PREF_NEWTAB_COLUMNS, this, false); }, /** @@ -1291,7 +1291,7 @@ var Telemetry = { * Initializes object. */ init: function Telemetry_init() { - Services.obs.addObserver(this, TOPIC_GATHER_TELEMETRY); + Services.obs.addObserver(this, TOPIC_GATHER_TELEMETRY, false); }, /** diff --git a/toolkit/modules/Promise-backend.js b/toolkit/modules/Promise-backend.js index ab67d232df39..2ed31ed4221e 100644 --- a/toolkit/modules/Promise-backend.js +++ b/toolkit/modules/Promise-backend.js @@ -126,7 +126,7 @@ var PendingErrors = { init() { Services.obs.addObserver(function observe(aSubject, aTopic, aValue) { PendingErrors.report(aValue); - }, "promise-finalization-witness"); + }, "promise-finalization-witness", false); }, /** diff --git a/toolkit/modules/RemotePageManager.jsm b/toolkit/modules/RemotePageManager.jsm index 6d8249b4967e..6e71b4f36b17 100644 --- a/toolkit/modules/RemotePageManager.jsm +++ b/toolkit/modules/RemotePageManager.jsm @@ -284,7 +284,7 @@ function ChromeMessagePort(browser, portID) { this._browser = browser; this._permanentKey = browser.permanentKey; - Services.obs.addObserver(this, "message-manager-disconnect"); + Services.obs.addObserver(this, "message-manager-disconnect", false); this.publicPort = publicMessagePort(this); this.swapBrowsers = this.swapBrowsers.bind(this); @@ -518,8 +518,8 @@ var observer = (window) => { // Set up the child side of the message port new ChildMessagePort(messageManager, window); }; -Services.obs.addObserver(observer, "chrome-document-global-created"); -Services.obs.addObserver(observer, "content-document-global-created"); +Services.obs.addObserver(observer, "chrome-document-global-created", false); +Services.obs.addObserver(observer, "content-document-global-created", false); // A message from chrome telling us what pages to listen for Services.cpmm.addMessageListener("RemotePage:Register", ({ data }) => { diff --git a/toolkit/modules/SessionRecorder.jsm b/toolkit/modules/SessionRecorder.jsm index 0466c41f5ff9..3b6eadd7da18 100644 --- a/toolkit/modules/SessionRecorder.jsm +++ b/toolkit/modules/SessionRecorder.jsm @@ -271,10 +271,10 @@ SessionRecorder.prototype = Object.freeze({ this._started = true; - this._os.addObserver(this, "profile-before-change"); - this._os.addObserver(this, "user-interaction-active"); - this._os.addObserver(this, "user-interaction-inactive"); - this._os.addObserver(this, "idle-daily"); + this._os.addObserver(this, "profile-before-change", false); + this._os.addObserver(this, "user-interaction-active", false); + this._os.addObserver(this, "user-interaction-inactive", false); + this._os.addObserver(this, "idle-daily", false); // This has the side-effect of clearing current session state. this._moveCurrentToPrevious(); diff --git a/toolkit/modules/Sqlite.jsm b/toolkit/modules/Sqlite.jsm index bf668774b17a..42dc4df74aa2 100644 --- a/toolkit/modules/Sqlite.jsm +++ b/toolkit/modules/Sqlite.jsm @@ -146,7 +146,7 @@ XPCOMUtils.defineLazyGetter(this, "Barriers", () => { "' was not properly closed. Auto-close triggered by garbage collection.\n"); connectionData.close(); }; - Services.obs.addObserver(finalizationObserver, "sqlite-finalization-witness"); + Services.obs.addObserver(finalizationObserver, "sqlite-finalization-witness", false); /** * Ensure that Sqlite.jsm: diff --git a/toolkit/modules/addons/WebNavigation.jsm b/toolkit/modules/addons/WebNavigation.jsm index 1aadbd579e05..cfd874663de8 100644 --- a/toolkit/modules/addons/WebNavigation.jsm +++ b/toolkit/modules/addons/WebNavigation.jsm @@ -37,7 +37,7 @@ var Manager = { Services.obs.addObserver(this, "autocomplete-did-enter-text", true); - Services.obs.addObserver(this, "webNavigation-createdNavigationTarget"); + Services.obs.addObserver(this, "webNavigation-createdNavigationTarget", false); Services.mm.addMessageListener("Content:Click", this); Services.mm.addMessageListener("Extension:DOMContentLoaded", this); diff --git a/toolkit/modules/addons/WebNavigationContent.js b/toolkit/modules/addons/WebNavigationContent.js index b159827bec0e..c38e4ba8dee7 100644 --- a/toolkit/modules/addons/WebNavigationContent.js +++ b/toolkit/modules/addons/WebNavigationContent.js @@ -27,7 +27,7 @@ var CreatedNavigationTargetListener = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), init() { - Services.obs.addObserver(this, "webNavigation-createdNavigationTarget-from-js"); + Services.obs.addObserver(this, "webNavigation-createdNavigationTarget-from-js", false); }, uninit() { Services.obs.removeObserver(this, "webNavigation-createdNavigationTarget-from-js"); @@ -78,7 +78,7 @@ var FormSubmitListener = { Ci.nsISupportsWeakReference]), init() { this.formSubmitWindows = new WeakSet(); - Services.obs.addObserver(FormSubmitListener, "earlyformsubmit"); + Services.obs.addObserver(FormSubmitListener, "earlyformsubmit", false); }, uninit() { diff --git a/toolkit/modules/addons/WebRequest.jsm b/toolkit/modules/addons/WebRequest.jsm index c744a777879f..acfedb2fc7c3 100644 --- a/toolkit/modules/addons/WebRequest.jsm +++ b/toolkit/modules/addons/WebRequest.jsm @@ -558,7 +558,7 @@ HttpObserverManager = { let needModify = this.listeners.opening.size || this.listeners.modify.size || this.listeners.afterModify.size; if (needModify && !this.modifyInitialized) { this.modifyInitialized = true; - Services.obs.addObserver(this, "http-on-modify-request"); + Services.obs.addObserver(this, "http-on-modify-request", false); } else if (!needModify && this.modifyInitialized) { this.modifyInitialized = false; Services.obs.removeObserver(this, "http-on-modify-request"); @@ -573,9 +573,9 @@ HttpObserverManager = { if (needExamine && !this.examineInitialized) { this.examineInitialized = true; - Services.obs.addObserver(this, "http-on-examine-response"); - Services.obs.addObserver(this, "http-on-examine-cached-response"); - Services.obs.addObserver(this, "http-on-examine-merged-response"); + Services.obs.addObserver(this, "http-on-examine-response", false); + Services.obs.addObserver(this, "http-on-examine-cached-response", false); + Services.obs.addObserver(this, "http-on-examine-merged-response", false); } else if (!needExamine && this.examineInitialized) { this.examineInitialized = false; Services.obs.removeObserver(this, "http-on-examine-response"); diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index 25b4a3a61d62..153e5521d4bd 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -158,8 +158,8 @@ function providerName(aProvider) { */ var PrefObserver = { init() { - Services.prefs.addObserver(PREF_LOGGING_ENABLED, this); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false); + Services.obs.addObserver(this, "xpcom-shutdown", false); this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED); }, @@ -837,11 +837,11 @@ var AddonManagerInternal = { gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY, gCheckCompatibility); - Services.prefs.addObserver(PREF_EM_CHECK_COMPATIBILITY, this); + Services.prefs.addObserver(PREF_EM_CHECK_COMPATIBILITY, this, false); gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY, gStrictCompatibility); - Services.prefs.addObserver(PREF_EM_STRICT_COMPATIBILITY, this); + Services.prefs.addObserver(PREF_EM_STRICT_COMPATIBILITY, this, false); let defaultBranch = Services.prefs.getDefaultBranch(""); gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, @@ -849,22 +849,22 @@ var AddonManagerInternal = { gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, gCheckUpdateSecurity); - Services.prefs.addObserver(PREF_EM_CHECK_UPDATE_SECURITY, this); + Services.prefs.addObserver(PREF_EM_CHECK_UPDATE_SECURITY, this, false); gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED, gUpdateEnabled); - Services.prefs.addObserver(PREF_EM_UPDATE_ENABLED, this); + Services.prefs.addObserver(PREF_EM_UPDATE_ENABLED, this, false); gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT, gAutoUpdateDefault); - Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this); + Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this, false); gHotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID, gHotfixID); - Services.prefs.addObserver(PREF_EM_HOTFIX_ID, this); + Services.prefs.addObserver(PREF_EM_HOTFIX_ID, this, false); gWebExtensionsMinPlatformVersion = Services.prefs.getCharPref(PREF_MIN_WEBEXT_PLATFORM_VERSION, gWebExtensionsMinPlatformVersion); - Services.prefs.addObserver(PREF_MIN_WEBEXT_PLATFORM_VERSION, this); + Services.prefs.addObserver(PREF_MIN_WEBEXT_PLATFORM_VERSION, this, false); let defaultProvidersEnabled = Services.prefs.getBoolPref(PREF_DEFAULT_PROVIDERS_ENABLED, true); AddonManagerPrivate.recordSimpleMeasure("default_providers", defaultProvidersEnabled); diff --git a/toolkit/mozapps/extensions/DeferredSave.jsm b/toolkit/mozapps/extensions/DeferredSave.jsm index 7ac0c5b713d0..7a47f2ad1583 100644 --- a/toolkit/mozapps/extensions/DeferredSave.jsm +++ b/toolkit/mozapps/extensions/DeferredSave.jsm @@ -53,8 +53,8 @@ const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed"; */ var PrefObserver = { init() { - Services.prefs.addObserver(PREF_LOGGING_ENABLED, this); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false); + Services.obs.addObserver(this, "xpcom-shutdown", false); this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED); }, diff --git a/toolkit/mozapps/extensions/LightweightThemeManager.jsm b/toolkit/mozapps/extensions/LightweightThemeManager.jsm index eb23b2af649b..e62d4554967f 100644 --- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm @@ -338,7 +338,7 @@ this.LightweightThemeManager = { Services.prefs.clearUserPref(PREF_LWTHEME_TO_SELECT); } - _prefs.addObserver("", _prefObserver); + _prefs.addObserver("", _prefObserver, false); }, /** diff --git a/toolkit/mozapps/extensions/addonManager.js b/toolkit/mozapps/extensions/addonManager.js index 83c034310a38..3d68e1aa322f 100644 --- a/toolkit/mozapps/extensions/addonManager.js +++ b/toolkit/mozapps/extensions/addonManager.js @@ -49,8 +49,8 @@ function amManager() { Services.mm.addMessageListener(MSG_INSTALL_CLEANUP, this); Services.mm.addMessageListener(MSG_ADDON_EVENT_REQ, this); - Services.obs.addObserver(this, "message-manager-close"); - Services.obs.addObserver(this, "message-manager-disconnect"); + Services.obs.addObserver(this, "message-manager-close", false); + Services.obs.addObserver(this, "message-manager-disconnect", false); AddonManager.webAPI.setEventHandler(this.sendEvent); diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index e15d7b61f578..a922901127f0 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -242,7 +242,7 @@ function initialize(event) { gCategories.initialize(); gHeader.initialize(); gEventManager.initialize(); - Services.obs.addObserver(sendEMPong, "EM-ping"); + Services.obs.addObserver(sendEMPong, "EM-ping", false); Services.obs.notifyObservers(window, "EM-loaded", ""); // If the initial view has already been selected (by a call to loadView from diff --git a/toolkit/mozapps/extensions/internal/AddonLogging.jsm b/toolkit/mozapps/extensions/internal/AddonLogging.jsm index 31667af76c64..57afba225b3a 100644 --- a/toolkit/mozapps/extensions/internal/AddonLogging.jsm +++ b/toolkit/mozapps/extensions/internal/AddonLogging.jsm @@ -166,8 +166,8 @@ this.LogManager = { var PrefObserver = { init() { - Services.prefs.addObserver(PREF_LOGGING_ENABLED, this); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false); + Services.obs.addObserver(this, "xpcom-shutdown", false); this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED); }, diff --git a/toolkit/mozapps/extensions/internal/GMPProvider.jsm b/toolkit/mozapps/extensions/internal/GMPProvider.jsm index b3ab8d5bdbbe..5bf49b706392 100644 --- a/toolkit/mozapps/extensions/internal/GMPProvider.jsm +++ b/toolkit/mozapps/extensions/internal/GMPProvider.jsm @@ -530,7 +530,7 @@ var GMPProvider = { this.buildPluginList(); this.ensureProperCDMInstallState(); - Services.prefs.addObserver(GMPPrefs.KEY_LOG_BASE, configureLogging); + Services.prefs.addObserver(GMPPrefs.KEY_LOG_BASE, configureLogging, false); for (let plugin of this._plugins.values()) { let wrapper = plugin.wrapper; diff --git a/toolkit/mozapps/extensions/internal/PluginProvider.jsm b/toolkit/mozapps/extensions/internal/PluginProvider.jsm index cd9f8be45eac..0194b930ff83 100644 --- a/toolkit/mozapps/extensions/internal/PluginProvider.jsm +++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm @@ -60,8 +60,8 @@ var PluginProvider = { plugins: null, startup() { - Services.obs.addObserver(this, LIST_UPDATED_TOPIC); - Services.obs.addObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED); + Services.obs.addObserver(this, LIST_UPDATED_TOPIC, false); + Services.obs.addObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, false); }, /** diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 41483d5bb136..3dbcfc7588e7 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -2809,13 +2809,13 @@ this.XPIProvider = { null); this.enabledAddons = ""; - Services.prefs.addObserver(PREF_EM_MIN_COMPAT_APP_VERSION, this); - Services.prefs.addObserver(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, this); - Services.prefs.addObserver(PREF_E10S_ADDON_BLOCKLIST, this); - Services.prefs.addObserver(PREF_E10S_ADDON_POLICY, this); + Services.prefs.addObserver(PREF_EM_MIN_COMPAT_APP_VERSION, this, false); + Services.prefs.addObserver(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, this, false); + Services.prefs.addObserver(PREF_E10S_ADDON_BLOCKLIST, this, false); + Services.prefs.addObserver(PREF_E10S_ADDON_POLICY, this, false); if (!REQUIRE_SIGNING) - Services.prefs.addObserver(PREF_XPI_SIGNATURES_REQUIRED, this); - Services.obs.addObserver(this, NOTIFICATION_FLUSH_PERMISSIONS); + Services.prefs.addObserver(PREF_XPI_SIGNATURES_REQUIRED, this, false); + Services.obs.addObserver(this, NOTIFICATION_FLUSH_PERMISSIONS, false); // Cu.isModuleLoaded can fail here for external XUL apps where there is // no chrome.manifest that defines resource://devtools. @@ -2828,7 +2828,7 @@ this.XPIProvider = { this.onDebugConnectionChange.bind(this)); } else { // Else, wait for it to load - Services.obs.addObserver(this, NOTIFICATION_TOOLBOXPROCESS_LOADED); + Services.obs.addObserver(this, NOTIFICATION_TOOLBOXPROCESS_LOADED, false); } } @@ -2929,7 +2929,7 @@ this.XPIProvider = { } Services.obs.removeObserver(this, "quit-application-granted"); } - }, "quit-application-granted"); + }, "quit-application-granted", false); // Detect final-ui-startup for telemetry reporting Services.obs.addObserver({ @@ -2938,7 +2938,7 @@ this.XPIProvider = { XPIProvider.runPhase = XPI_AFTER_UI_STARTUP; Services.obs.removeObserver(this, "final-ui-startup"); } - }, "final-ui-startup"); + }, "final-ui-startup", false); AddonManagerPrivate.recordTimestamp("XPI_startup_end"); @@ -6307,7 +6307,7 @@ class DownloadAddonInstall extends AddonInstall { } this.channel.asyncOpen2(listener); - Services.obs.addObserver(this, "network:offline-about-to-go-offline"); + Services.obs.addObserver(this, "network:offline-about-to-go-offline", false); } catch (e) { logger.warn("Failed to start download for addon " + this.sourceURI.spec, e); this.state = AddonManager.STATE_DOWNLOAD_FAILED; diff --git a/toolkit/mozapps/extensions/nsBlocklistService.js b/toolkit/mozapps/extensions/nsBlocklistService.js index d5fd96cac28c..b23e74984083 100644 --- a/toolkit/mozapps/extensions/nsBlocklistService.js +++ b/toolkit/mozapps/extensions/nsBlocklistService.js @@ -281,14 +281,14 @@ function parseRegExp(aStr) { */ function Blocklist() { - Services.obs.addObserver(this, "xpcom-shutdown"); - Services.obs.addObserver(this, "sessionstore-windows-restored"); + Services.obs.addObserver(this, "xpcom-shutdown", false); + Services.obs.addObserver(this, "sessionstore-windows-restored", false); gLoggingEnabled = getPref("getBoolPref", PREF_EM_LOGGING_ENABLED, false); gBlocklistEnabled = getPref("getBoolPref", PREF_BLOCKLIST_ENABLED, true); gBlocklistLevel = Math.min(getPref("getIntPref", PREF_BLOCKLIST_LEVEL, DEFAULT_LEVEL), MAX_BLOCK_LEVEL); - gPref.addObserver("extensions.blocklist.", this); - gPref.addObserver(PREF_EM_LOGGING_ENABLED, this); + gPref.addObserver("extensions.blocklist.", this, false); + gPref.addObserver(PREF_EM_LOGGING_ENABLED, this, false); this.wrappedJSObject = this; // requests from child processes come in here, see receiveMessage. Services.ppmm.addMessageListener("Blocklist:getPluginBlocklistState", this); @@ -1458,7 +1458,7 @@ Blocklist.prototype = { Services.obs.removeObserver(applyBlocklistChanges, "addon-blocklist-closed"); } - Services.obs.addObserver(applyBlocklistChanges, "addon-blocklist-closed"); + Services.obs.addObserver(applyBlocklistChanges, "addon-blocklist-closed", false); if (getPref("getBoolPref", PREF_BLOCKLIST_SUPPRESSUI, false)) { applyBlocklistChanges(); diff --git a/toolkit/mozapps/extensions/nsBlocklistServiceContent.js b/toolkit/mozapps/extensions/nsBlocklistServiceContent.js index 3d92a0f76c1e..0a6b0f311b02 100644 --- a/toolkit/mozapps/extensions/nsBlocklistServiceContent.js +++ b/toolkit/mozapps/extensions/nsBlocklistServiceContent.js @@ -32,7 +32,7 @@ Blocklist.prototype = { init() { Services.cpmm.addMessageListener("Blocklist:blocklistInvalidated", this); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-shutdown", false); }, uninit() { diff --git a/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js b/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js index b299a5c98954..0d0fdb541f0c 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js +++ b/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js @@ -7,7 +7,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); } diff --git a/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js b/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js index 3f54285413a7..52e35f961af7 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js +++ b/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js @@ -80,7 +80,7 @@ function test() { const PREF = "extensions.getAddons.getWithPerformance.url"; // Watch HTTP requests - Services.obs.addObserver(observe, "http-on-modify-request"); + Services.obs.addObserver(observe, "http-on-modify-request", false); Services.prefs.setCharPref(PREF, "http://127.0.0.1:8888/extensions-dummy/metadata?appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%"); diff --git a/toolkit/mozapps/extensions/test/browser/browser_bug567127.js b/toolkit/mozapps/extensions/test/browser/browser_bug567127.js index 074cafa1697c..9a6285140ded 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_bug567127.js +++ b/toolkit/mozapps/extensions/test/browser/browser_bug567127.js @@ -24,7 +24,7 @@ function checkInstallConfirmation(...urls) { notificationCount++; } }; - Services.obs.addObserver(observer, "addon-install-started"); + Services.obs.addObserver(observer, "addon-install-started", false); let windows = new Set(); diff --git a/toolkit/mozapps/extensions/test/browser/browser_cancelCompatCheck.js b/toolkit/mozapps/extensions/test/browser/browser_cancelCompatCheck.js index 6508cd8a0581..d4091f653236 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_cancelCompatCheck.js +++ b/toolkit/mozapps/extensions/test/browser/browser_cancelCompatCheck.js @@ -57,7 +57,7 @@ function promise_observer(aTopic) { Services.obs.addObserver(function observe(aSubject, aObsTopic, aData) { Services.obs.removeObserver(arguments.callee, aObsTopic); deferred.resolve([aSubject, aData]); - }, aTopic); + }, aTopic, false); return deferred.promise; } diff --git a/toolkit/mozapps/extensions/test/browser/browser_discovery_install.js b/toolkit/mozapps/extensions/test/browser/browser_discovery_install.js index c57b77ae319c..63516bd53b10 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_discovery_install.js +++ b/toolkit/mozapps/extensions/test/browser/browser_discovery_install.js @@ -48,7 +48,7 @@ function waitForFail() { Services.obs.removeObserver(listener, topic); resolve(); } - Services.obs.addObserver(listener, "addon-install-origin-blocked"); + Services.obs.addObserver(listener, "addon-install-origin-blocked", false); }); } diff --git a/toolkit/mozapps/extensions/test/browser/browser_dragdrop.js b/toolkit/mozapps/extensions/test/browser/browser_dragdrop.js index b9e8cf1d21bb..cce6ac1f70a6 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_dragdrop.js +++ b/toolkit/mozapps/extensions/test/browser/browser_dragdrop.js @@ -30,7 +30,7 @@ function checkInstallConfirmation(...urls) { notificationCount++; } }; - Services.obs.addObserver(observer, "addon-install-started"); + Services.obs.addObserver(observer, "addon-install-started", false); let windows = new Set(); diff --git a/toolkit/mozapps/extensions/test/browser/browser_dragdrop_incompat.js b/toolkit/mozapps/extensions/test/browser/browser_dragdrop_incompat.js index ef7bbce480ed..8bd6c96f504e 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_dragdrop_incompat.js +++ b/toolkit/mozapps/extensions/test/browser/browser_dragdrop_incompat.js @@ -10,7 +10,7 @@ add_task(async function() { resolve(); } }; - Services.obs.addObserver(observer, "addon-install-failed"); + Services.obs.addObserver(observer, "addon-install-failed", false); }); let url = `${TESTROOT}/addons/browser_dragdrop_incompat.xpi`; diff --git a/toolkit/mozapps/extensions/test/browser/browser_experiments.js b/toolkit/mozapps/extensions/test/browser/browser_experiments.js index 0314b0c3360e..faaad588d55b 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_experiments.js +++ b/toolkit/mozapps/extensions/test/browser/browser_experiments.js @@ -207,7 +207,7 @@ add_task(function* testOpenPreferences() { deferred.resolve(); }); - }, "advanced-pane-loaded"); + }, "advanced-pane-loaded", false); info("Loading preferences pane."); // We need to focus before synthesizing the mouse event (bug 1240052) as diff --git a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js index 3de25df2e775..840a334f0595 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js +++ b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js @@ -99,7 +99,7 @@ add_task(function* initializeState() { GMPScope.GMPProvider.startup(); })); - Services.obs.addObserver(gOptionsObserver, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED); + Services.obs.addObserver(gOptionsObserver, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, false); // Start out with plugins not being installed, disabled and automatic updates // disabled. diff --git a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js index 639bc193f487..a4e17ecb155d 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js +++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js @@ -109,9 +109,11 @@ function test() { gCategoryUtilities = new CategoryUtilities(gManagerWindow); Services.obs.addObserver(observer, - AddonManager.OPTIONS_NOTIFICATION_DISPLAYED); + AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, + false); Services.obs.addObserver(observer, - AddonManager.OPTIONS_NOTIFICATION_HIDDEN); + AddonManager.OPTIONS_NOTIFICATION_HIDDEN, + false); run_next_test(); }); diff --git a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js index 87c44e263c2f..fe5a10bb748b 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js +++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js @@ -109,9 +109,11 @@ function test() { gCategoryUtilities = new CategoryUtilities(gManagerWindow); Services.obs.addObserver(observer, - AddonManager.OPTIONS_NOTIFICATION_DISPLAYED); + AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, + false); Services.obs.addObserver(observer, - AddonManager.OPTIONS_NOTIFICATION_HIDDEN); + AddonManager.OPTIONS_NOTIFICATION_HIDDEN, + false); run_next_test(); }); diff --git a/toolkit/mozapps/extensions/test/browser/head.js b/toolkit/mozapps/extensions/test/browser/head.js index 0c9023336642..0dc7ade20b00 100644 --- a/toolkit/mozapps/extensions/test/browser/head.js +++ b/toolkit/mozapps/extensions/test/browser/head.js @@ -416,7 +416,7 @@ function open_manager(aView, aCallback, aLoadCallback, aLongerTimeout) { return; } setup_manager(aSubject); - }, "EM-loaded"); + }, "EM-loaded", false); gBrowser.selectedTab = gBrowser.addTab(); switchToTabHavingURI(MANAGER_URI, true); @@ -425,7 +425,7 @@ function open_manager(aView, aCallback, aLoadCallback, aLongerTimeout) { Services.obs.addObserver(function(aSubject, aTopic, aData) { Services.obs.removeObserver(arguments.callee, aTopic); setup_manager(aSubject); - }, "EM-loaded"); + }, "EM-loaded", false); openDialog(MANAGER_URI); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js index d5f11bf4539c..8992ea1a3a44 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js +++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js @@ -201,7 +201,7 @@ this.BootstrapMonitor = { init() { this.inited = true; - Services.obs.addObserver(this, "bootstrapmonitor-event"); + Services.obs.addObserver(this, "bootstrapmonitor-event", false); }, shutdownCheck() { @@ -1335,7 +1335,7 @@ function* updateAllSystemAddons(xml, testserver) { Services.obs.removeObserver(arguments.callee, "addons-background-update-complete"); resolve(); - }, "addons-background-update-complete"); + }, "addons-background-update-complete", false); // Trigger the background update timer handler gInternalManager.notify(null); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js b/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js index 91f29de991ed..0957997a9ed8 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js @@ -42,7 +42,7 @@ function run_test_1() { Services.obs.removeObserver(arguments.callee, "addons-background-update-complete"); do_execute_soon(run_test_2); - }, "addons-background-update-complete"); + }, "addons-background-update-complete", false); // Trigger the background update timer handler gInternalManager.notify(null); @@ -105,7 +105,7 @@ function run_test_2() { do_check_eq(installCount, 3); sawCompleteNotification = true; - }, "addons-background-update-complete"); + }, "addons-background-update-complete", false); AddonManager.addInstallListener({ onNewInstall(aInstall) { diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js index 7d6a13870c27..897350f9de03 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js @@ -44,7 +44,7 @@ add_task(function* test_sends_serialized_data() { "versionRange:0,*"; let received; const observe = (subject, topic, data) => { received = data }; - Services.obs.addObserver(observe, EVENT_NAME); + Services.obs.addObserver(observe, EVENT_NAME, false); blocklist._notifyObserversBlocklistGFX(); equal(received, expected); Services.obs.removeObserver(observe, EVENT_NAME); @@ -80,7 +80,7 @@ add_task(function* test_empty_values_are_ignored() { const blocklist = Blocklist(); let received; const observe = (subject, topic, data) => { received = data }; - Services.obs.addObserver(observe, EVENT_NAME); + Services.obs.addObserver(observe, EVENT_NAME, false); blocklist._loadBlocklistFromString(input); ok(received.indexOf("os" < 0)); Services.obs.removeObserver(observe, EVENT_NAME); @@ -97,7 +97,7 @@ add_task(function* test_empty_devices_are_ignored() { const blocklist = Blocklist(); let received; const observe = (subject, topic, data) => { received = data }; - Services.obs.addObserver(observe, EVENT_NAME); + Services.obs.addObserver(observe, EVENT_NAME, false); blocklist._loadBlocklistFromString(input); ok(received.indexOf("devices" < 0)); Services.obs.removeObserver(observe, EVENT_NAME); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js index c48a71343fb7..c076387f47b9 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js @@ -56,7 +56,7 @@ function load_blocklist(aFile, aCallback) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); do_execute_soon(aCallback); - }, "blocklist-updated"); + }, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + aFile); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js index 43f4b411de93..b4d7ad41dcbd 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js @@ -62,7 +62,7 @@ function load_blocklist(aFile, aCallback) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); do_execute_soon(aCallback); - }, "blocklist-updated"); + }, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + aFile); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js index 61bbc7073d50..9a7f48ccb0e7 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js @@ -58,7 +58,7 @@ function load_blocklist(aFile, aCallback) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); do_execute_soon(aCallback); - }, "blocklist-updated"); + }, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + aFile); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js b/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js index ac11e9c3b46d..8873c22dddb7 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js @@ -399,7 +399,7 @@ function Pload_blocklist(aFile) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); resolve(); - }, "blocklist-updated"); + }, "blocklist-updated", false); }); Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/blocklistchange/" + aFile); @@ -448,7 +448,7 @@ function Pbackground_update() { return; resolve(); - }, "addons-background-update-complete"); + }, "addons-background-update-complete", false); }); AddonManagerPrivate.backgroundUpdateCheck(); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js index 940bd9fd797e..101d49510f4c 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js @@ -9,7 +9,7 @@ add_task(function*() { let sawInstall = false; Services.obs.addObserver(function() { sawInstall = true; - }, "addon-install"); + }, "addon-install", false); yield promiseInstallAllFiles([do_get_addon("test_bootstrap_const")]); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_globals.js b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_globals.js index e8f72c1e255f..29b538d21f35 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_globals.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_globals.js @@ -20,14 +20,14 @@ function run_test() { Services.obs.addObserver(function(subject) { subject.wrappedJSObject.expectedGlobals = EXPECTED_GLOBALS; - }, "bootstrap-request-globals"); + }, "bootstrap-request-globals", false); Services.obs.addObserver(function({ wrappedJSObject: seenGlobals }) { for (let [name, ] of EXPECTED_GLOBALS) do_check_true(seenGlobals.has(name)); sawGlobals = true; - }, "bootstrap-seen-globals"); + }, "bootstrap-seen-globals", false); installAllFiles([do_get_addon("bootstrap_globals")], function() { do_check_true(sawGlobals); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js index d31ace9c9163..df46c9f8c2d5 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js @@ -70,7 +70,7 @@ function load_blocklist(aFile, aCallback) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); do_execute_soon(aCallback); - }, "blocklist-updated"); + }, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + aFile); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js index 760ecc464acf..74bdecbb88e1 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js @@ -58,7 +58,7 @@ function load_blocklist(aFile, aCallback) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); do_execute_soon(aCallback); - }, "blocklist-updated"); + }, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + aFile); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug594058.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug594058.js index 0d21d0633c54..dbc121ff98c6 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bug594058.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug594058.js @@ -48,7 +48,7 @@ function run_test() { observe(aSubject, aTopic, aData) { gCachePurged = true; } - }, "startupcache-invalidate"); + }, "startupcache-invalidate", false); createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1"); startupManager(); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js index 3b4082675717..1c21385e0973 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js @@ -19,7 +19,7 @@ function load_blocklist(file, aCallback) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); do_execute_soon(aCallback); - }, "blocklist-updated"); + }, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + file); @@ -43,19 +43,19 @@ function run_test() { do_check_eq(aSubject.getAttribute("testattr"), "GFX"); do_check_eq(aSubject.childNodes.length, 2); gSawGFX = true; - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); Services.obs.addObserver(function(aSubject, aTopic, aData) { do_check_true(aSubject instanceof AM_Ci.nsIDOMElement); do_check_eq(aSubject.getAttribute("testattr"), "FOO"); do_check_eq(aSubject.childNodes.length, 3); gSawTest = true; - }, "blocklist-data-testItems"); + }, "blocklist-data-testItems", false); Services.obs.addObserver(function(aSubject, aTopic, aData) { do_check_true(gSawGFX); do_check_true(gSawTest); - }, "blocklist-data-fooItems"); + }, "blocklist-data-fooItems", false); // Need to wait for the blocklist to load; Bad Things happen if the test harness // shuts down AddonManager before the blocklist service is done telling it about diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_cacheflush.js b/toolkit/mozapps/extensions/test/xpcshell/test_cacheflush.js index 41b707fb423f..ae799b61167c 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_cacheflush.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_cacheflush.js @@ -24,7 +24,7 @@ var CacheFlushObserver = { function run_test() { do_test_pending(); - Services.obs.addObserver(CacheFlushObserver, "flush-cache-entry"); + Services.obs.addObserver(CacheFlushObserver, "flush-cache-entry", false); createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "2"); startupManager(); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_dependencies.js b/toolkit/mozapps/extensions/test/xpcshell/test_dependencies.js index 086e213c7e4d..3afc03f84019 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_dependencies.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_dependencies.js @@ -53,8 +53,8 @@ add_task(function* setup() { events.push(["shutdown", data]); }; - Services.obs.addObserver(startupObserver, "test-addon-bootstrap-startup"); - Services.obs.addObserver(shutdownObserver, "test-addon-bootstrap-shutdown"); + Services.obs.addObserver(startupObserver, "test-addon-bootstrap-startup", false); + Services.obs.addObserver(shutdownObserver, "test-addon-bootstrap-shutdown", false); do_register_cleanup(() => { Services.obs.removeObserver(startupObserver, "test-addon-bootstrap-startup"); Services.obs.removeObserver(shutdownObserver, "test-addon-bootstrap-shutdown"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js index 4a1dfb63d239..476129e380a9 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js @@ -89,7 +89,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js index 57457677ffa9..7385f7f0a28c 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js @@ -85,7 +85,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js index 8851afdcff38..356f59deb361 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js @@ -116,7 +116,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js index 1df149488bde..cde122d9622f 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js @@ -86,7 +86,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js index f1dcb5b4f494..9d6a3e57bd3a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js @@ -86,7 +86,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js index 33ef972396be..3601c3363dda 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js @@ -86,7 +86,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js index 4ace72563fb3..c5ad62a0ea6f 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js @@ -86,7 +86,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js index e5093fd91ef1..b63f7015148e 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js @@ -82,7 +82,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js index cf3b738a7eea..62ec6d9194be 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js @@ -87,7 +87,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js index f8caafdde2de..73ad50a51b15 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js @@ -86,7 +86,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js index f0026209e333..7f7ff3bdf5fe 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js @@ -88,7 +88,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist_OSVersion.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js index c8b730e1087a..54b14cf4be6a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js @@ -88,7 +88,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist_OSVersion.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js index 918efe813f0b..bfb5c3c4e2d2 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js @@ -89,7 +89,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist_OSVersion.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js index 901c2e17a25c..c9478d6b4fed 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js @@ -86,7 +86,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js index 250bdfbc4bd9..3f2fe9100970 100755 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js @@ -142,7 +142,7 @@ function run_test() { // If we wait until after we go through the event loop, gfxInfo is sure to // have processed the gfxItems event. do_execute_soon(checkBlacklist); - }, "blocklist-data-gfxItems"); + }, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist_AllOS.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js index 27439f0469c7..c308bfb88142 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js @@ -96,7 +96,7 @@ function run_test() { Ci.nsIGfxInfo.FEATURE_BLOCKED_DRIVER_VERSION); Services.obs.removeObserver(blacklistAdded, "blocklist-data-gfxItems"); - Services.obs.addObserver(blacklistRemoved, "blocklist-data-gfxItems"); + Services.obs.addObserver(blacklistRemoved, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist2.xml"); } @@ -126,6 +126,6 @@ function run_test() { gTestserver.stop(do_test_finished); } - Services.obs.addObserver(blacklistAdded, "blocklist-data-gfxItems"); + Services.obs.addObserver(blacklistAdded, "blocklist-data-gfxItems", false); load_blocklist("test_gfxBlacklist.xml"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_pluginBlocklistCtp.js b/toolkit/mozapps/extensions/test/xpcshell/test_pluginBlocklistCtp.js index 6cf722fc8378..563b7434ce16 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_pluginBlocklistCtp.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_pluginBlocklistCtp.js @@ -167,7 +167,7 @@ function run_test() { gPluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost); gBlocklistService = Components.classes["@mozilla.org/extensions/blocklist;1"].getService(Components.interfaces.nsIBlocklistService); gNotifier = Components.classes["@mozilla.org/extensions/blocklist;1"].getService(Components.interfaces.nsITimerCallback); - Services.obs.addObserver(observer, "blocklist-updated"); + Services.obs.addObserver(observer, "blocklist-updated", false); do_register_cleanup(function() { Services.prefs.clearUserPref("extensions.blocklist.url"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_signed_updatepref.js b/toolkit/mozapps/extensions/test/xpcshell/test_signed_updatepref.js index 581d616ea990..e41017dd6b6c 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_signed_updatepref.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_signed_updatepref.js @@ -33,7 +33,7 @@ function verifySignatures() { Services.obs.removeObserver(observer, "xpi-signature-changed"); resolve(JSON.parse(data)); } - Services.obs.addObserver(observer, "xpi-signature-changed"); + Services.obs.addObserver(observer, "xpi-signature-changed", false); do_print("Verifying signatures"); let XPIscope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {}); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_signed_verify.js b/toolkit/mozapps/extensions/test/xpcshell/test_signed_verify.js index 2f9c9a8c899e..a5c79b0f84e2 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_signed_verify.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_signed_verify.js @@ -25,7 +25,7 @@ function verifySignatures() { Services.obs.removeObserver(observer, "xpi-signature-changed"); resolve(JSON.parse(data)); } - Services.obs.addObserver(observer, "xpi-signature-changed"); + Services.obs.addObserver(observer, "xpi-signature-changed", false); do_print("Verifying signatures"); let XPIscope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {}); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js b/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js index 316393e1a468..1a86df3a599a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js @@ -54,7 +54,7 @@ function load_blocklist(aFile) { Services.obs.removeObserver(arguments.callee, "blocklist-updated"); resolve(); - }, "blocklist-updated"); + }, "blocklist-updated", false); Services.prefs.setCharPref("extensions.blocklist.url", `http://localhost:${gPort}/data/${aFile}`); var blocklist = Cc["@mozilla.org/extensions/blocklist;1"]. diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js b/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js index 05e4406070bc..cb317956127e 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js @@ -29,7 +29,7 @@ function backgroundUpdate(aCallback) { Services.obs.addObserver(function() { Services.obs.removeObserver(arguments.callee, "addons-background-update-complete"); aCallback(); - }, "addons-background-update-complete"); + }, "addons-background-update-complete", false); AddonManagerPrivate.backgroundUpdateCheck(); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_startup.js b/toolkit/mozapps/extensions/test/xpcshell/test_startup.js index 348c1eb625fd..0d1f2e0384bc 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_startup.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_startup.js @@ -123,7 +123,7 @@ function run_test() { observe(aSubject, aTopic, aData) { gCachePurged = true; } - }, "startupcache-invalidate"); + }, "startupcache-invalidate", false); startupManager(); check_startup_changes(AddonManager.STARTUP_CHANGE_INSTALLED, []); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js b/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js index e4f9e47800d2..8855a8e4a290 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js @@ -55,7 +55,7 @@ function waitForBootstrapEvent(expectedEvent, addonId) { } }, }; - Services.obs.addObserver(observer, "bootstrapmonitor-event"); + Services.obs.addObserver(observer, "bootstrapmonitor-event", false); }); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_theme.js b/toolkit/mozapps/extensions/test/xpcshell/test_theme.js index 61893e5778d0..0bc7b013d0f9 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_theme.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_theme.js @@ -31,7 +31,7 @@ var LightweightThemeObserver = { AM_Cc["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService) - .addObserver(LightweightThemeObserver, "lightweight-theme-styling-update"); + .addObserver(LightweightThemeObserver, "lightweight-theme-styling-update", false); function run_test() { diff --git a/toolkit/mozapps/extensions/test/xpinstall/head.js b/toolkit/mozapps/extensions/test/xpinstall/head.js index d099f29cddf6..338cd8f8292a 100644 --- a/toolkit/mozapps/extensions/test/xpinstall/head.js +++ b/toolkit/mozapps/extensions/test/xpinstall/head.js @@ -106,14 +106,14 @@ var Harness = { Services.prefs.setBoolPref(PREF_INSTALL_REQUIRESECUREORIGIN, false); Services.prefs.setBoolPref(PREF_LOGGING_ENABLED, true); - Services.obs.addObserver(this, "addon-install-started"); - Services.obs.addObserver(this, "addon-install-disabled"); + Services.obs.addObserver(this, "addon-install-started", false); + Services.obs.addObserver(this, "addon-install-disabled", false); // XXX this breaks a bunch of stuff, see comment in onInstallCancelled // Services.obs.addObserver(this, "addon-install-cancelled", false); - Services.obs.addObserver(this, "addon-install-origin-blocked"); - Services.obs.addObserver(this, "addon-install-blocked"); - Services.obs.addObserver(this, "addon-install-failed"); - Services.obs.addObserver(this, "addon-install-complete"); + Services.obs.addObserver(this, "addon-install-origin-blocked", false); + Services.obs.addObserver(this, "addon-install-blocked", false); + Services.obs.addObserver(this, "addon-install-failed", false); + Services.obs.addObserver(this, "addon-install-complete", false); AddonManager.addInstallListener(this); diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js index c21acac137ad..513782e6e59d 100644 --- a/toolkit/mozapps/update/content/updates.js +++ b/toolkit/mozapps/update/content/updates.js @@ -871,7 +871,7 @@ var gDownloadingPage = { let applyingStatus = gUpdates.getAUSString("applyingUpdate"); this._setStatus(applyingStatus); - Services.obs.addObserver(this, "update-staged"); + Services.obs.addObserver(this, "update-staged", false); this._updateApplyingObserver = true; }, diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index af8b3b36ba99..724b91d5a74a 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -1828,13 +1828,13 @@ const UpdateServiceFactory = { */ function UpdateService() { LOG("Creating UpdateService"); - Services.obs.addObserver(this, "xpcom-shutdown"); - Services.prefs.addObserver(PREF_APP_UPDATE_LOG, this); + Services.obs.addObserver(this, "xpcom-shutdown", false); + Services.prefs.addObserver(PREF_APP_UPDATE_LOG, this, false); if (AppConstants.platform == "gonk") { // PowerManagerService::SyncProfile (which is called for Reboot, PowerOff // and Restart) sends the profile-change-net-teardown event. We can then // pause the download in a similar manner to xpcom-shutdown. - Services.obs.addObserver(this, "profile-change-net-teardown"); + Services.obs.addObserver(this, "profile-change-net-teardown", false); } } @@ -1893,7 +1893,8 @@ UpdateService.prototype = { // Delay post-update processing to ensure that possible update // dialogs are shown in front of the app window, if possible. // See bug 311614. - Services.obs.addObserver(this, APPID_TO_TOPIC[Services.appinfo.ID]); + Services.obs.addObserver(this, APPID_TO_TOPIC[Services.appinfo.ID], + false); break; } // intentional fallthrough @@ -2140,7 +2141,7 @@ UpdateService.prototype = { LOG("UpdateService:_registerOnlineObserver - waiting for the network to " + "be online, then forcing another check"); - Services.obs.addObserver(this, "network:offline-status-changed"); + Services.obs.addObserver(this, "network:offline-status-changed", false); this._registeredOnlineObserver = true; }, @@ -4495,7 +4496,7 @@ UpdatePrompt.prototype = { } observer.service = Services.obs; - observer.service.addObserver(observer, "quit-application"); + observer.service.addObserver(observer, "quit-application", false); // bug 534090 - show the UI when idle for update available notifications. if (page == "updatesavailable") { @@ -4553,7 +4554,7 @@ UpdatePrompt.prototype = { } }; idleService.addIdleObserver(observer, IDLE_TIME); - Services.obs.addObserver(observer, "quit-application"); + Services.obs.addObserver(observer, "quit-application", false); } }, diff --git a/toolkit/mozapps/update/tests/chrome/utils.js b/toolkit/mozapps/update/tests/chrome/utils.js index d1a9edaf014b..fe7e12fa2c4c 100644 --- a/toolkit/mozapps/update/tests/chrome/utils.js +++ b/toolkit/mozapps/update/tests/chrome/utils.js @@ -980,7 +980,7 @@ const errorsPrefObserver = { let maxErrors = aMaxErrorCount ? aMaxErrorCount : 2; Services.prefs.setIntPref(aMaxErrorPref, maxErrors); - Services.prefs.addObserver(aObservePref, this); + Services.prefs.addObserver(aObservePref, this, false); }, /** diff --git a/toolkit/mozapps/update/tests/data/shared.js b/toolkit/mozapps/update/tests/data/shared.js index 5db7821b09b8..62a8328faefd 100644 --- a/toolkit/mozapps/update/tests/data/shared.js +++ b/toolkit/mozapps/update/tests/data/shared.js @@ -168,7 +168,7 @@ function setUpdateChannel(aChannel) { gChannel = aChannel; debugDump("setting default pref " + PREF_APP_UPDATE_CHANNEL + " to " + gChannel); gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, gChannel); - gPrefRoot.addObserver(PREF_APP_UPDATE_CHANNEL, observer); + gPrefRoot.addObserver(PREF_APP_UPDATE_CHANNEL, observer, false); } /** diff --git a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js index f1f74502fb53..86cfb5e44249 100644 --- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js +++ b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js @@ -1889,7 +1889,7 @@ function stageUpdate(aCheckSvcLog) { gSvcOriginalLogContents = readServiceLogFile(); } - Services.obs.addObserver(gUpdateStagedObserver, "update-staged"); + Services.obs.addObserver(gUpdateStagedObserver, "update-staged", false); setAppBundleModTime(); setEnvironment(); diff --git a/tools/quitter/QuitterObserver.js b/tools/quitter/QuitterObserver.js index a978ccf4ea24..8091d1643234 100644 --- a/tools/quitter/QuitterObserver.js +++ b/tools/quitter/QuitterObserver.js @@ -43,8 +43,8 @@ QuitterObserver.prototype = { init: function() { var obs = Services.obs; - obs.addObserver(this, "xpcom-shutdown"); - obs.addObserver(this, "chrome-document-global-created"); + obs.addObserver(this, "xpcom-shutdown", false); + obs.addObserver(this, "chrome-document-global-created", false); }, uninit: function() diff --git a/uriloader/exthandler/nsHandlerService.js b/uriloader/exthandler/nsHandlerService.js index 503abee99872..09440eab82d6 100644 --- a/uriloader/exthandler/nsHandlerService.js +++ b/uriloader/exthandler/nsHandlerService.js @@ -109,17 +109,17 @@ HandlerService.prototype = { _init: function HS__init() { // Observe profile-before-change so we can switch to the datasource // in the new profile when the user changes profiles. - this._observerSvc.addObserver(this, "profile-before-change"); + this._observerSvc.addObserver(this, "profile-before-change", false); // Observe xpcom-shutdown so we can remove these observers // when the application shuts down. - this._observerSvc.addObserver(this, "xpcom-shutdown"); + this._observerSvc.addObserver(this, "xpcom-shutdown", false); // Observe profile-do-change so that non-default profiles get upgraded too - this._observerSvc.addObserver(this, "profile-do-change"); + this._observerSvc.addObserver(this, "profile-do-change", false); // Observe handlersvc-rdf-replace so we can switch to the datasource - this._observerSvc.addObserver(this, "handlersvc-rdf-replace"); + this._observerSvc.addObserver(this, "handlersvc-rdf-replace", false); }, _updateDB: function HS__updateDB() { diff --git a/widget/tests/test_imestate.html b/widget/tests/test_imestate.html index eb708fccfaee..26f449f7469b 100644 --- a/widget/tests/test_imestate.html +++ b/widget/tests/test_imestate.html @@ -1310,7 +1310,7 @@ function runTestPasswordFieldOnDialog() { Components.classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService). - addObserver(this, "domwindowopened"); + addObserver(this, "domwindowopened", false); } WindowObserver.prototype = { diff --git a/xpcom/tests/unit/test_bug374754.js b/xpcom/tests/unit/test_bug374754.js index 0c530c1da86c..9b0ccf26e990 100644 --- a/xpcom/tests/unit/test_bug374754.js +++ b/xpcom/tests/unit/test_bug374754.js @@ -46,8 +46,8 @@ function run_test() { do_test_pending(); var observerService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService); - observerService.addObserver(observer, addedTopic); - observerService.addObserver(observer, removedTopic); + observerService.addObserver(observer, addedTopic, false); + observerService.addObserver(observer, removedTopic, false); var categoryManager = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager); categoryManager.addCategoryEntry(testCategory, testEntry, testValue, false, true); diff --git a/xpcom/tests/unit/test_bug725015.js b/xpcom/tests/unit/test_bug725015.js index b210a21e9c6f..d6f62c5097fa 100644 --- a/xpcom/tests/unit/test_bug725015.js +++ b/xpcom/tests/unit/test_bug725015.js @@ -34,6 +34,6 @@ function observe_category(subj, topic, data) { function run_test() { do_test_pending(); - Services.obs.addObserver(observe_category, observerTopic); + Services.obs.addObserver(observe_category, observerTopic, false); Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(manifest); }