Bug 1356569 - Remove notifyObservers' last parameter when it is falsy, r=jaws.

This commit is contained in:
Florian Queze 2017-04-14 21:51:39 +02:00
Родитель 37f2343b9a
Коммит f935ddc4b3
218 изменённых файлов: 381 добавлений и 387 удалений

Просмотреть файл

@ -47,7 +47,7 @@ const make = (exports, rootURI, components) => {
// during development is acceptable.
components.classes["@mozilla.org/observer-service;1"].
getService(components.interfaces.nsIObserverService).
notifyObservers({}, "startupcache-invalidate", null);
notifyObservers({}, "startupcache-invalidate");
if (all) {
for (let uri of Object.keys(loader.sandboxes)) {

Просмотреть файл

@ -105,7 +105,7 @@ function listener(event) {
// Use the raw observer service here since it will be usable even if the
// loader has unloaded
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
Services.obs.notifyObservers(null, "Test:Reply", "");
Services.obs.notifyObservers(null, "Test:Reply");
}
frames.port.on('sdk/test/registerframesevent', (frame) => {

Просмотреть файл

@ -105,7 +105,7 @@ function listener(event) {
// Use the raw observer service here since it will be usable even if the
// loader has unloaded
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
Services.obs.notifyObservers(null, "Test:Reply", "");
Services.obs.notifyObservers(null, "Test:Reply");
}
frames.port.on('sdk/test/registerframesevent', (frame) => {

Просмотреть файл

@ -265,7 +265,7 @@ var USBRemoteDebugger = {
this._listener.open();
// Temporary event, until bug 942756 lands and offers a way to know
// when the server is up and running.
Services.obs.notifyObservers(null, "debugger-server-started", null);
Services.obs.notifyObservers(null, "debugger-server-started");
} catch (e) {
debug("Unable to start USB debugger server: " + e);
}

Просмотреть файл

@ -695,7 +695,7 @@ var shell = {
this.sendEvent(window, 'ContentStart');
Services.obs.notifyObservers(null, 'content-start', null);
Services.obs.notifyObservers(null, 'content-start');
if (AppConstants.MOZ_GRAPHENE &&
Services.prefs.getBoolPref("b2g.nativeWindowGeometry.fullscreen")) {
@ -732,7 +732,7 @@ var shell = {
// This will cause Gonk Widget to remove boot animation from the screen
// and reveals the page.
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
Services.obs.notifyObservers(null, "browser-ui-startup-complete");
SystemAppProxy.setIsLoaded();
},
@ -797,7 +797,7 @@ var CustomEventManager = {
switch(detail.type) {
case 'system-message-listener-ready':
Services.obs.notifyObservers(null, 'system-message-listener-ready', null);
Services.obs.notifyObservers(null, 'system-message-listener-ready');
break;
case 'captive-portal-login-cancel':
CaptivePortalLoginHelper.handleEvent(detail);

Просмотреть файл

@ -71,12 +71,12 @@ this.GlobalSimulatorScreen = {
this.mozOrientation = orientation;
// Notify each app screen object to fire the event
Services.obs.notifyObservers(null, 'simulator-orientation-change', null);
Services.obs.notifyObservers(null, 'simulator-orientation-change');
}
// Finally, in any case, we update the window size and orientation
// (Use wrappedJSObject trick to be able to pass a raw JS object)
Services.obs.notifyObservers({wrappedJSObject:this}, 'simulator-adjust-window-size', null);
Services.obs.notifyObservers({wrappedJSObject:this}, 'simulator-adjust-window-size');
},
flipScreen: function() {

Просмотреть файл

@ -124,7 +124,7 @@ this.SafeMode = {
// browser-ui-startup-complete is used by the AppShell to stop the
// boot animation and start gecko rendering.
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
Services.obs.notifyObservers(null, "browser-ui-startup-complete");
content.addEventListener("mozContentEvent", handleEvent, true);
}

Просмотреть файл

@ -27,7 +27,7 @@ var mockSendResult = (aId, aResult) => {
id: aId,
result: aResult
};
Services.obs.notifyObservers({wrappedJSObject: msg}, CHROME_MSG, null);
Services.obs.notifyObservers({wrappedJSObject: msg}, CHROME_MSG);
};
var mockSendError = (aId, aError) => {
@ -35,7 +35,7 @@ var mockSendError = (aId, aError) => {
id: aId,
result: aError
};
Services.obs.notifyObservers({wrappedJSObject: msg}, CHROME_MSG, null);
Services.obs.notifyObservers({wrappedJSObject: msg}, CHROME_MSG);
};
function attachMocks() {

Просмотреть файл

@ -32,7 +32,7 @@ do_get_profile();
// Mock the system app proxy; make message passing possible
var mockSendCustomEvent = function(aEventName, aMsg) {
Services.obs.notifyObservers({wrappedJSObject: aMsg}, aEventName, null);
Services.obs.notifyObservers({wrappedJSObject: aMsg}, aEventName);
};
function run_test() {

Просмотреть файл

@ -85,7 +85,7 @@ var gDataNotificationInfoBar = {
buttons,
event => {
if (event == "removed") {
Services.obs.notifyObservers(null, "datareporting:notify-data-policy:close", null);
Services.obs.notifyObservers(null, "datareporting:notify-data-policy:close");
}
}
);

Просмотреть файл

@ -393,7 +393,7 @@ var FullScreen = {
break;
}
case "DOMFullscreen:Painted": {
Services.obs.notifyObservers(window, "fullscreen-painted", "");
Services.obs.notifyObservers(window, "fullscreen-painted");
TelemetryStopwatch.finish("FULLSCREEN_CHANGE_MS");
break;
}

Просмотреть файл

@ -287,7 +287,7 @@ var FullZoom = {
if (token.isCurrent) {
ZoomManager.setZoomForBrowser(browser, value === undefined ? 1 : value);
this._ignorePendingZoomAccesses(browser);
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset");
}
});
this._removePref(browser);
@ -355,7 +355,7 @@ var FullZoom = {
* @param browser The zoom of this browser will be saved. Required.
*/
_applyZoomToPref: function FullZoom__applyZoomToPref(browser) {
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomChange", "");
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomChange");
if (!this.siteSpecific ||
gInPrintPreviewMode ||
browser.isSyntheticDocument)
@ -376,7 +376,7 @@ var FullZoom = {
* @param browser The zoom of this browser will be removed. Required.
*/
_removePref: function FullZoom__removePref(browser) {
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset");
if (browser.isSyntheticDocument)
return;
let ctxt = this._loadContextFromBrowser(browser);
@ -514,7 +514,7 @@ var FullZoom = {
*/
_notifyOnLocationChange: function FullZoom__notifyOnLocationChange(browser) {
this._executeSoon(function() {
Services.obs.notifyObservers(browser, "browser-fullZoom:location-change", "");
Services.obs.notifyObservers(browser, "browser-fullZoom:location-change");
});
},

Просмотреть файл

@ -236,7 +236,7 @@ var gSyncUI = {
if (!needsSetup) {
setTimeout(() => Weave.Service.errorHandler.syncAndReportErrors(), 0);
}
Services.obs.notifyObservers(null, "cloudsync:user-sync", null);
Services.obs.notifyObservers(null, "cloudsync:user-sync");
}).catch(err => {
this.log.error("Failed to force a sync", err);
});

Просмотреть файл

@ -1188,7 +1188,7 @@ var gBrowserInit = {
// their tasks BEFORE the browser window is shown. SessionStore uses it to
// restore tabs into windows AFTER important parts like gMultiProcessBrowser
// have been initialized.
Services.obs.notifyObservers(window, "browser-window-before-show", "");
Services.obs.notifyObservers(window, "browser-window-before-show");
let isResistFingerprintingEnabled = gPrefService.getBoolPref("privacy.resistFingerprinting");
@ -1606,7 +1606,7 @@ var gBrowserInit = {
this.delayedStartupFinished = true;
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
Services.obs.notifyObservers(window, "browser-delayed-startup-finished");
TelemetryTimestamps.add("delayedStartupFinished");
},
@ -6160,7 +6160,7 @@ var BrowserOffline = {
_canGoOffline() {
try {
var cancelGoOffline = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelGoOffline, "offline-requested", null);
Services.obs.notifyObservers(cancelGoOffline, "offline-requested");
// Something aborted the quit process.
if (cancelGoOffline.data)
@ -6489,8 +6489,7 @@ function warnAboutClosingWindow() {
createInstance(Ci.nsISupportsPRBool);
exitingCanceled.data = false;
Services.obs.notifyObservers(exitingCanceled,
"last-pb-context-exiting",
null);
"last-pb-context-exiting");
if (exitingCanceled.data)
return false;
}
@ -6504,11 +6503,11 @@ function warnAboutClosingWindow() {
let closingCanceled = Cc["@mozilla.org/supports-PRBool;1"].
createInstance(Ci.nsISupportsPRBool);
os.notifyObservers(closingCanceled,
"browser-lastwindow-close-requested", null);
"browser-lastwindow-close-requested");
if (closingCanceled.data)
return false;
os.notifyObservers(null, "browser-lastwindow-close-granted", null);
os.notifyObservers(null, "browser-lastwindow-close-granted");
// OS X doesn't quit the application when the last window is closed, but keeps
// the session alive. Hence don't prompt users to save tabs, but warn about
@ -6566,7 +6565,7 @@ function BrowserOpenAddonsMgr(aView) {
}
}
Services.obs.addObserver(receivePong, "EM-pong");
Services.obs.notifyObservers(null, "EM-ping", "");
Services.obs.notifyObservers(null, "EM-ping");
Services.obs.removeObserver(receivePong, "EM-pong");
if (emWindow) {
@ -8129,7 +8128,7 @@ function safeModeRestart() {
return;
}
Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
Services.obs.notifyObservers(null, "restart-in-safe-mode");
}
/* duplicateTabIn duplicates tab in a place specified by the parameter |where|.

Просмотреть файл

@ -113,7 +113,7 @@ var handleContentContextMenu = function(event) {
addonInfo,
};
subject.wrappedJSObject = subject;
Services.obs.notifyObservers(subject, "content-contextmenu", null);
Services.obs.notifyObservers(subject, "content-contextmenu");
let doc = event.target.ownerDocument;
let docLocation = doc.mozDocumentURIIfNotForErrorPages;

Просмотреть файл

@ -67,7 +67,7 @@ nsContextMenu.prototype = {
frameId: this.frameOuterWindowID,
};
subject.wrappedJSObject = subject;
Services.obs.notifyObservers(subject, "on-build-contextmenu", null);
Services.obs.notifyObservers(subject, "on-build-contextmenu");
}
this.isFrameImage = document.getElementById("isFrameImage");

Просмотреть файл

@ -336,7 +336,7 @@ function onLoadPageInfo() {
loadTab(args);
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(window, "page-info-dialog-loaded", null);
.notifyObservers(window, "page-info-dialog-loaded");
}
function loadPageInfo(frameOuterWindowID, imageElement, browser) {

Просмотреть файл

@ -88,7 +88,7 @@ Sanitizer.prototype = {
try {
yield promise;
} finally {
Services.obs.notifyObservers(null, "sanitizer-sanitization-complete", "");
Services.obs.notifyObservers(null, "sanitizer-sanitization-complete");
}
}),
@ -437,7 +437,7 @@ Sanitizer.prototype = {
sdr.logoutAndTeardown();
// clear FTP and plain HTTP auth sessions
Services.obs.notifyObservers(null, "net:clear-active-logins", null);
Services.obs.notifyObservers(null, "net:clear-active-logins");
} finally {
TelemetryStopwatch.finish("FX_SANITIZE_SESSIONS", refObj);
}

Просмотреть файл

@ -12,7 +12,7 @@ add_task(function* test_settingsOpen_observer() {
info("simulate a notifications-open-settings notification");
let uri = NetUtil.newURI("https://example.com");
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
Services.obs.notifyObservers(principal, "notifications-open-settings", null);
Services.obs.notifyObservers(principal, "notifications-open-settings");
let tab = yield tabPromise;
ok(tab, "The notification settings tab opened");
yield BrowserTestUtils.removeTab(tab);

Просмотреть файл

@ -16,7 +16,7 @@ add_task(function* checkCaptivePortalCertErrorUI() {
let captivePortalStatePropagated = TestUtils.topicObserved("ipc:network:captive-portal-set-state");
info("Checking that the alternate about:certerror UI is shown when we are behind a captive portal.");
Services.obs.notifyObservers(null, "captive-portal-login", null);
Services.obs.notifyObservers(null, "captive-portal-login");
info("Waiting for captive portal state to be propagated to the content process.");
yield captivePortalStatePropagated;
@ -67,7 +67,7 @@ add_task(function* checkCaptivePortalCertErrorUI() {
let portalTabRemoved = BrowserTestUtils.tabRemoved(portalTab);
let errorTabReloaded = BrowserTestUtils.waitForErrorPage(browser);
Services.obs.notifyObservers(null, "captive-portal-login-success", null);
Services.obs.notifyObservers(null, "captive-portal-login-success");
yield portalTabRemoved;
info("Waiting for error tab to be reloaded after the captive portal was freed.");

Просмотреть файл

@ -40,7 +40,7 @@ function* setupPrefsAndRecentWindowBehavior() {
}
function* portalDetected() {
Services.obs.notifyObservers(null, "captive-portal-login", null);
Services.obs.notifyObservers(null, "captive-portal-login");
yield BrowserTestUtils.waitForCondition(() => {
return cps.state == cps.LOCKED_PORTAL;
}, "Waiting for Captive Portal Service to update state after portal detected.");
@ -48,7 +48,7 @@ function* portalDetected() {
function* freePortal(aSuccess) {
Services.obs.notifyObservers(null,
"captive-portal-login-" + (aSuccess ? "success" : "abort"), null);
"captive-portal-login-" + (aSuccess ? "success" : "abort"));
yield BrowserTestUtils.waitForCondition(() => {
return cps.state != cps.LOCKED_PORTAL;
}, "Waiting for Captive Portal Service to update state after portal freed.");
@ -76,7 +76,7 @@ function* focusWindowAndWaitForPortalUI(aLongRecheck, win) {
yield BrowserTestUtils.waitForCondition(() => {
return win.CaptivePortalWatcher._waitingForRecheck;
}, "Waiting for CaptivePortalWatcher to trigger a recheck.");
Services.obs.notifyObservers(null, "captive-portal-check-complete", null);
Services.obs.notifyObservers(null, "captive-portal-check-complete");
let notification = ensurePortalNotification(win);

Просмотреть файл

@ -18,7 +18,7 @@ const TEST_ROOT = "http://example.com/browser/browser/base/content/test/general/
let stubs = {
updateUI() {
return unstubs["updateUI"].call(gFxAccounts).then(() => {
Services.obs.notifyObservers(null, "test:browser_fxaccounts:updateUI", null);
Services.obs.notifyObservers(null, "test:browser_fxaccounts:updateUI");
});
},
// Opening preferences is trickier than it should be as leaks are reported
@ -26,7 +26,7 @@ const TEST_ROOT = "http://example.com/browser/browser/base/content/test/general/
// know when they are done.
// So just ensure openPreferences is called rather than whether it opens.
openPreferences() {
Services.obs.notifyObservers(null, "test:browser_fxaccounts:openPreferences", null);
Services.obs.notifyObservers(null, "test:browser_fxaccounts:openPreferences");
}
};
@ -73,7 +73,7 @@ add_task(function* test_nouser() {
let user = yield fxAccounts.getSignedInUser();
Assert.strictEqual(user, null, "start with no user signed in");
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI");
Services.obs.notifyObservers(null, this.FxAccountsCommon.ONLOGOUT_NOTIFICATION, null);
Services.obs.notifyObservers(null, this.FxAccountsCommon.ONLOGOUT_NOTIFICATION);
yield promiseUpdateDone;
// Check the world - the FxA footer area is visible as it is offering a signin.
@ -152,7 +152,7 @@ add_task(function* test_verifiedUserDisplayName() {
add_task(function* test_profileNotificationsClearsCache() {
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI", 1);
gFxAccounts._cachedProfile = { foo: "bar" };
Services.obs.notifyObservers(null, this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION, null);
Services.obs.notifyObservers(null, this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION);
Assert.ok(!gFxAccounts._cachedProfile);
yield promiseUpdateDone;
});

Просмотреть файл

@ -26,7 +26,7 @@ function notifyAndPromiseUIUpdated(topic) {
});
};
// Now send the notification.
Services.obs.notifyObservers(null, topic, null);
Services.obs.notifyObservers(null, topic);
});
}
@ -84,7 +84,7 @@ add_task(function* prepare() {
window.gSyncUI._needsSetup = oldNeedsSetup;
// and an observer to set the state back to what it should be now we've
// restored the stub.
Services.obs.notifyObservers(null, "weave:service:login:finish", null);
Services.obs.notifyObservers(null, "weave:service:login:finish");
});
// and a notification to have the state change away from "needs setup"
yield notifyAndPromiseUIUpdated("weave:service:login:finish");

Просмотреть файл

@ -342,7 +342,7 @@ function openLinkIn(url, where, params) {
sourceTabBrowser,
sourceFrameOuterWindowID: params.frameOuterWindowID,
},
}, "webNavigation-createdNavigationTarget", null);
}, "webNavigation-createdNavigationTarget");
}
};
Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished");
@ -462,7 +462,7 @@ function openLinkIn(url, where, params) {
sourceTabBrowser: w.gBrowser.selectedBrowser,
sourceFrameOuterWindowID: params.frameOuterWindowID,
},
}, "webNavigation-createdNavigationTarget", null);
}, "webNavigation-createdNavigationTarget");
}
break;
}

Просмотреть файл

@ -442,7 +442,7 @@ const CustomizableWidgets = [
Cu.reportError(err);
}).then(() => {
// an observer for tests.
Services.obs.notifyObservers(null, "synced-tabs-menu:test:tabs-updated", null);
Services.obs.notifyObservers(null, "synced-tabs-menu:test:tabs-updated");
});
},
_clearTabList() {
@ -623,14 +623,14 @@ const CustomizableWidgets = [
if (aWidgetId != this.id)
return;
Services.obs.notifyObservers(null, "social:" + this.id + "-added", null);
Services.obs.notifyObservers(null, "social:" + this.id + "-added");
},
onWidgetRemoved: aWidgetId => {
if (aWidgetId != this.id)
return;
Services.obs.notifyObservers(null, "social:" + this.id + "-removed", null);
Services.obs.notifyObservers(null, "social:" + this.id + "-removed");
},
onWidgetInstanceRemoved: (aWidgetId, aDoc) => {

Просмотреть файл

@ -24,7 +24,7 @@ var newTab = null;
// once the UI has been updated.
function updateTabsPanel() {
let promiseTabsUpdated = promiseObserverNotified("synced-tabs-menu:test:tabs-updated");
Services.obs.notifyObservers(null, SyncedTabs.TOPIC_TABS_CHANGED, null);
Services.obs.notifyObservers(null, SyncedTabs.TOPIC_TABS_CHANGED);
return promiseTabsUpdated;
}

Просмотреть файл

@ -459,7 +459,7 @@ DistributionCustomizer.prototype = {
prefDefaultsApplied) {
let os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
os.notifyObservers(null, DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC, null);
os.notifyObservers(null, DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC);
}
}
};

Просмотреть файл

@ -9,7 +9,7 @@ function* makeAndInstallXPI(id, backgroundScript, loadedURL) {
background: backgroundScript,
});
SimpleTest.registerCleanupFunction(function cleanupXPI() {
Services.obs.notifyObservers(xpi, "flush-cache-entry", null);
Services.obs.notifyObservers(xpi, "flush-cache-entry");
xpi.remove(false);
});

Просмотреть файл

@ -305,7 +305,7 @@ BrowserGlue.prototype = {
this._initPlaces(false);
} else if (data == "smart-bookmarks-init") {
this.ensurePlacesDefaultQueriesInitialized().then(() => {
Services.obs.notifyObservers(null, "test-smart-bookmarks-done", null);
Services.obs.notifyObservers(null, "test-smart-bookmarks-done");
});
} else if (data == "mock-fxaccounts") {
Object.defineProperty(this, "fxAccounts", {
@ -561,7 +561,7 @@ BrowserGlue.prototype = {
UnsubmittedCrashHandler.init();
}
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
Services.obs.notifyObservers(null, "browser-ui-startup-complete");
},
_checkForOldBuildUpdates() {
@ -1495,7 +1495,7 @@ BrowserGlue.prototype = {
}).then(() => {
// NB: deliberately after the catch so that we always do this, even if
// we threw halfway through initializing in the Task above.
Services.obs.notifyObservers(null, "places-browser-init-complete", "");
Services.obs.notifyObservers(null, "places-browser-init-complete");
});
},

Просмотреть файл

@ -817,7 +817,7 @@ var gEditItemOverlay = {
// Auto-show the bookmarks toolbar when adding / moving an item there.
if (containerId == PlacesUtils.toolbarFolderId) {
Services.obs.notifyObservers(null, "autoshow-bookmarks-toolbar", null);
Services.obs.notifyObservers(null, "autoshow-bookmarks-toolbar");
}
}

Просмотреть файл

@ -43,7 +43,7 @@ this.SiteDataManager = {
_quotaUsageRequests: null,
updateSites() {
Services.obs.notifyObservers(null, "sitedatamanager:updating-sites", null);
Services.obs.notifyObservers(null, "sitedatamanager:updating-sites");
// Clear old data and requests first
this._sites.clear();
@ -74,7 +74,7 @@ this.SiteDataManager = {
Promise.all([this._updateQuotaPromise, this._updateDiskCachePromise])
.then(() => {
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated", null);
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated");
});
},

Просмотреть файл

@ -799,7 +799,7 @@ InternalHandlerInfoWrapper.prototype = {
// or unregistration of this handler.
store() {
HandlerInfoWrapper.prototype.store.call(this);
Services.obs.notifyObservers(null, this._handlerChanged, null);
Services.obs.notifyObservers(null, this._handlerChanged);
},
get enabled() {
@ -942,7 +942,7 @@ var gApplicationsPane = {
// Notify observers that the UI is now ready
Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService).
notifyObservers(window, "app-handler-pane-loaded", null);
notifyObservers(window, "app-handler-pane-loaded");
}
setTimeout(_delayedPaneLoad, 0, this);
},

Просмотреть файл

@ -127,7 +127,7 @@ var gMainPane = {
// Notify observers that the UI is now ready
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(window, "main-pane-loaded", null);
.notifyObservers(window, "main-pane-loaded");
},
enableE10SChange() {

Просмотреть файл

@ -99,7 +99,7 @@ function init_all() {
// Wait until initialization of all preferences are complete before
// notifying observers that the UI is now ready.
Services.obs.notifyObservers(window, "advanced-pane-loaded", null);
Services.obs.notifyObservers(window, "advanced-pane-loaded");
}
// Make the space above the categories list shrink on low window heights

Просмотреть файл

@ -659,7 +659,7 @@ var gPrivacyPane = {
ts.value = timeSpanOrig;
}
Services.obs.notifyObservers(null, "clear-private-data", null);
Services.obs.notifyObservers(null, "clear-private-data");
});
},

Просмотреть файл

@ -250,14 +250,14 @@ add_task(function *() {
is(actual, expected, "Should show the right total site data size");
});
Services.obs.notifyObservers(null, "sitedatamanager:updating-sites", null);
Services.obs.notifyObservers(null, "sitedatamanager:updating-sites");
is(clearBtn.disabled, true, "Should disable clear button while updating sites");
is(settingsButton.disabled, true, "Should disable settings button while updating sites");
actual = totalSiteDataSizeLabel.textContent;
expected = prefStrBundle.getString("loadingSiteDataSize");
is(actual, expected, "Should show the loading message while updating");
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated", null);
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated");
is(clearBtn.disabled, false, "Should enable clear button after sites updated");
is(settingsButton.disabled, false, "Should enable settings button after sites updated");
yield SiteDataManager.getTotalUsage()

Просмотреть файл

@ -801,7 +801,7 @@ InternalHandlerInfoWrapper.prototype = {
// or unregistration of this handler.
store() {
HandlerInfoWrapper.prototype.store.call(this);
Services.obs.notifyObservers(null, this._handlerChanged, null);
Services.obs.notifyObservers(null, this._handlerChanged);
},
get enabled() {
@ -946,7 +946,7 @@ var gApplicationsPane = {
// Notify observers that the UI is now ready
Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService).
notifyObservers(window, "app-handler-pane-loaded", null);
notifyObservers(window, "app-handler-pane-loaded");
}
setTimeout(_delayedPaneLoad, 0, this);
},

Просмотреть файл

@ -197,7 +197,7 @@ var gMainPane = {
// Notify observers that the UI is now ready
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(window, "main-pane-loaded", null);
.notifyObservers(window, "main-pane-loaded");
},
enableE10SChange() {

Просмотреть файл

@ -96,7 +96,7 @@ function init_all() {
// Wait until initialization of all preferences are complete before
// notifying observers that the UI is now ready.
Services.obs.notifyObservers(window, "advanced-pane-loaded", null);
Services.obs.notifyObservers(window, "advanced-pane-loaded");
}
// Make the space above the categories list shrink on low window heights

Просмотреть файл

@ -785,7 +785,7 @@ var gPrivacyPane = {
ts.value = timeSpanOrig;
}
Services.obs.notifyObservers(null, "clear-private-data", null);
Services.obs.notifyObservers(null, "clear-private-data");
});
},

Просмотреть файл

@ -191,14 +191,14 @@ add_task(function *() {
is(actual, expected, "Should show the right total site data size");
});
Services.obs.notifyObservers(null, "sitedatamanager:updating-sites", null);
Services.obs.notifyObservers(null, "sitedatamanager:updating-sites");
is(clearBtn.disabled, true, "Should disable clear button while updating sites");
is(settingsButton.disabled, true, "Should disable settings button while updating sites");
actual = totalSiteDataSizeLabel.textContent;
expected = prefStrBundle.getString("loadingSiteDataSize");
is(actual, expected, "Should show the loading message while updating");
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated", null);
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated");
is(clearBtn.disabled, false, "Should enable clear button after sites updated");
is(settingsButton.disabled, false, "Should enable settings button after sites updated");
yield SiteDataManager.getTotalUsage()

Просмотреть файл

@ -42,7 +42,7 @@ let gSiteDataSettings = {
let sortCol = document.getElementById("hostCol");
this._sortSites(this._sites, sortCol);
this._buildSitesList(this._sites);
Services.obs.notifyObservers(null, "sitedata-settings-init", null);
Services.obs.notifyObservers(null, "sitedata-settings-init");
});
let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");

Просмотреть файл

@ -43,7 +43,7 @@ function newFileInDirectory(aDir) {
function clearHistory() {
// simulate clearing the private data
Services.obs.notifyObservers(null, "browser:purge-session-history", "");
Services.obs.notifyObservers(null, "browser:purge-session-history");
}
function _initTest() {

Просмотреть файл

@ -374,7 +374,7 @@ var SessionFileInternal = {
AsyncShutdown.profileBeforeChange.removeBlocker(promise);
if (isFinalWrite) {
Services.obs.notifyObservers(null, "sessionstore-final-state-write-complete", "");
Services.obs.notifyObservers(null, "sessionstore-final-state-write-complete");
}
});
},

Просмотреть файл

@ -54,7 +54,7 @@ const PREF_IDLE_DELAY = "browser.sessionstore.idleDelay";
// Notify observers about a given topic with a given subject.
function notify(subject, topic) {
Services.obs.notifyObservers(subject, topic, "");
Services.obs.notifyObservers(subject, topic);
}
// TelemetryStopwatch helper functions.

Просмотреть файл

@ -952,7 +952,7 @@ var SessionStoreInternal = {
// This callback is used exclusively by tests that want to
// monitor the progress of network loads.
if (gDebuggingEnabled) {
Services.obs.notifyObservers(browser, NOTIFY_TAB_RESTORED, null);
Services.obs.notifyObservers(browser, NOTIFY_TAB_RESTORED);
}
SessionStoreInternal._resetLocalTabRestoringState(tab);
@ -1149,7 +1149,7 @@ var SessionStoreInternal = {
this._deferredInitialState = gSessionStartup.state;
// Nothing to restore now, notify observers things are complete.
Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, "");
Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED);
} else {
TelemetryTimestamps.add("sessionRestoreRestoring");
this._restoreCount = aInitialState.windows ? aInitialState.windows.length : 0;
@ -1167,7 +1167,7 @@ var SessionStoreInternal = {
}
} else {
// Nothing to restore, notify observers things are complete.
Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, "");
Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED);
}
// this window was opened by _openWindowWithState
} else if (!this._isWindowLoaded(aWindow)) {
@ -1309,7 +1309,7 @@ var SessionStoreInternal = {
this._sessionInitialized = true;
if (initialState) {
Services.obs.notifyObservers(null, NOTIFY_RESTORING_ON_STARTUP, "");
Services.obs.notifyObservers(null, NOTIFY_RESTORING_ON_STARTUP);
}
TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS");
this.initializeWindow(aWindow, initialState);
@ -2663,7 +2663,7 @@ var SessionStoreInternal = {
throw Components.Exception("Last session can not be restored");
}
Services.obs.notifyObservers(null, NOTIFY_INITIATING_MANUAL_RESTORE, "");
Services.obs.notifyObservers(null, NOTIFY_INITIATING_MANUAL_RESTORE);
// First collect each window with its id...
let windows = {};
@ -3443,7 +3443,7 @@ var SessionStoreInternal = {
this._sendWindowRestoredNotification(aWindow);
Services.obs.notifyObservers(aWindow, NOTIFY_SINGLE_WINDOW_RESTORED, "");
Services.obs.notifyObservers(aWindow, NOTIFY_SINGLE_WINDOW_RESTORED);
this._sendRestoreCompletedNotifications();
},
@ -4033,7 +4033,7 @@ var SessionStoreInternal = {
}
this._closedObjectsChanged = false;
setTimeout(() => {
Services.obs.notifyObservers(null, NOTIFY_CLOSED_OBJECTS_CHANGED, null);
Services.obs.notifyObservers(null, NOTIFY_CLOSED_OBJECTS_CHANGED);
}, 0);
},
@ -4424,8 +4424,7 @@ var SessionStoreInternal = {
// This was the last window restored at startup, notify observers.
Services.obs.notifyObservers(null,
this._browserSetState ? NOTIFY_BROWSER_STATE_RESTORED : NOTIFY_WINDOWS_RESTORED,
"");
this._browserSetState ? NOTIFY_BROWSER_STATE_RESTORED : NOTIFY_WINDOWS_RESTORED);
this._browserSetState = false;
this._restoreCount = -1;
@ -4987,7 +4986,7 @@ var LastSession = {
clear() {
if (this._state) {
this._state = null;
Services.obs.notifyObservers(null, NOTIFY_LAST_SESSION_CLEARED, null);
Services.obs.notifyObservers(null, NOTIFY_LAST_SESSION_CLEARED);
}
}
};

Просмотреть файл

@ -104,7 +104,7 @@ this.StartupPerformance = {
this._promiseFinished.then(() => {
try {
this._isRestored = true;
Services.obs.notifyObservers(null, this.RESTORED_TOPIC, "");
Services.obs.notifyObservers(null, this.RESTORED_TOPIC);
if (this._latestRestoredTimeStamp == this._startTimeStamp) {
// Apparently, we haven't restored any tab.

Просмотреть файл

@ -112,7 +112,7 @@ function updateTabListVisibility() {
}
function restoreSession() {
Services.obs.notifyObservers(null, "sessionstore-initiating-manual-restore", "");
Services.obs.notifyObservers(null, "sessionstore-initiating-manual-restore");
document.getElementById("errorTryAgain").disabled = true;
if (isTreeViewVisible()) {

Просмотреть файл

@ -97,7 +97,7 @@ SessionStartup.prototype = {
* Initialize the component
*/
init: function sss_init() {
Services.obs.notifyObservers(null, "sessionstore-init-started", null);
Services.obs.notifyObservers(null, "sessionstore-init-started");
StartupPerformance.init();
// do not need to initialize anything in auto-started private browsing sessions
@ -132,7 +132,7 @@ SessionStartup.prototype = {
// Let observers modify the state before it is used
let supportsStateString = this._createSupportsString(source);
Services.obs.notifyObservers(supportsStateString, "sessionstore-state-read", "");
Services.obs.notifyObservers(supportsStateString, "sessionstore-state-read");
let stateString = supportsStateString.data;
if (stateString != source) {
@ -152,7 +152,7 @@ SessionStartup.prototype = {
if (this._initialState == null) {
// No valid session found.
this._sessionType = Ci.nsISessionStartup.NO_SESSION;
Services.obs.notifyObservers(null, "sessionstore-state-finalized", "");
Services.obs.notifyObservers(null, "sessionstore-state-finalized");
gOnceInitializedDeferred.resolve();
return;
}
@ -220,7 +220,7 @@ SessionStartup.prototype = {
Services.obs.addObserver(this, "browser:purge-session-history", true);
// We're ready. Notify everyone else.
Services.obs.notifyObservers(null, "sessionstore-state-finalized", "");
Services.obs.notifyObservers(null, "sessionstore-state-finalized");
gOnceInitializedDeferred.resolve();
});
},

Просмотреть файл

@ -118,7 +118,7 @@ add_task(function* test_old_data() {
yield promiseBrowserState(state);
info("Sending idle-daily");
Services.obs.notifyObservers(null, "idle-daily", "");
Services.obs.notifyObservers(null, "idle-daily");
info("Sent idle-daily");
state = JSON.parse(ss.getBrowserState());
@ -144,7 +144,7 @@ add_task(function* test_cleanup() {
yield promiseBrowserState(state);
info("Sending idle-daily");
Services.obs.notifyObservers(null, "idle-daily", "");
Services.obs.notifyObservers(null, "idle-daily");
info("Sent idle-daily");
state = JSON.parse(ss.getBrowserState());

Просмотреть файл

@ -57,7 +57,7 @@ add_task(function* test_closedObjectsChangedNotifications() {
// Forget any previous closed windows or tabs from other tests that may have
// run in the same session.
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history", 0));
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history"));
// Add an observer to count the number of notifications.
Services.obs.addObserver(countingObserver, TOPIC);
@ -90,7 +90,7 @@ add_task(function* test_closedObjectsChangedNotifications() {
assertNotificationCount(5);
info("Purging session history.");
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history", 0));
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history"));
assertNotificationCount(6);
info("Opening and closing another tab.");

Просмотреть файл

@ -48,7 +48,7 @@ add_task(function* test_closedObjectsChangedNotifications() {
// Forget any previous closed windows or tabs from other tests that may have
// run in the same session.
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history", 0));
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history"));
// Add an observer to count the number of notifications.
Services.obs.addObserver(countingObserver, TOPIC);
@ -96,7 +96,7 @@ add_task(function* test_closedObjectsChangedNotifications() {
assertNotificationCount(8);
info("Sending idle-daily");
yield awaitNotification(() => Services.obs.notifyObservers(null, "idle-daily", ""));
yield awaitNotification(() => Services.obs.notifyObservers(null, "idle-daily"));
assertNotificationCount(9);
info("Opening and closing another window.");
@ -104,7 +104,7 @@ add_task(function* test_closedObjectsChangedNotifications() {
assertNotificationCount(10);
info("Purging session history.");
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history", 0));
yield awaitNotification(() => Services.obs.notifyObservers(null, "browser:purge-session-history"));
assertNotificationCount(11);
info("Setting window state.")

Просмотреть файл

@ -22,7 +22,7 @@ let forgetTabHelper = Task.async(function*(forgetFn) {
// Forget any previous closed tabs from other tests that may have
// run in the same session.
Services.obs.notifyObservers(null, "browser:purge-session-history", 0);
Services.obs.notifyObservers(null, "browser:purge-session-history");
is(ss.getClosedTabCount(window), 0,
"We should have 0 closed tabs being stored.");
@ -69,7 +69,7 @@ let forgetWinHelper = Task.async(function*(forgetFn) {
// Forget any previous closed windows from other tests that may have
// run in the same session.
Services.obs.notifyObservers(null, "browser:purge-session-history", 0);
Services.obs.notifyObservers(null, "browser:purge-session-history");
is(ss.getClosedWindowCount(), 0, "We should have 0 closed windows being stored.");
@ -128,7 +128,7 @@ add_task(function* test_forget_closed_window() {
*/
add_task(function* test_forget_purged_tab() {
yield forgetTabHelper(() => {
Services.obs.notifyObservers(null, "browser:purge-session-history", 0);
Services.obs.notifyObservers(null, "browser:purge-session-history");
});
});
@ -139,6 +139,6 @@ add_task(function* test_forget_purged_tab() {
*/
add_task(function* test_forget_purged_window() {
yield forgetWinHelper(() => {
Services.obs.notifyObservers(null, "browser:purge-session-history", 0);
Services.obs.notifyObservers(null, "browser:purge-session-history");
});
});

Просмотреть файл

@ -44,7 +44,7 @@ add_task(function* () {
yield promise;
// Purge session history.
Services.obs.notifyObservers(null, "browser:purge-session-history", "");
Services.obs.notifyObservers(null, "browser:purge-session-history");
yield checkTabContents(browser);
ok(tab2.hasAttribute("pending"), "tab is still pending");

Просмотреть файл

@ -27,6 +27,6 @@ function afterSessionStartupInitialization(cb) {
getService(Ci.nsIObserver);
Services.obs.addObserver(startup, "final-ui-startup");
Services.obs.addObserver(startup, "quit-application");
Services.obs.notifyObservers(null, "final-ui-startup", "");
Services.obs.notifyObservers(null, "final-ui-startup");
Services.obs.addObserver(observer, "sessionstore-state-finalized");
}

Просмотреть файл

@ -109,7 +109,7 @@ add_task(function* testObserver() {
SyncedTabs.syncTabs.restore();
Assert.ok(component.updatePanel.called, "triggers panel update during init");
Services.obs.notifyObservers(null, SyncedTabs.TOPIC_TABS_CHANGED, "");
Services.obs.notifyObservers(null, SyncedTabs.TOPIC_TABS_CHANGED);
Assert.ok(component.observe.calledWith(null, SyncedTabs.TOPIC_TABS_CHANGED, ""),
"component is notified");
@ -117,13 +117,13 @@ add_task(function* testObserver() {
Assert.ok(listStore.getData.called, "gets list data");
Assert.ok(component.updatePanel.calledTwice, "triggers panel update");
Services.obs.notifyObservers(null, FxAccountsCommon.ONLOGIN_NOTIFICATION, "");
Services.obs.notifyObservers(null, FxAccountsCommon.ONLOGIN_NOTIFICATION);
Assert.ok(component.observe.calledWith(null, FxAccountsCommon.ONLOGIN_NOTIFICATION, ""),
"component is notified of login");
Assert.equal(component.updatePanel.callCount, 3, "triggers panel update again");
Services.obs.notifyObservers(null, "weave:service:login:change", "");
Services.obs.notifyObservers(null, "weave:service:login:change");
Assert.ok(component.observe.calledWith(null, "weave:service:login:change", ""),
"component is notified of login change");

Просмотреть файл

@ -684,7 +684,7 @@ Experiments.Experiments.prototype = {
e.branch = String(branchstr);
this._log.trace("setExperimentBranch(" + id + ", " + e.branch + ") _dirty=" + this._dirty);
this._dirty = true;
Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC, null);
Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC);
yield this._run();
}),
/**
@ -1296,7 +1296,7 @@ Experiments.Experiments.prototype = {
gPrefs.set(PREF_ACTIVE_EXPERIMENT, activeExperiment != null);
if (activeChanged || this._firstEvaluate) {
Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC, null);
Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC);
this._firstEvaluate = false;
}

Просмотреть файл

@ -29,7 +29,7 @@ function changeMimeHandler(preferredAction, alwaysAskBeforeHandling) {
handlerInfo.preferredAction = preferredAction;
handlerService.store(handlerInfo);
Services.obs.notifyObservers(null, "pdfjs:handlerChanged", null);
Services.obs.notifyObservers(null, "pdfjs:handlerChanged");
// Refresh data
handlerInfo = mimeService.getFromTypeAndExtension("application/pdf", "pdf");

Просмотреть файл

@ -140,7 +140,7 @@ var SelfSupportBackendInternal = {
this._frame = null;
}
if (this._testing) {
Services.obs.notifyObservers(this._browser, "self-support-browser-destroyed", "");
Services.obs.notifyObservers(this._browser, "self-support-browser-destroyed");
}
},
@ -202,7 +202,7 @@ var SelfSupportBackendInternal = {
this._browser.setAttribute("src", aURL);
if (this._testing) {
Services.obs.notifyObservers(this._browser, "self-support-browser-created", "");
Services.obs.notifyObservers(this._browser, "self-support-browser-created");
}
doc.documentElement.appendChild(this._browser);
});

Просмотреть файл

@ -101,7 +101,7 @@ this.Social = {
// Called to update our cache of providers and set the current provider
_updateProviderCache(providers) {
this.providers = providers;
Services.obs.notifyObservers(null, "social:providers-changed", null);
Services.obs.notifyObservers(null, "social:providers-changed");
},
get enabled() {

Просмотреть файл

@ -91,7 +91,7 @@ let buttonCount = (UpdateUtils.UpdateChannel == "aurora" ? 3 : 2);
add_task(function* terminateScriptTest() {
let promise = promiseNotificationShown(window, "process-hang");
Services.obs.notifyObservers(gTestHangReport, "process-hang-report", null);
Services.obs.notifyObservers(gTestHangReport, "process-hang-report");
let notification = yield promise;
let buttons = notification.currentNotification.getElementsByTagName("button");
@ -112,7 +112,7 @@ add_task(function* terminateScriptTest() {
add_task(function* waitForScriptTest() {
let promise = promiseNotificationShown(window, "process-hang");
Services.obs.notifyObservers(gTestHangReport, "process-hang-report", null);
Services.obs.notifyObservers(gTestHangReport, "process-hang-report");
let notification = yield promise;
let buttons = notification.currentNotification.getElementsByTagName("button");
@ -131,11 +131,11 @@ add_task(function* waitForScriptTest() {
gTestHangReport.testCallback = oldcb;
// send another hang pulse, we should not get a notification here
Services.obs.notifyObservers(gTestHangReport, "process-hang-report", null);
Services.obs.notifyObservers(gTestHangReport, "process-hang-report");
is(notification.currentNotification, null, "no notification should be visible");
gTestHangReport.testCallback = function() {};
Services.obs.notifyObservers(gTestHangReport, "clear-hang-report", null);
Services.obs.notifyObservers(gTestHangReport, "clear-hang-report");
gTestHangReport.testCallback = oldcb;
yield popPrefs();
@ -150,11 +150,11 @@ add_task(function* hangGoesAwayTest() {
yield pushPrefs(["browser.hangNotification.expiration", 1000]);
let promise = promiseNotificationShown(window, "process-hang");
Services.obs.notifyObservers(gTestHangReport, "process-hang-report", null);
Services.obs.notifyObservers(gTestHangReport, "process-hang-report");
yield promise;
promise = promiseReportCallMade(gTestHangReport.TEST_CALLBACK_CANCELED);
Services.obs.notifyObservers(gTestHangReport, "clear-hang-report", null);
Services.obs.notifyObservers(gTestHangReport, "clear-hang-report");
yield promise;
yield popPrefs();
@ -167,7 +167,7 @@ add_task(function* hangGoesAwayTest() {
add_task(function* terminatePluginTest() {
let promise = promiseNotificationShown(window, "process-hang");
Services.obs.notifyObservers(gTestHangReport, "process-hang-report", null);
Services.obs.notifyObservers(gTestHangReport, "process-hang-report");
let notification = yield promise;
let buttons = notification.currentNotification.getElementsByTagName("button");

Просмотреть файл

@ -11,7 +11,7 @@ const UNFILTERED_URI_COUNT = "browser.engagement.unfiltered_uri_count";
const TELEMETRY_SUBSESSION_TOPIC = "internal-telemetry-after-subsession-split";
// Reset internal URI counter in case URIs were opened by other tests.
Services.obs.notifyObservers(null, TELEMETRY_SUBSESSION_TOPIC, "");
Services.obs.notifyObservers(null, TELEMETRY_SUBSESSION_TOPIC);
/**
* Waits for the web progress listener associated with this tab to fire an
@ -165,7 +165,7 @@ add_task(function* test_subsessionSplit() {
// notifying the subsession split topic.
Services.telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN,
true /* clearScalars */);
Services.obs.notifyObservers(null, TELEMETRY_SUBSESSION_TOPIC, "");
Services.obs.notifyObservers(null, TELEMETRY_SUBSESSION_TOPIC);
// After a subsession split, only the MAX_CONCURRENT_* scalars must be available
// and have the correct value. No tabs, windows or URIs were opened so other scalars

4
devtools/bootstrap.js поставляемый
Просмотреть файл

@ -170,7 +170,7 @@ function reload(event) {
dump("Reload DevTools. (reload-toolbox:" + reloadToolbox + ")\n");
// Invalidate xul cache in order to see changes made to chrome:// files
Services.obs.notifyObservers(null, "startupcache-invalidate", null);
Services.obs.notifyObservers(null, "startupcache-invalidate");
// This frame script is going to be executed in all processes:
// parent and child
@ -178,7 +178,7 @@ function reload(event) {
/* Flush message manager cached frame scripts as well as chrome locales */
let obs = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
obs.notifyObservers(null, "message-manager-flush-caches", null);
obs.notifyObservers(null, "message-manager-flush-caches");
/* Also purge cached modules in child processes, we do it a few lines after
in the parent process */

Просмотреть файл

@ -11,11 +11,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
// This function is called from the webconsole test:
// browser_addons_debug_bootstrapped.js
function myBootstrapAddonFunction() { // eslint-disable-line no-unused-vars
Services.obs.notifyObservers(null, "addon-console-works", null);
Services.obs.notifyObservers(null, "addon-console-works");
}
function startup() {
Services.obs.notifyObservers(null, "test-devtools", null);
Services.obs.notifyObservers(null, "test-devtools");
}
function shutdown() {}
function install() {}

Просмотреть файл

@ -34,7 +34,7 @@ function test() {
let consolePromise = addonDebugger.once("console");
console.log("Bad message");
Services.obs.notifyObservers(null, "addon-test-ping", "");
Services.obs.notifyObservers(null, "addon-test-ping");
let messageGrip = yield consolePromise;
is(messageGrip.arguments[0].type, "object", "Should have logged an object");

Просмотреть файл

@ -64,7 +64,7 @@ function testDebugger() {
gThreadClient.resume(deferred.resolve);
});
Services.obs.notifyObservers(null, "debuggerAttached", null);
Services.obs.notifyObservers(null, "debuggerAttached");
return deferred.promise;
}

Просмотреть файл

@ -333,4 +333,4 @@ Services.prefs.addObserver("devtools.debugger.log", {
}
});
Services.obs.notifyObservers(null, "ToolboxProcessLoaded", null);
Services.obs.notifyObservers(null, "ToolboxProcessLoaded");

Просмотреть файл

@ -210,7 +210,7 @@ function setTitle(title) {
function quitApp() {
let quit = Cc["@mozilla.org/supports-PRBool;1"]
.createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(quit, "quit-application-requested", null);
Services.obs.notifyObservers(quit, "quit-application-requested");
let shouldProceed = !quit.data;
if (shouldProceed) {

Просмотреть файл

@ -37,7 +37,7 @@ const browserBasedDirsRegExp =
/^resource\:\/\/devtools\/client\/\S*\/components\//;
function clearCache() {
Services.obs.notifyObservers(null, "startupcache-invalidate", null);
Services.obs.notifyObservers(null, "startupcache-invalidate");
}
/*

Просмотреть файл

@ -25,7 +25,7 @@ function iterStyleNodes(window, func) {
function replaceCSS(window, fileURI) {
const document = window.document;
const randomKey = Math.random();
Services.obs.notifyObservers(null, "startupcache-invalidate", null);
Services.obs.notifyObservers(null, "startupcache-invalidate");
// Scan every CSS tag and reload ones that match the file we are
// looking for.

Просмотреть файл

@ -625,7 +625,7 @@ DeveloperToolbar.prototype.destroy = function () {
DeveloperToolbar.prototype._notify = function (topic) {
let data = { toolbar: this };
data.wrappedJSObject = data;
Services.obs.notifyObservers(data, topic, null);
Services.obs.notifyObservers(data, topic);
};
/**

Просмотреть файл

@ -588,7 +588,7 @@ WebConsole.prototype = {
}
let id = WebConsoleUtils.supportsString(this.hudId);
Services.obs.notifyObservers(id, "web-console-destroyed", null);
Services.obs.notifyObservers(id, "web-console-destroyed");
this._destroyer.resolve(null);
}.bind(this));

Просмотреть файл

@ -488,7 +488,7 @@ WebConsoleFrame.prototype = {
// to the toolbox before the web-console-created event is receieved.
let notifyObservers = () => {
let id = WebConsoleUtils.supportsString(this.hudId);
Services.obs.notifyObservers(id, "web-console-created", null);
Services.obs.notifyObservers(id, "web-console-created");
};
allReady.then(notifyObservers, notifyObservers);

Просмотреть файл

@ -45,7 +45,7 @@ webideCli.prototype = {
// If this is a new Firefox instance, and because we will only start
// webide, we need to notify "sessionstore-windows-restored" to trigger
// addons registration (for simulators and adb helper).
Services.obs.notifyObservers(null, "sessionstore-windows-restored", "");
Services.obs.notifyObservers(null, "sessionstore-windows-restored");
}
},

Просмотреть файл

@ -32,7 +32,7 @@ MonitorActor.prototype = {
if (!this._started) {
this._started = true;
Services.obs.addObserver(this, "devtools-monitor-update");
Services.obs.notifyObservers(null, "devtools-monitor-start", "");
Services.obs.notifyObservers(null, "devtools-monitor-start");
this._agents.forEach(agent => this._startAgent(agent));
}
return {};
@ -41,7 +41,7 @@ MonitorActor.prototype = {
stop: function () {
if (this._started) {
this._agents.forEach(agent => agent.stop());
Services.obs.notifyObservers(null, "devtools-monitor-stop", "");
Services.obs.notifyObservers(null, "devtools-monitor-stop");
Services.obs.removeObserver(this, "devtools-monitor-update");
this._started = false;
}

Просмотреть файл

@ -1023,7 +1023,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
// Tell anyone who cares of the resume (as of now, that's the xpcshell harness and
// devtools-startup.js when handling the --wait-for-jsdebugger flag)
if (Services.obs) {
Services.obs.notifyObservers(this, "devtools-thread-resumed", null);
Services.obs.notifyObservers(this, "devtools-thread-resumed");
}
return packet;
}, error => {

Просмотреть файл

@ -160,7 +160,7 @@ ConsoleAPIStorageService.prototype = {
}
else {
_consoleStorage.clear();
Services.obs.notifyObservers(null, "console-storage-reset", null);
Services.obs.notifyObservers(null, "console-storage-reset");
}
},
};

Просмотреть файл

@ -21,12 +21,12 @@ function onLoad()
quotaRequest.cancel();
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(window, "bug839193-loaded", null);
.notifyObservers(window, "bug839193-loaded");
}
function onUnload()
{
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(window, "bug839193-unloaded", null);
.notifyObservers(window, "bug839193-unloaded");
}

Просмотреть файл

@ -840,7 +840,7 @@ class RTCPeerConnection {
let chrome = new CreateOfferRequest(outerId, this._winID,
this._globalPCListId, false);
let request = this._win.CreateOfferRequest._create(this._win, chrome);
Services.obs.notifyObservers(request, "PeerConnection:request", null);
Services.obs.notifyObservers(request, "PeerConnection:request");
});
}
}

Просмотреть файл

@ -127,7 +127,7 @@ function EventManager(sr) {
}
self.requestTestEnd = function EventManager_requestTestEnd() {
Services.obs.notifyObservers(null, SPEECH_RECOGNITION_TEST_END_TOPIC, null);
Services.obs.notifyObservers(null, SPEECH_RECOGNITION_TEST_END_TOPIC);
}
}

Просмотреть файл

@ -67,7 +67,7 @@ function setup() {
var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(SpecialPowers.Ci.nsIObserverService);
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
});
gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {

Просмотреть файл

@ -76,7 +76,7 @@ function setup() {
var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(SpecialPowers.Ci.nsIObserverService);
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
});
gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {

Просмотреть файл

@ -56,7 +56,7 @@ function setup() {
aResolve(iframe);
});
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
gScript.addMessageListener('offer-received', function offerReceivedHandler() {
gScript.removeMessageListener('offer-received', offerReceivedHandler);

Просмотреть файл

@ -78,7 +78,7 @@ function setup() {
aResolve(receiverIframe);
});
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
// Create a non-receiver OOP iframe.
var nonReceiverIframe = document.createElement('iframe');

Просмотреть файл

@ -42,7 +42,7 @@ function setup() {
aResolve(iframe);
});
obs.notifyObservers(promise, "setup-request-promise", null);
obs.notifyObservers(promise, "setup-request-promise");
aResolve();
});

Просмотреть файл

@ -57,7 +57,7 @@ function setup() {
aResolve(iframe);
});
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
gScript.addMessageListener('offer-received', function offerReceivedHandler() {
gScript.removeMessageListener('offer-received', offerReceivedHandler);

Просмотреть файл

@ -53,7 +53,7 @@ function setup() {
aResolve(iframe);
});
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);

Просмотреть файл

@ -26,7 +26,7 @@ function setup() {
var promise = new Promise(function(aResolve, aReject) {
// In order to trigger timeout, do not resolve the promise.
});
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
aResolve();
});

Просмотреть файл

@ -24,7 +24,7 @@ function setup() {
aResolve(receiverIframe);
});
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
aResolve();
});

Просмотреть файл

@ -67,7 +67,7 @@ function setup() {
aResolve(receiverIframe);
});
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
// Create a non-receiver OOP iframe.
var nonReceiverIframe = document.createElement('iframe');

Просмотреть файл

@ -67,7 +67,7 @@ function setup() {
var obs = SpecialPowers.Cc['@mozilla.org/observer-service;1']
.getService(SpecialPowers.Ci.nsIObserverService);
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
});
gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {

Просмотреть файл

@ -72,7 +72,7 @@ function setup() {
var obs = SpecialPowers.Cc['@mozilla.org/observer-service;1']
.getService(SpecialPowers.Ci.nsIObserverService);
obs.notifyObservers(promise, 'setup-request-promise', null);
obs.notifyObservers(promise, 'setup-request-promise');
});
gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {

Просмотреть файл

@ -141,7 +141,7 @@ add_task(function* test_expiration_history_observer() {
visitDate: Date.now() * 1000,
transition: Ci.nsINavHistoryService.TRANSITION_LINK
});
Services.obs.notifyObservers(null, 'idle-daily', '');
Services.obs.notifyObservers(null, 'idle-daily');
// And we should receive notifications for both scopes.
yield subChangePromise;

Просмотреть файл

@ -288,7 +288,7 @@ NetworkManager.prototype = {
this.networkInterfaces[networkId] = network;
this.networkInterfaceLinks[networkId] = new NetworkInterfaceLinks();
Services.obs.notifyObservers(network.info, TOPIC_INTERFACE_REGISTERED, null);
Services.obs.notifyObservers(network.info, TOPIC_INTERFACE_REGISTERED);
debug("Network '" + networkId + "' registered.");
},
@ -485,7 +485,7 @@ NetworkManager.prototype = {
delete this.networkInterfaces[networkId];
Services.obs.notifyObservers(network.info, TOPIC_INTERFACE_UNREGISTERED, null);
Services.obs.notifyObservers(network.info, TOPIC_INTERFACE_UNREGISTERED);
debug("Network '" + networkId + "' unregistered.");
},
@ -843,7 +843,7 @@ NetworkManager.prototype = {
this._activeNetwork = this._overriddenActive;
this._setDefaultRouteAndProxy(this._activeNetwork, oldActive);
Services.obs.notifyObservers(this.activeNetworkInfo,
TOPIC_ACTIVE_CHANGED, null);
TOPIC_ACTIVE_CHANGED);
}
return;
}
@ -904,7 +904,7 @@ NetworkManager.prototype = {
.then(() => {
if (this._activeNetwork != oldActive) {
Services.obs.notifyObservers(this.activeNetworkInfo,
TOPIC_ACTIVE_CHANGED, null);
TOPIC_ACTIVE_CHANGED);
}
if (this._manageOfflineStatus) {

Просмотреть файл

@ -30,7 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
var windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDOMWindowUtils);
Services.obs.notifyObservers(null, "child-cc-request", null);
Services.obs.notifyObservers(null, "child-cc-request");
windowUtils.cycleCollect();
// Wait for a while.

Просмотреть файл

@ -41,7 +41,7 @@ function os()
function notify(top)
{
os().notifyObservers(null, top, null);
os().notifyObservers(null, top);
}
/**

Просмотреть файл

@ -76,9 +76,9 @@ function gcWorker() {
// process's main thread. IPDL PContent::CycleCollect is an async message.
// Ordering will be maintained if the postMessage goes via PContent as well,
// but that seems unlikely.)
SpecialPowers.notifyObservers(null, 'child-gc-request', null);
SpecialPowers.notifyObservers(null, 'child-cc-request', null);
SpecialPowers.notifyObservers(null, 'child-gc-request', null);
SpecialPowers.notifyObservers(null, 'child-gc-request');
SpecialPowers.notifyObservers(null, 'child-cc-request');
SpecialPowers.notifyObservers(null, 'child-gc-request');
// (Only send the ping after we set the gc/cc/gc in motion.)
registration.installing.postMessage({ type: 'ping' });
});

Просмотреть файл

@ -3,7 +3,6 @@ addEventListener("DOMContentLoaded", function loaded() {
removeEventListener("DOMContentLoaded", loaded);
var b = document.getElementById("browser");
Services.obs.notifyObservers(b.docShell,
"geckoembed-browser-loaded",
null);
"geckoembed-browser-loaded");
b.loadURI("http://people.mozilla.org/~tmielczarek/iosstart.html");
});

Просмотреть файл

@ -51,7 +51,7 @@ function* do_run_test() {
do_check_eq(Services.cookiemgr.getCookieString(uri2, chan2), "oh=hai");
// Remove cookies and check counts.
Services.obs.notifyObservers(null, "last-pb-context-exited", null);
Services.obs.notifyObservers(null, "last-pb-context-exited");
do_check_eq(Services.cookiemgr.getCookieString(uri1, chan1), null);
do_check_eq(Services.cookiemgr.getCookieString(uri2, chan2), null);
@ -59,7 +59,7 @@ function* do_run_test() {
do_check_eq(Services.cookiemgr.getCookieString(uri2, chan2), "oh=hai");
// Leave private browsing mode and check counts.
Services.obs.notifyObservers(null, "last-pb-context-exited", null);
Services.obs.notifyObservers(null, "last-pb-context-exited");
do_check_eq(Services.cookiemgr.countCookiesFromHost(uri1.host), 1);
do_check_eq(Services.cookiemgr.countCookiesFromHost(uri2.host), 0);
@ -89,7 +89,7 @@ function* do_run_test() {
do_check_eq(Services.cookiemgr.getCookieString(uri2, chan2), null);
// Leave private browsing mode and check counts.
Services.obs.notifyObservers(null, "last-pb-context-exited", null);
Services.obs.notifyObservers(null, "last-pb-context-exited");
do_check_eq(Services.cookiemgr.countCookiesFromHost(uri1.host), 1);
do_check_eq(Services.cookiemgr.countCookiesFromHost(uri2.host), 0);
@ -107,7 +107,7 @@ function* do_run_test() {
do_check_eq(Services.cookiemgr.getCookieString(uri2, chan2), null);
// Leave private browsing mode and check counts.
Services.obs.notifyObservers(null, "last-pb-context-exited", null);
Services.obs.notifyObservers(null, "last-pb-context-exited");
do_check_eq(Services.cookiemgr.countCookiesFromHost(uri1.host), 1);
do_check_eq(Services.cookiemgr.countCookiesFromHost(uri2.host), 0);

Просмотреть файл

@ -54,7 +54,7 @@ function run_test() {
autoConfigCfg.append(test.filename);
autoConfigCfg.copyTo(greD, "autoconfig.cfg");
obsvc.notifyObservers(ps, "prefservice:before-read-userprefs", null);
obsvc.notifyObservers(ps, "prefservice:before-read-userprefs");
for (let prefName in test.prefs) {
do_check_eq(test.prefs[prefName],

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше