From 9e0ecf32c56ae29899fe97bb838e271ace27e743 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Fri, 14 Apr 2017 23:39:17 +0200 Subject: [PATCH] Backed out changeset e1f191aad863 (bug 1356569) --- browser/base/content/utilityOverlay.js | 20 ++++++++-------- browser/components/extensions/ext-windows.js | 10 ++++---- .../components/feeds/WebContentConverter.js | 2 +- .../components/migration/MigrationUtils.jsm | 2 +- browser/components/nsBrowserContentHandler.js | 24 +++++++++---------- browser/components/places/PlacesUIUtils.jsm | 2 +- .../in-content-old/applications.js | 6 ++--- .../in-content-old/tests/browser_bug410900.js | 2 +- .../tests/browser_change_app_handler.js | 2 +- .../preferences/in-content/applications.js | 6 ++--- .../in-content/tests/browser_bug410900.js | 2 +- .../tests/browser_change_app_handler.js | 2 +- .../browser_contentpermissionprompt.js | 2 +- browser/modules/ContentWebRTC.jsm | 2 +- browser/modules/WindowsJumpLists.jsm | 6 ++--- .../provider/PresentationControlService.js | 2 +- .../PresentationSessionChromeScript.js | 2 +- .../test_presentation_device_manager.js | 2 +- .../test_presentation_session_transport.js | 2 +- .../xpcshell/test_tcp_control_channel.js | 2 +- dom/push/Push.js | 2 +- mobile/android/chrome/content/WebrtcUI.js | 4 ++-- .../robocop/testAndroidCastDeviceProvider.js | 2 +- .../browser/browser_clientAuth_ui.js | 2 +- .../downloads/test/unit/test_app_rep.js | 9 ++++--- .../components/extensions/ext-c-identity.js | 2 +- .../extensions/ext-protocolHandlers.js | 2 +- toolkit/components/feeds/FeedProcessor.js | 4 ++-- .../components/passwordmgr/LoginHelper.jsm | 2 +- .../nsUrlClassifierHashCompleter.js | 2 +- .../handling/nsContentDispatchChooser.js | 8 +++---- toolkit/mozapps/update/nsUpdateService.js | 2 +- uriloader/exthandler/nsHandlerService-json.js | 10 ++++---- uriloader/exthandler/nsHandlerService.js | 8 +++---- uriloader/exthandler/tests/mochitest/head.js | 2 +- .../tests/unit/common_test_handlerService.js | 4 ++-- .../tests/unit/test_handlerService.js | 6 +++-- .../tests/unit/test_taskbar_jumplistitems.js | 2 +- xpcom/tests/unit/test_nsIMutableArray.js | 6 ++--- 39 files changed, 92 insertions(+), 87 deletions(-) diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 8c4f11edf4071..1fa6b291dea14 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -309,15 +309,15 @@ function openLinkIn(url, where, params) { createInstance(Ci.nsISupportsPRUint32); userContextIdSupports.data = aUserContextId; - sa.appendElement(wuri); - sa.appendElement(charset); - sa.appendElement(referrerURISupports); - sa.appendElement(aPostData); - sa.appendElement(allowThirdPartyFixupSupports); - sa.appendElement(referrerPolicySupports); - sa.appendElement(userContextIdSupports); - sa.appendElement(aPrincipal); - sa.appendElement(aTriggeringPrincipal); + sa.appendElement(wuri, /* weak =*/ false); + sa.appendElement(charset, /* weak =*/ false); + sa.appendElement(referrerURISupports, /* weak =*/ false); + sa.appendElement(aPostData, /* weak =*/ false); + sa.appendElement(allowThirdPartyFixupSupports, /* weak =*/ false); + sa.appendElement(referrerPolicySupports, /* weak =*/ false); + sa.appendElement(userContextIdSupports, /* weak =*/ false); + sa.appendElement(aPrincipal, /* weak =*/ false); + sa.appendElement(aTriggeringPrincipal, /* weak =*/ false); let features = "chrome,dialog=no,all"; if (aIsPrivate) { @@ -747,7 +747,7 @@ function openPreferences(paneID, extraArgs) { let supportsStringPrefURL = Cc["@mozilla.org/supports-string;1"] .createInstance(Ci.nsISupportsString); supportsStringPrefURL.data = preferencesURL; - windowArguments.appendElement(supportsStringPrefURL); + windowArguments.appendElement(supportsStringPrefURL, /* weak =*/ false); win = Services.ww.openWindow(null, Services.prefs.getCharPref("browser.chromeURL"), "_blank", "chrome,dialog=no,all", windowArguments); diff --git a/browser/components/extensions/ext-windows.js b/browser/components/extensions/ext-windows.js index b856e483217f7..4b0acf59b5af5 100644 --- a/browser/components/extensions/ext-windows.js +++ b/browser/components/extensions/ext-windows.js @@ -123,19 +123,19 @@ this.windows = class extends ExtensionAPI { } createData.incognito = incognito; - args.appendElement(tab); + args.appendElement(tab, /* weak = */ false); } else if (createData.url !== null) { if (Array.isArray(createData.url)) { let array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); for (let url of createData.url) { - array.appendElement(mkstr(url)); + array.appendElement(mkstr(url), /* weak = */ false); } - args.appendElement(array); + args.appendElement(array, /* weak = */ false); } else { - args.appendElement(mkstr(createData.url)); + args.appendElement(mkstr(createData.url), /* weak = */ false); } } else { - args.appendElement(mkstr(aboutNewTabService.newTabURL)); + args.appendElement(mkstr(aboutNewTabService.newTabURL), /* weak = */ false); } let features = ["chrome"]; diff --git a/browser/components/feeds/WebContentConverter.js b/browser/components/feeds/WebContentConverter.js index e5298c7cd5adb..207414e73e484 100644 --- a/browser/components/feeds/WebContentConverter.js +++ b/browser/components/feeds/WebContentConverter.js @@ -437,7 +437,7 @@ WebContentConverterRegistrar.prototype = { let eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"]. getService(Ci.nsIExternalProtocolService); let handlerInfo = eps.getProtocolHandlerInfo(protocol); - handlerInfo.possibleApplicationHandlers.appendElement(handler); + handlerInfo.possibleApplicationHandlers.appendElement(handler, false); // Since the user has agreed to add a new handler, chances are good // that the next time they see a handler of this type, they're going diff --git a/browser/components/migration/MigrationUtils.jsm b/browser/components/migration/MigrationUtils.jsm index 2206823581128..3c0832fcda65c 100644 --- a/browser/components/migration/MigrationUtils.jsm +++ b/browser/components/migration/MigrationUtils.jsm @@ -865,7 +865,7 @@ this.MigrationUtils = Object.freeze({ throw new Error("Unexpected parameter type " + (typeof item) + ": " + item); } } - params.appendElement(comtaminatedVal); + params.appendElement(comtaminatedVal, false); } } else { params = aParams; diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index a72b636359561..617d06a86a672 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -197,20 +197,20 @@ function openWindow(parent, url, target, features, args, noExternalArgs) { var sstring = Components.classes["@mozilla.org/supports-string;1"] .createInstance(nsISupportsString); sstring.data = uri; - uriArray.appendElement(sstring); + uriArray.appendElement(sstring, /* weak = */ false); }); - argArray.appendElement(uriArray); + argArray.appendElement(uriArray, /* weak =*/ false); } else { - argArray.appendElement(null); + argArray.appendElement(null, /* weak =*/ false); } // Pass these as null to ensure that we always trigger the "single URL" // behavior in browser.js's gBrowserInit.onLoad (which handles the window // arguments) - argArray.appendElement(null); // charset - argArray.appendElement(null); // referer - argArray.appendElement(null); // postData - argArray.appendElement(null); // allowThirdPartyFixup + argArray.appendElement(null, /* weak =*/ false); // charset + argArray.appendElement(null, /* weak =*/ false); // referer + argArray.appendElement(null, /* weak =*/ false); // postData + argArray.appendElement(null, /* weak =*/ false); // allowThirdPartyFixup return Services.ww.openWindow(parent, url, target, features, argArray); } @@ -223,7 +223,7 @@ function openPreferences() { .createInstance(Components.interfaces.nsISupportsString); wuri.data = "about:preferences"; - args.appendElement(wuri); + args.appendElement(wuri, /* weak = */ false); Services.ww.openWindow(null, gBrowserContentHandler.chromeURL, "_blank", @@ -251,10 +251,10 @@ function doSearch(searchTerm, cmdLine) { .createInstance(Components.interfaces.nsISupportsString); wuri.data = submission.uri.spec; - args.appendElement(wuri); - args.appendElement(null); - args.appendElement(null); - args.appendElement(submission.postData); + args.appendElement(wuri, /* weak =*/ false); + args.appendElement(null, /* weak =*/ false); + args.appendElement(null, /* weak =*/ false); + args.appendElement(submission.postData, /* weak =*/ false); // XXXbsmedberg: use handURIToExistingBrowser to obey tabbed-browsing // preferences, but need nsIBrowserDOMWindow extensions diff --git a/browser/components/places/PlacesUIUtils.jsm b/browser/components/places/PlacesUIUtils.jsm index 097e265c529eb..b09f00d5b0a41 100644 --- a/browser/components/places/PlacesUIUtils.jsm +++ b/browser/components/places/PlacesUIUtils.jsm @@ -947,7 +947,7 @@ this.PlacesUIUtils = { var uriList = PlacesUtils.toISupportsString(urls.join("|")); var args = Cc["@mozilla.org/array;1"]. createInstance(Ci.nsIMutableArray); - args.appendElement(uriList); + args.appendElement(uriList, /* weak =*/ false); browserWindow = Services.ww.openWindow(aWindow, "chrome://browser/content/browser.xul", null, "chrome,dialog=no,all", args); diff --git a/browser/components/preferences/in-content-old/applications.js b/browser/components/preferences/in-content-old/applications.js index 052c656f6748a..d577aa7b1745c 100644 --- a/browser/components/preferences/in-content-old/applications.js +++ b/browser/components/preferences/in-content-old/applications.js @@ -222,7 +222,7 @@ HandlerInfoWrapper.prototype = { if (possibleApps.getNext().equals(aNewHandler)) return; } - this.possibleApplicationHandlers.appendElement(aNewHandler); + this.possibleApplicationHandlers.appendElement(aNewHandler, false); }, removePossibleApplicationHandler(aHandler) { @@ -572,13 +572,13 @@ FeedHandlerInfo.prototype = { let preferredApp = getLocalHandlerApp(preferredAppFile); let defaultApp = this._defaultApplicationHandler; if (!defaultApp || !defaultApp.equals(preferredApp)) - this._possibleApplicationHandlers.appendElement(preferredApp); + this._possibleApplicationHandlers.appendElement(preferredApp, false); } // Add the registered web handlers. There can be any number of these. var webHandlers = this._converterSvc.getContentHandlers(this.type); for (let webHandler of webHandlers) - this._possibleApplicationHandlers.appendElement(webHandler); + this._possibleApplicationHandlers.appendElement(webHandler, false); return this._possibleApplicationHandlers; }, diff --git a/browser/components/preferences/in-content-old/tests/browser_bug410900.js b/browser/components/preferences/in-content-old/tests/browser_bug410900.js index 1147896f09be2..27882ff7f0028 100644 --- a/browser/components/preferences/in-content-old/tests/browser_bug410900.js +++ b/browser/components/preferences/in-content-old/tests/browser_bug410900.js @@ -16,7 +16,7 @@ function test() { var extps = Cc["@mozilla.org/uriloader/external-protocol-service;1"]. getService(Ci.nsIExternalProtocolService); var info = extps.getProtocolHandlerInfo("apppanetest"); - info.possibleApplicationHandlers.appendElement(handler); + info.possibleApplicationHandlers.appendElement(handler, false); var hserv = Cc["@mozilla.org/uriloader/handler-service;1"]. getService(Ci.nsIHandlerService); diff --git a/browser/components/preferences/in-content-old/tests/browser_change_app_handler.js b/browser/components/preferences/in-content-old/tests/browser_change_app_handler.js index ee761a0286f9b..f66cdfd37b4e7 100644 --- a/browser/components/preferences/in-content-old/tests/browser_change_app_handler.js +++ b/browser/components/preferences/in-content-old/tests/browser_change_app_handler.js @@ -9,7 +9,7 @@ function setupFakeHandler() { let handler = info.possibleLocalHandlers.queryElementAt(0, Ci.nsILocalHandlerApp); let infoToModify = gMimeSvc.getFromTypeAndExtension("text/x-test-handler", null); - infoToModify.possibleApplicationHandlers.appendElement(handler); + infoToModify.possibleApplicationHandlers.appendElement(handler, false); gHandlerSvc.store(infoToModify); } diff --git a/browser/components/preferences/in-content/applications.js b/browser/components/preferences/in-content/applications.js index 017891d767c16..d5fe4b7bf0682 100644 --- a/browser/components/preferences/in-content/applications.js +++ b/browser/components/preferences/in-content/applications.js @@ -224,7 +224,7 @@ HandlerInfoWrapper.prototype = { if (possibleApps.getNext().equals(aNewHandler)) return; } - this.possibleApplicationHandlers.appendElement(aNewHandler); + this.possibleApplicationHandlers.appendElement(aNewHandler, false); }, removePossibleApplicationHandler(aHandler) { @@ -574,13 +574,13 @@ FeedHandlerInfo.prototype = { let preferredApp = getLocalHandlerApp(preferredAppFile); let defaultApp = this._defaultApplicationHandler; if (!defaultApp || !defaultApp.equals(preferredApp)) - this._possibleApplicationHandlers.appendElement(preferredApp); + this._possibleApplicationHandlers.appendElement(preferredApp, false); } // Add the registered web handlers. There can be any number of these. var webHandlers = this._converterSvc.getContentHandlers(this.type); for (let webHandler of webHandlers) - this._possibleApplicationHandlers.appendElement(webHandler); + this._possibleApplicationHandlers.appendElement(webHandler, false); return this._possibleApplicationHandlers; }, diff --git a/browser/components/preferences/in-content/tests/browser_bug410900.js b/browser/components/preferences/in-content/tests/browser_bug410900.js index 06be0d6257f05..e9bc54c664794 100644 --- a/browser/components/preferences/in-content/tests/browser_bug410900.js +++ b/browser/components/preferences/in-content/tests/browser_bug410900.js @@ -16,7 +16,7 @@ function test() { var extps = Cc["@mozilla.org/uriloader/external-protocol-service;1"]. getService(Ci.nsIExternalProtocolService); var info = extps.getProtocolHandlerInfo("apppanetest"); - info.possibleApplicationHandlers.appendElement(handler); + info.possibleApplicationHandlers.appendElement(handler, false); var hserv = Cc["@mozilla.org/uriloader/handler-service;1"]. getService(Ci.nsIHandlerService); diff --git a/browser/components/preferences/in-content/tests/browser_change_app_handler.js b/browser/components/preferences/in-content/tests/browser_change_app_handler.js index d0c39cc6ef035..a87d189e4713c 100644 --- a/browser/components/preferences/in-content/tests/browser_change_app_handler.js +++ b/browser/components/preferences/in-content/tests/browser_change_app_handler.js @@ -9,7 +9,7 @@ function setupFakeHandler() { let handler = info.possibleLocalHandlers.queryElementAt(0, Ci.nsILocalHandlerApp); let infoToModify = gMimeSvc.getFromTypeAndExtension("text/x-test-handler", null); - infoToModify.possibleApplicationHandlers.appendElement(handler); + infoToModify.possibleApplicationHandlers.appendElement(handler, false); gHandlerSvc.store(infoToModify); } diff --git a/browser/components/tests/browser/browser_contentpermissionprompt.js b/browser/components/tests/browser/browser_contentpermissionprompt.js index 469b1fa81d34d..054aa22e83d7c 100644 --- a/browser/components/tests/browser/browser_contentpermissionprompt.js +++ b/browser/components/tests/browser/browser_contentpermissionprompt.js @@ -44,7 +44,7 @@ MockContentPermissionType.prototype = { function MockContentPermissionRequest(typesArray) { this.types = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); for (let type of typesArray) { - this.types.appendElement(type); + this.types.appendElement(type, false); } } diff --git a/browser/modules/ContentWebRTC.jsm b/browser/modules/ContentWebRTC.jsm index d8d2f58f76a67..e1406767bd452 100644 --- a/browser/modules/ContentWebRTC.jsm +++ b/browser/modules/ContentWebRTC.jsm @@ -72,7 +72,7 @@ this.ContentWebRTC = { let allowedDevices = Cc["@mozilla.org/array;1"] .createInstance(Ci.nsIMutableArray); for (let deviceIndex of aMessage.data.devices) - allowedDevices.appendElement(devices[deviceIndex]); + allowedDevices.appendElement(devices[deviceIndex], /* weak =*/ false); Services.obs.notifyObservers(allowedDevices, "getUserMedia:response:allow", callID); break; diff --git a/browser/modules/WindowsJumpLists.jsm b/browser/modules/WindowsJumpLists.jsm index ad7d4bebdb9ac..c2ad908dc7555 100644 --- a/browser/modules/WindowsJumpLists.jsm +++ b/browser/modules/WindowsJumpLists.jsm @@ -279,7 +279,7 @@ this.WinTaskbarJumpList = return; var item = this._getHandlerAppItem(task.title, task.description, task.args, task.iconIndex, null); - items.appendElement(item); + items.appendElement(item, false); }, this); if (items.length > 0) @@ -324,7 +324,7 @@ this.WinTaskbarJumpList = let faviconPageUri = Services.io.newURI(aResult.uri); let shortcut = this._getHandlerAppItem(title, title, aResult.uri, 1, faviconPageUri); - items.appendElement(shortcut); + items.appendElement(shortcut, false); this._frequentHashList.push(aResult.uri); }, this @@ -369,7 +369,7 @@ this.WinTaskbarJumpList = let faviconPageUri = Services.io.newURI(aResult.uri); let shortcut = this._getHandlerAppItem(title, title, aResult.uri, 1, faviconPageUri); - items.appendElement(shortcut); + items.appendElement(shortcut, false); count++; }, this diff --git a/dom/presentation/provider/PresentationControlService.js b/dom/presentation/provider/PresentationControlService.js index 55af6869b5ec4..00d826ebf0526 100644 --- a/dom/presentation/provider/PresentationControlService.js +++ b/dom/presentation/provider/PresentationControlService.js @@ -375,7 +375,7 @@ function ChannelDescription(aInit) { let wrapper = Cc["@mozilla.org/supports-cstring;1"] .createInstance(Ci.nsISupportsCString); wrapper.data = address; - this._tcpAddresses.appendElement(wrapper); + this._tcpAddresses.appendElement(wrapper, false); } this._tcpPort = aInit.tcpPort; diff --git a/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js b/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js index c4f51690ec295..d5cca570129fa 100644 --- a/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js +++ b/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js @@ -51,7 +51,7 @@ const address = Cc["@mozilla.org/supports-cstring;1"] .createInstance(Ci.nsISupportsCString); address.data = "127.0.0.1"; const addresses = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); -addresses.appendElement(address); +addresses.appendElement(address, false); const mockedChannelDescription = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]), diff --git a/dom/presentation/tests/xpcshell/test_presentation_device_manager.js b/dom/presentation/tests/xpcshell/test_presentation_device_manager.js index 492fc37069b6b..8882d5fa3525c 100644 --- a/dom/presentation/tests/xpcshell/test_presentation_device_manager.js +++ b/dom/presentation/tests/xpcshell/test_presentation_device_manager.js @@ -131,7 +131,7 @@ function filterDevice() { let presentationUrls = Cc['@mozilla.org/array;1'].createInstance(Ci.nsIMutableArray); let url = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString); url.data = forbiddenRequestedUrl; - presentationUrls.appendElement(url); + presentationUrls.appendElement(url, false); let devices = manager.getAvailableDevices(presentationUrls); Assert.equal(devices.length, 0, 'expect 0 available device for example.com'); run_next_test(); diff --git a/dom/presentation/tests/xpcshell/test_presentation_session_transport.js b/dom/presentation/tests/xpcshell/test_presentation_session_transport.js index d75d1bfb14936..8e207bc22fdcf 100644 --- a/dom/presentation/tests/xpcshell/test_presentation_session_transport.js +++ b/dom/presentation/tests/xpcshell/test_presentation_session_transport.js @@ -26,7 +26,7 @@ const address = Cc["@mozilla.org/supports-cstring;1"] .createInstance(Ci.nsISupportsCString); address.data = "127.0.0.1"; const addresses = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); -addresses.appendElement(address); +addresses.appendElement(address, false); const serverChannelDescription = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]), diff --git a/dom/presentation/tests/xpcshell/test_tcp_control_channel.js b/dom/presentation/tests/xpcshell/test_tcp_control_channel.js index 844128d0bc5d1..5f3df584d744d 100644 --- a/dom/presentation/tests/xpcshell/test_tcp_control_channel.js +++ b/dom/presentation/tests/xpcshell/test_tcp_control_channel.js @@ -32,7 +32,7 @@ function TestDescription(aType, aTcpAddress, aTcpPort) { let wrapper = Cc["@mozilla.org/supports-cstring;1"] .createInstance(Ci.nsISupportsCString); wrapper.data = address; - this.tcpAddress.appendElement(wrapper); + this.tcpAddress.appendElement(wrapper, false); } this.tcpPort = aTcpPort; } diff --git a/dom/push/Push.js b/dom/push/Push.js index d39837aaab4b2..173a757496a26 100644 --- a/dom/push/Push.js +++ b/dom/push/Push.js @@ -190,7 +190,7 @@ Push.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionType]), }; let typeArray = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); - typeArray.appendElement(type); + typeArray.appendElement(type, false); // create a nsIContentPermissionRequest let request = { diff --git a/mobile/android/chrome/content/WebrtcUI.js b/mobile/android/chrome/content/WebrtcUI.js index 8bfe9da95227f..475d05bd2c05a 100644 --- a/mobile/android/chrome/content/WebrtcUI.js +++ b/mobile/android/chrome/content/WebrtcUI.js @@ -156,13 +156,13 @@ var WebrtcUI = { if (inputs && inputs.audioDevice != undefined) audioId = inputs.audioDevice; if (audioDevices[audioId]) - allowedDevices.appendElement(audioDevices[audioId]); + allowedDevices.appendElement(audioDevices[audioId], /*weak =*/ false); let videoId = 0; if (inputs && inputs.videoSource != undefined) videoId = inputs.videoSource; if (videoDevices[videoId]) { - allowedDevices.appendElement(videoDevices[videoId]); + allowedDevices.appendElement(videoDevices[videoId], /*weak =*/ false); let perms = Services.perms; // Although the lifetime is "session" it will be removed upon // use so it's more of a one-shot. diff --git a/mobile/android/tests/browser/robocop/testAndroidCastDeviceProvider.js b/mobile/android/tests/browser/robocop/testAndroidCastDeviceProvider.js index 7e25975101c56..8b8dd69edc940 100644 --- a/mobile/android/tests/browser/robocop/testAndroidCastDeviceProvider.js +++ b/mobile/android/tests/browser/robocop/testAndroidCastDeviceProvider.js @@ -45,7 +45,7 @@ function TestDescription(aType, aTcpAddress, aTcpPort) { let wrapper = Cc["@mozilla.org/supports-cstring;1"] .createInstance(Ci.nsISupportsCString); wrapper.data = address; - this.tcpAddress.appendElement(wrapper); + this.tcpAddress.appendElement(wrapper, false); } this.tcpPort = aTcpPort; } diff --git a/security/manager/ssl/tests/mochitest/browser/browser_clientAuth_ui.js b/security/manager/ssl/tests/mochitest/browser/browser_clientAuth_ui.js index 8a97cbe5102fd..94243eb9ee16d 100644 --- a/security/manager/ssl/tests/mochitest/browser/browser_clientAuth_ui.js +++ b/security/manager/ssl/tests/mochitest/browser/browser_clientAuth_ui.js @@ -31,7 +31,7 @@ var cert; */ function openClientAuthDialog(cert) { let certList = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); - certList.appendElement(cert); + certList.appendElement(cert, false); let returnVals = Cc["@mozilla.org/hash-property-bag;1"] .createInstance(Ci.nsIWritablePropertyBag2); diff --git a/toolkit/components/downloads/test/unit/test_app_rep.js b/toolkit/components/downloads/test/unit/test_app_rep.js index adfef2f858ad6..e3d53a8f3222c 100644 --- a/toolkit/components/downloads/test/unit/test_app_rep.js +++ b/toolkit/components/downloads/test/unit/test_app_rep.js @@ -330,9 +330,12 @@ add_test(function test_redirect_on_blocklist() { let secman = Services.scriptSecurityManager; let badRedirects = Cc["@mozilla.org/array;1"] .createInstance(Ci.nsIMutableArray); - badRedirects.appendElement(secman.createCodebasePrincipal(exampleURI, {})); - badRedirects.appendElement(secman.createCodebasePrincipal(blocklistedURI, {})); - badRedirects.appendElement(secman.createCodebasePrincipal(whitelistedURI, {})); + badRedirects.appendElement(secman.createCodebasePrincipal(exampleURI, {}), + false); + badRedirects.appendElement(secman.createCodebasePrincipal(blocklistedURI, {}), + false); + badRedirects.appendElement(secman.createCodebasePrincipal(whitelistedURI, {}), + false); gAppRep.queryReputation({ sourceURI: whitelistedURI, referrerURI: exampleURI, diff --git a/toolkit/components/extensions/ext-c-identity.js b/toolkit/components/extensions/ext-c-identity.js index d1902037b0e58..5543773628f77 100644 --- a/toolkit/components/extensions/ext-c-identity.js +++ b/toolkit/components/extensions/ext-c-identity.js @@ -67,7 +67,7 @@ function openOAuthWindow(details, redirectURI) { let supportsStringPrefURL = Cc["@mozilla.org/supports-string;1"] .createInstance(Ci.nsISupportsString); supportsStringPrefURL.data = details.url; - args.appendElement(supportsStringPrefURL); + args.appendElement(supportsStringPrefURL, /* weak =*/ false); let window = Services.ww.openWindow(null, Services.prefs.getCharPref("browser.chromeURL"), diff --git a/toolkit/components/extensions/ext-protocolHandlers.js b/toolkit/components/extensions/ext-protocolHandlers.js index f07fd2b0f2f0a..3dc2207958edd 100644 --- a/toolkit/components/extensions/ext-protocolHandlers.js +++ b/toolkit/components/extensions/ext-protocolHandlers.js @@ -39,7 +39,7 @@ this.protocolHandlers = class extends ExtensionAPI { handler.uriTemplate = handlerConfig.uriTemplate; let protoInfo = protocolService.getProtocolHandlerInfo(handlerConfig.protocol); - protoInfo.possibleApplicationHandlers.appendElement(handler); + protoInfo.possibleApplicationHandlers.appendElement(handler, false); handlerService.store(protoInfo); } } diff --git a/toolkit/components/feeds/FeedProcessor.js b/toolkit/components/feeds/FeedProcessor.js index a40136657b06e..05429d5b37e4c 100644 --- a/toolkit/components/feeds/FeedProcessor.js +++ b/toolkit/components/feeds/FeedProcessor.js @@ -505,7 +505,7 @@ Entry.prototype = { this.enclosures.QueryInterface(Ci.nsIMutableArray); } - this.enclosures.appendElement(new_enc); + this.enclosures.appendElement(new_enc, false); this.__enclosure_map[new_enc.getPropertyAsAString("url")] = new_enc; }, @@ -1533,7 +1533,7 @@ FeedProcessor.prototype = { // off the handle in the browser, and loses track of the interface // on large files. Bug 335638. newProp.QueryInterface(Ci.nsIMutableArray); - newProp.appendElement(obj); + newProp.appendElement(obj, false); // If new object is an nsIFeedContainer, we want to deal with // its member nsIPropertyBag instead. diff --git a/toolkit/components/passwordmgr/LoginHelper.jsm b/toolkit/components/passwordmgr/LoginHelper.jsm index 7c7a76c0b58ff..c63b598e44a1a 100644 --- a/toolkit/components/passwordmgr/LoginHelper.jsm +++ b/toolkit/components/passwordmgr/LoginHelper.jsm @@ -703,7 +703,7 @@ this.LoginHelper = { dataObject = Cc["@mozilla.org/array;1"]. createInstance(Ci.nsIMutableArray); for (let i = 0; i < data.length; i++) { - dataObject.appendElement(data[i]); + dataObject.appendElement(data[i], false); } } else if (typeof(data) == "string") { dataObject = Cc["@mozilla.org/supports-string;1"]. diff --git a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js index 65614d44e0b34..159abc71af400 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js +++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js @@ -685,7 +685,7 @@ HashCompleterRequest.prototype = { req.response.matches.forEach(m => { matches.appendElement( - new FullHashMatch(m.tableName, m.completeHash, m.cacheDuration)); + new FullHashMatch(m.tableName, m.completeHash, m.cacheDuration), false); }); req.callback.completionV4(req.partialHash, req.tableName, diff --git a/toolkit/mozapps/handling/nsContentDispatchChooser.js b/toolkit/mozapps/handling/nsContentDispatchChooser.js index 21a78080535bc..f92e134f578c5 100644 --- a/toolkit/mozapps/handling/nsContentDispatchChooser.js +++ b/toolkit/mozapps/handling/nsContentDispatchChooser.js @@ -56,11 +56,11 @@ nsContentDispatchChooser.prototype = for (let text of arr) { let string = new SupportsString; string.data = text; - params.appendElement(string); + params.appendElement(string, false); } - params.appendElement(aHandler); - params.appendElement(aURI); - params.appendElement(aWindowContext); + params.appendElement(aHandler, false); + params.appendElement(aURI, false); + params.appendElement(aWindowContext, false); var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]. getService(Ci.nsIWindowWatcher); diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index 0fbe5ad864a21..af8b3b36ba99d 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -4577,7 +4577,7 @@ UpdatePrompt.prototype = { if (update) { ary = Cc["@mozilla.org/array;1"]. createInstance(Ci.nsIMutableArray); - ary.appendElement(update); + ary.appendElement(update, /* weak =*/ false); } var win = this._getUpdateWindow(); diff --git a/uriloader/exthandler/nsHandlerService-json.js b/uriloader/exthandler/nsHandlerService-json.js index 9d8566ca42a05..8fd17beb4f30a 100644 --- a/uriloader/exthandler/nsHandlerService-json.js +++ b/uriloader/exthandler/nsHandlerService-json.js @@ -122,7 +122,7 @@ HandlerService.prototype = { for (let handlerNumber of Object.keys(schemes[scheme])) { let handlerApp = this.handlerAppFromSerializable(schemes[scheme][handlerNumber]); if (!this._isInHandlerArray(possibleHandlers, handlerApp)) { - possibleHandlers.appendElement(handlerApp); + possibleHandlers.appendElement(handlerApp, false); } } @@ -167,11 +167,11 @@ HandlerService.prototype = { createInstance(Ci.nsIMutableArray); for (let type of Object.keys(this._store.data.mimetypes)) { let handler = gMIMEService.getFromTypeAndExtension(type, null); - handlers.appendElement(handler); + handlers.appendElement(handler, false); } for (let type of Object.keys(this._store.data.schemes)) { let handler = gExternalProtocolService.getProtocolHandlerInfo(type); - handlers.appendElement(handler); + handlers.appendElement(handler, false); } return handlers.enumerate(); }, @@ -245,7 +245,7 @@ HandlerService.prototype = { } handlerInfo.preferredApplicationHandler = preferHandler; if (preferHandler) { - handlerInfo.possibleApplicationHandlers.appendElement(preferHandler); + handlerInfo.possibleApplicationHandlers.appendElement(preferHandler, false); } if (storedHandlerInfo.possibleHandlers) { @@ -253,7 +253,7 @@ HandlerService.prototype = { let possibleHandler = this.handlerAppFromSerializable(handler); if (possibleHandler && (!preferHandler || !possibleHandler.equals(preferHandler))) { - handlerInfo.possibleApplicationHandlers.appendElement(possibleHandler); + handlerInfo.possibleApplicationHandlers.appendElement(possibleHandler, false); } } } diff --git a/uriloader/exthandler/nsHandlerService.js b/uriloader/exthandler/nsHandlerService.js index f968ce0fdaa4a..503abee99872f 100644 --- a/uriloader/exthandler/nsHandlerService.js +++ b/uriloader/exthandler/nsHandlerService.js @@ -267,7 +267,7 @@ HandlerService.prototype = { handlerApp.name = handlerPrefs.name; if (!this._isInHandlerArray(possibleHandlers, handlerApp)) { - possibleHandlers.appendElement(handlerApp); + possibleHandlers.appendElement(handlerApp, false); } } @@ -515,7 +515,7 @@ HandlerService.prototype = { // include the preferred handler, so check if it's included as we build // the list of handlers, and, if it's not included, add it to the list. if (aPreferredHandler) - aPossibleHandlers.appendElement(aPreferredHandler); + aPossibleHandlers.appendElement(aPreferredHandler, false); var possibleHandlerTargets = this._getTargets(aInfoID, NC_POSSIBLE_APP); @@ -528,7 +528,7 @@ HandlerService.prototype = { let possibleHandler = this._retrieveHandlerApp(possibleHandlerID); if (possibleHandler && (!aPreferredHandler || !possibleHandler.equals(aPreferredHandler))) - aPossibleHandlers.appendElement(possibleHandler); + aPossibleHandlers.appendElement(possibleHandler, false); } }, @@ -1169,7 +1169,7 @@ HandlerService.prototype = { else handler = this._protocolSvc.getProtocolHandlerInfo(type); - aHandlers.appendElement(handler); + aHandlers.appendElement(handler, false); } }, diff --git a/uriloader/exthandler/tests/mochitest/head.js b/uriloader/exthandler/tests/mochitest/head.js index 4d1dc88baa507..3f11e82d0964f 100644 --- a/uriloader/exthandler/tests/mochitest/head.js +++ b/uriloader/exthandler/tests/mochitest/head.js @@ -36,7 +36,7 @@ function createMockedObjects(createHandlerApp) { if (createHandlerApp) { let mockedHandlerApp = createMockedHandlerApp(); internalMockedMIME.description = mockedHandlerApp.detailedDescription; - internalMockedMIME.possibleApplicationHandlers.appendElement(mockedHandlerApp); + internalMockedMIME.possibleApplicationHandlers.appendElement(mockedHandlerApp, false); internalMockedMIME.preferredApplicationHandler = mockedHandlerApp; } diff --git a/uriloader/exthandler/tests/unit/common_test_handlerService.js b/uriloader/exthandler/tests/unit/common_test_handlerService.js index 94de89a5861d5..827674a40d431 100644 --- a/uriloader/exthandler/tests/unit/common_test_handlerService.js +++ b/uriloader/exthandler/tests/unit/common_test_handlerService.js @@ -255,8 +255,8 @@ add_task(function* testPreferHandlerIsTheFirstOrder() { HandlerServiceTestUtils.getBlankHandlerInfo("nonexistent/type2"); handlerInfo2.preferredAction = Ci.nsIHandlerInfo.useHelperApp; handlerInfo2.preferredApplicationHandler = webHandler; - handlerInfo2.possibleApplicationHandlers.appendElement(localHandler); - handlerInfo2.possibleApplicationHandlers.appendElement(webHandler); + handlerInfo2.possibleApplicationHandlers.appendElement(localHandler, false); + handlerInfo2.possibleApplicationHandlers.appendElement(webHandler, false); handlerInfo2.alwaysAskBeforeHandling = false; gHandlerService.store(handlerInfo2); diff --git a/uriloader/exthandler/tests/unit/test_handlerService.js b/uriloader/exthandler/tests/unit/test_handlerService.js index faded9c6f56fa..143a7ec642af8 100644 --- a/uriloader/exthandler/tests/unit/test_handlerService.js +++ b/uriloader/exthandler/tests/unit/test_handlerService.js @@ -301,8 +301,10 @@ function run_test() { // Add two handlers, store the object, re-retrieve it, and make sure it has // two handlers. - possibleHandlersInfo.possibleApplicationHandlers.appendElement(localHandler); - possibleHandlersInfo.possibleApplicationHandlers.appendElement(webHandler); + possibleHandlersInfo.possibleApplicationHandlers.appendElement(localHandler, + false); + possibleHandlersInfo.possibleApplicationHandlers.appendElement(webHandler, + false); handlerSvc.store(possibleHandlersInfo); possibleHandlersInfo = mimeSvc.getFromTypeAndExtension("nonexistent/possible-handlers", null); diff --git a/widget/tests/unit/test_taskbar_jumplistitems.js b/widget/tests/unit/test_taskbar_jumplistitems.js index c3b5ad0c45893..d145683ebdba5 100644 --- a/widget/tests/unit/test_taskbar_jumplistitems.js +++ b/widget/tests/unit/test_taskbar_jumplistitems.js @@ -227,7 +227,7 @@ function test_jumplist() if (notepad.exists()) { handlerApp.executable = notepad; sc.app = handlerApp; - items.appendElement(sc); + items.appendElement(sc, false); var removed = Cc["@mozilla.org/array;1"] .createInstance(Ci.nsIMutableArray); diff --git a/xpcom/tests/unit/test_nsIMutableArray.js b/xpcom/tests/unit/test_nsIMutableArray.js index f9c91a217ed0c..faede386181f1 100644 --- a/xpcom/tests/unit/test_nsIMutableArray.js +++ b/xpcom/tests/unit/test_nsIMutableArray.js @@ -16,7 +16,7 @@ function create_n_element_array(n) for (let i=0; i