From b37617840fa42e8591255ecb3a8ecc4c06b10d41 Mon Sep 17 00:00:00 2001 From: Mark Goodwin Date: Sat, 30 Jan 2016 08:07:38 +0000 Subject: [PATCH 01/18] Bug 1241821 - Create a SecurityReporter component for TLS Error Reports r=mossop, keeler This takes the TLS Error Reporting functionality used in the aboutNetError.xhtml and aboutCertError.xhtml error pages and moves it to its own component. This allows us to make use of this same error reporting functionality from elsewhere. Notably, this allows us to send error reports for issues that occur when loading subresources. The xpcshell test included is in security/manager/ssl/tests because we need to make use of tlsserver functionality from the PSM tests. --- b2g/installer/package-manifest.in | 5 + browser/installer/package-manifest.in | 5 + .../b2gdroid/installer/package-manifest.in | 5 + mobile/android/installer/package-manifest.in | 5 + .../unit/test_toolkit_securityreporter.js | 132 ++++++++++++++++++ security/manager/ssl/tests/unit/xpcshell.ini | 3 + toolkit/components/moz.build | 1 + .../securityreporter/SecurityReporter.js | 112 +++++++++++++++ .../SecurityReporter.manifest | 2 + toolkit/components/securityreporter/moz.build | 16 +++ .../securityreporter/nsISecurityReporter.idl | 14 ++ 11 files changed, 300 insertions(+) create mode 100644 security/manager/ssl/tests/unit/test_toolkit_securityreporter.js create mode 100644 toolkit/components/securityreporter/SecurityReporter.js create mode 100644 toolkit/components/securityreporter/SecurityReporter.manifest create mode 100644 toolkit/components/securityreporter/moz.build create mode 100644 toolkit/components/securityreporter/nsISecurityReporter.idl diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 3a2a2d3d92b..eed3fdcd390 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -325,6 +325,7 @@ @RESPATH@/components/toolkit_finalizationwitness.xpt @RESPATH@/components/toolkit_formautofill.xpt @RESPATH@/components/toolkit_osfile.xpt +@RESPATH@/components/toolkit_securityreporter.xpt #ifdef NIGHTLY_BUILD @RESPATH@/components/toolkit_perfmonitoring.xpt #endif @@ -707,6 +708,10 @@ @RESPATH@/components/PrivateBrowsing.manifest @RESPATH@/components/PrivateBrowsingTrackingProtectionWhitelist.js +; Security Reports +@RESPATH@/components/SecurityReporter.manifest +@RESPATH@/components/SecurityReporter.js + ; Signed Packaged Content @RESPATH@/components/InstallPackagedWebapp.manifest @RESPATH@/components/InstallPackagedWebapp.js diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 631a68c9ada..b2d7d6e4551 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -319,6 +319,7 @@ @RESPATH@/components/toolkit_finalizationwitness.xpt @RESPATH@/components/toolkit_formautofill.xpt @RESPATH@/components/toolkit_osfile.xpt +@RESPATH@/components/toolkit_securityreporter.xpt #ifdef NIGHTLY_BUILD @RESPATH@/components/toolkit_perfmonitoring.xpt #endif @@ -629,6 +630,10 @@ @RESPATH@/components/PrivateBrowsing.manifest @RESPATH@/components/PrivateBrowsingTrackingProtectionWhitelist.js +; Security Reports +@RESPATH@/components/SecurityReporter.manifest +@RESPATH@/components/SecurityReporter.js + ; Signed Packaged Content @RESPATH@/components/InstallPackagedWebapp.manifest @RESPATH@/components/InstallPackagedWebapp.js diff --git a/mobile/android/b2gdroid/installer/package-manifest.in b/mobile/android/b2gdroid/installer/package-manifest.in index 2f214ad0771..983ebc65938 100644 --- a/mobile/android/b2gdroid/installer/package-manifest.in +++ b/mobile/android/b2gdroid/installer/package-manifest.in @@ -251,6 +251,7 @@ @BINPATH@/components/toolkit_finalizationwitness.xpt @BINPATH@/components/toolkit_formautofill.xpt @BINPATH@/components/toolkit_osfile.xpt +@RESPATH@/components/toolkit_securityreporter.xpt #ifdef NIGHTLY_BUILD @BINPATH@/components/toolkit_perfmonitoring.xpt #endif @@ -466,6 +467,10 @@ @BINPATH@/components/url-classifier.xpt #endif +; Security Reports +@RESPATH@/components/SecurityReporter.manifest +@RESPATH@/components/SecurityReporter.js + ; [Browser Chrome Files] @BINPATH@/chrome/browser@JAREXT@ @BINPATH@/chrome/browser.manifest diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 0030384e96b..6c10168cc95 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -228,6 +228,7 @@ @BINPATH@/components/toolkit_finalizationwitness.xpt @BINPATH@/components/toolkit_formautofill.xpt @BINPATH@/components/toolkit_osfile.xpt +@BINPATH@/components/toolkit_securityreporter.xpt #ifdef NIGHTLY_BUILD @BINPATH@/components/toolkit_perfmonitoring.xpt #endif @@ -434,6 +435,10 @@ @BINPATH@/components/PrivateBrowsing.manifest @BINPATH@/components/PrivateBrowsingTrackingProtectionWhitelist.js +; Security Reports +@BINPATH@/components/SecurityReporter.manifest +@BINPATH@/components/SecurityReporter.js + ; [Browser Chrome Files] @BINPATH@/chrome/toolkit@JAREXT@ @BINPATH@/chrome/toolkit.manifest diff --git a/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js b/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js new file mode 100644 index 00000000000..1c7286a6aca --- /dev/null +++ b/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js @@ -0,0 +1,132 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* This test is for the TLS error reporting functionality exposed by + * SecurityReporter.js in /toolkit/components/securityreporter. The test is + * here because we make use of the tlsserver functionality that lives with the + * PSM ssl tests. + * + * The testing here will be augmented by the existing mochitests for the + * error reporting functionality in aboutNetError.xhtml and + * aboutCertError.xhtml once these make use of this component. + */ + +"use strict"; +const CC = Components.Constructor; +const Cm = Components.manager; + +Cu.import("resource://testing-common/AppInfo.jsm"); +updateAppInfo(); + +// We must get the profile before performing operations on the cert db. +do_get_profile(); + +const certdb = Cc["@mozilla.org/security/x509certdb;1"] + .getService(Ci.nsIX509CertDB); +const reporter = Cc["@mozilla.org/securityreporter;1"] + .getService(Ci.nsISecurityReporter); + + +const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1", + "nsIBinaryInputStream", "setInputStream"); + +var server; + +// this allows us to create a callback which checks that a report is as +// expected. +function getReportCheck(expectReport, expectedError) { + return function sendReportWithInfo(transportSecurityInfo) { + // register a path handler on the server + server.registerPathHandler("/submit/sslreports", + function(request, response) { + if (expectReport) { + let report = JSON.parse(readDataFromRequest(request)); + do_check_eq(report.errorCode, expectedError); + response.setStatusLine(null, 201, "Created"); + response.write("Created"); + } else { + do_throw("No report should have been received"); + } + }); + + reporter.reportTLSError(transportSecurityInfo, "example.com", -1); + } +} + +// read the request body from a request +function readDataFromRequest(aRequest) { + if (aRequest.method == "POST" || aRequest.method == "PUT") { + if (aRequest.bodyInputStream) { + let inputStream = new BinaryInputStream(aRequest.bodyInputStream); + let bytes = []; + let available; + + while ((available = inputStream.available()) > 0) { + Array.prototype.push.apply(bytes, inputStream.readByteArray(available)); + } + + return String.fromCharCode.apply(null, bytes); + } + } + return null; +} + +function run_test() { + // start a report server + server = new HttpServer(); + server.start(-1); + + let port = server.identity.primaryPort; + + // Set the reporting URL to ensure any reports are sent to the test server + Services.prefs.setCharPref("security.ssl.errorReporting.url", + `http://localhost:${port}/submit/sslreports`); + // set strict-mode pinning enforcement so we can cause connection failures. + Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2); + + // start a TLS server + add_tls_server_setup("BadCertServer", "bad_certs"); + + // Add a user-specified trust anchor. + addCertFromFile(certdb, "bad_certs/other-test-ca.pem", "CTu,u,u"); + + + // Cause a reportable condition with error reporting disabled. No report + // should be sent. + Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", false); + add_connection_test("expired.example.com", + SEC_ERROR_EXPIRED_CERTIFICATE, null, + getReportCheck(false)); + + // Now enable reporting + add_test(function () { + Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true); + run_next_test(); + }); + + // test calling the component with no transportSecurityInfo. No report should + // be sent even though reporting is enabled. + add_test(function() { + server.registerPathHandler("/submit/sslreports", + function(request, response) { + do_throw("No report should be sent"); + }); + reporter.reportTLSError(null, "example.com", -1); + run_next_test(); + }); + + // Test sending a report with no error. This allows us to check the case + // where there is no failed cert chain + add_connection_test("good.include-subdomains.pinning.example.com", + PRErrorCodeSuccess, null, + getReportCheck(true, PRErrorCodeSuccess)); + + // Test sending a report where there is an error and a failed cert chain. + add_connection_test("expired.example.com", + SEC_ERROR_EXPIRED_CERTIFICATE, null, + getReportCheck(true, SEC_ERROR_EXPIRED_CERTIFICATE)); + + run_next_test(); +} diff --git a/security/manager/ssl/tests/unit/xpcshell.ini b/security/manager/ssl/tests/unit/xpcshell.ini index 3fa90211e95..2270f32ab9f 100644 --- a/security/manager/ssl/tests/unit/xpcshell.ini +++ b/security/manager/ssl/tests/unit/xpcshell.ini @@ -150,3 +150,6 @@ skip-if = toolkit == 'android' || toolkit == 'gonk' run-sequentially = hardcoded ports [test_weak_crypto.js] firefox-appdir = browser + +# The TLS error reporting functionality lives in /toolkit but needs tlsserver +[test_toolkit_securityreporter.js] diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build index 309389fef1b..6923a8d0f60 100644 --- a/toolkit/components/moz.build +++ b/toolkit/components/moz.build @@ -48,6 +48,7 @@ DIRS += [ 'reader', 'remotebrowserutils', 'reflect', + 'securityreporter', 'sqlite', 'startup', 'statusfilter', diff --git a/toolkit/components/securityreporter/SecurityReporter.js b/toolkit/components/securityreporter/SecurityReporter.js new file mode 100644 index 00000000000..9ca1e55466c --- /dev/null +++ b/toolkit/components/securityreporter/SecurityReporter.js @@ -0,0 +1,112 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const { classes: Cc, interfaces: Ci, utils: Cu} = Components; + +Cu.importGlobalProperties(['fetch']); + +const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); +const protocolHandler = Cc["@mozilla.org/network/protocol;1?name=http"] + .getService(Ci.nsIHttpProtocolHandler); +const { Services } = Cu.import("resource://gre/modules/Services.jsm", {}); + +const TLS_ERROR_REPORT_TELEMETRY_SUCCESS = 6; +const TLS_ERROR_REPORT_TELEMETRY_FAILURE = 7; +const HISTOGRAM_ID = "TLS_ERROR_REPORT_UI"; + + +XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils", + "resource://gre/modules/UpdateUtils.jsm"); + +function getDERString(cert) +{ + var length = {}; + var derArray = cert.getRawDER(length); + var derString = ''; + for (var i = 0; i < derArray.length; i++) { + derString += String.fromCharCode(derArray[i]); + } + return derString; +} + +function SecurityReporter() { } + +SecurityReporter.prototype = { + classDescription: "Security reporter component", + classID: Components.ID("{8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b}"), + contractID: "@mozilla.org/securityreporter;1", + QueryInterface: XPCOMUtils.generateQI([Ci.nsISecurityReporter]), + reportTLSError: function(transportSecurityInfo, hostname, port) { + // don't send if there's no transportSecurityInfo (since the report cannot + // contain anything of interest) + if (!transportSecurityInfo) { + return; + } + + // don't send a report if the pref is not enabled + if (!Services.prefs.getBoolPref("security.ssl.errorReporting.enabled")) { + return; + } + + // Don't send a report if the host we're connecting to is the report + // server (otherwise we'll get loops when this fails) + let endpoint = + Services.prefs.getCharPref("security.ssl.errorReporting.url"); + let reportURI = Services.io.newURI(endpoint, null, null); + + if (reportURI.host == hostname) { + return; + } + + // Convert the nsIX509CertList into a format that can be parsed into + // JSON + let asciiCertChain = []; + + if (transportSecurityInfo.failedCertChain) { + let certs = transportSecurityInfo.failedCertChain.getEnumerator(); + while (certs.hasMoreElements()) { + let cert = certs.getNext(); + cert.QueryInterface(Ci.nsIX509Cert); + asciiCertChain.push(btoa(getDERString(cert))); + } + } + + let report = { + hostname: hostname, + port: port, + timestamp: Math.round(Date.now() / 1000), + errorCode: transportSecurityInfo.errorCode, + failedCertChain: asciiCertChain, + userAgent: protocolHandler.userAgent, + version: 1, + build: Services.appinfo.appBuildID, + product: Services.appinfo.name, + channel: UpdateUtils.UpdateChannel + } + + fetch(endpoint, { + method: "POST", + body: JSON.stringify(report), + headers: { + 'Content-Type': 'application/json' + } + }).then(function (aResponse) { + if (!aResponse.ok) { + // request returned non-success status + Services.telemetry.getHistogramById(HISTOGRAM_ID) + .add(TLS_ERROR_REPORT_TELEMETRY_FAILURE); + } else { + Services.telemetry.getHistogramById(HISTOGRAM_ID) + .add(TLS_ERROR_REPORT_TELEMETRY_SUCCESS); + } + }).catch(function (e) { + // error making request to reportURL + Services.telemetry.getHistogramById(HISTOGRAM_ID) + .add(TLS_ERROR_REPORT_TELEMETRY_FAILURE); + }); + } +}; + +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SecurityReporter]); diff --git a/toolkit/components/securityreporter/SecurityReporter.manifest b/toolkit/components/securityreporter/SecurityReporter.manifest new file mode 100644 index 00000000000..d4e080dc7cd --- /dev/null +++ b/toolkit/components/securityreporter/SecurityReporter.manifest @@ -0,0 +1,2 @@ +component {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b} SecurityReporter.js +contract @mozilla.org/securityreporter;1 {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b} diff --git a/toolkit/components/securityreporter/moz.build b/toolkit/components/securityreporter/moz.build new file mode 100644 index 00000000000..447033be2eb --- /dev/null +++ b/toolkit/components/securityreporter/moz.build @@ -0,0 +1,16 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +XPIDL_MODULE = 'toolkit_securityreporter' + +XPIDL_SOURCES += [ + 'nsISecurityReporter.idl', +] + +EXTRA_COMPONENTS += [ + 'SecurityReporter.js', + 'SecurityReporter.manifest', +] diff --git a/toolkit/components/securityreporter/nsISecurityReporter.idl b/toolkit/components/securityreporter/nsISecurityReporter.idl new file mode 100644 index 00000000000..462dd1e480e --- /dev/null +++ b/toolkit/components/securityreporter/nsISecurityReporter.idl @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsITransportSecurityInfo.idl" + +[scriptable, uuid(8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b)] +interface nsISecurityReporter : nsISupports +{ + void reportTLSError(in nsITransportSecurityInfo aSecurityInfo, + in AUTF8String aHostname, + in long aPort); +}; From 0290b6101a6d886b224835720ea4c052ad61b9be Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Sun, 31 Jan 2016 00:44:45 -0800 Subject: [PATCH 02/18] Bug 1237176 - skip dom/media/webspeech/synth/test/test_bfcache.html on Linux and Android for frequent timeouts --- dom/media/webspeech/synth/test/mochitest.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/media/webspeech/synth/test/mochitest.ini b/dom/media/webspeech/synth/test/mochitest.ini index 2136a7f34ac..b4e62a6f226 100644 --- a/dom/media/webspeech/synth/test/mochitest.ini +++ b/dom/media/webspeech/synth/test/mochitest.ini @@ -22,4 +22,5 @@ support-files = [test_global_queue.html] [test_global_queue_cancel.html] [test_global_queue_pause.html] -[test_bfcache.html] \ No newline at end of file +[test_bfcache.html] +skip-if = os == ('linux' || 'android') # bug 1237176 From f5917eaa3bc9c0838e6bbeffd43906c5a82d741b Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Sun, 31 Jan 2016 00:45:03 -0800 Subject: [PATCH 03/18] Bug 992311 - skip test_leaf_layers_partition_browser_window.xul on Linux for frequent timeouts, and adjust the comment to reflect that it's disabled on OS X for timing out, not because of a fixed bug --- layout/base/tests/chrome/chrome.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/base/tests/chrome/chrome.ini b/layout/base/tests/chrome/chrome.ini index 23679c6b775..277c9e62222 100644 --- a/layout/base/tests/chrome/chrome.ini +++ b/layout/base/tests/chrome/chrome.ini @@ -56,7 +56,7 @@ skip-if = buildapp == 'b2g' [test_fixed_bg_scrolling_repaints.html] skip-if = buildapp == 'b2g' [test_leaf_layers_partition_browser_window.xul] -skip-if = (!debug) || (toolkit == "cocoa") || (buildapp == 'b2g') # Disabled on Mac because of Bug 748219 +skip-if = (!debug) || (toolkit == "cocoa") || (os == "linux") || (buildapp == 'b2g') # Disabled on Mac and Linux because of Bug 992311 [test_no_clip_iframe.xul] skip-if = buildapp == 'b2g' [test_passpointerevents.html] From bfecb97afb55dabfc686afe86cc4a7c7a54341e7 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Sun, 31 Jan 2016 00:45:31 -0800 Subject: [PATCH 04/18] Bug 1171255 - disable test_peerConnection_twoAudioVideoStreams.html on Linux debug e10s for frequent hangs --- dom/media/tests/mochitest/mochitest.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini index 4abdca22dc2..bd0ced789f5 100644 --- a/dom/media/tests/mochitest/mochitest.ini +++ b/dom/media/tests/mochitest/mochitest.ini @@ -167,8 +167,8 @@ skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' & [test_peerConnection_twoAudioTracksInOneStream.html] skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g (Bug 1059867), android(Bug 1189784, timeouts on 4.3 emulator) [test_peerConnection_twoAudioVideoStreams.html] -# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator) -skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' +# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1171255 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator) +skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (os == 'linux' && debug && e10s) || android_version == '18' [test_peerConnection_twoAudioVideoStreamsCombined.html] # b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator) skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' From 2fd48a2017653f9050be9d0c656bb15fc4d75731 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Sun, 31 Jan 2016 00:46:18 -0800 Subject: [PATCH 05/18] Bug 1127828 - disable test_peerConnection_twoAudioVideoStreamsCombined.html on Linux debug e10s for frequent hangs --- dom/media/tests/mochitest/mochitest.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini index bd0ced789f5..88d0351dfe0 100644 --- a/dom/media/tests/mochitest/mochitest.ini +++ b/dom/media/tests/mochitest/mochitest.ini @@ -170,8 +170,8 @@ skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' & # b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1171255 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator) skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (os == 'linux' && debug && e10s) || android_version == '18' [test_peerConnection_twoAudioVideoStreamsCombined.html] -# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator) -skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' +# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1127828 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator) +skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (os == 'linux' && debug && e10s) || android_version == '18' [test_peerConnection_twoVideoStreams.html] # b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator) skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' From 3eaa43574602c1e665a23b882cd122958e4395e4 Mon Sep 17 00:00:00 2001 From: Neil Rashbrook Date: Sun, 31 Jan 2016 13:00:44 +0000 Subject: [PATCH 06/18] Bug 374471 Make the noautohide attribute live where supported r=enndeakin --- layout/xul/nsMenuPopupFrame.cpp | 8 ++++++++ layout/xul/nsXULPopupManager.cpp | 35 ++++++++++++++++++++++++++++++++ layout/xul/nsXULPopupManager.h | 8 ++++++++ 3 files changed, 51 insertions(+) diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 0750329eb00..a6fdda78582 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -2101,6 +2101,14 @@ nsMenuPopupFrame::AttributeChanged(int32_t aNameSpaceID, if (aAttribute == nsGkAtoms::left || aAttribute == nsGkAtoms::top) MoveToAttributePosition(); +#ifndef MOZ_GTK2 + if (aAttribute == nsGkAtoms::noautohide) { + nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); + if (pm) + pm->EnableRollup(mContent, !IsNoAutoHide()); + } +#endif + if (aAttribute == nsGkAtoms::label) { // set the label for the titlebar nsView* view = GetView(); diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index 5e36296c2de..92463eda63a 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -1236,6 +1236,41 @@ nsXULPopupManager::HidePopupsInList(const nsTArray &aFrames) SetCaptureState(nullptr); } +void +nsXULPopupManager::EnableRollup(nsIContent* aPopup, bool aShouldRollup) +{ +#ifndef MOZ_GTK + if (aShouldRollup) { + nsMenuChainItem* item = mNoHidePanels; + while (item) { + if (item->Content() == aPopup) { + item->Detach(&mNoHidePanels); + nsIContent* oldmenu = nullptr; + if (mPopups) + oldmenu = mPopups->Content(); + item->SetParent(mPopups); + mPopups = item; + SetCaptureState(oldmenu); + return; + } + item = item->GetParent(); + } + } else { + nsMenuChainItem* item = mPopups; + while (item) { + if (item->Content() == aPopup) { + item->Detach(&mPopups); + item->SetParent(mNoHidePanels); + mNoHidePanels = item; + SetCaptureState(nullptr); + return; + } + item = item->GetParent(); + } + } +#endif +} + bool nsXULPopupManager::IsChildOfDocShell(nsIDocument* aDoc, nsIDocShellTreeItem* aExpected) { diff --git a/layout/xul/nsXULPopupManager.h b/layout/xul/nsXULPopupManager.h index f706183d479..334049bed22 100644 --- a/layout/xul/nsXULPopupManager.h +++ b/layout/xul/nsXULPopupManager.h @@ -484,6 +484,14 @@ public: */ void HidePopupsInDocShell(nsIDocShellTreeItem* aDocShellToHide); + /** + * Enable or disable the dynamic noautohide state of a panel. + * + * aPanel - the panel whose state is to change + * aShouldRollup - whether the panel is no longer noautohide + */ + void EnableRollup(nsIContent* aPopup, bool aShouldRollup); + /** * Execute a menu command from the triggering event aEvent. * From a1b3dc0e5d3cf96bd1cdbb5e196f32c30ad83b8b Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Tue, 5 Jan 2016 10:08:58 +0000 Subject: [PATCH 07/18] Bug 1156742 Part 25: Flip the big switch and wait for the lightning. r=mconley --- modules/libpref/init/all.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 027581ef0a6..e09bbb2e223 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1033,7 +1033,11 @@ pref("print.print_edge_right", 0); pref("print.print_edge_bottom", 0); // Print via the parent process. This is only used when e10s is enabled. +#if defined(XP_WIN) +pref("print.print_via_parent", true); +#else pref("print.print_via_parent", false); +#endif // Pref used by the spellchecker extension to control the // maximum number of misspelled words that will be underlined From a93e22749fe7aef7eb4fe7c39dc6be9a2f4fed67 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 31 Jan 2016 17:12:12 +0200 Subject: [PATCH 08/18] Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj --- accessible/atk/AccessibleWrap.cpp | 8 +-- accessible/atk/nsMaiInterfaceTable.cpp | 4 +- accessible/atk/nsMaiInterfaceText.cpp | 4 +- accessible/base/EventQueue.h | 2 +- accessible/base/NotificationController.h | 4 +- accessible/base/TextRange-inl.h | 2 +- accessible/base/TextRange.cpp | 6 +- accessible/base/TreeWalker.h | 2 +- accessible/ipc/DocAccessibleChild.cpp | 8 +-- accessible/ipc/ProxyAccessible.cpp | 4 +- accessible/mac/mozAccessible.mm | 6 +- accessible/mac/mozTableAccessible.mm | 4 +- accessible/windows/ia2/ia2Accessible.cpp | 2 +- accessible/windows/ia2/ia2AccessibleTable.cpp | 8 +-- .../windows/ia2/ia2AccessibleTableCell.cpp | 4 +- accessible/windows/ia2/ia2AccessibleText.cpp | 2 +- accessible/windows/msaa/AccessibleWrap.cpp | 2 +- accessible/xpcom/xpcAccessibleHyperText.cpp | 2 +- accessible/xpcom/xpcAccessibleSelectable.cpp | 2 +- accessible/xpcom/xpcAccessibleTable.cpp | 8 +-- accessible/xpcom/xpcAccessibleTableCell.cpp | 4 +- docshell/base/nsDocShell.cpp | 6 +- docshell/shistory/nsSHistory.cpp | 2 +- dom/animation/EffectCompositor.cpp | 2 +- dom/animation/KeyframeEffect.cpp | 2 +- dom/base/DOMMatrix.cpp | 4 +- dom/base/File.cpp | 2 +- dom/base/FragmentOrElement.cpp | 18 +++--- dom/base/Navigator.cpp | 2 +- dom/base/nsContentIterator.cpp | 10 +-- dom/base/nsContentList.cpp | 2 +- dom/base/nsContentUtils.cpp | 14 ++-- dom/base/nsDOMMutationObserver.cpp | 10 +-- dom/base/nsDOMMutationObserver.h | 10 +-- dom/base/nsDOMTokenList.cpp | 8 +-- dom/base/nsDocument.cpp | 6 +- dom/base/nsDocumentEncoder.cpp | 10 +-- dom/base/nsFocusManager.cpp | 2 +- dom/base/nsFrameMessageManager.h | 2 +- dom/base/nsIDocument.h | 2 +- dom/base/nsINode.cpp | 8 +-- dom/base/nsLineBreaker.cpp | 6 +- dom/base/nsLineBreaker.h | 4 +- dom/base/nsPerformance.cpp | 2 +- dom/base/nsPlainTextSerializer.h | 4 +- dom/base/nsXHTMLContentSerializer.h | 2 +- dom/bindings/Codegen.py | 8 +-- dom/bluetooth/common/BluetoothService.cpp | 2 +- dom/cache/AutoUtils.cpp | 6 +- dom/cache/Cache.cpp | 4 +- dom/cache/CacheOpChild.cpp | 4 +- dom/cache/CacheOpParent.cpp | 6 +- dom/cache/DBSchema.cpp | 22 +++---- dom/cache/Manager.cpp | 10 +-- dom/cache/ReadStream.cpp | 4 +- dom/cache/TypeUtils.cpp | 6 +- dom/camera/GonkCameraControl.cpp | 12 ++-- dom/canvas/CanvasRenderingContext2D.h | 2 +- dom/canvas/ImageBitmapRenderingContext.cpp | 2 +- dom/events/EventStateManager.cpp | 4 +- dom/events/TextComposition.h | 2 +- dom/fetch/FetchDriver.cpp | 4 +- dom/fetch/InternalHeaders.cpp | 2 +- dom/gamepad/linux/LinuxGamepad.cpp | 2 +- dom/html/HTMLAllCollection.cpp | 2 +- dom/html/HTMLOptionsCollection.cpp | 2 +- dom/html/TimeRanges.cpp | 4 +- dom/html/TimeRanges.h | 2 +- dom/html/nsHTMLContentSink.cpp | 2 +- dom/indexedDB/ActorsParent.cpp | 8 +-- dom/indexedDB/IDBDatabase.cpp | 6 +- dom/indexedDB/Key.cpp | 2 +- dom/ipc/ContentParent.cpp | 6 +- dom/ipc/PreallocatedProcessManager.cpp | 4 +- dom/ipc/TabChild.h | 4 +- dom/media/AudioCaptureStream.cpp | 4 +- dom/media/AudioSegment.cpp | 8 +-- dom/media/AudioSegment.h | 10 +-- dom/media/AudioStream.cpp | 6 +- dom/media/DOMMediaStream.h | 4 +- dom/media/FileBlockCache.h | 2 +- dom/media/GraphDriver.cpp | 2 +- dom/media/GraphDriver.h | 2 +- dom/media/Intervals.h | 2 +- dom/media/MediaCache.cpp | 4 +- dom/media/MediaStreamGraph.cpp | 8 +-- dom/media/TrackUnionStream.cpp | 4 +- dom/media/VideoFrameContainer.cpp | 2 +- dom/media/encoder/OpusTrackEncoder.cpp | 4 +- dom/media/encoder/TrackEncoder.cpp | 4 +- dom/media/encoder/VorbisTrackEncoder.cpp | 4 +- dom/media/gmp/GMPDecryptorChild.cpp | 2 +- dom/media/gtest/TestVorbisTrackEncoder.cpp | 2 +- dom/media/mediasink/DecodedStream.cpp | 6 +- dom/media/mediasink/VideoSink.cpp | 4 +- dom/media/ogg/OggReader.cpp | 8 +-- dom/media/omx/OMXCodecWrapper.cpp | 4 +- .../platforms/agnostic/VorbisDecoder.cpp | 4 +- .../platforms/ffmpeg/FFmpegVideoDecoder.h | 2 +- dom/media/systemservices/MediaUtils.h | 2 +- dom/media/webaudio/AudioBuffer.h | 2 +- dom/media/webaudio/AudioNodeEngine.h | 4 +- .../webaudio/AudioNodeExternalInputStream.cpp | 6 +- dom/media/webaudio/AudioNodeStream.cpp | 8 +-- dom/media/webaudio/AudioNodeStream.h | 2 +- dom/media/webaudio/DelayBuffer.h | 2 +- dom/media/webaudio/WebAudioUtils.cpp | 10 +-- dom/media/webaudio/blink/HRTFElevation.cpp | 4 +- dom/media/webaudio/blink/Reverb.cpp | 4 +- dom/media/webm/WebMDemuxer.cpp | 4 +- dom/media/webrtc/MediaEngineDefault.cpp | 2 +- dom/media/webrtc/MediaEngineWebRTCAudio.cpp | 2 +- .../recognition/SpeechRecognition.cpp | 4 +- .../cocoa/OSXSpeechSynthesizerService.mm | 2 +- dom/media/webspeech/synth/nsSpeechTask.cpp | 2 +- .../webspeech/synth/nsSynthVoiceRegistry.cpp | 2 +- dom/messagechannel/MessagePort.cpp | 4 +- dom/notification/Notification.cpp | 4 +- dom/plugins/base/nsNPAPIPlugin.cpp | 2 +- dom/plugins/base/nsPluginHost.cpp | 4 +- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 +- dom/plugins/base/nsPluginsDirUtils.h | 2 +- dom/plugins/ipc/PluginInstanceChild.cpp | 2 +- dom/plugins/ipc/PluginInstanceParent.cpp | 4 +- dom/plugins/ipc/PluginModuleChild.h | 2 +- dom/power/PowerManager.cpp | 2 +- dom/power/PowerManagerService.cpp | 2 +- dom/quota/ActorsParent.cpp | 4 +- dom/quota/QuotaManager.h | 2 +- dom/svg/SVGLengthList.h | 6 +- dom/voicemail/Voicemail.h | 2 +- dom/workers/Queue.h | 2 +- dom/workers/RuntimeService.cpp | 20 +++--- dom/workers/ServiceWorkerEvents.cpp | 2 +- dom/workers/ServiceWorkerManager.cpp | 4 +- dom/workers/ServiceWorkerManager.h | 2 +- dom/workers/WorkerPrivate.cpp | 8 +-- dom/xbl/nsXBLEventHandler.cpp | 2 +- dom/xbl/nsXBLService.cpp | 4 +- dom/xbl/nsXBLWindowKeyHandler.cpp | 2 +- dom/xslt/xpath/txMozillaXPathTreeWalker.cpp | 2 +- dom/xul/templates/nsTreeRows.h | 2 +- dom/xul/templates/nsXULContentBuilder.cpp | 2 +- dom/xul/templates/nsXULTemplateBuilder.cpp | 2 +- dom/xul/templates/nsXULTreeBuilder.cpp | 2 +- editor/libeditor/nsEditor.cpp | 4 +- .../commandhandler/nsCommandGroup.cpp | 2 +- extensions/cookie/nsPermissionManager.h | 4 +- gfx/2d/StackArray.h | 2 +- gfx/gl/DecomposeIntoNoRepeatTriangles.h | 4 +- gfx/gl/GLContextProviderGLX.cpp | 2 +- gfx/layers/ImageContainer.cpp | 2 +- gfx/layers/ImageContainer.h | 2 +- gfx/layers/LayerTreeInvalidation.cpp | 4 +- gfx/layers/Layers.cpp | 2 +- gfx/layers/basic/BasicLayerManager.cpp | 4 +- gfx/layers/client/CanvasClient.cpp | 4 +- gfx/layers/client/ClientContainerLayer.h | 4 +- gfx/layers/client/ClientLayerManager.h | 4 +- gfx/layers/client/ContentClient.cpp | 2 +- gfx/layers/client/ImageClient.cpp | 4 +- .../composite/AsyncCompositionManager.cpp | 2 +- .../composite/ContainerLayerComposite.cpp | 8 +-- gfx/layers/composite/FPSCounter.h | 4 +- gfx/layers/composite/FrameUniformityData.h | 2 +- .../ipc/CompositableTransactionParent.cpp | 2 +- gfx/layers/ipc/CompositorChild.cpp | 2 +- gfx/layers/ipc/CompositorChild.h | 2 +- gfx/layers/ipc/ImageBridgeChild.cpp | 4 +- gfx/layers/ipc/ImageBridgeParent.cpp | 2 +- gfx/layers/ipc/ImageContainerParent.h | 2 +- gfx/layers/ipc/ShadowLayers.cpp | 4 +- gfx/layers/opengl/CompositorOGL.h | 2 +- gfx/src/nsRegion.cpp | 2 +- gfx/thebes/gfxCoreTextShaper.cpp | 6 +- gfx/thebes/gfxDWriteFontList.cpp | 8 +-- gfx/thebes/gfxFT2FontList.cpp | 2 +- gfx/thebes/gfxFont.cpp | 12 ++-- gfx/thebes/gfxFont.h | 2 +- gfx/thebes/gfxFontEntry.cpp | 6 +- gfx/thebes/gfxFontconfigFonts.cpp | 8 +-- gfx/thebes/gfxFontconfigFonts.h | 2 +- gfx/thebes/gfxFontconfigUtils.cpp | 2 +- gfx/thebes/gfxFontconfigUtils.h | 4 +- gfx/thebes/gfxGraphiteShaper.cpp | 2 +- gfx/thebes/gfxHarfBuzzShaper.cpp | 4 +- gfx/thebes/gfxMacPlatformFontList.mm | 10 +-- gfx/thebes/gfxPlatformFontList.cpp | 8 +-- gfx/thebes/gfxTextRun.cpp | 16 ++--- gfx/thebes/gfxTextRun.h | 2 +- gfx/thebes/gfxWindowsPlatform.cpp | 2 +- hal/gonk/GonkSensor.cpp | 2 +- image/RasterImage.cpp | 2 +- image/decoders/icon/mac/nsIconChannelCocoa.mm | 2 +- image/imgLoader.cpp | 2 +- intl/hyphenation/glue/nsHyphenator.cpp | 2 +- intl/locale/mac/nsDateTimeFormatMac.cpp | 2 +- intl/locale/nsLocaleService.cpp | 2 +- intl/lwbrk/nsJISx4051LineBreaker.cpp | 2 +- intl/lwbrk/nsPangoBreaker.cpp | 2 +- intl/lwbrk/nsUniscribeBreaker.cpp | 4 +- ipc/glue/IPCMessageUtils.h | 4 +- ipc/glue/WindowsMessageLoop.cpp | 2 +- js/xpconnect/src/XPCWrappedNative.cpp | 2 +- layout/base/FrameLayerBuilder.cpp | 10 +-- layout/base/FrameLayerBuilder.h | 4 +- layout/base/PositionedEventTargeting.cpp | 2 +- layout/base/RestyleManager.h | 2 +- layout/base/RestyleTracker.cpp | 4 +- layout/base/RestyleTracker.h | 2 +- layout/base/nsBidiPresUtils.cpp | 4 +- layout/base/nsCSSFrameConstructor.cpp | 10 +-- layout/base/nsCounterManager.cpp | 2 +- layout/base/nsDisplayList.cpp | 14 ++-- layout/base/nsDisplayList.h | 8 +-- layout/base/nsIPresShell.h | 2 +- layout/base/nsLayoutUtils.cpp | 20 +++--- layout/base/nsPresContext.cpp | 2 +- layout/base/nsPresShell.cpp | 12 ++-- layout/base/nsRefreshDriver.cpp | 4 +- layout/base/nsRefreshDriver.h | 6 +- layout/generic/FrameChildList.h | 2 +- layout/generic/MathMLTextRunFactory.cpp | 8 +-- layout/generic/RubyUtils.h | 6 +- layout/generic/nsBlockFrame.cpp | 4 +- layout/generic/nsContainerFrame.cpp | 2 +- layout/generic/nsFlexContainerFrame.cpp | 2 +- layout/generic/nsFontInflationData.cpp | 4 +- layout/generic/nsFrame.cpp | 8 +-- layout/generic/nsFrameState.cpp | 2 +- layout/generic/nsGfxScrollFrame.cpp | 2 +- layout/generic/nsGridContainerFrame.cpp | 4 +- layout/generic/nsHTMLReflowState.cpp | 2 +- layout/generic/nsIFrame.h | 2 +- layout/generic/nsImageMap.h | 2 +- layout/generic/nsPluginFrame.cpp | 2 +- layout/generic/nsRubyBaseContainerFrame.cpp | 6 +- layout/generic/nsSelection.cpp | 2 +- layout/generic/nsTextFrame.cpp | 14 ++-- layout/generic/nsTextFrame.h | 2 +- layout/generic/nsTextRunTransformations.cpp | 10 +-- layout/inspector/inDOMUtils.cpp | 2 +- layout/mathml/nsMathMLChar.cpp | 4 +- layout/mathml/nsMathMLmmultiscriptsFrame.cpp | 2 +- layout/style/CSSStyleSheet.cpp | 2 +- layout/style/CSSStyleSheet.h | 4 +- layout/style/CounterStyleManager.cpp | 4 +- layout/style/Declaration.cpp | 2 +- layout/style/Declaration.h | 2 +- layout/style/FontFace.h | 4 +- layout/style/FontFaceSet.cpp | 2 +- layout/style/Loader.cpp | 2 +- layout/style/Loader.h | 2 +- layout/style/StyleAnimationValue.cpp | 2 +- layout/style/StyleRule.cpp | 2 +- layout/style/nsCSSParser.cpp | 14 ++-- layout/style/nsCSSRuleProcessor.cpp | 8 +-- layout/style/nsCSSValue.cpp | 2 +- layout/style/nsFontFaceUtils.cpp | 4 +- layout/style/nsRuleNode.cpp | 14 ++-- layout/style/nsRuleProcessorData.h | 4 +- layout/style/nsStyleSet.cpp | 6 +- layout/style/nsStyleStruct.h | 8 +-- layout/svg/SVGTextFrame.cpp | 4 +- layout/svg/nsSVGEffects.cpp | 6 +- layout/svg/nsSVGFilterInstance.cpp | 4 +- layout/svg/nsSVGGradientFrame.cpp | 2 +- layout/tables/nsCellMap.cpp | 4 +- layout/tables/nsCellMap.h | 2 +- layout/tables/nsTableFrame.cpp | 4 +- layout/tables/nsTableFrame.h | 4 +- layout/tables/nsTableRowGroupFrame.cpp | 2 +- layout/xul/nsMenuBarFrame.cpp | 2 +- layout/xul/nsMenuBarListener.cpp | 2 +- layout/xul/tree/nsTreeContentView.cpp | 4 +- media/libstagefright/binding/Index.cpp | 2 +- .../binding/include/mp4_demuxer/ByteReader.h | 2 +- .../src/media-conduit/AudioConduit.h | 2 +- .../src/media-conduit/WebrtcGmpVideoCodec.cpp | 2 +- .../media-conduit/WebrtcOMXH264VideoCodec.cpp | 2 +- .../src/mediapipeline/MediaPipeline.cpp | 4 +- .../signaling/test/FakeMediaStreamsImpl.h | 2 +- .../components/build/nsAndroidHistory.h | 6 +- modules/libjar/nsJARProtocolHandler.h | 2 +- modules/libpref/nsPrefBranch.cpp | 2 +- netwerk/base/nsLoadGroup.cpp | 6 +- netwerk/cache/nsCacheService.cpp | 2 +- netwerk/cookie/nsCookieService.cpp | 8 +-- netwerk/sctp/datachannel/DataChannel.h | 4 +- parser/html/nsHtml5DocumentBuilder.h | 2 +- parser/html/nsParserUtils.cpp | 2 +- python/lldbutils/lldbutils/general.py | 2 +- rdf/base/nsCompositeDataSource.cpp | 2 +- rdf/base/nsInMemoryDataSource.cpp | 2 +- rdf/base/nsRDFContentSink.cpp | 4 +- rdf/base/nsRDFXMLSerializer.cpp | 2 +- storage/mozStorageSQLFunctions.cpp | 4 +- .../downloads/nsDownloadManager.cpp | 2 +- toolkit/components/places/History.h | 2 +- toolkit/profile/ProfileUnlockerWin.cpp | 4 +- uriloader/base/nsDocLoader.h | 2 +- .../exthandler/mac/nsOSHelperAppService.mm | 6 +- widget/TextEvents.h | 2 +- widget/TextRange.h | 2 +- widget/TouchEvents.h | 2 +- widget/android/nsAppShell.cpp | 2 +- widget/android/nsWindow.cpp | 6 +- widget/cocoa/NativeKeyBindings.mm | 4 +- widget/cocoa/nsChildView.mm | 2 +- widget/gonk/HwcComposer2D.cpp | 2 +- widget/gtk/nsWindow.cpp | 8 +-- widget/nsNativeTheme.h | 2 +- widget/qt/nsWindow.cpp | 2 +- widget/windows/KeyboardLayout.cpp | 6 +- widget/windows/WinMouseScrollHandler.cpp | 2 +- widget/windows/WinUtils.cpp | 2 +- widget/windows/nsFilePicker.h | 4 +- widget/windows/nsScreenManagerWin.h | 2 +- widget/windows/nsWindow.cpp | 4 +- xpcom/base/CycleCollectedJSRuntime.cpp | 2 +- xpcom/glue/BlockingResourceBase.h | 2 +- xpcom/glue/nsTArray-inl.h | 10 +-- xpcom/glue/nsTArray.h | 58 ++++++++--------- xpcom/glue/nsTArrayForwardDeclare.h | 4 +- xpcom/glue/nsTObserverArray.h | 2 +- xpcom/glue/tests/gtest/TestGCPostBarriers.cpp | 2 +- xpcom/io/nsLocalFileCommon.cpp | 4 +- xpcom/string/nsTStringObsolete.cpp | 2 +- xpcom/tests/TestTArray.cpp | 64 +++++++++---------- xpcom/threads/LazyIdleThread.cpp | 2 +- 330 files changed, 734 insertions(+), 734 deletions(-) diff --git a/accessible/atk/AccessibleWrap.cpp b/accessible/atk/AccessibleWrap.cpp index a0ef188fb2a..dd25b25d7bd 100644 --- a/accessible/atk/AccessibleWrap.cpp +++ b/accessible/atk/AccessibleWrap.cpp @@ -759,7 +759,7 @@ getAttributesCB(AtkObject *aAtkObj) if (!proxy) return nullptr; - nsAutoTArray attrs; + AutoTArray attrs; proxy->Attributes(&attrs); if (attrs.IsEmpty()) return nullptr; @@ -1019,7 +1019,7 @@ refRelationSetCB(AtkObject *aAtkObj) continue; size_t targetCount = targetSets[i].Length(); - nsAutoTArray wrappers; + AutoTArray wrappers; for (size_t j = 0; j < targetCount; j++) wrappers.AppendElement(GetWrapperFor(targetSets[i][j])); @@ -1664,7 +1664,7 @@ AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx) return nullptr; } - nsAutoTArray headerCells; + AutoTArray headerCells; tableCell->ColHeaderCells(&headerCells); if (headerCells.IsEmpty()) { return nullptr; @@ -1698,7 +1698,7 @@ AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx) return nullptr; } - nsAutoTArray headerCells; + AutoTArray headerCells; tableCell->RowHeaderCells(&headerCells); if (headerCells.IsEmpty()) { return nullptr; diff --git a/accessible/atk/nsMaiInterfaceTable.cpp b/accessible/atk/nsMaiInterfaceTable.cpp index 1795f8e12b0..c94815f3c82 100644 --- a/accessible/atk/nsMaiInterfaceTable.cpp +++ b/accessible/atk/nsMaiInterfaceTable.cpp @@ -273,7 +273,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected) { *aSelected = nullptr; - nsAutoTArray cols; + AutoTArray cols; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (accWrap) { accWrap->AsTable()->SelectedColIndices(&cols); @@ -300,7 +300,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected) static gint getSelectedRowsCB(AtkTable *aTable, gint **aSelected) { - nsAutoTArray rows; + AutoTArray rows; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (accWrap) { accWrap->AsTable()->SelectedRowIndices(&rows); diff --git a/accessible/atk/nsMaiInterfaceText.cpp b/accessible/atk/nsMaiInterfaceText.cpp index 0386ef8343f..1982f373091 100644 --- a/accessible/atk/nsMaiInterfaceText.cpp +++ b/accessible/atk/nsMaiInterfaceText.cpp @@ -311,7 +311,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset, return nullptr; } - nsAutoTArray attrs; + AutoTArray attrs; proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset); *aStartOffset = startOffset; *aEndOffset = endOffset; @@ -337,7 +337,7 @@ getDefaultAttributesCB(AtkText *aText) return nullptr; } - nsAutoTArray attrs; + AutoTArray attrs; proxy->DefaultTextAttributes(&attrs); return ConvertToAtkTextAttributeSet(attrs); } diff --git a/accessible/base/EventQueue.h b/accessible/base/EventQueue.h index 01384b844f7..b80cddcbeb4 100644 --- a/accessible/base/EventQueue.h +++ b/accessible/base/EventQueue.h @@ -76,7 +76,7 @@ protected: DocAccessible* mDocument; /** - * Pending events array. Don't make this an nsAutoTArray; we use + * Pending events array. Don't make this an AutoTArray; we use * SwapElements() on it. */ nsTArray > mEvents; diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h index 946b7964f0c..9ae6f7e6aa7 100644 --- a/accessible/base/NotificationController.h +++ b/accessible/base/NotificationController.h @@ -275,7 +275,7 @@ private: /** * A pending accessible tree update notifications for content insertions. - * Don't make this an nsAutoTArray; we use SwapElements() on it. + * Don't make this an AutoTArray; we use SwapElements() on it. */ nsTArray > mContentInsertions; @@ -309,7 +309,7 @@ private: nsTHashtable > mTextHash; /** - * Other notifications like DOM events. Don't make this an nsAutoTArray; we + * Other notifications like DOM events. Don't make this an AutoTArray; we * use SwapElements() on it. */ nsTArray > mNotifications; diff --git a/accessible/base/TextRange-inl.h b/accessible/base/TextRange-inl.h index ab8a4969a43..15bbaa23570 100644 --- a/accessible/base/TextRange-inl.h +++ b/accessible/base/TextRange-inl.h @@ -17,7 +17,7 @@ inline Accessible* TextRange::Container() const { uint32_t pos1 = 0, pos2 = 0; - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; return CommonParent(mStartContainer, mEndContainer, &parents1, &pos1, &parents2, &pos2); } diff --git a/accessible/base/TextRange.cpp b/accessible/base/TextRange.cpp index 5a1afe272f9..c2a69dc59ee 100644 --- a/accessible/base/TextRange.cpp +++ b/accessible/base/TextRange.cpp @@ -24,7 +24,7 @@ TextPoint::operator <(const TextPoint& aPoint) const // Build the chain of parents Accessible* p1 = mContainer; Accessible* p2 = aPoint.mContainer; - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; do { parents1.AppendElement(p1); p1 = p1->Parent(); @@ -76,7 +76,7 @@ TextRange::EmbeddedChildren(nsTArray* aChildren) const Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset); uint32_t pos1 = 0, pos2 = 0; - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; Accessible* container = CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2); @@ -146,7 +146,7 @@ bool TextRange::Crop(Accessible* aContainer) { uint32_t boundaryPos = 0, containerPos = 0; - nsAutoTArray boundaryParents, containerParents; + AutoTArray boundaryParents, containerParents; // Crop the start boundary. Accessible* container = nullptr; diff --git a/accessible/base/TreeWalker.h b/accessible/base/TreeWalker.h index 356a329aef7..72d3f8dbd7c 100644 --- a/accessible/base/TreeWalker.h +++ b/accessible/base/TreeWalker.h @@ -87,7 +87,7 @@ private: DocAccessible* mDoc; Accessible* mContext; nsIContent* mAnchorNode; - nsAutoTArray mStateStack; + AutoTArray mStateStack; int32_t mChildFilter; uint32_t mFlags; }; diff --git a/accessible/ipc/DocAccessibleChild.cpp b/accessible/ipc/DocAccessibleChild.cpp index 0c47835b64b..023cdfbdddf 100644 --- a/accessible/ipc/DocAccessibleChild.cpp +++ b/accessible/ipc/DocAccessibleChild.cpp @@ -1048,7 +1048,7 @@ DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID, { TableCellAccessible* acc = IdToTableCellAccessible(aID); if (acc) { - nsAutoTArray headerCells; + AutoTArray headerCells; acc->ColHeaderCells(&headerCells); aCells->SetCapacity(headerCells.Length()); for (uint32_t i = 0; i < headerCells.Length(); ++i) { @@ -1066,7 +1066,7 @@ DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID, { TableCellAccessible* acc = IdToTableCellAccessible(aID); if (acc) { - nsAutoTArray headerCells; + AutoTArray headerCells; acc->RowHeaderCells(&headerCells); aCells->SetCapacity(headerCells.Length()); for (uint32_t i = 0; i < headerCells.Length(); ++i) { @@ -1368,7 +1368,7 @@ DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID, { TableAccessible* acc = IdToTableAccessible(aID); if (acc) { - nsAutoTArray cells; + AutoTArray cells; acc->SelectedCells(&cells); aCellIDs->SetCapacity(cells.Length()); for (uint32_t i = 0; i < cells.Length(); ++i) { @@ -1529,7 +1529,7 @@ DocAccessibleChild::RecvSelectedItems(const uint64_t& aID, { Accessible* acc = IdToAccessibleSelect(aID); if (acc) { - nsAutoTArray selectedItems; + AutoTArray selectedItems; acc->SelectedItems(&selectedItems); aSelectedItemIDs->SetCapacity(selectedItems.Length()); for (size_t i = 0; i < selectedItems.Length(); ++i) { diff --git a/accessible/ipc/ProxyAccessible.cpp b/accessible/ipc/ProxyAccessible.cpp index 43665c5308d..aad2f03c061 100644 --- a/accessible/ipc/ProxyAccessible.cpp +++ b/accessible/ipc/ProxyAccessible.cpp @@ -778,7 +778,7 @@ ProxyAccessible::TableSelectedRowCount() void ProxyAccessible::TableSelectedCells(nsTArray* aCellIDs) { - nsAutoTArray cellIDs; + AutoTArray cellIDs; Unused << mDoc->SendTableSelectedCells(mID, &cellIDs); aCellIDs->SetCapacity(cellIDs.Length()); for (uint32_t i = 0; i < cellIDs.Length(); ++i) { @@ -857,7 +857,7 @@ ProxyAccessible::AtkTableRowHeader(int32_t aRow) void ProxyAccessible::SelectedItems(nsTArray* aSelectedItems) { - nsAutoTArray itemIDs; + AutoTArray itemIDs; Unused << mDoc->SendSelectedItems(mID, &itemIDs); aSelectedItems->SetCapacity(itemIDs.Length()); for (size_t i = 0; i < itemIDs.Length(); ++i) { diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index 770df417e0e..4426af45b7b 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -420,7 +420,7 @@ ConvertToNSArray(nsTArray& aArray) nsCOMPtr attributes = accWrap->Attributes(); nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness); } else { - nsAutoTArray attrs; + AutoTArray attrs; proxy->Attributes(&attrs); for (size_t i = 0 ; i < attrs.Length() ; i++) { if (attrs.ElementAt(i).Name() == "thickness") { @@ -684,11 +684,11 @@ ConvertToNSArray(nsTArray& aArray) // get the array of children. if (accWrap) { - nsAutoTArray childrenArray; + AutoTArray childrenArray; accWrap->GetUnignoredChildren(&childrenArray); mChildren = ConvertToNSArray(childrenArray); } else if (ProxyAccessible* proxy = [self getProxyAccessible]) { - nsAutoTArray childrenArray; + AutoTArray childrenArray; GetProxyUnignoredChildren(proxy, &childrenArray); mChildren = ConvertToNSArray(childrenArray); } diff --git a/accessible/mac/mozTableAccessible.mm b/accessible/mac/mozTableAccessible.mm index 53381cd2cad..a3612e5bc3b 100644 --- a/accessible/mac/mozTableAccessible.mm +++ b/accessible/mac/mozTableAccessible.mm @@ -207,12 +207,12 @@ return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(), cell->ColExtent())]; if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) { - nsAutoTArray headerCells; + AutoTArray headerCells; cell->RowHeaderCells(&headerCells); return ConvertToNSArray(headerCells); } if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) { - nsAutoTArray headerCells; + AutoTArray headerCells; cell->ColHeaderCells(&headerCells); return ConvertToNSArray(headerCells); } diff --git a/accessible/windows/ia2/ia2Accessible.cpp b/accessible/windows/ia2/ia2Accessible.cpp index f655417800a..ec17b47e222 100644 --- a/accessible/windows/ia2/ia2Accessible.cpp +++ b/accessible/windows/ia2/ia2Accessible.cpp @@ -768,7 +768,7 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges, if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; - nsAutoTArray ranges; + AutoTArray ranges; acc->Document()->SelectionRanges(&ranges); uint32_t len = ranges.Length(); for (uint32_t idx = 0; idx < len; idx++) { diff --git a/accessible/windows/ia2/ia2AccessibleTable.cpp b/accessible/windows/ia2/ia2AccessibleTable.cpp index 79ea2ccaebf..6ac6bbab4e7 100644 --- a/accessible/windows/ia2/ia2AccessibleTable.cpp +++ b/accessible/windows/ia2/ia2AccessibleTable.cpp @@ -371,7 +371,7 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren, if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cellIndices; + AutoTArray cellIndices; mTable->SelectedCellIndices(&cellIndices); uint32_t maxCells = cellIndices.Length(); @@ -663,7 +663,7 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells) if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cells; + AutoTArray cells; mTable->SelectedCells(&cells); if (cells.IsEmpty()) return S_FALSE; @@ -699,7 +699,7 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns) if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray colIndices; + AutoTArray colIndices; mTable->SelectedColIndices(&colIndices); uint32_t maxCols = colIndices.Length(); @@ -729,7 +729,7 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows) if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray rowIndices; + AutoTArray rowIndices; mTable->SelectedRowIndices(&rowIndices); uint32_t maxRows = rowIndices.Length(); diff --git a/accessible/windows/ia2/ia2AccessibleTableCell.cpp b/accessible/windows/ia2/ia2AccessibleTableCell.cpp index 20f0f1ecd7b..e625a70495b 100644 --- a/accessible/windows/ia2/ia2AccessibleTableCell.cpp +++ b/accessible/windows/ia2/ia2AccessibleTableCell.cpp @@ -100,7 +100,7 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles, if (!mTableCell) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cells; + AutoTArray cells; mTableCell->ColHeaderCells(&cells); *aNColumnHeaderCells = cells.Length(); @@ -172,7 +172,7 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles, if (!mTableCell) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cells; + AutoTArray cells; mTableCell->RowHeaderCells(&cells); *aNRowHeaderCells = cells.Length(); diff --git a/accessible/windows/ia2/ia2AccessibleText.cpp b/accessible/windows/ia2/ia2AccessibleText.cpp index d8237370cfc..7f79b110cc4 100644 --- a/accessible/windows/ia2/ia2AccessibleText.cpp +++ b/accessible/windows/ia2/ia2AccessibleText.cpp @@ -61,7 +61,7 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset, int32_t startOffset = 0, endOffset = 0; HRESULT hr; if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { - nsAutoTArray attrs; + AutoTArray attrs; proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset); hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes); } else { diff --git a/accessible/windows/msaa/AccessibleWrap.cpp b/accessible/windows/msaa/AccessibleWrap.cpp index 249784d886e..1fba158128b 100644 --- a/accessible/windows/msaa/AccessibleWrap.cpp +++ b/accessible/windows/msaa/AccessibleWrap.cpp @@ -834,7 +834,7 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren) return E_NOTIMPL; if (IsSelect()) { - nsAutoTArray selectedItems; + AutoTArray selectedItems; if (IsProxy()) { nsTArray proxies; Proxy()->SelectedItems(&proxies); diff --git a/accessible/xpcom/xpcAccessibleHyperText.cpp b/accessible/xpcom/xpcAccessibleHyperText.cpp index 3734ed85180..ade838eca34 100644 --- a/accessible/xpcom/xpcAccessibleHyperText.cpp +++ b/accessible/xpcom/xpcAccessibleHyperText.cpp @@ -371,7 +371,7 @@ xpcAccessibleHyperText::GetSelectionRanges(nsIArray** aRanges) do_CreateInstance(NS_ARRAY_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsAutoTArray ranges; + AutoTArray ranges; Intl()->SelectionRanges(&ranges); uint32_t len = ranges.Length(); for (uint32_t idx = 0; idx < len; idx++) diff --git a/accessible/xpcom/xpcAccessibleSelectable.cpp b/accessible/xpcom/xpcAccessibleSelectable.cpp index 2a09450530e..df63e116c85 100644 --- a/accessible/xpcom/xpcAccessibleSelectable.cpp +++ b/accessible/xpcom/xpcAccessibleSelectable.cpp @@ -21,7 +21,7 @@ xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems) return NS_ERROR_FAILURE; NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!"); - nsAutoTArray items; + AutoTArray items; Intl()->SelectedItems(&items); uint32_t itemCount = items.Length(); diff --git a/accessible/xpcom/xpcAccessibleTable.cpp b/accessible/xpcom/xpcAccessibleTable.cpp index aa6ee8f7646..0787bf73fdf 100644 --- a/accessible/xpcom/xpcAccessibleTable.cpp +++ b/accessible/xpcom/xpcAccessibleTable.cpp @@ -273,7 +273,7 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells) do_CreateInstance(NS_ARRAY_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsAutoTArray cellsArray; + AutoTArray cellsArray; Intl()->SelectedCells(&cellsArray); uint32_t totalCount = cellsArray.Length(); @@ -299,7 +299,7 @@ xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize, if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray cellsArray; + AutoTArray cellsArray; Intl()->SelectedCellIndices(&cellsArray); *aCellsArraySize = cellsArray.Length(); @@ -324,7 +324,7 @@ xpcAccessibleTable::GetSelectedColumnIndices(uint32_t* aColsArraySize, if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray colsArray; + AutoTArray colsArray; Intl()->SelectedColIndices(&colsArray); *aColsArraySize = colsArray.Length(); @@ -349,7 +349,7 @@ xpcAccessibleTable::GetSelectedRowIndices(uint32_t* aRowsArraySize, if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray rowsArray; + AutoTArray rowsArray; Intl()->SelectedRowIndices(&rowsArray); *aRowsArraySize = rowsArray.Length(); diff --git a/accessible/xpcom/xpcAccessibleTableCell.cpp b/accessible/xpcom/xpcAccessibleTableCell.cpp index dfd975bbdb0..e507a88162f 100644 --- a/accessible/xpcom/xpcAccessibleTableCell.cpp +++ b/accessible/xpcom/xpcAccessibleTableCell.cpp @@ -108,7 +108,7 @@ xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells) if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray headerCells; + AutoTArray headerCells; Intl()->ColHeaderCells(&headerCells); nsCOMPtr cells = do_CreateInstance(NS_ARRAY_CONTRACTID); @@ -132,7 +132,7 @@ xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells) if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray headerCells; + AutoTArray headerCells; Intl()->RowHeaderCells(&headerCells); nsCOMPtr cells = do_CreateInstance(NS_ARRAY_CONTRACTID); diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index bce09ed5227..b809aa157db 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -1688,7 +1688,7 @@ nsDocShell::FirePageHideNotification(bool aIsUnload) mTiming->NotifyUnloadEventEnd(); } - nsAutoTArray, 8> kids; + AutoTArray, 8> kids; uint32_t n = mChildList.Length(); kids.SetCapacity(n); for (uint32_t i = 0; i < n; i++) { @@ -4396,7 +4396,7 @@ nsDocShell::RemoveFromSessionHistory() int32_t index = 0; sessionHistory->GetIndex(&index); - nsAutoTArray ids; + AutoTArray ids; ids.AppendElement(mHistoryID); internalHistory->RemoveEntries(ids, index); return NS_OK; @@ -4487,7 +4487,7 @@ nsDocShell::ClearFrameHistory(nsISHEntry* aEntry) int32_t count = 0; shcontainer->GetChildCount(&count); - nsAutoTArray ids; + AutoTArray ids; for (int32_t i = 0; i < count; ++i) { nsCOMPtr child; shcontainer->GetChildAt(i, getter_AddRefs(child)); diff --git a/docshell/shistory/nsSHistory.cpp b/docshell/shistory/nsSHistory.cpp index 6400fe64dbd..94455c4ff41 100644 --- a/docshell/shistory/nsSHistory.cpp +++ b/docshell/shistory/nsSHistory.cpp @@ -1405,7 +1405,7 @@ nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex) nsCOMPtr originalSH; GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH)); nsCOMPtr originalContainer = do_QueryInterface(originalSH); - nsAutoTArray toBeRemovedEntries; + AutoTArray toBeRemovedEntries; if (originalContainer) { nsTArray originalDynDocShellIDs; GetDynamicChildren(originalContainer, originalDynDocShellIDs, true); diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 3c4da5ee63e..fb6af8b0335 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -578,7 +578,7 @@ EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext, nsCSSPropertySet& aPropertiesOverridden) { - nsAutoTArray propertiesToTrack; + AutoTArray propertiesToTrack; { nsCSSPropertySet propertiesToTrackAsSet; for (KeyframeEffectReadOnly* effect : aEffectSet) { diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index 05e106ffd23..51ebd8acc68 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -1405,7 +1405,7 @@ BuildAnimationPropertyListFromKeyframeSequence( { // Convert the object in aIterator to sequence, producing // an array of OffsetIndexedKeyframe objects. - nsAutoTArray keyframes; + AutoTArray keyframes; if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) { aRv.Throw(NS_ERROR_FAILURE); return; diff --git a/dom/base/DOMMatrix.cpp b/dom/base/DOMMatrix.cpp index 47210d96fe9..f30243befd0 100644 --- a/dom/base/DOMMatrix.cpp +++ b/dom/base/DOMMatrix.cpp @@ -267,7 +267,7 @@ template void GetDataFromMatrix(const DOMMatrixReadOnly* aMatrix, T void DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle aResult, ErrorResult& aRv) const { - nsAutoTArray arr; + AutoTArray arr; arr.SetLength(16); GetDataFromMatrix(this, arr.Elements()); JS::Rooted value(aCx); @@ -281,7 +281,7 @@ DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle a void DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle aResult, ErrorResult& aRv) const { - nsAutoTArray arr; + AutoTArray arr; arr.SetLength(16); GetDataFromMatrix(this, arr.Elements()); JS::Rooted value(aCx); diff --git a/dom/base/File.cpp b/dom/base/File.cpp index f252d043d71..a8299523155 100644 --- a/dom/base/File.cpp +++ b/dom/base/File.cpp @@ -259,7 +259,7 @@ Blob::ToFile() already_AddRefed Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const { - nsAutoTArray, 1> blobImpls; + AutoTArray, 1> blobImpls; blobImpls.AppendElement(mImpl); nsAutoString contentType; diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index c51e07f3157..a490e3a9af4 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -308,7 +308,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const // faster for the far more common case of there not being any such // attributes. // Also check for SVG elements which require special handling - nsAutoTArray baseAttrs; + AutoTArray baseAttrs; nsString attr; const nsIContent *elem = this; do { @@ -1328,7 +1328,7 @@ public: } private: - nsAutoTArray, + AutoTArray, SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots; RefPtr mNext; ContentUnbinder* mLast; @@ -1528,11 +1528,11 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode) // nodesToUnpurple contains nodes which will be removed // from the purple buffer if the DOM tree is black. - nsAutoTArray nodesToUnpurple; + AutoTArray nodesToUnpurple; // grayNodes need script traverse, so they aren't removed from // the purple buffer, but are marked to be in black subtree so that // traverse is faster. - nsAutoTArray grayNodes; + AutoTArray grayNodes; bool foundBlack = root->IsBlack(); if (root != currentDoc) { @@ -1598,8 +1598,8 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode) return !NeedsScriptTraverse(aNode); } -nsAutoTArray* gPurpleRoots = nullptr; -nsAutoTArray* gNodesToUnbind = nullptr; +AutoTArray* gPurpleRoots = nullptr; +AutoTArray* gNodesToUnbind = nullptr; void ClearCycleCollectorCleanupData() { @@ -1702,7 +1702,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed) // nodesToClear contains nodes which are either purple or // gray. - nsAutoTArray nodesToClear; + AutoTArray nodesToClear; bool foundBlack = root->IsBlack(); bool domOnlyCycle = false; @@ -1751,7 +1751,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed) root->SetIsPurpleRoot(true); if (domOnlyCycle) { if (!gNodesToUnbind) { - gNodesToUnbind = new nsAutoTArray(); + gNodesToUnbind = new AutoTArray(); } gNodesToUnbind->AppendElement(static_cast(root)); for (uint32_t i = 0; i < nodesToClear.Length(); ++i) { @@ -1763,7 +1763,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed) return true; } else { if (!gPurpleRoots) { - gPurpleRoots = new nsAutoTArray(); + gPurpleRoots = new AutoTArray(); } gPurpleRoots->AppendElement(root); } diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index d63f8efe654..c45fe7c4aa6 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -866,7 +866,7 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv) bool Navigator::Vibrate(uint32_t aDuration) { - nsAutoTArray pattern; + AutoTArray pattern; pattern.AppendElement(aDuration); return Vibrate(pattern); } diff --git a/dom/base/nsContentIterator.cpp b/dom/base/nsContentIterator.cpp index 85dbee07fa5..5bbb604539a 100644 --- a/dom/base/nsContentIterator.cpp +++ b/dom/base/nsContentIterator.cpp @@ -155,7 +155,7 @@ protected: nsCOMPtr mCommonParent; // used by nsContentIterator to cache indices - nsAutoTArray mIndexes; + AutoTArray mIndexes; // used by nsSubtreeIterator to cache indices. Why put them in the base // class? Because otherwise I have to duplicate the routines GetNextSibling @@ -1058,8 +1058,8 @@ nsContentIterator::PositionAt(nsINode* aCurNode) // We can be at ANY node in the sequence. Need to regenerate the array of // indexes back to the root or common parent! - nsAutoTArray oldParentStack; - nsAutoTArray newIndexes; + AutoTArray oldParentStack; + AutoTArray newIndexes; // Get a list of the parents up to the root, then compare the new node with // entries in that array until we find a match (lowest common ancestor). If @@ -1213,8 +1213,8 @@ protected: RefPtr mRange; // these arrays all typically are used and have elements - nsAutoTArray mEndNodes; - nsAutoTArray mEndOffsets; + AutoTArray mEndNodes; + AutoTArray mEndOffsets; }; NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator) diff --git a/dom/base/nsContentList.cpp b/dom/base/nsContentList.cpp index dbf0fb29dfe..e09239b376c 100644 --- a/dom/base/nsContentList.cpp +++ b/dom/base/nsContentList.cpp @@ -548,7 +548,7 @@ nsContentList::GetSupportedNames(unsigned aFlags, nsTArray& aNames) BringSelfUpToDate(true); - nsAutoTArray atoms; + AutoTArray atoms; for (uint32_t i = 0; i < mElements.Length(); ++i) { nsIContent *content = mElements.ElementAt(i); if (content->HasID()) { diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 00cea3a2e4e..86e80fc08a9 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -2286,7 +2286,7 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1, } // Build the chain of parents - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; do { parents1.AppendElement(aNode1); aNode1 = aNode1->GetParentNode(); @@ -2335,7 +2335,7 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1, 0; } - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; nsINode* node1 = aParent1; nsINode* node2 = aParent2; do { @@ -4287,7 +4287,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode, return frag.forget(); } - nsAutoTArray tagStack; + AutoTArray tagStack; nsAutoString uriStr, nameStr; nsCOMPtr content = do_QueryInterface(aContextNode); // just in case we have a text node @@ -6853,7 +6853,7 @@ nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc, int32_t newChildCount = aDest->GetChildCount(); if (newChildCount && nsContentUtils:: HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) { - nsAutoTArray, 50> childNodes; + AutoTArray, 50> childNodes; NS_ASSERTION(newChildCount - aOldChildCount >= 0, "What, some unexpected dom mutation has happened?"); childNodes.SetCapacity(newChildCount - aOldChildCount); @@ -7920,7 +7920,7 @@ nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem, int32_t childCount = 0; aItem->GetChildCount(&childCount); - nsAutoTArray, 8> kids; + AutoTArray, 8> kids; kids.AppendElements(childCount); for (int32_t i = 0; i < childCount; ++i) { aItem->GetChildAt(i, getter_AddRefs(kids[i])); @@ -7945,7 +7945,7 @@ nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem, { int32_t childCount = 0; aItem->GetChildCount(&childCount); - nsAutoTArray, 8> kids; + AutoTArray, 8> kids; kids.AppendElements(childCount); for (int32_t i = 0; i < childCount; ++i) { aItem->GetChildAt(i, getter_AddRefs(kids[i])); @@ -8534,7 +8534,7 @@ private: } } - nsAutoTArray mUnits; + AutoTArray mUnits; nsAutoPtr mNext; StringBuilder* mLast; // mLength is used only in the first StringBuilder object in the linked list. diff --git a/dom/base/nsDOMMutationObserver.cpp b/dom/base/nsDOMMutationObserver.cpp index da89b51cd2a..b801765ca19 100644 --- a/dom/base/nsDOMMutationObserver.cpp +++ b/dom/base/nsDOMMutationObserver.cpp @@ -22,7 +22,7 @@ using mozilla::dom::TreeOrderComparator; using mozilla::dom::Animation; -nsAutoTArray, 4>* +AutoTArray, 4>* nsDOMMutationObserver::sScheduledMutationObservers = nullptr; nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr; @@ -30,7 +30,7 @@ nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr; uint32_t nsDOMMutationObserver::sMutationLevel = 0; uint64_t nsDOMMutationObserver::sCount = 0; -nsAutoTArray, 4>, 4>* +AutoTArray, 4>, 4>* nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr; nsINodeList* @@ -585,7 +585,7 @@ void nsDOMMutationObserver::RescheduleForRun() { if (!sScheduledMutationObservers) { - sScheduledMutationObservers = new nsAutoTArray, 4>; + sScheduledMutationObservers = new AutoTArray, 4>; } bool didInsert = false; @@ -882,7 +882,7 @@ nsDOMMutationObserver::HandleMutationsInternal() nsTArray >* suppressedObservers = nullptr; while (sScheduledMutationObservers) { - nsAutoTArray, 4>* observers = + AutoTArray, 4>* observers = sScheduledMutationObservers; sScheduledMutationObservers = nullptr; for (uint32_t i = 0; i < observers->Length(); ++i) { @@ -995,7 +995,7 @@ nsDOMMutationObserver::AddCurrentlyHandlingObserver(nsDOMMutationObserver* aObse if (!sCurrentlyHandlingObservers) { sCurrentlyHandlingObservers = - new nsAutoTArray, 4>, 4>; + new AutoTArray, 4>, 4>; } while (sCurrentlyHandlingObservers->Length() < aMutationLevel) { diff --git a/dom/base/nsDOMMutationObserver.h b/dom/base/nsDOMMutationObserver.h index b2c6e398160..8ff450d3ad3 100644 --- a/dom/base/nsDOMMutationObserver.h +++ b/dom/base/nsDOMMutationObserver.h @@ -605,7 +605,7 @@ protected: nsClassHashtable > mTransientReceivers; // MutationRecords which are being constructed. - nsAutoTArray mCurrentMutations; + AutoTArray mCurrentMutations; // MutationRecords which will be handed to the callback at the end of // the microtask. RefPtr mFirstPendingMutation; @@ -621,11 +621,11 @@ protected: uint64_t mId; static uint64_t sCount; - static nsAutoTArray, 4>* sScheduledMutationObservers; + static AutoTArray, 4>* sScheduledMutationObservers; static nsDOMMutationObserver* sCurrentObserver; static uint32_t sMutationLevel; - static nsAutoTArray, 4>, 4>* + static AutoTArray, 4>, 4>* sCurrentlyHandlingObservers; }; @@ -740,7 +740,7 @@ private: static nsAutoMutationBatch* sCurrentBatch; nsAutoMutationBatch* mPreviousBatch; - nsAutoTArray mObservers; + AutoTArray mObservers; nsTArray > mRemovedNodes; nsTArray > mAddedNodes; nsINode* mBatchTarget; @@ -907,7 +907,7 @@ private: }; static nsAutoAnimationMutationBatch* sCurrentBatch; - nsAutoTArray mObservers; + AutoTArray mObservers; typedef nsTArray EntryArray; nsClassHashtable, EntryArray> mEntryTable; // List of nodes referred to by mEntryTable so we can sort them diff --git a/dom/base/nsDOMTokenList.cpp b/dom/base/nsDOMTokenList.cpp index 682be1ddb9c..855b8e9c0e5 100644 --- a/dom/base/nsDOMTokenList.cpp +++ b/dom/base/nsDOMTokenList.cpp @@ -134,7 +134,7 @@ nsDOMTokenList::AddInternal(const nsAttrValue* aAttr, } bool oneWasAdded = false; - nsAutoTArray addedClasses; + AutoTArray addedClasses; for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) { const nsString& aToken = aTokens[i]; @@ -175,7 +175,7 @@ nsDOMTokenList::Add(const nsTArray& aTokens, ErrorResult& aError) void nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError) { - nsAutoTArray tokens; + AutoTArray tokens; tokens.AppendElement(aToken); Add(tokens, aError); } @@ -261,7 +261,7 @@ nsDOMTokenList::Remove(const nsTArray& aTokens, ErrorResult& aError) void nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError) { - nsAutoTArray tokens; + AutoTArray tokens; tokens.AppendElement(aToken); Remove(tokens, aError); } @@ -281,7 +281,7 @@ nsDOMTokenList::Toggle(const nsAString& aToken, const bool forceOff = aForce.WasPassed() && !aForce.Value(); bool isPresent = attr && attr->Contains(aToken); - nsAutoTArray tokens; + AutoTArray tokens; (*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length()); if (isPresent) { diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 4dd42523a26..c7c11a43b3a 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3366,7 +3366,7 @@ nsDocument::NodesFromRectHelper(float aX, float aY, if (!rootFrame) return NS_OK; // return nothing to premature XUL callers as a reminder to wait - nsAutoTArray outFrames; + AutoTArray outFrames; nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames, nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC | (aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0)); @@ -11188,7 +11188,7 @@ nsDocument::RestorePreviousFullScreenState() } nsCOMPtr fullScreenDoc = GetFullscreenLeaf(this); - nsAutoTArray exitDocs; + AutoTArray exitDocs; nsIDocument* doc = fullScreenDoc; // Collect all subdocuments. @@ -11805,7 +11805,7 @@ nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest) // order, but we traverse the doctree in a leaf-to-root order, so we save // references to the documents we must dispatch to so that we get the order // as specified. - nsAutoTArray changed; + AutoTArray changed; // Remember the root document, so that if a full-screen document is hidden // we can reset full-screen state in the remaining visible full-screen documents. diff --git a/dom/base/nsDocumentEncoder.cpp b/dom/base/nsDocumentEncoder.cpp index f100a808d65..09b7195b37d 100644 --- a/dom/base/nsDocumentEncoder.cpp +++ b/dom/base/nsDocumentEncoder.cpp @@ -162,11 +162,11 @@ protected: uint32_t mEndDepth; int32_t mStartRootIndex; int32_t mEndRootIndex; - nsAutoTArray mCommonAncestors; - nsAutoTArray mStartNodes; - nsAutoTArray mStartOffsets; - nsAutoTArray mEndNodes; - nsAutoTArray mEndOffsets; + AutoTArray mCommonAncestors; + AutoTArray mStartNodes; + AutoTArray mStartOffsets; + AutoTArray mEndNodes; + AutoTArray mEndOffsets; bool mHaltRangeHint; // Used when context has already been serialized for // table cell selections (where parent is ) diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index 33b5e43c9a8..eb0d5b070e8 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -1370,7 +1370,7 @@ nsFocusManager::GetCommonAncestor(nsPIDOMWindowOuter* aWindow1, nsCOMPtr dsti2 = aWindow2->GetDocShell(); NS_ENSURE_TRUE(dsti2, nullptr); - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; do { parents1.AppendElement(dsti1); nsCOMPtr parentDsti1; diff --git a/dom/base/nsFrameMessageManager.h b/dom/base/nsFrameMessageManager.h index b0215ef32c8..9f38e293bda 100644 --- a/dom/base/nsFrameMessageManager.h +++ b/dom/base/nsFrameMessageManager.h @@ -399,7 +399,7 @@ protected: bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID); nsCOMPtr mGlobal; nsCOMPtr mPrincipal; - nsAutoTArray, 2> mAnonymousGlobalScopes; + AutoTArray, 2> mAnonymousGlobalScopes; static nsDataHashtable* sCachedScripts; static nsScriptCacheCleaner* sScriptCacheCleaner; diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index a8baaec25b2..ee0532da96e 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -1820,7 +1820,7 @@ public: return mObservers; } protected: - nsAutoTArray< nsCOMPtr, 8 > mObservers; + AutoTArray< nsCOMPtr, 8 > mObservers; }; /** diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 9c81089b96c..091df34388d 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -595,7 +595,7 @@ void nsINode::Normalize() { // First collect list of nodes to be removed - nsAutoTArray, 50> nodes; + AutoTArray, 50> nodes; bool canMerge = false; for (nsIContent* node = this->GetFirstChild(); @@ -864,7 +864,7 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const return static_cast(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING); } - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; const nsINode *node1 = &aOtherNode, *node2 = this; @@ -1992,7 +1992,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild, nodeToInsertBefore = nodeToInsertBefore->GetNextSibling(); } - Maybe, 50> > fragChildren; + Maybe, 50> > fragChildren; // Remove the new child from the old parent if one exists nsIContent* newContent = aNewChild->AsContent(); @@ -2702,7 +2702,7 @@ nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult) nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult); if (selectorList) { - FindMatchingElements>(this, + FindMatchingElements>(this, selectorList, *contentList, aResult); diff --git a/dom/base/nsLineBreaker.cpp b/dom/base/nsLineBreaker.cpp index b0e71275fa9..2a2296e3383 100644 --- a/dom/base/nsLineBreaker.cpp +++ b/dom/base/nsLineBreaker.cpp @@ -59,7 +59,7 @@ nsresult nsLineBreaker::FlushCurrentWord() { uint32_t length = mCurrentWord.Length(); - nsAutoTArray breakState; + AutoTArray breakState; if (!breakState.AppendElements(length)) return NS_ERROR_OUT_OF_MEMORY; @@ -187,7 +187,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText, return rv; } - nsAutoTArray breakState; + AutoTArray breakState; if (aSink) { if (!breakState.AppendElements(aLength)) return NS_ERROR_OUT_OF_MEMORY; @@ -368,7 +368,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, u return rv; } - nsAutoTArray breakState; + AutoTArray breakState; if (aSink) { if (!breakState.AppendElements(aLength)) return NS_ERROR_OUT_OF_MEMORY; diff --git a/dom/base/nsLineBreaker.h b/dom/base/nsLineBreaker.h index 012faa62dd1..81c4c334e9b 100644 --- a/dom/base/nsLineBreaker.h +++ b/dom/base/nsLineBreaker.h @@ -206,9 +206,9 @@ private: const char16_t *aTextLimit, uint8_t *aBreakState); - nsAutoTArray mCurrentWord; + AutoTArray mCurrentWord; // All the items that contribute to mCurrentWord - nsAutoTArray mTextItems; + AutoTArray mTextItems; nsIAtom* mCurrentWordLanguage; bool mCurrentWordContainsMixedLang; bool mCurrentWordContainsComplexChar; diff --git a/dom/base/nsPerformance.cpp b/dom/base/nsPerformance.cpp index 27b7f2086e2..08c186247f9 100644 --- a/dom/base/nsPerformance.cpp +++ b/dom/base/nsPerformance.cpp @@ -992,7 +992,7 @@ DOMHighResTimeStamp PerformanceBase::ResolveTimestampFromName(const nsAString& aName, ErrorResult& aRv) { - nsAutoTArray, 1> arr; + AutoTArray, 1> arr; DOMHighResTimeStamp ts; Optional typeParam; nsAutoString str; diff --git a/dom/base/nsPlainTextSerializer.h b/dom/base/nsPlainTextSerializer.h index a154b38321a..acdbff5bae0 100644 --- a/dom/base/nsPlainTextSerializer.h +++ b/dom/base/nsPlainTextSerializer.h @@ -199,10 +199,10 @@ private: RefPtr mElement; // For handling table rows - nsAutoTArray mHasWrittenCellsForRow; + AutoTArray mHasWrittenCellsForRow; // Values gotten in OpenContainer that is (also) needed in CloseContainer - nsAutoTArray mIsInCiteBlockquote; + AutoTArray mIsInCiteBlockquote; // The output data nsAString* mOutputString; diff --git a/dom/base/nsXHTMLContentSerializer.h b/dom/base/nsXHTMLContentSerializer.h index f6041c98b45..6fc7dce6691 100644 --- a/dom/base/nsXHTMLContentSerializer.h +++ b/dom/base/nsXHTMLContentSerializer.h @@ -152,7 +152,7 @@ protected: }; // Stack to store one olState struct per
    . - nsAutoTArray mOLStateStack; + AutoTArray mOLStateStack; bool HasNoChildren(nsIContent* aContent); }; diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 99e4bb77e7e..e8e2947bdc9 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -4474,8 +4474,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None, # reallocation behavior for arrays. In particular, if we use auto # arrays for sequences and have a sequence of elements which are # themselves sequences or have sequences as members, we have a problem. - # In that case, resizing the outermost nsAutoTarray to the right size - # will memmove its elements, but nsAutoTArrays are not memmovable and + # In that case, resizing the outermost AutoTArray to the right size + # will memmove its elements, but AutoTArrays are not memmovable and # hence will end up with pointers to bogus memory, which is bad. To # deal with this, we typically map WebIDL sequences to our Sequence # type, which is in fact memmovable. The one exception is when we're @@ -8389,7 +8389,7 @@ class CGEnumerateHook(CGAbstractBindingMethod): def generate_code(self): return CGGeneric(dedent(""" - nsAutoTArray names; + AutoTArray names; ErrorResult rv; self->GetOwnPropertyNames(cx, names, rv); if (rv.MaybeSetPendingException(cx)) { @@ -10456,7 +10456,7 @@ class CGEnumerateOwnPropertiesViaGetOwnPropertyNames(CGAbstractBindingMethod): def generate_code(self): return CGGeneric(dedent(""" - nsAutoTArray names; + AutoTArray names; ErrorResult rv; self->GetOwnPropertyNames(cx, names, rv); if (rv.MaybeSetPendingException(cx)) { diff --git a/dom/bluetooth/common/BluetoothService.cpp b/dom/bluetooth/common/BluetoothService.cpp index 675649171cb..69888624892 100644 --- a/dom/bluetooth/common/BluetoothService.cpp +++ b/dom/bluetooth/common/BluetoothService.cpp @@ -94,7 +94,7 @@ GetAllBluetoothActors(InfallibleTArray& aActors) MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aActors.IsEmpty()); - nsAutoTArray contentActors; + AutoTArray contentActors; ContentParent::GetAll(contentActors); for (uint32_t contentIndex = 0; diff --git a/dom/cache/AutoUtils.cpp b/dom/cache/AutoUtils.cpp index 1f9c8a52c75..527cb528a73 100644 --- a/dom/cache/AutoUtils.cpp +++ b/dom/cache/AutoUtils.cpp @@ -47,7 +47,7 @@ CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction) return; } - nsAutoTArray fds; + AutoTArray fds; FileDescriptorSetChild* fdSetActor = static_cast(aReadStream.fds().get_PFileDescriptorSetChild()); @@ -107,7 +107,7 @@ CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction) return; } - nsAutoTArray fds; + AutoTArray fds; FileDescriptorSetParent* fdSetActor = static_cast(aReadStream.fds().get_PFileDescriptorSetParent()); @@ -306,7 +306,7 @@ MatchInPutList(InternalRequest* aRequest, RefPtr cachedResponseHeaders = TypeUtils::ToInternalHeaders(cachedResponse.headers()); - nsAutoTArray varyHeaders; + AutoTArray varyHeaders; ErrorResult rv; cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv); MOZ_ALWAYS_TRUE(!rv.Failed()); diff --git a/dom/cache/Cache.cpp b/dom/cache/Cache.cpp index a91e2cb488e..a34ccf47d3a 100644 --- a/dom/cache/Cache.cpp +++ b/dom/cache/Cache.cpp @@ -114,7 +114,7 @@ public: // an Array of Response objects. The following code unwraps these // JS values back to an nsTArray>. - nsAutoTArray, 256> responseList; + AutoTArray, 256> responseList; responseList.SetCapacity(mRequestList.Length()); bool isArray; @@ -571,7 +571,7 @@ Cache::AddAll(const GlobalObject& aGlobal, return promise.forget(); } - nsAutoTArray, 256> fetchList; + AutoTArray, 256> fetchList; fetchList.SetCapacity(aRequestList.Length()); // Begin fetching each request in parallel. For now, if an error occurs just diff --git a/dom/cache/CacheOpChild.cpp b/dom/cache/CacheOpChild.cpp index fdc942abe38..c65a7fe1c65 100644 --- a/dom/cache/CacheOpChild.cpp +++ b/dom/cache/CacheOpChild.cpp @@ -219,7 +219,7 @@ CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid) void CacheOpChild::HandleResponseList(const nsTArray& aResponseList) { - nsAutoTArray, 256> responses; + AutoTArray, 256> responses; responses.SetCapacity(aResponseList.Length()); for (uint32_t i = 0; i < aResponseList.Length(); ++i) { @@ -233,7 +233,7 @@ CacheOpChild::HandleResponseList(const nsTArray& aResponseList) void CacheOpChild::HandleRequestList(const nsTArray& aRequestList) { - nsAutoTArray, 256> requests; + AutoTArray, 256> requests; requests.SetCapacity(aRequestList.Length()); for (uint32_t i = 0; i < aRequestList.Length(); ++i) { diff --git a/dom/cache/CacheOpParent.cpp b/dom/cache/CacheOpParent.cpp index 1077d4e8ab6..b67fbaa774b 100644 --- a/dom/cache/CacheOpParent.cpp +++ b/dom/cache/CacheOpParent.cpp @@ -79,8 +79,8 @@ CacheOpParent::Execute(Manager* aManager) const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs(); const nsTArray& list = args.requestResponseList(); - nsAutoTArray, 256> requestStreamList; - nsAutoTArray, 256> responseStreamList; + AutoTArray, 256> requestStreamList; + AutoTArray, 256> responseStreamList; for (uint32_t i = 0; i < list.Length(); ++i) { requestStreamList.AppendElement( @@ -221,7 +221,7 @@ CacheOpParent::DeserializeCacheStream(const CacheReadStreamOrVoid& aStreamOrVoid } // Option 3: A stream was serialized using normal methods. - nsAutoTArray fds; + AutoTArray fds; if (readStream.fds().type() == OptionalFileDescriptorSet::TPFileDescriptorSetChild) { diff --git a/dom/cache/DBSchema.cpp b/dom/cache/DBSchema.cpp index fa83a268a58..c3a49dea8b0 100644 --- a/dom/cache/DBSchema.cpp +++ b/dom/cache/DBSchema.cpp @@ -588,11 +588,11 @@ DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId, // Delete the bodies explicitly as we need to read out the body IDs // anyway. These body IDs must be deleted one-by-one as content may // still be referencing them invidivually. - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryAll(aConn, aCacheId, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray deletedSecurityIdList; + AutoTArray deletedSecurityIdList; rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut, deletedSecurityIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -720,7 +720,7 @@ CacheMatch(mozIStorageConnection* aConn, CacheId aCacheId, *aFoundResponseOut = false; - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -747,7 +747,7 @@ CacheMatchAll(mozIStorageConnection* aConn, CacheId aCacheId, MOZ_ASSERT(aConn); nsresult rv; - nsAutoTArray matches; + AutoTArray matches; if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) { rv = QueryAll(aConn, aCacheId, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -781,11 +781,11 @@ CachePut(mozIStorageConnection* aConn, CacheId aCacheId, CacheQueryParams params(false, false, false, false, NS_LITERAL_STRING("")); - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray deletedSecurityIdList; + AutoTArray deletedSecurityIdList; rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut, deletedSecurityIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -814,7 +814,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId, *aSuccessOut = false; - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -822,7 +822,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId, return rv; } - nsAutoTArray deletedSecurityIdList; + AutoTArray deletedSecurityIdList; rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut, deletedSecurityIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -845,7 +845,7 @@ CacheKeys(mozIStorageConnection* aConn, CacheId aCacheId, MOZ_ASSERT(aConn); nsresult rv; - nsAutoTArray matches; + AutoTArray matches; if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) { rv = QueryAll(aConn, aCacheId, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -912,7 +912,7 @@ StorageMatch(mozIStorageConnection* aConn, rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray cacheIdList; + AutoTArray cacheIdList; bool hasMoreData = false; while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) { @@ -1218,7 +1218,7 @@ MatchByVaryHeader(mozIStorageConnection* aConn, rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray varyValues; + AutoTArray varyValues; bool hasMoreData = false; while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) { diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp index 4a9f9e0a1c2..0e425035632 100644 --- a/dom/cache/Manager.cpp +++ b/dom/cache/Manager.cpp @@ -74,12 +74,12 @@ public: mozIStorageConnection::TRANSACTION_IMMEDIATE); // Clean up orphaned Cache objects - nsAutoTArray orphanedCacheIdList; + AutoTArray orphanedCacheIdList; nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) { - nsAutoTArray deletedBodyIdList; + AutoTArray deletedBodyIdList; rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -88,7 +88,7 @@ public: } // Clean up orphaned body objects - nsAutoTArray knownBodyIdList; + AutoTArray knownBodyIdList; rv = db::GetKnownBodyIds(aConn, knownBodyIdList); rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList); @@ -1373,7 +1373,7 @@ Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult, const SavedResponse& aSavedResponse, StreamList* aStreamList) { - nsAutoTArray responseList; + AutoTArray responseList; responseList.AppendElement(aSavedResponse); OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList, nsTArray(), aStreamList); @@ -1902,7 +1902,7 @@ Manager::NoteOrphanedBodyIdList(const nsTArray& aDeletedBodyIdList) { NS_ASSERT_OWNINGTHREAD(Manager); - nsAutoTArray deleteNowList; + AutoTArray deleteNowList; deleteNowList.SetCapacity(aDeletedBodyIdList.Length()); for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) { diff --git a/dom/cache/ReadStream.cpp b/dom/cache/ReadStream.cpp index d4a74c0084f..7cdd3d3a765 100644 --- a/dom/cache/ReadStream.cpp +++ b/dom/cache/ReadStream.cpp @@ -222,7 +222,7 @@ ReadStream::Inner::Serialize(CacheReadStream* aReadStreamOut) aReadStreamOut->id() = mId; mControl->SerializeControl(aReadStreamOut); - nsAutoTArray fds; + AutoTArray fds; SerializeInputStream(mStream, aReadStreamOut->params(), fds); mControl->SerializeFds(aReadStreamOut, fds); @@ -451,7 +451,7 @@ ReadStream::Create(const CacheReadStream& aReadStream) } MOZ_ASSERT(control); - nsAutoTArray fds; + AutoTArray fds; control->DeserializeFds(aReadStream, fds); nsCOMPtr stream = diff --git a/dom/cache/TypeUtils.cpp b/dom/cache/TypeUtils.cpp index ad373b26737..dce6909509f 100644 --- a/dom/cache/TypeUtils.cpp +++ b/dom/cache/TypeUtils.cpp @@ -44,7 +44,7 @@ namespace { static bool HasVaryStar(mozilla::dom::InternalHeaders* aHeaders) { - nsAutoTArray varyHeaders; + AutoTArray varyHeaders; ErrorResult rv; aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv); MOZ_ALWAYS_TRUE(!rv.Failed()); @@ -67,7 +67,7 @@ HasVaryStar(mozilla::dom::InternalHeaders* aHeaders) void SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut) { - nsAutoTArray fds; + AutoTArray fds; SerializeInputStream(aStream, aReadStreamOut.params(), fds); PFileDescriptorSetChild* fdSet = nullptr; @@ -94,7 +94,7 @@ ToHeadersEntryList(nsTArray& aOut, InternalHeaders* aHeaders) { MOZ_ASSERT(aHeaders); - nsAutoTArray entryList; + AutoTArray entryList; aHeaders->GetEntries(entryList); for (uint32_t i = 0; i < entryList.Length(); ++i) { diff --git a/dom/camera/GonkCameraControl.cpp b/dom/camera/GonkCameraControl.cpp index 425d46104f4..51aa0000b58 100644 --- a/dom/camera/GonkCameraControl.cpp +++ b/dom/camera/GonkCameraControl.cpp @@ -247,7 +247,7 @@ nsGonkCameraControl::Initialize() DOM_CAMERA_LOGI(" - flash: NOT supported\n"); } - nsAutoTArray sizes; + AutoTArray sizes; mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes); if (sizes.Length() > 0) { mSeparateVideoAndPreviewSizesSupported = true; @@ -264,7 +264,7 @@ nsGonkCameraControl::Initialize() mLastRecorderSize = mCurrentConfiguration.mPreviewSize; } - nsAutoTArray modes; + AutoTArray modes; mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes); if (!modes.IsEmpty()) { nsString mode; @@ -302,7 +302,7 @@ nsGonkCameraControl::~nsGonkCameraControl() nsresult nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig) { - nsAutoTArray supportedSizes; + AutoTArray supportedSizes; Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes); nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes, @@ -923,7 +923,7 @@ nsGonkCameraControl::SetThumbnailSizeImpl(const Size& aSize) uint32_t smallestDeltaIndex = UINT32_MAX; int targetArea = aSize.width * aSize.height; - nsAutoTArray supportedSizes; + AutoTArray supportedSizes; Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes); for (uint32_t i = 0; i < supportedSizes.Length(); ++i) { @@ -1028,7 +1028,7 @@ nsGonkCameraControl::SetPictureSizeImpl(const Size& aSize) return NS_OK; } - nsAutoTArray supportedSizes; + AutoTArray supportedSizes; Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes); Size best; @@ -1727,7 +1727,7 @@ nsGonkCameraControl::SelectCaptureAndPreviewSize(const Size& aPreviewSize, aPreviewSize.width, aPreviewSize.height, aMaxSize.width, aMaxSize.height); - nsAutoTArray sizes; + AutoTArray sizes; nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index e5561cb11b7..444d3b10314 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -1034,7 +1034,7 @@ protected: bool fontExplicitLanguage; }; - nsAutoTArray mStyleStack; + AutoTArray mStyleStack; inline ContextState& CurrentState() { return mStyleStack[mStyleStack.Length() - 1]; diff --git a/dom/canvas/ImageBitmapRenderingContext.cpp b/dom/canvas/ImageBitmapRenderingContext.cpp index b8b079eeb5c..e3009918618 100644 --- a/dom/canvas/ImageBitmapRenderingContext.cpp +++ b/dom/canvas/ImageBitmapRenderingContext.cpp @@ -239,7 +239,7 @@ ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder, imageLayer->SetContainer(imageContainer); } - nsAutoTArray imageList; + AutoTArray imageList; RefPtr image = ClipToIntrinsicSize(); imageList.AppendElement(ImageContainer::NonOwningImage(image)); imageContainer->SetCurrentImages(imageList); diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index bd0c7a11d8e..ae4925f49ca 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -731,7 +731,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, if (modifierMask && (modifierMask == Prefs::ChromeAccessModifierMask() || modifierMask == Prefs::ContentAccessModifierMask())) { - nsAutoTArray accessCharCodes; + AutoTArray accessCharCodes; nsContentUtils::GetAccessKeyCandidates(keyEvent, accessCharCodes); if (HandleAccessKey(aPresContext, accessCharCodes, @@ -1291,7 +1291,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent, // event to. // // NB: the elements of |targets| must be unique, for correctness. - nsAutoTArray, 1> targets; + AutoTArray, 1> targets; if (aEvent->mClass != eTouchEventClass || aEvent->mMessage == eTouchStart) { // If this event only has one target, and it's remote, add it to // the array. diff --git a/dom/events/TextComposition.h b/dom/events/TextComposition.h index f99da8ef09a..103d0b81e2c 100644 --- a/dom/events/TextComposition.h +++ b/dom/events/TextComposition.h @@ -429,7 +429,7 @@ private: */ class TextCompositionArray final : - public nsAutoTArray, 2> + public AutoTArray, 2> { public: // Looking for per native IME context. diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index c05823ed248..21bb9faba18 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -338,7 +338,7 @@ FetchDriver::HttpFetch() // nsCORSListenerProxy. We just inform it which unsafe headers are included // in the request. if (mRequest->Mode() == RequestMode::Cors) { - nsAutoTArray unsafeHeaders; + AutoTArray unsafeHeaders; mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders); nsCOMPtr loadInfo = chan->GetLoadInfo(); loadInfo->SetCorsPreflightInfo(unsafeHeaders, false); @@ -709,7 +709,7 @@ FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const { MOZ_ASSERT(aChannel); - nsAutoTArray headers; + AutoTArray headers; mRequest->Headers()->GetEntries(headers); bool hasAccept = false; for (uint32_t i = 0; i < headers.Length(); ++i) { diff --git a/dom/fetch/InternalHeaders.cpp b/dom/fetch/InternalHeaders.cpp index fccc9fc18f0..e8d1a76e7df 100644 --- a/dom/fetch/InternalHeaders.cpp +++ b/dom/fetch/InternalHeaders.cpp @@ -309,7 +309,7 @@ InternalHeaders::CORSHeaders(InternalHeaders* aHeaders) aHeaders->Get(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result); MOZ_ASSERT(!result.Failed()); - nsAutoTArray exposeNamesArray; + AutoTArray exposeNamesArray; nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ','); while (exposeTokens.hasMoreTokens()) { const nsDependentCSubstring& token = exposeTokens.nextToken(); diff --git a/dom/gamepad/linux/LinuxGamepad.cpp b/dom/gamepad/linux/LinuxGamepad.cpp index 420f277d880..7cc52ec53ed 100644 --- a/dom/gamepad/linux/LinuxGamepad.cpp +++ b/dom/gamepad/linux/LinuxGamepad.cpp @@ -77,7 +77,7 @@ private: struct udev_monitor* mMonitor; guint mMonitorSourceID; // Information about currently connected gamepads. - nsAutoTArray mGamepads; + AutoTArray mGamepads; }; // singleton instance diff --git a/dom/html/HTMLAllCollection.cpp b/dom/html/HTMLAllCollection.cpp index 098fd3ffcf2..ff0c0c2a661 100644 --- a/dom/html/HTMLAllCollection.cpp +++ b/dom/html/HTMLAllCollection.cpp @@ -173,7 +173,7 @@ HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray& aNames // XXXbz this is very similar to nsContentList::GetSupportedNames, // but has to check IsAllNamedElement for the name case. - nsAutoTArray atoms; + AutoTArray atoms; for (uint32_t i = 0; i < Length(); ++i) { nsIContent *content = Item(i); if (content->HasID()) { diff --git a/dom/html/HTMLOptionsCollection.cpp b/dom/html/HTMLOptionsCollection.cpp index b4611aaf497..1435706179b 100644 --- a/dom/html/HTMLOptionsCollection.cpp +++ b/dom/html/HTMLOptionsCollection.cpp @@ -287,7 +287,7 @@ HTMLOptionsCollection::GetSupportedNames(unsigned aFlags, return; } - nsAutoTArray atoms; + AutoTArray atoms; for (uint32_t i = 0; i < mElements.Length(); ++i) { HTMLOptionElement* content = mElements.ElementAt(i); if (content) { diff --git a/dom/html/TimeRanges.cpp b/dom/html/TimeRanges.cpp index c817b53e203..debb81a2fa9 100644 --- a/dom/html/TimeRanges.cpp +++ b/dom/html/TimeRanges.cpp @@ -112,7 +112,7 @@ void TimeRanges::Normalize(double aTolerance) { if (mRanges.Length() >= 2) { - nsAutoTArray normalized; + AutoTArray normalized; mRanges.Sort(CompareTimeRanges()); @@ -147,7 +147,7 @@ TimeRanges::Union(const TimeRanges* aOtherRanges, double aTolerance) void TimeRanges::Intersection(const TimeRanges* aOtherRanges) { - nsAutoTArray intersection; + AutoTArray intersection; const nsTArray& otherRanges = aOtherRanges->mRanges; for (index_type i = 0, j = 0; i < mRanges.Length() && j < otherRanges.Length();) { diff --git a/dom/html/TimeRanges.h b/dom/html/TimeRanges.h index 5e9bb6f0047..306fe3ff0b8 100644 --- a/dom/html/TimeRanges.h +++ b/dom/html/TimeRanges.h @@ -93,7 +93,7 @@ private: } }; - nsAutoTArray mRanges; + AutoTArray mRanges; nsCOMPtr mParent; diff --git a/dom/html/nsHTMLContentSink.cpp b/dom/html/nsHTMLContentSink.cpp index 3a3b1c43d87..5be802274ed 100644 --- a/dom/html/nsHTMLContentSink.cpp +++ b/dom/html/nsHTMLContentSink.cpp @@ -160,7 +160,7 @@ protected: RefPtr mBody; RefPtr mHead; - nsAutoTArray mContextStack; + AutoTArray mContextStack; SinkContext* mCurrentContext; SinkContext* mHeadContext; diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 0fd28e1a9ca..3f2faa0bfa6 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -16352,10 +16352,10 @@ QuotaClient::InitOrigin(PersistenceType aPersistenceType, // are database files then we need to cleanup stored files (if it's needed) // and also get the usage. - nsAutoTArray subdirsToProcess; + AutoTArray subdirsToProcess; nsTArray> unknownFiles; nsTHashtable validSubdirs(20); - nsAutoTArray initInfos; + AutoTArray initInfos; nsCOMPtr entries; rv = directory->GetDirectoryEntries(getter_AddRefs(entries)); @@ -18217,7 +18217,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob( aInfo->mData.SwapElements(uncompressed); if (!aFileIds.IsVoid()) { - nsAutoTArray array; + AutoTArray array; nsresult rv = ConvertFileIdsToArray(aFileIds, array); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; @@ -23344,7 +23344,7 @@ UpdateIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues, const IndexMetadata& metadata = mOp->mMetadata; const int64_t& objectStoreId = mOp->mObjectStoreId; - nsAutoTArray updateInfos; + AutoTArray updateInfos; rv = IDBObjectStore::AppendIndexUpdateInfo(metadata.id(), metadata.keyPath(), metadata.unique(), diff --git a/dom/indexedDB/IDBDatabase.cpp b/dom/indexedDB/IDBDatabase.cpp index e9fb101b58e..c7ec6ecd30f 100644 --- a/dom/indexedDB/IDBDatabase.cpp +++ b/dom/indexedDB/IDBDatabase.cpp @@ -667,7 +667,7 @@ IDBDatabase::Transaction(const StringOrStringSequence& aStoreNames, return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR; } - nsAutoTArray stackSequence; + AutoTArray stackSequence; if (aStoreNames.IsString()) { stackSequence.AppendElement(aStoreNames.GetAsString()); @@ -848,8 +848,8 @@ IDBDatabase::AbortTransactions(bool aShouldWarn) class MOZ_STACK_CLASS Helper final { - typedef nsAutoTArray, 20> StrongTransactionArray; - typedef nsAutoTArray WeakTransactionArray; + typedef AutoTArray, 20> StrongTransactionArray; + typedef AutoTArray WeakTransactionArray; public: static void diff --git a/dom/indexedDB/Key.cpp b/dom/indexedDB/Key.cpp index fe3c8d4f1b1..c7fd28048c2 100644 --- a/dom/indexedDB/Key.cpp +++ b/dom/indexedDB/Key.cpp @@ -470,7 +470,7 @@ Key::EncodeLocaleString(const nsDependentString& aString, uint8_t aTypeOffset, } MOZ_ASSERT(collator); - nsAutoTArray keyBuffer; + AutoTArray keyBuffer; int32_t sortKeyLength = ucol_getSortKey(collator, ustr, length, keyBuffer.Elements(), keyBuffer.Length()); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 5cfaaddebd0..79c37ba4151 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -607,7 +607,7 @@ ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb, nsISupports* aClosure, bool aAnonymize) { - nsAutoTArray cps; + AutoTArray cps; ContentParent::GetAllEvenIfDead(cps); for (uint32_t i = 0; i < cps.Length(); i++) { @@ -911,7 +911,7 @@ ContentParent::JoinAllSubprocesses() { MOZ_ASSERT(NS_IsMainThread()); - nsAutoTArray processes; + AutoTArray processes; GetAll(processes); if (processes.IsEmpty()) { printf_stderr("There are no live subprocesses."); @@ -5145,7 +5145,7 @@ ContentParent::IgnoreIPCPrincipal() void ContentParent::NotifyUpdatedDictionaries() { - nsAutoTArray processes; + AutoTArray processes; GetAll(processes); nsCOMPtr spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID)); diff --git a/dom/ipc/PreallocatedProcessManager.cpp b/dom/ipc/PreallocatedProcessManager.cpp index 8bce3dc1a32..46c12f65780 100644 --- a/dom/ipc/PreallocatedProcessManager.cpp +++ b/dom/ipc/PreallocatedProcessManager.cpp @@ -71,8 +71,8 @@ private: CancelableTask* mPreallocateAppProcessTask; // The array containing the preallocated processes. 4 as the inline storage size - // should be enough so we don't need to grow the nsAutoTArray. - nsAutoTArray, 4> mSpareProcesses; + // should be enough so we don't need to grow the AutoTArray. + AutoTArray, 4> mSpareProcesses; // Nuwa process is ready for creating new process. bool mIsNuwaReady; diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index b403e39d2a8..42af6977f05 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -706,7 +706,7 @@ private: // Whether we have already received a FileDescriptor for the app package. bool mAppPackageFileDescriptorRecved; // At present only 1 of these is really expected. - nsAutoTArray, 1> + AutoTArray, 1> mCachedFileDescriptorInfos; nscolor mLastBackgroundColor; bool mDidFakeShow; @@ -734,7 +734,7 @@ private: CSSSize mUnscaledInnerSize; bool mDidSetRealShowInfo; - nsAutoTArray mAudioChannelsActive; + AutoTArray mAudioChannelsActive; DISALLOW_EVIL_CONSTRUCTORS(TabChild); }; diff --git a/dom/media/AudioCaptureStream.cpp b/dom/media/AudioCaptureStream.cpp index 459d1cba81e..5d192d8320f 100644 --- a/dom/media/AudioCaptureStream.cpp +++ b/dom/media/AudioCaptureStream.cpp @@ -102,8 +102,8 @@ AudioCaptureStream::MixerCallback(AudioDataValue* aMixedBuffer, AudioSampleFormat aFormat, uint32_t aChannels, uint32_t aFrames, uint32_t aSampleRate) { - nsAutoTArray, MONO> output; - nsAutoTArray bufferPtrs; + AutoTArray, MONO> output; + AutoTArray bufferPtrs; output.SetLength(MONO); bufferPtrs.SetLength(MONO); diff --git a/dom/media/AudioSegment.cpp b/dom/media/AudioSegment.cpp index 56a4f46cf37..1f242157323 100644 --- a/dom/media/AudioSegment.cpp +++ b/dom/media/AudioSegment.cpp @@ -85,9 +85,9 @@ void AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels, uint32_t aSampleRate) { - nsAutoTArray + AutoTArray buf; - nsAutoTArray channelData; + AutoTArray channelData; uint32_t offsetSamples = 0; uint32_t duration = GetDuration(); @@ -132,7 +132,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels, MOZ_ASSERT(channelData.Length() == aOutputChannels); } else if (channelData.Length() > aOutputChannels) { // Down mix. - nsAutoTArray outChannelPtrs; + AutoTArray outChannelPtrs; outChannelPtrs.SetLength(aOutputChannels); uint32_t offsetSamples = 0; for (uint32_t channel = 0; channel < aOutputChannels; channel++) { @@ -166,7 +166,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels, void AudioSegment::WriteTo(uint64_t aID, AudioMixer& aMixer, uint32_t aOutputChannels, uint32_t aSampleRate) { - nsAutoTArray buf; + AutoTArray buf; // Offset in the buffer that will be written to the mixer, in samples. uint32_t offset = 0; diff --git a/dom/media/AudioSegment.h b/dom/media/AudioSegment.h index e2880dadc37..252b7e5747c 100644 --- a/dom/media/AudioSegment.h +++ b/dom/media/AudioSegment.h @@ -118,8 +118,8 @@ DownmixAndInterleave(const nsTArray& aChannelData, InterleaveAndConvertBuffer(aChannelData.Elements(), aDuration, aVolume, aOutputChannels, aOutput); } else { - nsAutoTArray outputChannelData; - nsAutoTArray outputBuffers; + AutoTArray outputChannelData; + AutoTArray outputBuffers; outputChannelData.SetLength(aOutputChannels); outputBuffers.SetLength(aDuration * aOutputChannels); for (uint32_t i = 0; i < aOutputChannels; i++) { @@ -254,8 +254,8 @@ public: #endif for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) { - nsAutoTArray, GUESS_AUDIO_CHANNELS> output; - nsAutoTArray bufferPtrs; + AutoTArray, GUESS_AUDIO_CHANNELS> output; + AutoTArray bufferPtrs; AudioChunk& c = *ci; // If this chunk is null, don't bother resampling, just alter its duration if (c.IsNull()) { @@ -395,7 +395,7 @@ void WriteChunk(AudioChunk& aChunk, uint32_t aOutputChannels, AudioDataValue* aOutputBuffer) { - nsAutoTArray channelData; + AutoTArray channelData; channelData = aChunk.ChannelData(); diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index 087a0b5a474..4290669caab 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -113,7 +113,7 @@ public: } } private: - nsAutoTArray mChunks; + AutoTArray mChunks; int64_t mBaseOffset; double mBasePosition; }; @@ -287,7 +287,7 @@ WriteDumpFile(FILE* aDumpFile, AudioStream* aStream, uint32_t aFrames, } NS_ASSERTION(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_FLOAT32, "bad format"); - nsAutoTArray buf; + AutoTArray buf; buf.SetLength(samples*2); float* input = static_cast(aBuffer); uint8_t* output = buf.Elements(); @@ -616,7 +616,7 @@ AudioStream::GetTimeStretched(AudioBufferWriter& aWriter) mTimeStretcher->putSamples(c->Data(), c->Frames()); } else { // Write silence if downmixing fails. - nsAutoTArray buf; + AutoTArray buf; buf.SetLength(mOutChannels * c->Frames()); memset(buf.Elements(), 0, buf.Length() * sizeof(AudioDataValue)); mTimeStretcher->putSamples(buf.Elements(), c->Frames()); diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index 03d622242ae..ffb30b13d5b 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -583,10 +583,10 @@ protected: RefPtr mPlaybackPort; // MediaStreamTracks corresponding to tracks in our mOwnedStream. - nsAutoTArray, 2> mOwnedTracks; + AutoTArray, 2> mOwnedTracks; // MediaStreamTracks corresponding to tracks in our mPlaybackStream. - nsAutoTArray, 2> mTracks; + AutoTArray, 2> mTracks; RefPtr mOwnedListener; RefPtr mPlaybackListener; diff --git a/dom/media/FileBlockCache.h b/dom/media/FileBlockCache.h index a32bfb638a2..58ac3942277 100644 --- a/dom/media/FileBlockCache.h +++ b/dom/media/FileBlockCache.h @@ -202,7 +202,7 @@ private: // main thread). nsCOMPtr mThread; // Queue of pending block indexes that need to be written or moved. - //nsAutoTArray mChangeIndexList; + //AutoTArray mChangeIndexList; Int32Queue mChangeIndexList; // True if we've dispatched an event to commit all pending block changes // to file on mThread. diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index 24532b6432f..82325f6bdf4 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -1098,7 +1098,7 @@ AudioCallbackDriver::EnqueueStreamAndPromiseForOperation(MediaStream* aStream, void AudioCallbackDriver::CompleteAudioContextOperations(AsyncCubebOperation aOperation) { - nsAutoTArray array; + AutoTArray array; // We can't lock for the whole function because AudioContextOperationCompleted // will grab the monitor diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 319bdda05c8..b079f8cce8b 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -519,7 +519,7 @@ private: * shutdown of the audio stream. */ nsCOMPtr mInitShutdownThread; /* This must be accessed with the graph monitor held. */ - nsAutoTArray mPromisesForOperation; + AutoTArray mPromisesForOperation; /* This is set during initialization, and can be read safely afterwards. */ dom::AudioChannel mAudioChannel; /* Used to queue us to add the mixer callback on first run. */ diff --git a/dom/media/Intervals.h b/dom/media/Intervals.h index fa3ea2ed08e..4e0cbf161ff 100644 --- a/dom/media/Intervals.h +++ b/dom/media/Intervals.h @@ -255,7 +255,7 @@ class IntervalSet public: typedef IntervalSet SelfType; typedef Interval ElemType; - typedef nsAutoTArray ContainerType; + typedef AutoTArray ContainerType; typedef typename ContainerType::index_type IndexType; IntervalSet() diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index a9c76e7621b..0ee735272e4 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -794,7 +794,7 @@ MediaCache::FindReusableBlock(TimeStamp aNow, // predicted time of next use". We can exploit the fact that the block // linked lists are ordered by increasing time of next use. This is // actually the whole point of having the linked lists. - nsAutoTArray candidates; + AutoTArray candidates; for (uint32_t i = 0; i < mStreams.Length(); ++i) { MediaCacheStream* stream = mStreams[i]; if (stream->mPinCount > 0) { @@ -1040,7 +1040,7 @@ MediaCache::Update() // decisions while holding the cache lock but implement those decisions // without holding the cache lock, since we need to call out to // stream, decoder and element code. - nsAutoTArray actions; + AutoTArray actions; { ReentrantMonitorAutoEnter mon(mReentrantMonitor); diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index f245979d046..4c3e7824ee9 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -606,7 +606,7 @@ MediaStreamGraphImpl::CreateOrDestroyAudioStreams(MediaStream* aStream) STREAM_LOG(LogLevel::Debug, ("Updating AudioOutputStreams for MediaStream %p", aStream)); - nsAutoTArray audioOutputStreamsFound; + AutoTArray audioOutputStreamsFound; for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) { audioOutputStreamsFound.AppendElement(false); } @@ -791,7 +791,7 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream) TimeStamp currentTimeStamp = CurrentDriver()->GetCurrentTimeStamp(); // Collect any new frames produced in this iteration. - nsAutoTArray newImages; + AutoTArray newImages; RefPtr blackImage; MOZ_ASSERT(mProcessedTime >= aStream->mBufferStartTime, "frame position before buffer?"); @@ -861,14 +861,14 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream) if (!aStream->mLastPlayedVideoFrame.GetImage()) return; - nsAutoTArray images; + AutoTArray images; bool haveMultipleImages = false; for (uint32_t i = 0; i < aStream->mVideoOutputs.Length(); ++i) { VideoFrameContainer* output = aStream->mVideoOutputs[i]; // Find previous frames that may still be valid. - nsAutoTArray previousImages; + AutoTArray previousImages; output->GetImageContainer()->GetCurrentImages(&previousImages); uint32_t j = previousImages.Length(); if (j) { diff --git a/dom/media/TrackUnionStream.cpp b/dom/media/TrackUnionStream.cpp index 9325641970a..06ff80b5136 100644 --- a/dom/media/TrackUnionStream.cpp +++ b/dom/media/TrackUnionStream.cpp @@ -67,8 +67,8 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) : if (IsFinishedOnGraphThread()) { return; } - nsAutoTArray mappedTracksFinished; - nsAutoTArray mappedTracksWithMatchingInputTracks; + AutoTArray mappedTracksFinished; + AutoTArray mappedTracksWithMatchingInputTracks; for (uint32_t i = 0; i < mTrackMap.Length(); ++i) { mappedTracksFinished.AppendElement(true); mappedTracksWithMatchingInputTracks.AppendElement(false); diff --git a/dom/media/VideoFrameContainer.cpp b/dom/media/VideoFrameContainer.cpp index 2ece19ad2cb..e5a172e0ced 100644 --- a/dom/media/VideoFrameContainer.cpp +++ b/dom/media/VideoFrameContainer.cpp @@ -35,7 +35,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, { if (aImage) { MutexAutoLock lock(mMutex); - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement( ImageContainer::NonOwningImage(aImage, aTargetTime, ++mFrameID)); SetCurrentFramesLocked(aIntrinsicSize, imageList); diff --git a/dom/media/encoder/OpusTrackEncoder.cpp b/dom/media/encoder/OpusTrackEncoder.cpp index 33d96ab6205..3785d7f06d7 100644 --- a/dom/media/encoder/OpusTrackEncoder.cpp +++ b/dom/media/encoder/OpusTrackEncoder.cpp @@ -313,7 +313,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData) } // Start encoding data. - nsAutoTArray pcm; + AutoTArray pcm; pcm.SetLength(GetPacketDuration() * mChannels); AudioSegment::ChunkIterator iter(mSourceSegment); int frameCopied = 0; @@ -344,7 +344,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData) audiodata->SetFrameType(EncodedFrame::OPUS_AUDIO_FRAME); int framesInPCM = frameCopied; if (mResampler) { - nsAutoTArray resamplingDest; + AutoTArray resamplingDest; // We want to consume all the input data, so we slightly oversize the // resampled data buffer so we can fit the output data in. We cannot really // predict the output frame count at each call. diff --git a/dom/media/encoder/TrackEncoder.cpp b/dom/media/encoder/TrackEncoder.cpp index 0e2cc7610ad..6fbceea8c3e 100644 --- a/dom/media/encoder/TrackEncoder.cpp +++ b/dom/media/encoder/TrackEncoder.cpp @@ -140,7 +140,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk, { switch(aChunk.mBufferFormat) { case AUDIO_FORMAT_S16: { - nsAutoTArray array; + AutoTArray array; array.SetLength(aOutputChannels); for (uint32_t i = 0; i < array.Length(); i++) { array[i] = static_cast(aChunk.mChannelData[i]); @@ -149,7 +149,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk, break; } case AUDIO_FORMAT_FLOAT32: { - nsAutoTArray array; + AutoTArray array; array.SetLength(aOutputChannels); for (uint32_t i = 0; i < array.Length(); i++) { array[i] = static_cast(aChunk.mChannelData[i]); diff --git a/dom/media/encoder/VorbisTrackEncoder.cpp b/dom/media/encoder/VorbisTrackEncoder.cpp index 0899ee8c744..d53228631cc 100644 --- a/dom/media/encoder/VorbisTrackEncoder.cpp +++ b/dom/media/encoder/VorbisTrackEncoder.cpp @@ -202,8 +202,8 @@ VorbisTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData) vorbis_analysis_buffer(&mVorbisDsp, (int)sourceSegment->GetDuration()); int framesCopied = 0; - nsAutoTArray interleavedPcm; - nsAutoTArray nonInterleavedPcm; + AutoTArray interleavedPcm; + AutoTArray nonInterleavedPcm; interleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels); nonInterleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels); while (!iter.IsEnded()) { diff --git a/dom/media/gmp/GMPDecryptorChild.cpp b/dom/media/gmp/GMPDecryptorChild.cpp index 0df7da8d9c5..aec5078e45b 100644 --- a/dom/media/gmp/GMPDecryptorChild.cpp +++ b/dom/media/gmp/GMPDecryptorChild.cpp @@ -157,7 +157,7 @@ GMPDecryptorChild::KeyStatusChanged(const char* aSessionId, uint32_t aKeyIdLength, GMPMediaKeyStatus aStatus) { - nsAutoTArray kid; + AutoTArray kid; kid.AppendElements(aKeyId, aKeyIdLength); CALL_ON_GMP_THREAD(SendKeyStatusChanged, nsCString(aSessionId, aSessionIdLength), kid, diff --git a/dom/media/gtest/TestVorbisTrackEncoder.cpp b/dom/media/gtest/TestVorbisTrackEncoder.cpp index 4f16519364a..9166afcf5b1 100644 --- a/dom/media/gtest/TestVorbisTrackEncoder.cpp +++ b/dom/media/gtest/TestVorbisTrackEncoder.cpp @@ -183,7 +183,7 @@ TEST(VorbisTrackEncoder, EncodedFrame) for (int i = 0; i < rate; i++) { data[i] = ((i%8)*4000) - (7*4000)/2; } - nsAutoTArray channelData; + AutoTArray channelData; channelData.AppendElement(data); AudioSegment segment; segment.AppendFrames(samples.forget(), channelData, 44100); diff --git a/dom/media/mediasink/DecodedStream.cpp b/dom/media/mediasink/DecodedStream.cpp index 687994ad023..aced1eec833 100644 --- a/dom/media/mediasink/DecodedStream.cpp +++ b/dom/media/mediasink/DecodedStream.cpp @@ -500,7 +500,7 @@ SendStreamAudio(DecodedStreamData* aStream, int64_t aStartTime, audio->EnsureAudioBuffer(); RefPtr buffer = audio->mAudioBuffer; AudioDataValue* bufferData = static_cast(buffer->Data()); - nsAutoTArray channels; + AutoTArray channels; for (uint32_t i = 0; i < audio->mChannels; ++i) { channels.AppendElement(bufferData + i * audio->mFrames); } @@ -522,7 +522,7 @@ DecodedStream::SendAudio(double aVolume, bool aIsSameOrigin) AudioSegment output; uint32_t rate = mInfo.mAudio.mRate; - nsAutoTArray,10> audio; + AutoTArray,10> audio; TrackID audioTrackId = mInfo.mAudio.mTrackId; SourceMediaStream* sourceStream = mData->mStream; @@ -587,7 +587,7 @@ DecodedStream::SendVideo(bool aIsSameOrigin) VideoSegment output; TrackID videoTrackId = mInfo.mVideo.mTrackId; - nsAutoTArray, 10> video; + AutoTArray, 10> video; SourceMediaStream* sourceStream = mData->mStream; // It's OK to hold references to the VideoData because VideoData diff --git a/dom/media/mediasink/VideoSink.cpp b/dom/media/mediasink/VideoSink.cpp index 5fa85d65833..e12ad7ad18f 100644 --- a/dom/media/mediasink/VideoSink.cpp +++ b/dom/media/mediasink/VideoSink.cpp @@ -314,13 +314,13 @@ VideoSink::RenderVideoFrames(int32_t aMaxFrames, { AssertOwnerThread(); - nsAutoTArray,16> frames; + AutoTArray,16> frames; VideoQueue().GetFirstElements(aMaxFrames, &frames); if (frames.IsEmpty() || !mContainer) { return; } - nsAutoTArray images; + AutoTArray images; TimeStamp lastFrameTime; MediaSink::PlaybackParams params = mAudioSink->GetPlaybackParams(); for (uint32_t i = 0; i < frames.Length(); ++i) { diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index 3bb3de595d9..f4d8b92aa4d 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -296,7 +296,7 @@ void OggReader::SetupTargetSkeleton(SkeletonState* aSkeletonState) } else if (ReadHeaders(aSkeletonState) && aSkeletonState->HasIndex()) { // Extract the duration info out of the index, so we don't need to seek to // the end of resource to get it. - nsAutoTArray tracks; + AutoTArray tracks; BuildSerialList(tracks); int64_t duration = 0; if (NS_SUCCEEDED(aSkeletonState->GetDuration(tracks, duration))) { @@ -395,7 +395,7 @@ nsresult OggReader::ReadMetadata(MediaInfo* aInfo, *aTags = nullptr; ogg_page page; - nsAutoTArray bitstreams; + AutoTArray bitstreams; nsTArray serials; bool readAllBOS = false; while (!readAllBOS) { @@ -1254,7 +1254,7 @@ OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget return SEEK_INDEX_FAIL; } // We have an index from the Skeleton track, try to use it to seek. - nsAutoTArray tracks; + AutoTArray tracks; BuildSerialList(tracks); SkeletonState::nsSeekTarget keyframe; if (NS_FAILED(mSkeletonState->IndexedSeekTarget(aTarget, @@ -1449,7 +1449,7 @@ nsresult OggReader::SeekInternal(int64_t aTarget, int64_t aEndTime) // No index or other non-fatal index-related failure. Try to seek // using a bisection search. Determine the already downloaded data // in the media cache, so we can try to seek in the cached data first. - nsAutoTArray ranges; + AutoTArray ranges; res = GetSeekRanges(ranges); NS_ENSURE_SUCCESS(res,res); diff --git a/dom/media/omx/OMXCodecWrapper.cpp b/dom/media/omx/OMXCodecWrapper.cpp index 08892213750..b6e3f566bab 100644 --- a/dom/media/omx/OMXCodecWrapper.cpp +++ b/dom/media/omx/OMXCodecWrapper.cpp @@ -751,7 +751,7 @@ public: UpdateAfterSendChunk(chunkSamples, bytesCopied, aSamplesRead); } else { // Interleave data to a temporary buffer. - nsAutoTArray pcm; + AutoTArray pcm; pcm.SetLength(bytesToCopy); AudioDataValue* interleavedSource = pcm.Elements(); AudioTrackEncoder::InterleaveTrackData(aChunk, chunkSamples, @@ -853,7 +853,7 @@ private: * mOMXAEncoder.mChannels * sizeof(AudioDataValue); uint32_t dstSamplesCopied = aSamplesNum; if (mOMXAEncoder.mResampler) { - nsAutoTArray pcm; + AutoTArray pcm; pcm.SetLength(bytesToCopy); AudioTrackEncoder::InterleaveTrackData(aSource, aSamplesNum, mOMXAEncoder.mChannels, diff --git a/dom/media/platforms/agnostic/VorbisDecoder.cpp b/dom/media/platforms/agnostic/VorbisDecoder.cpp index c51c03d5a1b..50906e442c5 100644 --- a/dom/media/platforms/agnostic/VorbisDecoder.cpp +++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp @@ -71,8 +71,8 @@ VorbisDataDecoder::Init() PodZero(&mVorbisDsp); PodZero(&mVorbisBlock); - nsAutoTArray headers; - nsAutoTArray headerLens; + AutoTArray headers; + AutoTArray headerLens; if (!XiphExtradataToHeaders(headers, headerLens, mInfo.mCodecSpecificConfig->Elements(), mInfo.mCodecSpecificConfig->Length())) { diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h index 7f3896b210d..91a6e38ec6e 100644 --- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h @@ -123,7 +123,7 @@ private: } private: - nsAutoTArray mMap; + AutoTArray mMap; }; DurationMap mDurationMap; diff --git a/dom/media/systemservices/MediaUtils.h b/dom/media/systemservices/MediaUtils.h index bde0c913fae..dad43bd3499 100644 --- a/dom/media/systemservices/MediaUtils.h +++ b/dom/media/systemservices/MediaUtils.h @@ -321,7 +321,7 @@ private: static uint32_t counter = 0; return ++counter; }; - nsAutoTArray mElements; + AutoTArray mElements; }; /* media::Refcountable - Add threadsafe ref-counting to something that isn't. diff --git a/dom/media/webaudio/AudioBuffer.h b/dom/media/webaudio/AudioBuffer.h index ee462668f80..abb430d7fef 100644 --- a/dom/media/webaudio/AudioBuffer.h +++ b/dom/media/webaudio/AudioBuffer.h @@ -119,7 +119,7 @@ protected: nsWeakPtr mOwnerWindow; // Float32Arrays - nsAutoTArray, 2> mJSChannels; + AutoTArray, 2> mJSChannels; // mSharedChannels aggregates the data from mJSChannels. This is non-null // if and only if the mJSChannels' buffers are detached. diff --git a/dom/media/webaudio/AudioNodeEngine.h b/dom/media/webaudio/AudioNodeEngine.h index 51e64f7f593..58a9f962121 100644 --- a/dom/media/webaudio/AudioNodeEngine.h +++ b/dom/media/webaudio/AudioNodeEngine.h @@ -128,7 +128,7 @@ public: } private: - nsAutoTArray mContents; + AutoTArray mContents; }; /** @@ -253,7 +253,7 @@ class AudioNodeEngine { public: // This should be compatible with AudioNodeStream::OutputChunks. - typedef nsAutoTArray OutputChunks; + typedef AutoTArray OutputChunks; explicit AudioNodeEngine(dom::AudioNode* aNode) : mNode(aNode) diff --git a/dom/media/webaudio/AudioNodeExternalInputStream.cpp b/dom/media/webaudio/AudioNodeExternalInputStream.cpp index 3ebf9e48798..f7814774a1a 100644 --- a/dom/media/webaudio/AudioNodeExternalInputStream.cpp +++ b/dom/media/webaudio/AudioNodeExternalInputStream.cpp @@ -49,7 +49,7 @@ CopyChunkToBlock(AudioChunk& aInput, AudioBlock *aBlock, uint32_t aOffsetInBlock) { uint32_t blockChannels = aBlock->ChannelCount(); - nsAutoTArray channels; + AutoTArray channels; if (aInput.IsNull()) { channels.SetLength(blockChannels); PodZero(channels.Elements(), blockChannels); @@ -137,7 +137,7 @@ AudioNodeExternalInputStream::ProcessInput(GraphTime aFrom, GraphTime aTo, MOZ_ASSERT(mInputs.Length() == 1); MediaStream* source = mInputs[0]->GetSource(); - nsAutoTArray audioSegments; + AutoTArray audioSegments; uint32_t inputChannels = 0; for (StreamBuffer::TrackIter tracks(source->mBuffer, MediaSegment::AUDIO); !tracks.IsEnded(); tracks.Next()) { @@ -192,7 +192,7 @@ AudioNodeExternalInputStream::ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t accumulateIndex = 0; if (inputChannels) { - nsAutoTArray downmixBuffer; + AutoTArray downmixBuffer; for (uint32_t i = 0; i < audioSegments.Length(); ++i) { AudioBlock tmpChunk; ConvertSegmentToAudioBlock(&audioSegments[i], &tmpChunk, inputChannels); diff --git a/dom/media/webaudio/AudioNodeStream.cpp b/dom/media/webaudio/AudioNodeStream.cpp index 08c9f1a5a7e..9f0b5b665de 100644 --- a/dom/media/webaudio/AudioNodeStream.cpp +++ b/dom/media/webaudio/AudioNodeStream.cpp @@ -408,7 +408,7 @@ AudioNodeStream::ObtainInputBlock(AudioBlock& aTmpChunk, { uint32_t inputCount = mInputs.Length(); uint32_t outputChannelCount = 1; - nsAutoTArray inputChunks; + AutoTArray inputChunks; for (uint32_t i = 0; i < inputCount; ++i) { if (aPortIndex != mInputs[i]->InputNumber()) { // This input is connected to a different port @@ -454,7 +454,7 @@ AudioNodeStream::ObtainInputBlock(AudioBlock& aTmpChunk, aTmpChunk.AllocateChannels(outputChannelCount); // The static storage here should be 1KB, so it's fine - nsAutoTArray downmixBuffer; + AutoTArray downmixBuffer; for (uint32_t i = 0; i < inputChunkCount; ++i) { AccumulateInputChunk(i, *inputChunks[i], &aTmpChunk, &downmixBuffer); @@ -467,7 +467,7 @@ AudioNodeStream::AccumulateInputChunk(uint32_t aInputIndex, AudioBlock* aBlock, nsTArray* aDownmixBuffer) { - nsAutoTArray channels; + AutoTArray channels; UpMixDownMixChunk(&aChunk, aBlock->ChannelCount(), channels, *aDownmixBuffer); for (uint32_t c = 0; c < channels.Length(); ++c) { @@ -509,7 +509,7 @@ AudioNodeStream::UpMixDownMixChunk(const AudioBlock* aChunk, } } else if (aOutputChannels.Length() > aOutputChannelCount) { if (mChannelInterpretation == ChannelInterpretation::Speakers) { - nsAutoTArray outputChannels; + AutoTArray outputChannels; outputChannels.SetLength(aOutputChannelCount); aDownmixBuffer.SetLength(aOutputChannelCount * WEBAUDIO_BLOCK_SIZE); for (uint32_t j = 0; j < aOutputChannelCount; ++j) { diff --git a/dom/media/webaudio/AudioNodeStream.h b/dom/media/webaudio/AudioNodeStream.h index f0832e072ba..2882578c350 100644 --- a/dom/media/webaudio/AudioNodeStream.h +++ b/dom/media/webaudio/AudioNodeStream.h @@ -41,7 +41,7 @@ public: enum { AUDIO_TRACK = 1 }; - typedef nsAutoTArray OutputChunks; + typedef AutoTArray OutputChunks; // Flags re main thread updates and stream output. typedef unsigned Flags; diff --git a/dom/media/webaudio/DelayBuffer.h b/dom/media/webaudio/DelayBuffer.h index 6109e038f23..e55d0ba83a5 100644 --- a/dom/media/webaudio/DelayBuffer.h +++ b/dom/media/webaudio/DelayBuffer.h @@ -94,7 +94,7 @@ private: // Circular buffer for capturing delayed samples. FallibleTArray mChunks; // Cache upmixed channel arrays. - nsAutoTArray mUpmixChannels; + AutoTArray mUpmixChannels; double mSmoothingRate; // Current delay, in fractional ticks double mCurrentDelay; diff --git a/dom/media/webaudio/WebAudioUtils.cpp b/dom/media/webaudio/WebAudioUtils.cpp index d9e21f35c30..db9fbc38469 100644 --- a/dom/media/webaudio/WebAudioUtils.cpp +++ b/dom/media/webaudio/WebAudioUtils.cpp @@ -36,8 +36,8 @@ WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, float* aOut, uint32_t* aOutLen) { #ifdef MOZ_SAMPLE_TYPE_S16 - nsAutoTArray tmp1; - nsAutoTArray tmp2; + AutoTArray tmp1; + AutoTArray tmp2; tmp1.SetLength(*aInLen); tmp2.SetLength(*aOutLen); ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen); @@ -55,7 +55,7 @@ WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, const int16_t* aIn, uint32_t* aInLen, float* aOut, uint32_t* aOutLen) { - nsAutoTArray tmp; + AutoTArray tmp; #ifdef MOZ_SAMPLE_TYPE_S16 tmp.SetLength(*aOutLen); int result = speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, tmp.Elements(), aOutLen); @@ -78,8 +78,8 @@ WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, #ifdef MOZ_SAMPLE_TYPE_S16 return speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, aOut, aOutLen); #else - nsAutoTArray tmp1; - nsAutoTArray tmp2; + AutoTArray tmp1; + AutoTArray tmp2; tmp1.SetLength(*aInLen); tmp2.SetLength(*aOutLen); ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen); diff --git a/dom/media/webaudio/blink/HRTFElevation.cpp b/dom/media/webaudio/blink/HRTFElevation.cpp index c6e04308859..2300872f3ab 100644 --- a/dom/media/webaudio/blink/HRTFElevation.cpp +++ b/dom/media/webaudio/blink/HRTFElevation.cpp @@ -128,7 +128,7 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation(int az // Note that depending on the fftSize returned by the panner, we may be truncating the impulse response. const size_t resampledResponseLength = fftSizeForSampleRate(sampleRate) / 2; - nsAutoTArray resampled; + AutoTArray resampled; if (sampleRate == rawSampleRate) { resampledResponse = response; MOZ_ASSERT(resampledResponseLength == ResponseFrameSize); @@ -163,7 +163,7 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation(int az } #ifdef MOZ_SAMPLE_TYPE_S16 - nsAutoTArray floatArray; + AutoTArray floatArray; floatArray.SetLength(resampledResponseLength); float *floatResponse = floatArray.Elements(); ConvertAudioSamples(resampledResponse, diff --git a/dom/media/webaudio/blink/Reverb.cpp b/dom/media/webaudio/blink/Reverb.cpp index 39f9d59c935..4fca0822b6a 100644 --- a/dom/media/webaudio/blink/Reverb.cpp +++ b/dom/media/webaudio/blink/Reverb.cpp @@ -81,11 +81,11 @@ Reverb::Reverb(ThreadSharedFloatArrayBufferList* impulseResponse, size_t impulse { float scale = 1; - nsAutoTArray irChannels; + AutoTArray irChannels; for (size_t i = 0; i < impulseResponse->GetChannels(); ++i) { irChannels.AppendElement(impulseResponse->GetData(i)); } - nsAutoTArray tempBuf; + AutoTArray tempBuf; if (normalize) { scale = calculateNormalizationScale(impulseResponse, impulseResponseBufferLength, sampleRate); diff --git a/dom/media/webm/WebMDemuxer.cpp b/dom/media/webm/WebMDemuxer.cpp index 4cf3fe57d42..ebc582bda99 100644 --- a/dom/media/webm/WebMDemuxer.cpp +++ b/dom/media/webm/WebMDemuxer.cpp @@ -389,8 +389,8 @@ WebMDemuxer::ReadMetadata() return NS_ERROR_FAILURE; } - nsAutoTArray headers; - nsAutoTArray headerLens; + AutoTArray headers; + AutoTArray headerLens; for (uint32_t header = 0; header < nheaders; ++header) { unsigned char* data = 0; size_t length = 0; diff --git a/dom/media/webrtc/MediaEngineDefault.cpp b/dom/media/webrtc/MediaEngineDefault.cpp index 9f7d272b87b..93710f97721 100644 --- a/dom/media/webrtc/MediaEngineDefault.cpp +++ b/dom/media/webrtc/MediaEngineDefault.cpp @@ -510,7 +510,7 @@ MediaEngineDefaultAudioSource::AppendToSegment(AudioSegment& aSegment, int16_t* dest = static_cast(buffer->Data()); mSineGenerator->generate(dest, aSamples); - nsAutoTArray channels; + AutoTArray channels; channels.AppendElement(dest); aSegment.AppendFrames(buffer.forget(), channels, aSamples); } diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index 4b826650093..10a4c93414b 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -639,7 +639,7 @@ MediaEngineWebRTCMicrophoneSource::Process(int channel, memcpy(dest, audio10ms, length * sizeof(sample)); nsAutoPtr segment(new AudioSegment()); - nsAutoTArray channels; + AutoTArray channels; channels.AppendElement(dest); segment->AppendFrames(buffer.forget(), channels, length); TimeStamp insertTime; diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp index 1d07e9c513b..f2bcf2bb379 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.cpp +++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp @@ -932,7 +932,7 @@ SpeechRecognition::CreateAudioSegment(nsTArray>& aChunks) RefPtr buffer = aChunks[i]; const int16_t* chunkData = static_cast(buffer->Data()); - nsAutoTArray channels; + AutoTArray channels; channels.AppendElement(chunkData); segment->AppendFrames(buffer.forget(), channels, mAudioSamplesPerChunk); } @@ -959,7 +959,7 @@ SpeechRecognition::FeedAudioData(already_AddRefed aSamples, uint32_t samplesIndex = 0; const int16_t* samples = static_cast(refSamples->Data()); - nsAutoTArray, 5> chunksToSend; + AutoTArray, 5> chunksToSend; // fill up our buffer and make a chunk out of it, if possible if (mBufferedSamples > 0) { diff --git a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm index d78a99bb3cc..7ccab6b51e8 100644 --- a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm +++ b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm @@ -275,7 +275,7 @@ EnumVoicesRunnable::Run() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - nsAutoTArray list; + AutoTArray list; NSArray* voices = [NSSpeechSynthesizer availableVoices]; NSString* defaultVoice = [NSSpeechSynthesizer defaultVoice]; diff --git a/dom/media/webspeech/synth/nsSpeechTask.cpp b/dom/media/webspeech/synth/nsSpeechTask.cpp index 39fab24ceae..4be7290b88a 100644 --- a/dom/media/webspeech/synth/nsSpeechTask.cpp +++ b/dom/media/webspeech/synth/nsSpeechTask.cpp @@ -323,7 +323,7 @@ nsSpeechTask::SendAudioImpl(RefPtr& aSamples, uint32_t aD } AudioSegment segment; - nsAutoTArray channelData; + AutoTArray channelData; channelData.AppendElement(static_cast(aSamples->Data())); segment.AppendFrames(aSamples.forget(), channelData, aDataLen); mStream->AppendToTrack(1, &segment); diff --git a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp index f413c5b3631..0b423b9b3d9 100644 --- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp +++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp @@ -36,7 +36,7 @@ GetAllSpeechSynthActors(InfallibleTArray& MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aActors.IsEmpty()); - nsAutoTArray contentActors; + AutoTArray contentActors; mozilla::dom::ContentParent::GetAll(contentActors); for (uint32_t contentIndex = 0; diff --git a/dom/messagechannel/MessagePort.cpp b/dom/messagechannel/MessagePort.cpp index 7fc5b927cd8..9b0f012d61a 100644 --- a/dom/messagechannel/MessagePort.cpp +++ b/dom/messagechannel/MessagePort.cpp @@ -475,10 +475,10 @@ MessagePort::PostMessage(JSContext* aCx, JS::Handle aMessage, MOZ_ASSERT(mActor); MOZ_ASSERT(mMessagesForTheOtherPort.IsEmpty()); - nsAutoTArray, 1> array; + AutoTArray, 1> array; array.AppendElement(data); - nsAutoTArray messages; + AutoTArray messages; SharedMessagePortMessage::FromSharedToMessagesChild(mActor, array, messages); mActor->SendPostMessages(messages); } diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp index 5bb688b8cd4..e68e510c7af 100644 --- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -158,7 +158,7 @@ public: MOZ_ASSERT(ok); ErrorResult result; - nsAutoTArray, 5> notifications; + AutoTArray, 5> notifications; for (uint32_t i = 0; i < mStrings.Length(); ++i) { RefPtr n = @@ -2094,7 +2094,7 @@ public: RefPtr workerPromise = mPromiseProxy->WorkerPromise(); ErrorResult result; - nsAutoTArray, 5> notifications; + AutoTArray, 5> notifications; for (uint32_t i = 0; i < mStrings.Length(); ++i) { RefPtr n = Notification::ConstructFromFields(aWorkerPrivate->GlobalScope(), diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 708f46d0970..f769e93fc2f 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -1693,7 +1693,7 @@ _releasevariantvalue(NPVariant* variant) } else { void *p = (void *)s->UTF8Characters; DWORD nheaps = 0; - nsAutoTArray heaps; + AutoTArray heaps; nheaps = GetProcessHeaps(0, heaps.Elements()); heaps.AppendElements(nheaps); GetProcessHeaps(nheaps, heaps.Elements()); diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index dae2aec54ff..aad18ebbe43 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -2111,7 +2111,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir, if (NS_FAILED(rv)) return rv; - nsAutoTArray, 6> pluginFiles; + AutoTArray, 6> pluginFiles; bool hasMore; while (NS_SUCCEEDED(iter->HasMoreElements(&hasMore)) && hasMore) { @@ -3666,7 +3666,7 @@ nsPluginHost::ParsePostBufferToFixHeaders(const char *inPostData, uint32_t inPos const char CRLFCRLF[] = {CR,LF,CR,LF,'\0'}; // C string"\r\n\r\n" const char ContentLenHeader[] = "Content-length"; - nsAutoTArray singleLF; + AutoTArray singleLF; const char *pSCntlh = 0;// pointer to start of ContentLenHeader in inPostData const char *pSod = 0; // pointer to start of data in inPostData const char *pEoh = 0; // pointer to end of headers in inPostData diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 0df46218d34..3f75a09429e 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -903,7 +903,7 @@ nsPluginInstanceOwner::GetCompositionString(uint32_t aType, *aLength = aDist->Length(); return true; } - nsAutoTArray clauses; + AutoTArray clauses; clauses.AppendElement(0); for (TextRange& range : *ranges) { if (!range.IsClause()) { diff --git a/dom/plugins/base/nsPluginsDirUtils.h b/dom/plugins/base/nsPluginsDirUtils.h index 8fb907c0d1a..178dc6968e7 100644 --- a/dom/plugins/base/nsPluginsDirUtils.h +++ b/dom/plugins/base/nsPluginsDirUtils.h @@ -26,7 +26,7 @@ ParsePluginMimeDescription(const char *mdesc, nsPluginInfo &info) char *mdescDup = PL_strdup(mdesc); // make a dup of intput string we'll change it content char anEmptyString[] = ""; - nsAutoTArray tmpMimeTypeArr; + AutoTArray tmpMimeTypeArr; char delimiters[] = {':',':',';'}; int mimeTypeVariantCount = 0; char *p = mdescDup; // make a dup of intput string we'll change it content diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index 7f0144eea60..400f0094aea 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -2043,7 +2043,7 @@ PluginInstanceChild::ImmGetCompositionStringProc(HIMC aIMC, DWORD aIndex, if (!sCurrentPluginInstance) { return IMM_ERROR_GENERAL; } - nsAutoTArray dist; + AutoTArray dist; int32_t length = 0; // IMM_ERROR_NODATA sCurrentPluginInstance->SendGetCompositionString(aIndex, &dist, &length); if (length == IMM_ERROR_NODATA || length == IMM_ERROR_GENERAL) { diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index 8dcbd99c464..8f292998b0c 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -807,7 +807,7 @@ PluginInstanceParent::SetCurrentImage(Image* aImage) ImageContainer::NonOwningImage holder(aImage); holder.mFrameID = ++mFrameID; - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement(holder); mImageContainer->SetCurrentImages(imageList); @@ -959,7 +959,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect, gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface); RefPtr image = new SourceSurfaceImage(surface->GetSize(), sourceSurface); - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement( ImageContainer::NonOwningImage(image)); diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h index ffd35558166..61d84487a9d 100644 --- a/dom/plugins/ipc/PluginModuleChild.h +++ b/dom/plugins/ipc/PluginModuleChild.h @@ -363,7 +363,7 @@ private: bool _savedNestableTasksAllowed; }; - nsAutoTArray mIncallPumpingStack; + AutoTArray mIncallPumpingStack; static LRESULT CALLBACK NestedInputEventHook(int code, WPARAM wParam, diff --git a/dom/power/PowerManager.cpp b/dom/power/PowerManager.cpp index e7baeac48e9..64534976da1 100644 --- a/dom/power/PowerManager.cpp +++ b/dom/power/PowerManager.cpp @@ -135,7 +135,7 @@ PowerManager::Callback(const nsAString &aTopic, const nsAString &aState) * because the callbacks may install new listeners. We expect no * more than one listener per window, so it shouldn't be too long. */ - nsAutoTArray, 2> listeners(mListeners); + AutoTArray, 2> listeners(mListeners); for (uint32_t i = 0; i < listeners.Length(); ++i) { listeners[i]->Callback(aTopic, aState); } diff --git a/dom/power/PowerManagerService.cpp b/dom/power/PowerManagerService.cpp index a37a929ece4..5e972e12c05 100644 --- a/dom/power/PowerManagerService.cpp +++ b/dom/power/PowerManagerService.cpp @@ -112,7 +112,7 @@ PowerManagerService::Notify(const WakeLockInformation& aWakeLockInfo) * because the callbacks may install new listeners. We expect no * more than one listener per window, so it shouldn't be too long. */ - nsAutoTArray, 2> listeners(mWakeLockListeners); + AutoTArray, 2> listeners(mWakeLockListeners); for (uint32_t i = 0; i < listeners.Length(); ++i) { listeners[i]->Callback(aWakeLockInfo.topic(), state); diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index 665edb9a373..f9ced8a20d3 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -2476,7 +2476,7 @@ QuotaObject::MaybeUpdateSize(int64_t aSize, bool aTruncate) if (newTemporaryStorageUsage > quotaManager->mTemporaryStorageLimit) { // This will block the thread without holding the lock while waitting. - nsAutoTArray, 10> locks; + AutoTArray, 10> locks; uint64_t sizeToBeFreed = quotaManager->LockedCollectOriginsForEviction(delta, locks); @@ -3801,7 +3801,7 @@ QuotaManager::OpenDirectoryInternal(Nullable aPersistenceType, // All the locks that block this new exclusive lock need to be invalidated. // We also need to notify clients to abort operations for them. - nsAutoTArray>, + AutoTArray>, Client::TYPE_MAX> origins; origins.SetLength(Client::TYPE_MAX); diff --git a/dom/quota/QuotaManager.h b/dom/quota/QuotaManager.h index 4586958f0fb..db7ea977eec 100644 --- a/dom/quota/QuotaManager.h +++ b/dom/quota/QuotaManager.h @@ -500,7 +500,7 @@ private: // by any mutex but it is only ever touched on the IO thread. nsTArray mInitializedOrigins; - nsAutoTArray, Client::TYPE_MAX> mClients; + AutoTArray, Client::TYPE_MAX> mClients; nsString mIndexedDBPath; nsString mStoragePath; diff --git a/dom/svg/SVGLengthList.h b/dom/svg/SVGLengthList.h index 4d11e1afb9e..7ca07d1da35 100644 --- a/dom/svg/SVGLengthList.h +++ b/dom/svg/SVGLengthList.h @@ -130,20 +130,20 @@ protected: /* Rationale for using nsTArray and not nsTArray: * - * It might seem like we should use nsAutoTArray instead of + * It might seem like we should use AutoTArray instead of * nsTArray. That would preallocate space for one SVGLength and * avoid an extra memory allocation call in the common case of the 'x' * and 'y' attributes each containing a single length (and the 'dx' and 'dy' * attributes being empty). However, consider this: * - * An empty nsTArray uses sizeof(Header*). An nsAutoTArray on the other hand uses sizeof(Header*) + * (2 * sizeof(uint32_t)) + (N * sizeof(E)), which for one SVGLength is * sizeof(Header*) + 16 bytes. * * Now consider that for text elements we have four length list attributes * (x, y, dx, dy), each of which can have a baseVal and an animVal list. If - * we were to go the nsAutoTArray route for each of these, we'd + * we were to go the AutoTArray route for each of these, we'd * end up using at least 160 bytes for these four attributes alone, even * though we only need storage for two SVGLengths (16 bytes) in the common * case!! diff --git a/dom/voicemail/Voicemail.h b/dom/voicemail/Voicemail.h index 8cae51f96b0..d9e395bbb67 100644 --- a/dom/voicemail/Voicemail.h +++ b/dom/voicemail/Voicemail.h @@ -87,7 +87,7 @@ private: // |mStatuses| keeps all instantiated VoicemailStatus objects as well as the // empty slots for not interested ones. The length of |mStatuses| is decided // in the constructor and is never changed ever since. - nsAutoTArray, 1> mStatuses; + AutoTArray, 1> mStatuses; // Return a nsIVoicemailProvider instance based on the requests from external // components. Return nullptr if aOptionalServiceId contains an invalid diff --git a/dom/workers/Queue.h b/dom/workers/Queue.h index f4f87e985aa..c7a99158bf6 100644 --- a/dom/workers/Queue.h +++ b/dom/workers/Queue.h @@ -17,7 +17,7 @@ BEGIN_WORKERS_NAMESPACE template struct StorageWithTArray { - typedef nsAutoTArray StorageType; + typedef AutoTArray StorageType; static void Reverse(StorageType& aStorage) { diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 544de2631e7..53319e82617 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -126,7 +126,7 @@ static_assert(MAX_WORKERS_PER_DOMAIN >= 1, PR_BEGIN_MACRO \ AssertIsOnMainThread(); \ \ - nsAutoTArray workers; \ + AutoTArray workers; \ { \ MutexAutoLock lock(mMutex); \ \ @@ -1788,7 +1788,7 @@ RuntimeService::ShutdownIdleThreads(nsITimer* aTimer, void* /* aClosure */) TimeStamp nextExpiration; - nsAutoTArray, 20> expiredThreads; + AutoTArray, 20> expiredThreads; { MutexAutoLock lock(runtime->mMutex); @@ -1992,7 +1992,7 @@ RuntimeService::Shutdown() { MutexAutoLock lock(mMutex); - nsAutoTArray workers; + AutoTArray workers; AddAllTopLevelWorkersToArray(workers); if (!workers.IsEmpty()) { @@ -2033,7 +2033,7 @@ RuntimeService::Cleanup() { MutexAutoLock lock(mMutex); - nsAutoTArray workers; + AutoTArray workers; AddAllTopLevelWorkersToArray(workers); if (!workers.IsEmpty()) { @@ -2042,7 +2042,7 @@ RuntimeService::Cleanup() // Shut down any idle threads. if (!mIdleThreadArray.IsEmpty()) { - nsAutoTArray, 20> idleThreads; + AutoTArray, 20> idleThreads; uint32_t idleThreadCount = mIdleThreadArray.Length(); idleThreads.SetLength(idleThreadCount); @@ -2197,7 +2197,7 @@ RuntimeService::CancelWorkersForWindow(nsPIDOMWindowInner* aWindow) { AssertIsOnMainThread(); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); if (!workers.IsEmpty()) { @@ -2225,7 +2225,7 @@ RuntimeService::FreezeWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); if (!workers.IsEmpty()) { @@ -2249,7 +2249,7 @@ RuntimeService::ThawWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); if (!workers.IsEmpty()) { @@ -2273,7 +2273,7 @@ RuntimeService::SuspendWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); for (uint32_t index = 0; index < workers.Length(); index++) { @@ -2287,7 +2287,7 @@ RuntimeService::ResumeWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); for (uint32_t index = 0; index < workers.Length(); index++) { diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp index 21d4f4c819b..a6b763a679a 100644 --- a/dom/workers/ServiceWorkerEvents.cpp +++ b/dom/workers/ServiceWorkerEvents.cpp @@ -199,7 +199,7 @@ public: mChannel->SynthesizeStatus(mInternalResponse->GetUnfilteredStatus(), mInternalResponse->GetUnfilteredStatusText()); - nsAutoTArray entries; + AutoTArray entries; mInternalResponse->UnfilteredHeaders()->GetEntries(entries); for (uint32_t i = 0; i < entries.Length(); ++i) { mChannel->SynthesizeHeader(entries[i].mName, entries[i].mValue); diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index d91842e24f4..7f4af258525 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -2636,7 +2636,7 @@ ServiceWorkerManager::ReportToAllClients(const nsCString& aScope, return; } - nsAutoTArray windows; + AutoTArray windows; // Report errors to every controlled document. for (auto iter = mControlledDocuments.Iter(); !iter.Done(); iter.Next()) { @@ -5125,7 +5125,7 @@ public: } private: - nsAutoTArray, 1> mInstances; + AutoTArray, 1> mInstances; ServiceWorkerState mState; }; diff --git a/dom/workers/ServiceWorkerManager.h b/dom/workers/ServiceWorkerManager.h index afa7bdb40e4..15d02f4f765 100644 --- a/dom/workers/ServiceWorkerManager.h +++ b/dom/workers/ServiceWorkerManager.h @@ -205,7 +205,7 @@ private: // addition and removal. // There is a high chance of there being at least one ServiceWorker // associated with this all the time. - nsAutoTArray mInstances; + AutoTArray mInstances; RefPtr mServiceWorkerPrivate; bool mSkipWaitingFlag; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 8988a4039b3..696e5d79679 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -3128,14 +3128,14 @@ WorkerPrivateParent::BroadcastErrorToSharedWorkers( { AssertIsOnMainThread(); - nsAutoTArray, 10> sharedWorkers; + AutoTArray, 10> sharedWorkers; GetAllSharedWorkers(sharedWorkers); if (sharedWorkers.IsEmpty()) { return; } - nsAutoTArray windowActions; + AutoTArray windowActions; nsresult rv; // First fire the error event at all SharedWorker objects. This may include @@ -5154,7 +5154,7 @@ WorkerPrivate::NotifyFeatures(JSContext* aCx, Status aStatus) } } - nsAutoTArray children; + AutoTArray children; children.AppendElements(mChildWorkers); for (uint32_t index = 0; index < children.Length(); index++) { @@ -5951,7 +5951,7 @@ WorkerPrivate::RunExpiredTimeouts(JSContext* aCx) (now - actual_now).ToMilliseconds())); } - nsAutoTArray expiredTimeouts; + AutoTArray expiredTimeouts; for (uint32_t index = 0; index < mTimeouts.Length(); index++) { nsAutoPtr& info = mTimeouts[index]; if (info->mTargetTime > now) { diff --git a/dom/xbl/nsXBLEventHandler.cpp b/dom/xbl/nsXBLEventHandler.cpp index 790ee374b13..2522419f8e6 100644 --- a/dom/xbl/nsXBLEventHandler.cpp +++ b/dom/xbl/nsXBLEventHandler.cpp @@ -140,7 +140,7 @@ nsXBLKeyEventHandler::HandleEvent(nsIDOMEvent* aEvent) if (!key) return NS_OK; - nsAutoTArray accessKeys; + AutoTArray accessKeys; nsContentUtils::GetAccelKeyCandidates(key, accessKeys); if (accessKeys.IsEmpty()) { diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp index 569fcdb72c0..08f6db50eb9 100644 --- a/dom/xbl/nsXBLService.cpp +++ b/dom/xbl/nsXBLService.cpp @@ -188,7 +188,7 @@ private: ~nsXBLStreamListener(); nsCOMPtr mInner; - nsAutoTArray mBindingRequests; + AutoTArray mBindingRequests; nsCOMPtr mBoundDocument; nsCOMPtr mSink; // Only set until OnStartRequest @@ -647,7 +647,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, bool* aIsReady, nsXBLBinding** aResult) { // More than 6 binding URIs are rare, see bug 55070 comment 18. - nsAutoTArray, 6> uris; + AutoTArray, 6> uris; return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady, aResult, uris); } diff --git a/dom/xbl/nsXBLWindowKeyHandler.cpp b/dom/xbl/nsXBLWindowKeyHandler.cpp index fd51f621a33..083a11aa6e4 100644 --- a/dom/xbl/nsXBLWindowKeyHandler.cpp +++ b/dom/xbl/nsXBLWindowKeyHandler.cpp @@ -441,7 +441,7 @@ nsXBLWindowKeyHandler::WalkHandlersInternal(nsIDOMKeyEvent* aKeyEvent, bool aExecute, bool* aOutReservedForChrome) { - nsAutoTArray accessKeys; + AutoTArray accessKeys; nsContentUtils::GetAccelKeyCandidates(aKeyEvent, accessKeys); if (accessKeys.IsEmpty()) { diff --git a/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp b/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp index 231b7ea465b..fee671ea59f 100644 --- a/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp +++ b/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp @@ -604,7 +604,7 @@ txXPathNodeUtils::comparePosition(const txXPathNode& aNode, // same tree. // Get parents up the tree. - nsAutoTArray parents, otherParents; + AutoTArray parents, otherParents; nsINode* node = aNode.mNode; nsINode* otherNode = aOtherNode.mNode; nsINode* parent; diff --git a/dom/xul/templates/nsTreeRows.h b/dom/xul/templates/nsTreeRows.h index 75eb1eba976..801af022693 100644 --- a/dom/xul/templates/nsTreeRows.h +++ b/dom/xul/templates/nsTreeRows.h @@ -187,7 +187,7 @@ public: class iterator { protected: int32_t mRowIndex; - nsAutoTArray mLink; + AutoTArray mLink; void Next(); void Prev(); diff --git a/dom/xul/templates/nsXULContentBuilder.cpp b/dom/xul/templates/nsXULContentBuilder.cpp index 95b644fa60a..246494016f6 100644 --- a/dom/xul/templates/nsXULContentBuilder.cpp +++ b/dom/xul/templates/nsXULContentBuilder.cpp @@ -1270,7 +1270,7 @@ nsXULContentBuilder::RemoveGeneratedContent(nsIContent* aElement) { // Keep a queue of "ungenerated" elements that we have to probe // for generated content. - nsAutoTArray ungenerated; + AutoTArray ungenerated; if (ungenerated.AppendElement(aElement) == nullptr) return NS_ERROR_OUT_OF_MEMORY; diff --git a/dom/xul/templates/nsXULTemplateBuilder.cpp b/dom/xul/templates/nsXULTemplateBuilder.cpp index fdcc35f1fdc..a5ea7597076 100644 --- a/dom/xul/templates/nsXULTemplateBuilder.cpp +++ b/dom/xul/templates/nsXULTemplateBuilder.cpp @@ -2358,7 +2358,7 @@ nsXULTemplateBuilder::AddSimpleRuleBindings(nsTemplateRule* aRule, // Crawl the content tree of a "simple" rule, adding a variable // assignment for any attribute whose value is "rdf:". - nsAutoTArray elements; + AutoTArray elements; if (elements.AppendElement(aElement) == nullptr) return NS_ERROR_OUT_OF_MEMORY; diff --git a/dom/xul/templates/nsXULTreeBuilder.cpp b/dom/xul/templates/nsXULTreeBuilder.cpp index e67f5e74d97..8c4e9682a78 100644 --- a/dom/xul/templates/nsXULTreeBuilder.cpp +++ b/dom/xul/templates/nsXULTreeBuilder.cpp @@ -1463,7 +1463,7 @@ nsXULTreeBuilder::OpenSubtreeOf(nsTreeRows::Subtree* aSubtree, nsIXULTemplateResult *aResult, int32_t* aDelta) { - nsAutoTArray open; + AutoTArray open; int32_t count = 0; int32_t rulecount = mQuerySets.Length(); diff --git a/editor/libeditor/nsEditor.cpp b/editor/libeditor/nsEditor.cpp index 2980365d1ca..bc604c141df 100644 --- a/editor/libeditor/nsEditor.cpp +++ b/editor/libeditor/nsEditor.cpp @@ -2664,7 +2664,7 @@ nsEditor::SplitNodeImpl(nsIContent& aExistingRightNode, nsIContent& aNewLeftNode) { // Remember all selection points. - nsAutoTArray savedRanges; + AutoTArray savedRanges; for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) { SelectionType type(1 << i); SavedRange range; @@ -2811,7 +2811,7 @@ nsEditor::JoinNodesImpl(nsINode* aNodeToKeep, nsINode* parent = GetNodeLocation(aNodeToKeep, &keepOffset); // Remember all selection points. - nsAutoTArray savedRanges; + AutoTArray savedRanges; for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) { SelectionType type(1 << i); SavedRange range; diff --git a/embedding/components/commandhandler/nsCommandGroup.cpp b/embedding/components/commandhandler/nsCommandGroup.cpp index 8619e207ad4..696b93f67c2 100644 --- a/embedding/components/commandhandler/nsCommandGroup.cpp +++ b/embedding/components/commandhandler/nsCommandGroup.cpp @@ -214,7 +214,7 @@ nsControllerCommandGroup::AddCommandToGroup(const char* aCommand, nsTArray* commandList = mGroupsHash.Get(groupKey); if (!commandList) { // make this list - commandList = new nsAutoTArray; + commandList = new AutoTArray; mGroupsHash.Put(groupKey, commandList); } diff --git a/extensions/cookie/nsPermissionManager.h b/extensions/cookie/nsPermissionManager.h index a75b2d62b6f..7dfcd443523 100644 --- a/extensions/cookie/nsPermissionManager.h +++ b/extensions/cookie/nsPermissionManager.h @@ -121,7 +121,7 @@ public: } // Force the hashtable to use the copy constructor when shuffling entries - // around, otherwise the Auto part of our nsAutoTArray won't be happy! + // around, otherwise the Auto part of our AutoTArray won't be happy! enum { ALLOW_MEMMOVE = false }; inline nsTArray & GetPermissions() @@ -150,7 +150,7 @@ public: } private: - nsAutoTArray mPermissions; + AutoTArray mPermissions; }; // nsISupports diff --git a/gfx/2d/StackArray.h b/gfx/2d/StackArray.h index e3c2684a0bf..a2451f93059 100644 --- a/gfx/2d/StackArray.h +++ b/gfx/2d/StackArray.h @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* A handy class that will allocate data for size*T objects on the stack and - * otherwise allocate them on the heap. It is similar in purpose to nsAutoTArray */ + * otherwise allocate them on the heap. It is similar in purpose to AutoTArray */ template class StackArray diff --git a/gfx/gl/DecomposeIntoNoRepeatTriangles.h b/gfx/gl/DecomposeIntoNoRepeatTriangles.h index 8e8b27ec5f6..f67d6f93e8a 100644 --- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h +++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h @@ -45,8 +45,8 @@ public: } private: // Reserve inline storage for one quad (2 triangles, 3 coords). - nsAutoTArray mVertexCoords; - nsAutoTArray mTexCoords; + AutoTArray mVertexCoords; + AutoTArray mTexCoords; static void AppendRectToCoordArray(InfallibleTArray& array, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1); diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp index aff5a78e79b..61c3fb46ffa 100644 --- a/gfx/gl/GLContextProviderGLX.cpp +++ b/gfx/gl/GLContextProviderGLX.cpp @@ -778,7 +778,7 @@ TRY_AGAIN_NO_SHARING: GLXContext glxContext = shareContext ? shareContext->mContext : nullptr; if (glx.HasCreateContextAttribs()) { - nsAutoTArray attrib_list; + AutoTArray attrib_list; if (glx.HasRobustness()) { int robust_attribs[] = { LOCAL_GL_CONTEXT_FLAGS_ARB, LOCAL_GL_CONTEXT_ROBUST_ACCESS_BIT_ARB, diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index 25b836f0972..0154a1a2eef 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -293,7 +293,7 @@ ImageContainer::SetCurrentImageInTransaction(Image *aImage) NS_ASSERTION(NS_IsMainThread(), "Should be on main thread."); NS_ASSERTION(!mImageClient, "Should use async image transfer with ImageBridge."); - nsAutoTArray images; + AutoTArray images; images.AppendElement(NonOwningImage(aImage)); SetCurrentImageInternal(images); } diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index c1a693e027f..e94e8875ff9 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -634,7 +634,7 @@ public: } private: - nsAutoTArray mImages; + AutoTArray mImages; }; struct PlanarYCbCrData { diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 941d7c7ad6b..74f18051a07 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -21,7 +21,7 @@ #include "nsHashKeys.h" // for nsPtrHashKey #include "nsISupportsImpl.h" // for Layer::AddRef, etc #include "nsRect.h" // for IntRect -#include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl +#include "nsTArray.h" // for AutoTArray, nsTArray_Impl #include "mozilla/layers/ImageHost.h" #include "mozilla/layers/LayerManagerComposite.h" @@ -383,7 +383,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase } // The old list of children: - nsAutoTArray,1> mChildren; + AutoTArray,1> mChildren; float mPreXScale; float mPreYScale; }; diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 079bb3a679e..2fe39163bb6 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -1346,7 +1346,7 @@ ContainerLayer::Collect3DContextLeaves(nsTArray& aToSort) void ContainerLayer::SortChildrenBy3DZOrder(nsTArray& aArray) { - nsAutoTArray toSort; + AutoTArray toSort; for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) { ContainerLayer* container = l->AsContainerLayer(); diff --git a/gfx/layers/basic/BasicLayerManager.cpp b/gfx/layers/basic/BasicLayerManager.cpp index 46be276dcf1..9c3cfa4dc1a 100644 --- a/gfx/layers/basic/BasicLayerManager.cpp +++ b/gfx/layers/basic/BasicLayerManager.cpp @@ -43,7 +43,7 @@ #include "nsPoint.h" // for nsIntPoint #include "nsRect.h" // for mozilla::gfx::IntRect #include "nsRegion.h" // for nsIntRegion, etc -#include "nsTArray.h" // for nsAutoTArray +#include "nsTArray.h" // for AutoTArray #ifdef MOZ_ENABLE_SKIA #include "skia/include/core/SkCanvas.h" // for SkCanvas #include "skia/include/core/SkBitmapDevice.h" // for SkBitmapDevice @@ -897,7 +897,7 @@ BasicLayerManager::PaintSelfOrChildren(PaintLayerContext& aPaintContext, } else { ContainerLayer* container = static_cast(aPaintContext.mLayer); - nsAutoTArray children; + AutoTArray children; container->SortChildrenBy3DZOrder(children); for (uint32_t i = 0; i < children.Length(); i++) { Layer* layer = children.ElementAt(i); diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp index 49143d9fadf..2a5c991c457 100644 --- a/gfx/layers/client/CanvasClient.cpp +++ b/gfx/layers/client/CanvasClient.cpp @@ -120,7 +120,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer) } if (updated) { - nsAutoTArray textures; + AutoTArray textures; CompositableForwarder::TimedTextureClient* t = textures.AppendElement(); t->mTextureClient = mBuffer; t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mBuffer->GetSize()); @@ -476,7 +476,7 @@ CanvasClientSharedSurface::Updated() // Add the new TexClient. MOZ_ALWAYS_TRUE( AddTextureClient(mFront) ); - nsAutoTArray textures; + AutoTArray textures; CompositableForwarder::TimedTextureClient* t = textures.AppendElement(); t->mTextureClient = mFront; t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mFront->GetSize()); diff --git a/gfx/layers/client/ClientContainerLayer.h b/gfx/layers/client/ClientContainerLayer.h index c6ad5b65800..254d2a45a9c 100644 --- a/gfx/layers/client/ClientContainerLayer.h +++ b/gfx/layers/client/ClientContainerLayer.h @@ -13,7 +13,7 @@ #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE #include "nsRegion.h" // for nsIntRegion -#include "nsTArray.h" // for nsAutoTArray +#include "nsTArray.h" // for AutoTArray #include "ReadbackProcessor.h" #include "ClientPaintedLayer.h" @@ -50,7 +50,7 @@ public: DefaultComputeSupportsComponentAlphaChildren(); - nsAutoTArray children; + AutoTArray children; SortChildrenBy3DZOrder(children); ReadbackProcessor readback; diff --git a/gfx/layers/client/ClientLayerManager.h b/gfx/layers/client/ClientLayerManager.h index 7d8b3be4a94..94295c08565 100644 --- a/gfx/layers/client/ClientLayerManager.h +++ b/gfx/layers/client/ClientLayerManager.h @@ -350,8 +350,8 @@ private: APZTestData mApzTestData; RefPtr mForwarder; - nsAutoTArray,2> mTexturePools; - nsAutoTArray mOverfillCallbacks; + AutoTArray,2> mTexturePools; + AutoTArray mOverfillCallbacks; mozilla::TimeStamp mTransactionStart; nsTArray mDidCompositeObservers; diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 77f37097261..9fc49bd6223 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -379,7 +379,7 @@ ContentClientRemoteBuffer::Updated(const nsIntRegion& aRegionToDraw, mForwarder->UseComponentAlphaTextures(this, mTextureClient, mTextureClientOnWhite); } else { - nsAutoTArray textures; + AutoTArray textures; CompositableForwarder::TimedTextureClient* t = textures.AppendElement(); t->mTextureClient = mTextureClient; IntSize size = mTextureClient->GetSize(); diff --git a/gfx/layers/client/ImageClient.cpp b/gfx/layers/client/ImageClient.cpp index 030ba720022..d7fda20665b 100644 --- a/gfx/layers/client/ImageClient.cpp +++ b/gfx/layers/client/ImageClient.cpp @@ -123,7 +123,7 @@ ImageClientSingle::FlushAllImages(AsyncTransactionWaiter* aAsyncTransactionWaite bool ImageClientSingle::UpdateImage(ImageContainer* aContainer, uint32_t aContentFlags) { - nsAutoTArray images; + AutoTArray images; uint32_t generationCounter; aContainer->GetCurrentImages(&images, &generationCounter); @@ -149,7 +149,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer, uint32_t aContentFlag } nsTArray newBuffers; - nsAutoTArray textures; + AutoTArray textures; for (auto& img : images) { Image* image = img.mImage; diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 3ebf7bee7c7..dd3b7ad24a5 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -1401,7 +1401,7 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame, } #endif } else { - nsAutoTArray scrollableLayers; + AutoTArray scrollableLayers; #ifdef MOZ_WIDGET_ANDROID mLayerManager->GetRootScrollableLayers(scrollableLayers); #else diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index 0c842f937aa..f7a46eeeff9 100755 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -29,7 +29,7 @@ #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE #include "nsRegion.h" // for nsIntRegion -#include "nsTArray.h" // for nsAutoTArray +#include "nsTArray.h" // for AutoTArray #include "TextRenderer.h" // for TextRenderer #include #include "VRManager.h" // for VRManager @@ -190,7 +190,7 @@ ContainerRenderVR(ContainerT* aContainer, compositor->SetRenderTarget(surface); - nsAutoTArray children; + AutoTArray children; aContainer->SortChildrenBy3DZOrder(children); gfx::Matrix4x4 origTransform = aContainer->GetEffectiveTransform(); @@ -336,7 +336,7 @@ NeedToDrawCheckerboardingForLayer(Layer* aLayer, Color* aOutCheckerboardingColor struct PreparedData { RefPtr mTmpTarget; - nsAutoTArray mLayers; + AutoTArray mLayers; bool mNeedsSurfaceCopy; }; @@ -361,7 +361,7 @@ ContainerPrepare(ContainerT* aContainer, /** * Determine which layers to draw. */ - nsAutoTArray children; + AutoTArray children; aContainer->SortChildrenBy3DZOrder(children); for (uint32_t i = 0; i < children.Length(); i++) { diff --git a/gfx/layers/composite/FPSCounter.h b/gfx/layers/composite/FPSCounter.h index bf594093dbc..7a59267fced 100644 --- a/gfx/layers/composite/FPSCounter.h +++ b/gfx/layers/composite/FPSCounter.h @@ -12,7 +12,7 @@ #include "GLDefs.h" // for GLuint #include "mozilla/RefPtr.h" // for already_AddRefed, RefCounted #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration -#include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl, etc +#include "nsTArray.h" // for AutoTArray, nsTArray_Impl, etc #include "prio.h" // for NSPR file i/o namespace mozilla { @@ -87,7 +87,7 @@ private: * read at an offset except our latest write * we don't need an explicit read pointer. */ - nsAutoTArray mFrameTimestamps; + AutoTArray mFrameTimestamps; int mWriteIndex; // points to next open write slot int mIteratorIndex; // used only when iterating const char* mFPSName; diff --git a/gfx/layers/composite/FrameUniformityData.h b/gfx/layers/composite/FrameUniformityData.h index 70d9fb0efa6..f7e175f367d 100644 --- a/gfx/layers/composite/FrameUniformityData.h +++ b/gfx/layers/composite/FrameUniformityData.h @@ -30,7 +30,7 @@ struct LayerTransforms { gfx::Point GetStdDev(); // 60 fps * 5 seconds worth of data - nsAutoTArray mTransforms; + AutoTArray mTransforms; }; class LayerTransformRecorder { diff --git a/gfx/layers/ipc/CompositableTransactionParent.cpp b/gfx/layers/ipc/CompositableTransactionParent.cpp index cc0b4e1c178..82327c8bee8 100644 --- a/gfx/layers/ipc/CompositableTransactionParent.cpp +++ b/gfx/layers/ipc/CompositableTransactionParent.cpp @@ -172,7 +172,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation const OpUseTexture& op = aEdit.get_OpUseTexture(); CompositableHost* compositable = AsCompositable(op); - nsAutoTArray textures; + AutoTArray textures; for (auto& timedTexture : op.textures()) { CompositableHost::TimedTexture* t = textures.AppendElement(); t->mTexture = diff --git a/gfx/layers/ipc/CompositorChild.cpp b/gfx/layers/ipc/CompositorChild.cpp index 2f7817c3bca..f1600052ab0 100644 --- a/gfx/layers/ipc/CompositorChild.cpp +++ b/gfx/layers/ipc/CompositorChild.cpp @@ -95,7 +95,7 @@ CompositorChild::Destroy() mLayerManager = nullptr; } - nsAutoTArray transactions; + AutoTArray transactions; ManagedPLayerTransactionChild(transactions); for (int i = transactions.Length() - 1; i >= 0; --i) { RefPtr layers = diff --git a/gfx/layers/ipc/CompositorChild.h b/gfx/layers/ipc/CompositorChild.h index 8ca9f84a69a..a8ce648ddc8 100644 --- a/gfx/layers/ipc/CompositorChild.h +++ b/gfx/layers/ipc/CompositorChild.h @@ -195,7 +195,7 @@ private: DISALLOW_EVIL_CONSTRUCTORS(CompositorChild); // When we receive overfill numbers, notify these client layer managers - nsAutoTArray mOverfillObservers; + AutoTArray mOverfillObservers; // True until the beginning of the two-step shutdown sequence of this actor. bool mCanSend; diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index e99fdfb4a3b..b8f983067ad 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -35,7 +35,7 @@ #include "mozilla/mozalloc.h" // for operator new, etc #include "nsAutoPtr.h" // for nsRefPtr #include "nsISupportsImpl.h" // for ImageContainer::AddRef, etc -#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc +#include "nsTArray.h" // for AutoTArray, nsTArray, etc #include "nsTArrayForwardDeclare.h" // for AutoInfallibleTArray #include "nsThreadUtils.h" // for NS_IsMainThread #include "nsXULAppAPI.h" // for XRE_GetIOMessageLoop @@ -146,7 +146,7 @@ ImageBridgeChild::UseTextures(CompositableClient* aCompositable, MOZ_ASSERT(aCompositable->GetIPDLActor()); MOZ_ASSERT(aCompositable->IsConnected()); - nsAutoTArray textures; + AutoTArray textures; for (auto& t : aTextures) { MOZ_ASSERT(t.mTextureClient); diff --git a/gfx/layers/ipc/ImageBridgeParent.cpp b/gfx/layers/ipc/ImageBridgeParent.cpp index 7e13db32082..7494d412e71 100644 --- a/gfx/layers/ipc/ImageBridgeParent.cpp +++ b/gfx/layers/ipc/ImageBridgeParent.cpp @@ -332,7 +332,7 @@ ImageBridgeParent::NotifyImageComposites(nsTArray& a uint32_t i = 0; bool ok = true; while (i < aNotifications.Length()) { - nsAutoTArray notifications; + AutoTArray notifications; notifications.AppendElement(aNotifications[i]); uint32_t end = i + 1; MOZ_ASSERT(aNotifications[i].imageContainerParent()); diff --git a/gfx/layers/ipc/ImageContainerParent.h b/gfx/layers/ipc/ImageContainerParent.h index 6f1e10edcc0..817aa823163 100644 --- a/gfx/layers/ipc/ImageContainerParent.h +++ b/gfx/layers/ipc/ImageContainerParent.h @@ -26,7 +26,7 @@ public: virtual bool RecvAsyncDelete() override; - nsAutoTArray mImageHosts; + AutoTArray mImageHosts; private: virtual void ActorDestroy(ActorDestroyReason why) override {} diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index f1b11c8dcfb..08bb1f7720c 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -29,7 +29,7 @@ #include "mozilla/layers/TextureClient.h" // for TextureClient #include "mozilla/mozalloc.h" // for operator new, etc #include "nsAutoPtr.h" // for nsRefPtr, getter_AddRefs, etc -#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc +#include "nsTArray.h" // for AutoTArray, nsTArray, etc #include "nsXULAppAPI.h" // for XRE_GetProcessType, etc #include "mozilla/ReentrantMonitor.h" @@ -387,7 +387,7 @@ ShadowLayerForwarder::UseTextures(CompositableClient* aCompositable, { MOZ_ASSERT(aCompositable && aCompositable->IsConnected()); - nsAutoTArray textures; + AutoTArray textures; for (auto& t : aTextures) { MOZ_ASSERT(t.mTextureClient); diff --git a/gfx/layers/opengl/CompositorOGL.h b/gfx/layers/opengl/CompositorOGL.h index bde7a431090..06947781d65 100644 --- a/gfx/layers/opengl/CompositorOGL.h +++ b/gfx/layers/opengl/CompositorOGL.h @@ -28,7 +28,7 @@ #include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_ASSERTION, NS_WARNING #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc -#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc +#include "nsTArray.h" // for AutoTArray, nsTArray, etc #include "nsThreadUtils.h" // for nsRunnable #include "nsXULAppAPI.h" // for XRE_GetProcessType #include "nscore.h" // for NS_IMETHOD diff --git a/gfx/src/nsRegion.cpp b/gfx/src/nsRegion.cpp index a90ea659b5e..a46944e6807 100644 --- a/gfx/src/nsRegion.cpp +++ b/gfx/src/nsRegion.cpp @@ -305,7 +305,7 @@ void nsRegion::SimplifyOutwardByArea(uint32_t aThreshold) pixman_box32_t *topRects = boxes; // we need some temporary storage for merging both rows of rectangles - nsAutoTArray tmpStorage; + AutoTArray tmpStorage; tmpStorage.SetCapacity(n); pixman_box32_t *tmpRect = tmpStorage.Elements(); diff --git a/gfx/thebes/gfxCoreTextShaper.cpp b/gfx/thebes/gfxCoreTextShaper.cpp index ab15e09466f..d83f84f4610 100644 --- a/gfx/thebes/gfxCoreTextShaper.cpp +++ b/gfx/thebes/gfxCoreTextShaper.cpp @@ -349,10 +349,10 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText, // Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds, // and so allocating a new array and copying data with CTRunGetGlyphs // will be extremely rare. - // If this were not the case, we could use an nsAutoTArray<> to + // If this were not the case, we could use an AutoTArray<> to // try and avoid the heap allocation for small runs. // It's possible that some future change to CoreText will mean that - // CTRunGetGlyphsPtr fails more often; if this happens, nsAutoTArray<> + // CTRunGetGlyphsPtr fails more often; if this happens, AutoTArray<> // may become an attractive option. glyphs = ::CTRunGetGlyphsPtr(aCTRun); if (!glyphs) { @@ -390,7 +390,7 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText, double runWidth = ::CTRunGetTypographicBounds(aCTRun, ::CFRangeMake(0, 0), nullptr, nullptr, nullptr); - nsAutoTArray detailedGlyphs; + AutoTArray detailedGlyphs; gfxShapedText::CompressedGlyph *charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset; diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 808341a445b..f8c5b2d1313 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -70,7 +70,7 @@ GetDirectWriteFontName(IDWriteFont *aFont, nsAString& aFontName) } BOOL exists; - nsAutoTArray faceName; + AutoTArray faceName; UINT32 englishIdx = 0; hr = names->FindLocaleName(L"en-us", &englishIdx, &exists); if (FAILED(hr)) { @@ -114,7 +114,7 @@ GetDirectWriteFaceName(IDWriteFont *aFont, return E_FAIL; } - nsAutoTArray faceName; + AutoTArray faceName; UINT32 englishIdx = 0; hr = infostrings->FindLocaleName(L"en-us", &englishIdx, &exists); if (FAILED(hr)) { @@ -633,7 +633,7 @@ gfxDWriteFontEntry::CreateFontFace(IDWriteFontFace **aFontFace, if (FAILED(mFontFace->GetFiles(&numberOfFiles, nullptr))) { return NS_ERROR_FAILURE; } - nsAutoTArray files; + AutoTArray files; files.AppendElements(numberOfFiles); if (FAILED(mFontFace->GetFiles(&numberOfFiles, files.Elements()))) { return NS_ERROR_FAILURE; @@ -1517,7 +1517,7 @@ void DirectWriteFontInfo::LoadFontFamilyData(const nsAString& aFamilyName) { // lookup the family - nsAutoTArray famName; + AutoTArray famName; uint32_t len = aFamilyName.Length(); if(!famName.SetLength(len + 1, fallible)) { diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index 8fd86da3236..e007945dec4 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -1353,7 +1353,7 @@ gfxFT2FontList::GetSystemFontList(InfallibleTArray* retValue) static void LoadSkipSpaceLookupCheck(nsTHashtable& aSkipSpaceLookupCheck) { - nsAutoTArray skiplist; + AutoTArray skiplist; gfxFontUtils::GetPrefsFontList( "font.whitelist.skip_default_features_space_check", skiplist); diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index e20d1aee2ea..cdb0fd935fb 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -347,7 +347,7 @@ LookupAlternateValues(gfxFontFeatureValueSet *featureLookup, uint32_t numAlternates = altValue.Length(); for (uint32_t i = 0; i < numAlternates; i++) { const gfxAlternateValue& av = altValue.ElementAt(i); - nsAutoTArray values; + AutoTArray values; // map ==> bool found = @@ -522,7 +522,7 @@ gfxFontShaper::MergeFontFeatures( // add font-specific feature values from style rules if (aStyle->featureValueLookup && numAlts > 0) { - nsAutoTArray featureList; + AutoTArray featureList; // insert list of alternate feature settings LookupAlternateValues(aStyle->featureValueLookup, aFamilyName, @@ -2190,8 +2190,8 @@ gfxFont::RenderColorGlyph(DrawTarget* aDrawTarget, const mozilla::gfx::Point& aPoint, uint32_t aGlyphId) const { - nsAutoTArray layerGlyphs; - nsAutoTArray layerColors; + AutoTArray layerGlyphs; + AutoTArray layerColors; if (!GetFontEntry()->GetColorLayersInfo(aGlyphId, layerGlyphs, layerColors)) { return false; @@ -3148,8 +3148,8 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget, // apply uppercase transform to the string nsDependentSubstring origString(aText + runStart, runLength); nsAutoString convertedString; - nsAutoTArray charsToMergeArray; - nsAutoTArray deletedCharsArray; + AutoTArray charsToMergeArray; + AutoTArray deletedCharsArray; bool mergeNeeded = nsCaseTransformTextRunFactory:: TransformString(origString, diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 511c01d8286..9047c0caccb 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -2083,7 +2083,7 @@ protected: nsExpirationState mExpirationState; gfxFontStyle mStyle; - nsAutoTArray mGlyphExtentsArray; + AutoTArray mGlyphExtentsArray; nsAutoPtr > > mGlyphChangeObservers; gfxFloat mAdjustedSize; diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index 7dd5d9e573b..84fcbd2bcc9 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -1148,7 +1148,7 @@ gfxFontEntry* gfxFontFamily::FindFontForStyle(const gfxFontStyle& aFontStyle, bool& aNeedsSyntheticBold) { - nsAutoTArray matched; + AutoTArray matched; FindAllFontsForStyle(aFontStyle, matched, aNeedsSyntheticBold); if (!matched.IsEmpty()) { return matched[0]; @@ -1636,7 +1636,7 @@ gfxFontFamily::ReadOtherFamilyNamesForFace(gfxPlatformFontList *aPlatformFontLis { uint32_t dataLength; const char *nameData = hb_blob_get_data(aNameTable, &dataLength); - nsAutoTArray otherFamilyNames; + AutoTArray otherFamilyNames; ReadOtherFamilyNamesForFace(mName, nameData, dataLength, otherFamilyNames, useFullName); @@ -1721,7 +1721,7 @@ gfxFontFamily::ReadFaceNames(gfxPlatformFontList *aPlatformFontList, aFontInfoData->mLoadOtherNames && !asyncFontLoaderDisabled) { - nsAutoTArray otherFamilyNames; + AutoTArray otherFamilyNames; bool foundOtherNames = aFontInfoData->GetOtherFamilyNames(mName, otherFamilyNames); if (foundOtherNames) { diff --git a/gfx/thebes/gfxFontconfigFonts.cpp b/gfx/thebes/gfxFontconfigFonts.cpp index f637fc20261..2e5950e1a05 100644 --- a/gfx/thebes/gfxFontconfigFonts.cpp +++ b/gfx/thebes/gfxFontconfigFonts.cpp @@ -189,7 +189,7 @@ public: cairo_font_face_reference(mFontFace); cairo_font_face_set_user_data(mFontFace, &sFontEntryKey, this, nullptr); - // mPatterns is an nsAutoTArray with 1 space always available, so the + // mPatterns is an AutoTArray with 1 space always available, so the // AppendElement always succeeds. // FIXME: Make this infallible after bug 968520 is done. MOZ_ALWAYS_TRUE(mPatterns.AppendElement(fallible)); @@ -913,7 +913,7 @@ gfxFcFontSet::SortPreferredFonts(bool &aWaitForUserFont) // but FcConfigSubstitute may add more values (e.g. prepending "en" to // "ja" will use western fonts to render Latin/Arabic numerals in Japanese // text.) - nsAutoTArray requiredLangs; + AutoTArray requiredLangs; for (int v = 0; ; ++v) { FcChar8 *lang; FcResult result = FcPatternGetString(mSortPattern, FC_LANG, v, &lang); @@ -1289,7 +1289,7 @@ gfxPangoFontGroup::FindGenericFontsPFG(FontFamilyType aGenericType, nsIAtom *aLanguage, void *aClosure) { - nsAutoTArray resolvedGenerics; + AutoTArray resolvedGenerics; ResolveGenericFontNamesPFG(aGenericType, aLanguage, resolvedGenerics); uint32_t g = 0, numGenerics = resolvedGenerics.Length(); for (g = 0; g < numGenerics; g++) { @@ -1494,7 +1494,7 @@ gfxPangoFontGroup::MakeFontSet(PangoLanguage *aLang, gfxFloat aSizeAdjustFactor, langGroup = do_GetAtom(lang); } - nsAutoTArray fcFamilyList; + AutoTArray fcFamilyList; EnumerateFontListPFG(langGroup ? langGroup.get() : mStyle.language.get(), &fcFamilyList); diff --git a/gfx/thebes/gfxFontconfigFonts.h b/gfx/thebes/gfxFontconfigFonts.h index d08749745aa..76b3e6b0fa9 100644 --- a/gfx/thebes/gfxFontconfigFonts.h +++ b/gfx/thebes/gfxFontconfigFonts.h @@ -73,7 +73,7 @@ private: }; // There is only one of entry in this array unless characters from scripts // of other languages are measured. - nsAutoTArray mFontSets; + AutoTArray mFontSets; gfxFloat mSizeAdjustFactor; PangoLanguage *mPangoLanguage; diff --git a/gfx/thebes/gfxFontconfigUtils.cpp b/gfx/thebes/gfxFontconfigUtils.cpp index 6b2633bf43b..867f60747ed 100644 --- a/gfx/thebes/gfxFontconfigUtils.cpp +++ b/gfx/thebes/gfxFontconfigUtils.cpp @@ -985,7 +985,7 @@ gfxFontconfigUtils::GetLangSupportEntry(const FcChar8 *aLang, bool aWithFonts) #endif }; - nsAutoTArray fonts; + AutoTArray fonts; for (unsigned fs = 0; fs < ArrayLength(fontSets); ++fs) { FcFontSet *fontSet = fontSets[fs]; diff --git a/gfx/thebes/gfxFontconfigUtils.h b/gfx/thebes/gfxFontconfigUtils.h index de9f27f9065..86e9a2c3b46 100644 --- a/gfx/thebes/gfxFontconfigUtils.h +++ b/gfx/thebes/gfxFontconfigUtils.h @@ -260,11 +260,11 @@ protected: return mFonts; } - // Don't memmove the nsAutoTArray. + // Don't memmove the AutoTArray. enum { ALLOW_MEMMOVE = false }; private: // There is usually only one font, but sometimes more. - nsAutoTArray,1> mFonts; + AutoTArray,1> mFonts; }; class LangSupportEntry : public CopiedFcStrEntry { diff --git a/gfx/thebes/gfxGraphiteShaper.cpp b/gfx/thebes/gfxGraphiteShaper.cpp index 97ac0f4d3ea..257655a6c20 100644 --- a/gfx/thebes/gfxGraphiteShaper.cpp +++ b/gfx/thebes/gfxGraphiteShaper.cpp @@ -313,7 +313,7 @@ gfxGraphiteShaper::SetGlyphsFromSegment(DrawTarget *aDrawTarget, charGlyphs[offs].SetSimpleGlyph(appAdvance, gids[c.baseGlyph]); } else { // not a one-to-one mapping with simple metrics: use DetailedGlyph - nsAutoTArray details; + AutoTArray details; float clusterLoc; for (uint32_t j = c.baseGlyph; j < c.baseGlyph + c.nGlyphs; ++j) { gfxShapedText::DetailedGlyph* d = details.AppendElement(); diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp index 8299ca9d884..675307098de 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp @@ -1498,7 +1498,7 @@ gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget, gfxFontEntry *entry = mFont->GetFontEntry(); // insert any merged features into hb_feature array - nsAutoTArray features; + AutoTArray features; MergeFontFeatures(style, entry->mFeatureSettings, aShapedText->DisableLigatures(), @@ -1579,7 +1579,7 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, return NS_OK; } - nsAutoTArray detailedGlyphs; + AutoTArray detailedGlyphs; uint32_t wordLength = aLength; static const int32_t NO_GLYPH = -1; diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 4ee0f0cd415..9d2a85a9965 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -733,7 +733,7 @@ gfxMacPlatformFontList::InitFontList() void gfxMacPlatformFontList::InitSingleFaceList() { - nsAutoTArray singleFaceFonts; + AutoTArray singleFaceFonts; gfxFontUtils::GetPrefsFontList("font.single-face-list", singleFaceFonts); uint32_t numFonts = singleFaceFonts.Length(); @@ -902,7 +902,7 @@ gfxMacPlatformFontList::InitSystemFonts() #endif nsAutoCString en("en"); - nsAutoTArray list; + AutoTArray list; LookupFontCascadeForLang(en, list); mDefaultCascadeFamilies.AppendElements(list); } @@ -1018,7 +1018,7 @@ gfxMacPlatformFontList::GlobalFontFallback(const uint32_t aCh, ::CFStringCompare(familyNameRef, CFSTR("LastResort"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) { - nsAutoTArray buffer; + AutoTArray buffer; CFIndex familyNameLen = ::CFStringGetLength(familyNameRef); buffer.SetLength(familyNameLen+1); ::CFStringGetCharacters(familyNameRef, ::CFRangeMake(0, familyNameLen), @@ -1300,7 +1300,7 @@ gfxMacPlatformFontList::AppendLinkedSystemFamilies(nsIAtom* aLanguage, } // lookup the cascade fonts - nsAutoTArray list; + AutoTArray list; LookupFontCascadeForLang(lang, list); // add cascade to cascade cache @@ -1380,7 +1380,7 @@ MacFontInfo::LoadFontFamilyData(const nsAString& aFamilyName) CFStringRef faceName = (CFStringRef) CTFontDescriptorCopyAttribute(faceDesc, kCTFontNameAttribute); - nsAutoTArray buffer; + AutoTArray buffer; CFIndex len = CFStringGetLength(faceName); buffer.SetLength(len+1); CFStringGetCharacters(faceName, ::CFRangeMake(0, len), diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index dd5521c87e8..9ed85639bc2 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -391,7 +391,7 @@ gfxPlatformFontList::LookupInFaceNameLists(const nsAString& aFaceName) void gfxPlatformFontList::PreloadNamesList() { - nsAutoTArray preloadFonts; + AutoTArray preloadFonts; gfxFontUtils::GetPrefsFontList("font.preload-names-list", preloadFonts); uint32_t numFonts = preloadFonts.Length(); @@ -411,7 +411,7 @@ gfxPlatformFontList::PreloadNamesList() void gfxPlatformFontList::LoadBadUnderlineList() { - nsAutoTArray blacklist; + AutoTArray blacklist; gfxFontUtils::GetPrefsFontList("font.blacklist.underline_offset", blacklist); uint32_t numFonts = blacklist.Length(); for (uint32_t i = 0; i < numFonts; i++) { @@ -568,7 +568,7 @@ gfxPlatformFontList::CommonFontFallback(uint32_t aCh, uint32_t aNextCh, const gfxFontStyle* aMatchStyle, gfxFontFamily** aMatchedFamily) { - nsAutoTArray defaultFallbacks; + AutoTArray defaultFallbacks; uint32_t i, numFallbacks; gfxPlatform::GetPlatform()->GetCommonFallbackFonts(aCh, aNextCh, @@ -795,7 +795,7 @@ gfxPlatformFontList::ResolveGenericFontNames( return; } - nsAutoTArray genericFamilies; + AutoTArray genericFamilies; // load family for "font.name.generic.lang" nsAutoCString prefFontName("font.name."); diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 854557e32eb..aa7207f176e 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -397,7 +397,7 @@ gfxTextRun::DrawGlyphs(gfxFont *aFont, uint32_t aStart, uint32_t aEnd, uint32_t aSpacingStart, uint32_t aSpacingEnd, TextRunDrawParams& aParams, uint16_t aOrientation) { - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; bool haveSpacing = GetAdjustedSpacingArray(aStart, aEnd, aProvider, aSpacingStart, aSpacingEnd, &spacingBuffer); aParams.spacing = haveSpacing ? spacingBuffer.Elements() : nullptr; @@ -711,7 +711,7 @@ gfxTextRun::DrawEmphasisMarks(gfxContext *aContext, gfxTextRun* aMark, inlineCoord += direction * ComputePartialLigatureWidth(start, ligatureRunStart, aProvider); - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; bool haveSpacing = GetAdjustedSpacingArray( ligatureRunStart, ligatureRunEnd, aProvider, ligatureRunStart, ligatureRunEnd, &spacingBuffer); @@ -734,7 +734,7 @@ gfxTextRun::AccumulateMetricsForRun(gfxFont *aFont, uint16_t aOrientation, Metrics *aMetrics) { - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; bool haveSpacing = GetAdjustedSpacingArray(aStart, aEnd, aProvider, aSpacingStart, aSpacingEnd, &spacingBuffer); Metrics metrics = aFont->Measure(this, aStart, aEnd, aBoundingBoxType, @@ -1027,7 +1027,7 @@ gfxTextRun::GetAdvanceWidth(uint32_t aStart, uint32_t aLength, // processing it along with the glyphs. if (aProvider && (mFlags & gfxTextRunFactory::TEXT_ENABLE_SPACING)) { uint32_t i; - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; if (spacingBuffer.AppendElements(aLength)) { GetAdjustedSpacing(this, ligatureRunStart, ligatureRunEnd, aProvider, spacingBuffer.Elements()); @@ -1614,7 +1614,7 @@ gfxFontGroup::BuildFontList() } // initialize fonts in the font family list - nsAutoTArray fonts; + AutoTArray fonts; gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList(); // lookup fonts in the fontlist @@ -1682,7 +1682,7 @@ void gfxFontGroup::AddFamilyToFontList(gfxFontFamily* aFamily) { NS_ASSERTION(aFamily, "trying to add a null font family to fontlist"); - nsAutoTArray fontEntryList; + AutoTArray fontEntryList; bool needsBold; aFamily->FindAllFontsForStyle(mStyle, fontEntryList, needsBold); // add these to the fontlist @@ -1846,7 +1846,7 @@ gfxFontGroup::GetDefaultFont() // that assumes it will be able to get valid metrics for layout, // just look for the first usable font and put in the list. // (see bug 554544) - nsAutoTArray,200> familyList; + AutoTArray,200> familyList; pfl->GetFontFamilyList(familyList); numFonts = familyList.Length(); for (uint32_t i = 0; i < numFonts; ++i) { @@ -2345,7 +2345,7 @@ gfxFontGroup::InitScriptRun(DrawTarget* aDrawTarget, gfxFont *mainFont = GetFirstValidFont(); uint32_t runStart = 0; - nsAutoTArray fontRanges; + AutoTArray fontRanges; ComputeRanges(fontRanges, aString, aLength, aRunScript, aTextRun->GetFlags() & gfxTextRunFactory::TEXT_ORIENT_MASK); uint32_t numRanges = fontRanges.Length(); diff --git a/gfx/thebes/gfxTextRun.h b/gfx/thebes/gfxTextRun.h index d60b5854922..ea576acc5de 100644 --- a/gfx/thebes/gfxTextRun.h +++ b/gfx/thebes/gfxTextRun.h @@ -717,7 +717,7 @@ private: // XXX this should be changed to a GlyphRun plus a maybe-null GlyphRun*, // for smaller size especially in the super-common one-glyphrun case - nsAutoTArray mGlyphRuns; + AutoTArray mGlyphRuns; void *mUserData; gfxFontGroup *mFontGroup; // addrefed on creation, but our reference diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index f7e5341b0b5..48e31c75695 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -1284,7 +1284,7 @@ gfxWindowsPlatform::GetDLLVersion(char16ptr_t aDLLPath, nsAString& aVersion) // version info not available case aVersion.AssignLiteral(MOZ_UTF16("0.0.0.0")); versInfoSize = GetFileVersionInfoSizeW(aDLLPath, nullptr); - nsAutoTArray versionInfo; + AutoTArray versionInfo; if (versInfoSize == 0 || !versionInfo.AppendElements(uint32_t(versInfoSize))) diff --git a/hal/gonk/GonkSensor.cpp b/hal/gonk/GonkSensor.cpp index 7bffd63fe63..9f94e9b6926 100644 --- a/hal/gonk/GonkSensor.cpp +++ b/hal/gonk/GonkSensor.cpp @@ -183,7 +183,7 @@ public: private: SensorData mSensorData; - nsAutoTArray mSensorValues; + AutoTArray mSensorValues; }; namespace hal_impl { diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 2e4e03a9437..fe6ad040e56 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -721,7 +721,7 @@ RasterImage::UpdateImageContainer() } mLastImageContainerDrawResult = drawResult; - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement(ImageContainer::NonOwningImage(image)); container->SetCurrentImages(imageList); } diff --git a/image/decoders/icon/mac/nsIconChannelCocoa.mm b/image/decoders/icon/mac/nsIconChannelCocoa.mm index 2b6c6e12d03..e6208d7be75 100644 --- a/image/decoders/icon/mac/nsIconChannelCocoa.mm +++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm @@ -350,7 +350,7 @@ nsIconChannel::MakeInputStream(nsIInputStream** _retval, // create our buffer int32_t bufferCapacity = 2 + [bitmapRep bytesPerPlane]; - nsAutoTArray iconBuffer; // initial size is for + AutoTArray iconBuffer; // initial size is for // 16x16 iconBuffer.SetLength(bufferCapacity); diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp index 9ce4ccb0244..ac4a8f8589a 100644 --- a/image/imgLoader.cpp +++ b/image/imgLoader.cpp @@ -1356,7 +1356,7 @@ NS_IMETHODIMP_(void) imgLoader::ClearCacheForControlledDocument(nsIDocument* aDoc) { MOZ_ASSERT(aDoc); - nsAutoTArray, 128> entriesToBeRemoved; + AutoTArray, 128> entriesToBeRemoved; imgCacheTable& cache = GetCache(false); for (auto iter = cache.Iter(); !iter.Done(); iter.Next()) { auto& key = iter.Key(); diff --git a/intl/hyphenation/glue/nsHyphenator.cpp b/intl/hyphenation/glue/nsHyphenator.cpp index 8a75090e40f..6235f5550c8 100644 --- a/intl/hyphenation/glue/nsHyphenator.cpp +++ b/intl/hyphenation/glue/nsHyphenator.cpp @@ -121,7 +121,7 @@ nsHyphenator::Hyphenate(const nsAString& aString, } } - nsAutoTArray utf8hyphens; + AutoTArray utf8hyphens; utf8hyphens.SetLength(utf8.Length() + 5); char **rep = nullptr; int *pos = nullptr; diff --git a/intl/locale/mac/nsDateTimeFormatMac.cpp b/intl/locale/mac/nsDateTimeFormatMac.cpp index e4ab1fc822f..6ee73292d7a 100644 --- a/intl/locale/mac/nsDateTimeFormatMac.cpp +++ b/intl/locale/mac/nsDateTimeFormatMac.cpp @@ -217,7 +217,7 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale, CFIndex stringLen = CFStringGetLength(formattedDate); - nsAutoTArray stringBuffer; + AutoTArray stringBuffer; stringBuffer.SetLength(stringLen + 1); CFStringGetCharacters(formattedDate, CFRangeMake(0, stringLen), stringBuffer.Elements()); stringOut.Assign(reinterpret_cast(stringBuffer.Elements()), stringLen); diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp index 76d89abcb55..13b3f7f01b3 100644 --- a/intl/locale/nsLocaleService.cpp +++ b/intl/locale/nsLocaleService.cpp @@ -178,7 +178,7 @@ nsLocaleService::nsLocaleService(void) CFStringRef userLocaleStr = ::CFLocaleGetIdentifier(userLocaleRef); ::CFRetain(userLocaleStr); - nsAutoTArray buffer; + AutoTArray buffer; int size = ::CFStringGetLength(userLocaleStr); buffer.SetLength(size + 1); CFRange range = ::CFRangeMake(0, size); diff --git a/intl/lwbrk/nsJISx4051LineBreaker.cpp b/intl/lwbrk/nsJISx4051LineBreaker.cpp index 1b2a2382e0f..b2d0019df3d 100644 --- a/intl/lwbrk/nsJISx4051LineBreaker.cpp +++ b/intl/lwbrk/nsJISx4051LineBreaker.cpp @@ -774,7 +774,7 @@ nsJISx4051LineBreaker::WordMove(const char16_t* aText, uint32_t aLen, } int32_t ret; - nsAutoTArray breakState; + AutoTArray breakState; if (!textNeedsJISx4051 || !breakState.AppendElements(end - begin)) { // No complex text character, do not try to do complex line break. // (This is required for serializers. See Bug #344816.) diff --git a/intl/lwbrk/nsPangoBreaker.cpp b/intl/lwbrk/nsPangoBreaker.cpp index 8d5104c42d1..c6fcb37cf8b 100644 --- a/intl/lwbrk/nsPangoBreaker.cpp +++ b/intl/lwbrk/nsPangoBreaker.cpp @@ -18,7 +18,7 @@ NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, memset(aBreakBefore, false, aLength * sizeof(uint8_t)); - nsAutoTArray attrBuffer; + AutoTArray attrBuffer; if (!attrBuffer.AppendElements(aLength + 1)) return; diff --git a/intl/lwbrk/nsUniscribeBreaker.cpp b/intl/lwbrk/nsUniscribeBreaker.cpp index 0d29d284a31..2a1b69b2267 100644 --- a/intl/lwbrk/nsUniscribeBreaker.cpp +++ b/intl/lwbrk/nsUniscribeBreaker.cpp @@ -21,7 +21,7 @@ NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, int outItems = 0; HRESULT result; - nsAutoTArray items; + AutoTArray items; char16ptr_t text = aText; memset(aBreakBefore, false, aLength); @@ -42,7 +42,7 @@ NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, for (int iItem = 0; iItem < outItems; ++iItem) { uint32_t endOffset = (iItem + 1 == outItems ? aLength : items[iItem + 1].iCharPos); uint32_t startOffset = items[iItem].iCharPos; - nsAutoTArray sla; + AutoTArray sla; if (!sla.AppendElements(endOffset - startOffset)) return; diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h index 1677c586226..93f2aed488d 100644 --- a/ipc/glue/IPCMessageUtils.h +++ b/ipc/glue/IPCMessageUtils.h @@ -542,9 +542,9 @@ struct ParamTraits > }; template -struct ParamTraits> : ParamTraits> +struct ParamTraits> : ParamTraits> { - typedef nsAutoTArray paramType; + typedef AutoTArray paramType; }; template<> diff --git a/ipc/glue/WindowsMessageLoop.cpp b/ipc/glue/WindowsMessageLoop.cpp index fcf0b201368..f743a93e1fc 100644 --- a/ipc/glue/WindowsMessageLoop.cpp +++ b/ipc/glue/WindowsMessageLoop.cpp @@ -830,7 +830,7 @@ MessageChannel::SyncStackFrame::SyncStackFrame(MessageChannel* channel, bool int if (!mStaticPrev) { NS_ASSERTION(!gNeuteredWindows, "Should only set this once!"); - gNeuteredWindows = new nsAutoTArray(); + gNeuteredWindows = new AutoTArray(); NS_ASSERTION(gNeuteredWindows, "Out of memory!"); } } diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index 5f415f9a79c..9a3aae5b7d9 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -1288,7 +1288,7 @@ class MOZ_STACK_CLASS CallMethodHelper const uint16_t mVTableIndex; HandleId mIdxValueId; - nsAutoTArray mDispatchParams; + AutoTArray mDispatchParams; uint8_t mJSContextIndex; // TODO make const uint8_t mOptArgcIndex; // TODO make const diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 43124d96b40..50d40788a32 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -213,13 +213,13 @@ FrameLayerBuilder::DisplayItemData::BeginUpdate(Layer* aLayer, LayerState aState // We avoid adding or removing element unnecessarily // since we have to modify userdata each time - nsAutoTArray copy(mFrameList); + AutoTArray copy(mFrameList); if (!copy.RemoveElement(aItem->Frame())) { AddFrame(aItem->Frame()); mFrameListChanges.AppendElement(aItem->Frame()); } - nsAutoTArray mergedFrames; + AutoTArray mergedFrames; aItem->GetMergedFrames(&mergedFrames); for (uint32_t i = 0; i < mergedFrames.Length(); ++i) { if (!copy.RemoveElement(mergedFrames[i])) { @@ -1382,7 +1382,7 @@ protected: * It's essential that this array is only appended to, since PaintedLayerData * records the index of its PaintedLayer in this array. */ - typedef nsAutoTArray AutoLayersArray; + typedef AutoTArray AutoLayersArray; AutoLayersArray mNewChildLayers; nsTHashtable> mPaintedLayersAvailableForRecycling; nscoord mAppUnitsPerDevPixel; @@ -4667,7 +4667,7 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) return; } - nsAutoTArray metricsArray; + AutoTArray metricsArray; if (aEntry->mBaseFrameMetrics) { metricsArray.AppendElement(*aEntry->mBaseFrameMetrics); @@ -4768,7 +4768,7 @@ GetStationaryClipInContainer(Layer* aLayer) void ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer) { - nsAutoTArray opaqueRegions; + AutoTArray opaqueRegions; bool hideAll = false; int32_t opaqueRegionForContainer = -1; diff --git a/layout/base/FrameLayerBuilder.h b/layout/base/FrameLayerBuilder.h index 5f018d0fdaa..96049dd0e0a 100644 --- a/layout/base/FrameLayerBuilder.h +++ b/layout/base/FrameLayerBuilder.h @@ -489,7 +489,7 @@ public: RefPtr mLayer; RefPtr mOptLayer; RefPtr mInactiveManager; - nsAutoTArray mFrameList; + AutoTArray mFrameList; nsAutoPtr mGeometry; DisplayItemClip mClip; uint32_t mDisplayItemKey; @@ -501,7 +501,7 @@ public: * BeginUpdate and EndUpdate. */ nsDisplayItem* mItem; - nsAutoTArray mFrameListChanges; + AutoTArray mFrameListChanges; /** * Used to track if data currently stored in mFramesWithLayers (from an existing diff --git a/layout/base/PositionedEventTargeting.cpp b/layout/base/PositionedEventTargeting.cpp index 6b02ad978da..a0170510e28 100644 --- a/layout/base/PositionedEventTargeting.cpp +++ b/layout/base/PositionedEventTargeting.cpp @@ -595,7 +595,7 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent, restrictToDescendants, prefs, aFlags); PET_LOG("Expanded point to target rect %s\n", mozilla::layers::Stringify(targetRect).c_str()); - nsAutoTArray candidates; + AutoTArray candidates; nsresult rv = nsLayoutUtils::GetFramesForArea(aRootFrame, targetRect, candidates, flags); if (NS_FAILED(rv)) { return target; diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index 2f0b914f074..7bb8cb7ab8c 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -917,7 +917,7 @@ class MOZ_STACK_CLASS AutoDisplayContentsAncestorPusher final private: TreeMatchContext& mTreeMatchContext; nsPresContext* const mPresContext; - nsAutoTArray mAncestors; + AutoTArray mAncestors; }; } // namespace mozilla diff --git a/layout/base/RestyleTracker.cpp b/layout/base/RestyleTracker.cpp index 0c2237048d4..c0ff65e78eb 100644 --- a/layout/base/RestyleTracker.cpp +++ b/layout/base/RestyleTracker.cpp @@ -165,7 +165,7 @@ RestyleTracker::DoProcessRestyles() while (mPendingRestyles.Count()) { if (mHaveLaterSiblingRestyles) { // Convert them to individual restyles on all the later siblings - nsAutoTArray, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr; + AutoTArray, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr; for (auto iter = mPendingRestyles.Iter(); !iter.Done(); iter.Next()) { auto element = static_cast(iter.Key()); // Only collect the entries that actually need restyling by us (and @@ -280,7 +280,7 @@ RestyleTracker::DoProcessRestyles() // scratch array instead of calling out to ProcessOneRestyle while // enumerating the hashtable. Use the stack if we can, otherwise // fall back on heap-allocation. - nsAutoTArray restyleArr; + AutoTArray restyleArr; RestyleEnumerateData* restylesToProcess = restyleArr.AppendElements(mPendingRestyles.Count()); if (restylesToProcess) { diff --git a/layout/base/RestyleTracker.h b/layout/base/RestyleTracker.h index e2e7d943551..33bf4a6b7be 100644 --- a/layout/base/RestyleTracker.h +++ b/layout/base/RestyleTracker.h @@ -390,7 +390,7 @@ private: const RestyleHintData& aRestyleHintData); typedef nsClassHashtable PendingRestyleTable; - typedef nsAutoTArray< RefPtr, 32> RestyleRootArray; + typedef AutoTArray< RefPtr, 32> RestyleRootArray; // Our restyle bits. These will be a subset of ELEMENT_ALL_RESTYLE_FLAGS, and // will include one flag from ELEMENT_PENDING_RESTYLE_FLAGS, one flag // from ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS, and might also include diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index 2d423aecbcb..cce51607b81 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -105,7 +105,7 @@ static char16_t GetBidiControl(nsStyleContext* aStyleContext, struct BidiParagraphData { nsString mBuffer; - nsAutoTArray mEmbeddingStack; + AutoTArray mEmbeddingStack; nsTArray mLogicalFrames; nsTArray mLinePerFrame; nsDataHashtable mContentToFrameIndex; @@ -394,7 +394,7 @@ struct BidiLineData { nsTArray mLogicalFrames; nsTArray mVisualFrames; nsTArray mIndexMap; - nsAutoTArray mLevels; + AutoTArray mLevels; bool mIsReordered; BidiLineData(nsIFrame* aFirstFrameOnLine, int32_t aNumFramesOnLine) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 16bbba972dd..81b31dc162b 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -1310,7 +1310,7 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems, nsIFrame* firstNewFrame = aFrameItems.FirstChild(); // Cache the ancestor chain so that we can reuse it if needed. - nsAutoTArray firstNewFrameAncestors; + AutoTArray firstNewFrameAncestors; nsIFrame* notCommonAncestor = nullptr; if (lastChild) { notCommonAncestor = nsLayoutUtils::FillAncestors(firstNewFrame, @@ -1328,7 +1328,7 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems, } else { // Try the other children. First collect them to an array so that a // reasonable fast binary search can be used to find the insertion point. - nsAutoTArray children; + AutoTArray children; for (nsIFrame* f = childList.FirstChild(); f != lastChild; f = f->GetNextSibling()) { children.AppendElement(f); @@ -2840,7 +2840,7 @@ nsCSSFrameConstructor::ConstructAnonymousContentForCanvas(nsFrameConstructorStat { NS_ASSERTION(aFrame->GetType() == nsGkAtoms::canvasFrame, "aFrame should be canvas frame!"); - nsAutoTArray anonymousItems; + AutoTArray anonymousItems; GetAnonymousContent(aDocElement, aFrame, anonymousItems); if (anonymousItems.IsEmpty()) { return; @@ -3968,7 +3968,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState, PendingBinding* aPendingBinding, nsFrameItems& aChildItems) { - nsAutoTArray newAnonymousItems; + AutoTArray newAnonymousItems; nsresult rv = GetAnonymousContent(aParent, aParentFrame, newAnonymousItems); NS_ENSURE_SUCCESS(rv, rv); @@ -10381,7 +10381,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, // Create any anonymous frames we need here. This must happen before the // non-anonymous children are processed to ensure that popups are never // constructed before the popupset. - nsAutoTArray anonymousItems; + AutoTArray anonymousItems; GetAnonymousContent(aContent, aPossiblyLeafFrame, anonymousItems); #ifdef DEBUG for (uint32_t i = 0; i < anonymousItems.Length(); ++i) { diff --git a/layout/base/nsCounterManager.cpp b/layout/base/nsCounterManager.cpp index 6adf34d06ea..0a2424f3bd2 100644 --- a/layout/base/nsCounterManager.cpp +++ b/layout/base/nsCounterManager.cpp @@ -94,7 +94,7 @@ nsCounterUseNode::GetText(nsString& aResult) { aResult.Truncate(); - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(static_cast(this)); if (mAllCounters && mScopeStart) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index dd0976aeeca..6455b86a413 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -966,7 +966,7 @@ nsDisplayListBuilder::MarkFramesForDisplayList(nsIFrame* aDirtyFrame, void nsDisplayListBuilder::MarkPreserve3DFramesForDisplayList(nsIFrame* aDirtyFrame, const nsRect& aDirtyRect) { - nsAutoTArray childListArray; + AutoTArray childListArray; aDirtyFrame->GetChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); for (; !lists.IsDone(); lists.Next()) { @@ -1471,7 +1471,7 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder, bool anyVisible = false; - nsAutoTArray elements; + AutoTArray elements; MoveListTo(this, &elements); for (int32_t i = elements.Length() - 1; i >= 0; --i) { @@ -1908,7 +1908,7 @@ void nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, aState->mItemBuffer.AppendElement(item); } - nsAutoTArray temp; + AutoTArray temp; for (int32_t i = aState->mItemBuffer.Length() - 1; i >= itemBufferStart; --i) { // Pop element off the end of the buffer. We want to shorten the buffer // so that recursive calls to HitTest have more buffer space. @@ -1928,7 +1928,7 @@ void nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, if (!item->GetClip().MayIntersect(aRect)) { continue; } - nsAutoTArray neverUsed; + AutoTArray neverUsed; // Start gethering leaves of the 3D rendering context, and // append leaves at the end of mItemBuffer. Leaves are // processed at following iterations. @@ -1939,7 +1939,7 @@ void nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, continue; } if (same3DContext || item->GetClip().MayIntersect(r)) { - nsAutoTArray outFrames; + AutoTArray outFrames; item->HitTest(aBuilder, aRect, aState, &outFrames); // For 3d transforms with preserve-3d we add hit frames into the temp list @@ -3663,7 +3663,7 @@ nsDisplayBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder, nsPoint offset = ToReferenceFrame(); nsRect borderRect = mFrame->VisualBorderRectRelativeToSelf() + offset; nsPresContext* presContext = mFrame->PresContext(); - nsAutoTArray rects; + AutoTArray rects; ComputeDisjointRectangles(mVisibleRegion, &rects); PROFILER_LABEL("nsDisplayBoxShadowOuter", "Paint", @@ -3751,7 +3751,7 @@ nsDisplayBoxShadowInner::Paint(nsDisplayListBuilder* aBuilder, nsPoint offset = ToReferenceFrame(); nsRect borderRect = nsRect(offset, mFrame->GetSize()); nsPresContext* presContext = mFrame->PresContext(); - nsAutoTArray rects; + AutoTArray rects; ComputeDisjointRectangles(mVisibleRegion, &rects); PROFILER_LABEL("nsDisplayBoxShadowInner", "Paint", diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index e642f95c85b..4a9198b009f 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -1195,9 +1195,9 @@ private: nsDisplayLayerEventRegions* mLayerEventRegions; PLArenaPool mPool; nsCOMPtr mBoundingSelection; - nsAutoTArray mPresShellStates; - nsAutoTArray mFramesMarkedForDisplay; - nsAutoTArray mThemeGeometries; + AutoTArray mPresShellStates; + AutoTArray mFramesMarkedForDisplay; + AutoTArray mThemeGeometries; nsDisplayTableItem* mCurrentTableItem; DisplayListClipState mClipState; // mCurrentFrame is the frame that we're currently calling (or about to call) @@ -1358,7 +1358,7 @@ public: // Handling transform items for preserve 3D frames. bool mInPreserves3D; - nsAutoTArray mItemBuffer; + AutoTArray mItemBuffer; }; /** diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index 21c15cf3a4e..e8697e86a6e 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -1783,7 +1783,7 @@ protected: // same update block we have already had other changes that require // the whole document to be restyled (i.e., mStylesHaveChanged is already // true), then we don't bother adding the scope root here. - nsAutoTArray,1> mChangedScopeStyleRoots; + AutoTArray,1> mChangedScopeStyleRoots; static nsIContent* gKeyDownTarget; diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 64252a89ba3..2cd96e32136 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -1597,7 +1597,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIContent* aContent1, NS_PRECONDITION(aContent1, "aContent1 must not be null"); NS_PRECONDITION(aContent2, "aContent2 must not be null"); - nsAutoTArray content1Ancestors; + AutoTArray content1Ancestors; nsINode* c1; for (c1 = aContent1; c1 && c1 != aCommonAncestor; c1 = c1->GetParentNode()) { content1Ancestors.AppendElement(c1); @@ -1608,7 +1608,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIContent* aContent1, aCommonAncestor = nullptr; } - nsAutoTArray content2Ancestors; + AutoTArray content2Ancestors; nsINode* c2; for (c2 = aContent2; c2 && c2 != aCommonAncestor; c2 = c2->GetParentNode()) { content2Ancestors.AppendElement(c2); @@ -1702,7 +1702,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIFrame* aFrame1, NS_PRECONDITION(aFrame1, "aFrame1 must not be null"); NS_PRECONDITION(aFrame2, "aFrame2 must not be null"); - nsAutoTArray frame2Ancestors; + AutoTArray frame2Ancestors; nsIFrame* nonCommonAncestor = FillAncestors(aFrame2, aCommonAncestor, &frame2Ancestors); @@ -1729,7 +1729,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIFrame* aFrame1, return 0; } - nsAutoTArray frame1Ancestors; + AutoTArray frame1Ancestors; if (aCommonAncestor && !FillAncestors(aFrame1, aCommonAncestor, &frame1Ancestors)) { // We reached the root of the frame tree ... if aCommonAncestor was set, @@ -2501,8 +2501,8 @@ nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(nsIFrame* aFrame) nsIFrame* nsLayoutUtils::FindNearestCommonAncestorFrame(nsIFrame* aFrame1, nsIFrame* aFrame2) { - nsAutoTArray ancestors1; - nsAutoTArray ancestors2; + AutoTArray ancestors1; + AutoTArray ancestors2; nsIFrame* commonAncestor = nullptr; if (aFrame1->PresContext() == aFrame2->PresContext()) { commonAncestor = aFrame1->PresContext()->PresShell()->GetRootFrame(); @@ -2959,7 +2959,7 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, uint32_t aFlags) js::ProfileEntry::Category::GRAPHICS); nsresult rv; - nsAutoTArray outFrames; + AutoTArray outFrames; rv = GetFramesForArea(aFrame, nsRect(aPt, nsSize(1, 1)), outFrames, aFlags); NS_ENSURE_SUCCESS(rv, nullptr); return outFrames.Length() ? outFrames.ElementAt(0) : nullptr; @@ -5038,7 +5038,7 @@ nsLayoutUtils::ComputeBSizeDependentValue( /* static */ void nsLayoutUtils::MarkDescendantsDirty(nsIFrame *aSubtreeRoot) { - nsAutoTArray subtrees; + AutoTArray subtrees; subtrees.AppendElement(aSubtreeRoot); // dirty descendants, iterating over subtrees that may include @@ -5051,7 +5051,7 @@ nsLayoutUtils::MarkDescendantsDirty(nsIFrame *aSubtreeRoot) // recursion). // Note that nsHTMLReflowState::InitResizeFlags has some similar // code; see comments there for how and why it differs. - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(subtreeRoot); do { @@ -7451,7 +7451,7 @@ nsLayoutUtils::SizeOfTextRunsForFrames(nsIFrame* aFrame, return total; } - nsAutoTArray childListArray; + AutoTArray childListArray; aFrame->GetChildLists(&childListArray); for (nsIFrame::ChildListArrayIterator childLists(childListArray); diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 71f3b93718f..8bedc64f72f 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -3112,7 +3112,7 @@ SortConfigurations(nsTArray* aConfigurations) continue; LayoutDeviceIntRect bounds; pluginsToMove[j].mChild->GetBounds(bounds); - nsAutoTArray clipRects; + AutoTArray clipRects; pluginsToMove[j].mChild->GetWindowClipRegion(&clipRects); if (HasOverlap(bounds.TopLeft(), clipRects, config->mBounds.TopLeft(), diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 699ee64c0e7..65ceae51f91 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2504,7 +2504,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty, } #endif - nsAutoTArray subtrees; + AutoTArray subtrees; subtrees.AppendElement(aFrame); do { @@ -2555,7 +2555,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty, // recursion). // Note that nsHTMLReflowState::InitResizeFlags has some similar // code; see comments there for how and why it differs. - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(subtreeRoot); do { @@ -4348,7 +4348,7 @@ PresShell::ReconstructFrames(void) void nsIPresShell::ReconstructStyleDataInternal() { - nsAutoTArray,1> scopeRoots; + AutoTArray,1> scopeRoots; mChangedScopeStyleRoots.SwapElements(scopeRoots); if (mStylesHaveChanged) { @@ -5856,7 +5856,7 @@ public: nsDisplayListBuilder::EVENT_DELIVERY, /* aBuildCert= */ false); nsDisplayList list; - nsAutoTArray outFrames; + AutoTArray outFrames; nsDisplayItem::HitTestState hitTestState; builder.EnterPresShell(mFrame); nsRect bounds = mShell->GetPresContext()->GetVisibleArea(); @@ -6749,7 +6749,7 @@ PresShell::DispatchAfterKeyboardEvent(nsINode* aTarget, } // Build up a target chain. Each item in the chain will receive an after event. - nsAutoTArray, 5> chain; + AutoTArray, 5> chain; bool targetIsIframe = false; BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe); DispatchAfterKeyboardEventInternal(chain, aEvent, aEmbeddedCancelled); @@ -6784,7 +6784,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget, MOZ_ASSERT(aEvent.mMessage == eKeyDown || aEvent.mMessage == eKeyUp); // Build up a target chain. Each item in the chain will receive a before event. - nsAutoTArray, 5> chain; + AutoTArray, 5> chain; bool targetIsIframe = false; BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe); diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index e84eaefff47..fbc5a38f87d 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -1694,7 +1694,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) if (mPresContext && mPresContext->GetPresShell()) { bool tracingStyleFlush = false; - nsAutoTArray observers; + AutoTArray observers; observers.AppendElements(mStyleFlushObservers); for (uint32_t j = observers.Length(); j && mPresContext && mPresContext->GetPresShell(); --j) { @@ -1734,7 +1734,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) } else if (i == 1) { // This is the Flush_Layout case. bool tracingLayoutFlush = false; - nsAutoTArray observers; + AutoTArray observers; observers.AppendElements(mLayoutFlushObservers); for (uint32_t j = observers.Length(); j && mPresContext && mPresContext->GetPresShell(); --j) { diff --git a/layout/base/nsRefreshDriver.h b/layout/base/nsRefreshDriver.h index 5c335ca8a2d..a327423df84 100644 --- a/layout/base/nsRefreshDriver.h +++ b/layout/base/nsRefreshDriver.h @@ -429,9 +429,9 @@ private: nsCOMPtr mEvent; }; - nsAutoTArray mStyleFlushObservers; - nsAutoTArray mLayoutFlushObservers; - nsAutoTArray mPresShellsToInvalidateIfHidden; + AutoTArray mStyleFlushObservers; + AutoTArray mLayoutFlushObservers; + AutoTArray mPresShellsToInvalidateIfHidden; // nsTArray on purpose, because we want to be able to swap. nsTArray mFrameRequestCallbackDocs; nsTArray mThrottledFrameRequestCallbackDocs; diff --git a/layout/generic/FrameChildList.h b/layout/generic/FrameChildList.h index 34bce1e1f4e..8ccfa2ff816 100644 --- a/layout/generic/FrameChildList.h +++ b/layout/generic/FrameChildList.h @@ -93,7 +93,7 @@ class MOZ_STACK_CLASS FrameChildListIterator explicit FrameChildListIterator(const nsIFrame* aFrame); protected: - nsAutoTArray mLists; + AutoTArray mLists; }; inline mozilla::layout::FrameChildListIDs diff --git a/layout/generic/MathMLTextRunFactory.cpp b/layout/generic/MathMLTextRunFactory.cpp index 557c1bfc375..1fc3cb148a0 100644 --- a/layout/generic/MathMLTextRunFactory.cpp +++ b/layout/generic/MathMLTextRunFactory.cpp @@ -535,10 +535,10 @@ MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, gfxFontGroup* fontGroup = aTextRun->GetFontGroup(); nsAutoString convertedString; - nsAutoTArray charsToMergeArray; - nsAutoTArray deletedCharsArray; - nsAutoTArray,50> styleArray; - nsAutoTArray canBreakBeforeArray; + AutoTArray charsToMergeArray; + AutoTArray deletedCharsArray; + AutoTArray,50> styleArray; + AutoTArray canBreakBeforeArray; bool mergeNeeded = false; bool singleCharMI = diff --git a/layout/generic/RubyUtils.h b/layout/generic/RubyUtils.h index 1497c93c406..0b610c49b82 100644 --- a/layout/generic/RubyUtils.h +++ b/layout/generic/RubyUtils.h @@ -97,7 +97,7 @@ public: * of the given ruby base container. */ class MOZ_STACK_CLASS AutoRubyTextContainerArray final - : public nsAutoTArray + : public AutoTArray { public: explicit AutoRubyTextContainerArray(nsRubyBaseContainerFrame* aBaseContainer); @@ -131,7 +131,7 @@ private: struct MOZ_STACK_CLASS RubyColumn { nsRubyBaseFrame* mBaseFrame; - nsAutoTArray mTextFrames; + AutoTArray mTextFrames; bool mIsIntraLevelWhitespace; RubyColumn() : mBaseFrame(nullptr), mIsIntraLevelWhitespace(false) { } @@ -204,7 +204,7 @@ private: // Frames in this array are NOT necessary part of the current column. // When in doubt, use GetFrameAtLevel to access it. // See GetFrameAtLevel() and Next() for more info. - nsAutoTArray mFrames; + AutoTArray mFrames; // Whether we are on a column for intra-level whitespaces bool mAtIntraLevelWhitespace; }; diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 02626e1d963..01c9b7a275d 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -7219,7 +7219,7 @@ nsBlockFrame::CheckFloats(nsBlockReflowState& aState) bool anyLineDirty = false; // Check that the float list is what we would have built - nsAutoTArray lineFloats; + AutoTArray lineFloats; for (line_iterator line = begin_lines(), line_end = end_lines(); line != line_end; ++line) { if (line->HasFloats()) { @@ -7234,7 +7234,7 @@ nsBlockFrame::CheckFloats(nsBlockReflowState& aState) } } - nsAutoTArray storedFloats; + AutoTArray storedFloats; bool equal = true; uint32_t i = 0; for (nsIFrame* f : mFloats) { diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index d60f91e63fa..c6874b3f355 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -1526,7 +1526,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsIFrame* aNextInFlow, // with very many next-in-flows nsIFrame* nextNextInFlow = aNextInFlow->GetNextInFlow(); if (nextNextInFlow) { - nsAutoTArray frames; + AutoTArray frames; for (nsIFrame* f = nextNextInFlow; f; f = f->GetNextInFlow()) { frames.AppendElement(f); } diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index af5d5b9ee1f..aef9f32e4d4 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -3671,7 +3671,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, nscoord contentBoxMainSize = GetMainSizeFromReflowState(aReflowState, axisTracker); - nsAutoTArray struts; + AutoTArray struts; DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus, contentBoxMainSize, availableBSizeForContent, struts, axisTracker); diff --git a/layout/generic/nsFontInflationData.cpp b/layout/generic/nsFontInflationData.cpp index 1809bd5e9da..e7af2372300 100644 --- a/layout/generic/nsFontInflationData.cpp +++ b/layout/generic/nsFontInflationData.cpp @@ -100,7 +100,7 @@ NearestCommonAncestorFirstInFlow(nsIFrame *aFrame1, nsIFrame *aFrame2, aFrame2 = aFrame2->FirstInFlow(); aKnownCommonAncestor = aKnownCommonAncestor->FirstInFlow(); - nsAutoTArray ancestors1, ancestors2; + AutoTArray ancestors1, ancestors2; for (nsIFrame *f = aFrame1; f != aKnownCommonAncestor; (f = f->GetParent()) && (f = f->FirstInFlow())) { ancestors1.AppendElement(f); @@ -238,7 +238,7 @@ nsFontInflationData::FindEdgeInflatableFrameIn(nsIFrame* aFrame, } // FIXME: aDirection! - nsAutoTArray lists; + AutoTArray lists; aFrame->GetChildLists(&lists); for (uint32_t i = 0, len = lists.Length(); i < len; ++i) { const nsFrameList& list = diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 7f3bed7cf05..89d7c4acf79 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5245,7 +5245,7 @@ nsIFrame::InvalidateFrameSubtree(uint32_t aDisplayItemKey) AddStateBits(NS_FRAME_ALL_DESCENDANTS_NEED_PAINT); - nsAutoTArray childListArray; + AutoTArray childListArray; GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); @@ -5261,7 +5261,7 @@ void nsIFrame::ClearInvalidationStateBits() { if (HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT)) { - nsAutoTArray childListArray; + AutoTArray childListArray; GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); @@ -8956,7 +8956,7 @@ nsIFrame::AddInPopupStateBitToDescendants(nsIFrame* aFrame) { aFrame->AddStateBits(NS_FRAME_IN_POPUP); - nsAutoTArray childListArray; + AutoTArray childListArray; aFrame->GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); @@ -8978,7 +8978,7 @@ nsIFrame::RemoveInPopupStateBitFromDescendants(nsIFrame* aFrame) aFrame->RemoveStateBits(NS_FRAME_IN_POPUP); - nsAutoTArray childListArray; + AutoTArray childListArray; aFrame->GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); diff --git a/layout/generic/nsFrameState.cpp b/layout/generic/nsFrameState.cpp index 3bfadca7d06..2eec729db2f 100644 --- a/layout/generic/nsFrameState.cpp +++ b/layout/generic/nsFrameState.cpp @@ -32,7 +32,7 @@ nsCString GetFrameState(nsIFrame* aFrame) { nsCString result; - nsAutoTArray groups; + AutoTArray groups; nsFrameState state = aFrame->GetStateBits(); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index b5058637ca1..e914ee8588a 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2711,7 +2711,7 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder, bool overlayScrollbars = LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0; - nsAutoTArray scrollParts; + AutoTArray scrollParts; for (nsIFrame* kid : mOuter->PrincipalChildList()) { if (kid == mScrolledFrame || (kid->IsAbsPosContaininingBlock() || overlayScrollbars) != aPositioned) diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 1c9b3819a5e..907343c61a2 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -958,7 +958,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::Tracks } #endif - nsAutoTArray mSizes; + AutoTArray mSizes; nscoord mContentBoxSize; nscoord mGridGap; LogicalAxis mAxis; @@ -2563,7 +2563,7 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( // http://dev.w3.org/csswg/css-grid/#algo-content // We're also setting mIsFlexing on the item here to speed up // FindUsedFlexFraction later. - nsAutoTArray stateBitsPerSpan; + AutoTArray stateBitsPerSpan; nsTArray step2Items; GridItemCSSOrderIterator& iter = aState.mIter; nsRenderingContext* rc = &aState.mRenderingContext; diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index d297a41645d..801144b65d4 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -598,7 +598,7 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT // frame tree geometry (the width on an ancestor) rather than // style. - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(frame); do { diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index c4b5e5fbc1e..e26436b4676 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -844,7 +844,7 @@ public: nsPoint GetPositionIgnoringScrolling(); - typedef nsAutoTArray ContentArray; + typedef AutoTArray ContentArray; static void DestroyContentArray(ContentArray* aArray); #define NS_DECLARE_FRAME_PROPERTY_WITH_DTOR(prop, type, dtor) \ diff --git a/layout/generic/nsImageMap.h b/layout/generic/nsImageMap.h index 627657b1045..50dd737972c 100644 --- a/layout/generic/nsImageMap.h +++ b/layout/generic/nsImageMap.h @@ -90,7 +90,7 @@ protected: nsImageFrame* mImageFrame; // the frame that owns us nsCOMPtr mMap; - nsAutoTArray mAreas; // almost always has some entries + AutoTArray mAreas; // almost always has some entries bool mContainsBlockContents; }; diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 7d40c6b68cd..2c04e83a344 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -313,7 +313,7 @@ nsPluginFrame::PrepForDrawing(nsIWidget *aWidget) // will be reset when nsRootPresContext computes our true // geometry. The plugin window does need to have a good size here, so // set the size explicitly to a reasonable guess. - nsAutoTArray configurations; + AutoTArray configurations; nsIWidget::Configuration* configuration = configurations.AppendElement(); nscoord appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel(); configuration->mChild = mWidget; diff --git a/layout/generic/nsRubyBaseContainerFrame.cpp b/layout/generic/nsRubyBaseContainerFrame.cpp index 364324babed..72262b25d33 100644 --- a/layout/generic/nsRubyBaseContainerFrame.cpp +++ b/layout/generic/nsRubyBaseContainerFrame.cpp @@ -334,8 +334,8 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext, // Since there are pointers refer to reflow states and line layouts, // it is necessary to guarantee that they won't be moved. For this // reason, they are wrapped in UniquePtr here. - nsAutoTArray, RTC_ARRAY_SIZE> reflowStates; - nsAutoTArray, RTC_ARRAY_SIZE> lineLayouts; + AutoTArray, RTC_ARRAY_SIZE> reflowStates; + AutoTArray, RTC_ARRAY_SIZE> lineLayouts; reflowStates.SetCapacity(rtcCount); lineLayouts.SetCapacity(rtcCount); @@ -451,7 +451,7 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext, struct MOZ_STACK_CLASS nsRubyBaseContainerFrame::PullFrameState { ContinuationTraversingState mBase; - nsAutoTArray mTexts; + AutoTArray mTexts; const AutoRubyTextContainerArray& mTextContainers; PullFrameState(nsRubyBaseContainerFrame* aBaseContainer, diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index fad6ec2cc8b..177b394a1c2 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -3674,7 +3674,7 @@ Selection::AddItem(nsRange* aItem, int32_t* aOutIndex, bool aNoStartSelect) NS_ASSERTION(aOutIndex, "aOutIndex can't be null"); if (mUserInitiated) { - nsAutoTArray, 4> rangesToAdd; + AutoTArray, 4> rangesToAdd; *aOutIndex = -1; if (!aNoStartSelect && mType == nsISelectionController::SELECTION_NORMAL && diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 8010ecac81c..e95ab73f434 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -1018,10 +1018,10 @@ public: }; private: - nsAutoTArray mMappedFlows; - nsAutoTArray mLineBreakBeforeFrames; - nsAutoTArray,10> mBreakSinks; - nsAutoTArray mTextRunsToDelete; + AutoTArray mMappedFlows; + AutoTArray mLineBreakBeforeFrames; + AutoTArray,10> mBreakSinks; + AutoTArray mTextRunsToDelete; nsLineBreaker mLineBreaker; gfxTextRun* mCurrentFramesAllSameTextRun; DrawTarget* mDrawTarget; @@ -1923,7 +1923,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer) textFlags |= gfxTextRunFactory::TEXT_INCOMING_ARABICCHAR; } - nsAutoTArray textBreakPoints; + AutoTArray textBreakPoints; TextRunUserData dummyData; TextRunMappedFlow dummyMappedFlow; @@ -2174,7 +2174,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer) NS_ASSERTION(nextBreakIndex == mLineBreakBeforeFrames.Length(), "Didn't find all the frames to break-before..."); gfxSkipCharsIterator iter(skipChars); - nsAutoTArray textBreakPointsAfterTransform; + AutoTArray textBreakPointsAfterTransform; for (uint32_t i = 0; i < textBreakPoints.Length(); ++i) { nsTextFrameUtils::AppendLineBreakOffset(&textBreakPointsAfterTransform, iter.ConvertOriginalToSkipped(textBreakPoints[i])); @@ -2316,7 +2316,7 @@ BuildTextRunsScanner::SetupLineBreakerContext(gfxTextRun *aTextRun) gfxSkipChars skipChars; - nsAutoTArray textBreakPoints; + AutoTArray textBreakPoints; TextRunUserData dummyData; TextRunMappedFlow dummyMappedFlow; diff --git a/layout/generic/nsTextFrame.h b/layout/generic/nsTextFrame.h index 931f79c0a87..84a602c6d05 100644 --- a/layout/generic/nsTextFrame.h +++ b/layout/generic/nsTextFrame.h @@ -662,7 +662,7 @@ protected: } }; struct TextDecorations { - nsAutoTArray mOverlines, mUnderlines, mStrikes; + AutoTArray mOverlines, mUnderlines, mStrikes; TextDecorations() { } diff --git a/layout/generic/nsTextRunTransformations.cpp b/layout/generic/nsTextRunTransformations.cpp index 5b210947ad0..07141d5ce11 100644 --- a/layout/generic/nsTextRunTransformations.cpp +++ b/layout/generic/nsTextRunTransformations.cpp @@ -133,7 +133,7 @@ MergeCharactersInTextRun(gfxTextRun* aDest, gfxTextRun* aSrc, gfxTextRun::GlyphRunIterator iter(aSrc, 0, aSrc->GetLength()); uint32_t offset = 0; - nsAutoTArray glyphs; + AutoTArray glyphs; while (iter.NextRun()) { gfxTextRun::GlyphRun* run = iter.GetGlyphRun(); nsresult rv = aDest->AddGlyphRun(run->mFont, run->mMatchType, @@ -605,10 +605,10 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, gfxMissingFontRecorder* aMFR) { nsAutoString convertedString; - nsAutoTArray charsToMergeArray; - nsAutoTArray deletedCharsArray; - nsAutoTArray canBreakBeforeArray; - nsAutoTArray,50> styleArray; + AutoTArray charsToMergeArray; + AutoTArray deletedCharsArray; + AutoTArray canBreakBeforeArray; + AutoTArray,50> styleArray; bool mergeNeeded = TransformString(aTextRun->mString, convertedString, diff --git a/layout/inspector/inDOMUtils.cpp b/layout/inspector/inDOMUtils.cpp index d7761ed35e1..5c15eb3d219 100644 --- a/layout/inspector/inDOMUtils.cpp +++ b/layout/inspector/inDOMUtils.cpp @@ -91,7 +91,7 @@ inDOMUtils::GetAllStyleSheets(nsIDOMDocument *aDocument, uint32_t *aLength, for (int32_t i = 0; i < styleSet->SheetCount(sheetType); i++) { sheets.AppendElement(styleSet->StyleSheetAt(sheetType, i)); } - nsAutoTArray xblSheetArray; + AutoTArray xblSheetArray; styleSet->AppendAllXBLStyleSheets(xblSheetArray); // The XBL stylesheet array will quite often be full of duplicates. Cope: diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index 3582633fb13..b4c9488d84b 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -1087,7 +1087,7 @@ public: bool mTryParts; private: - nsAutoTArray mTablesTried; + AutoTArray mTablesTried; bool& mGlyphFound; }; @@ -1653,7 +1653,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext, // really shouldn't be doing things this way but for now // insert fallbacks into the list - nsAutoTArray mathFallbacks; + AutoTArray mathFallbacks; gfxFontUtils::GetPrefsFontList("font.name.serif.x-math", mathFallbacks); gfxFontUtils::AppendPrefsFontList("font.name-list.serif.x-math", mathFallbacks); diff --git a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp index 126f54ca305..01a3599fe38 100644 --- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp +++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp @@ -59,7 +59,7 @@ nsMathMLmmultiscriptsFrame::TransmitAutomaticData() int32_t count = 0; bool isSubScript = !mContent->IsMathMLElement(nsGkAtoms::msup_); - nsAutoTArray subScriptFrames; + AutoTArray subScriptFrames; nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { if (childFrame->GetContent()->IsMathMLElement(nsGkAtoms::mprescripts_)) { diff --git a/layout/style/CSSStyleSheet.cpp b/layout/style/CSSStyleSheet.cpp index f8b79a10ae5..0a825c30a59 100644 --- a/layout/style/CSSStyleSheet.cpp +++ b/layout/style/CSSStyleSheet.cpp @@ -1327,7 +1327,7 @@ nsresult CSSStyleSheet::AddRuleProcessor(nsCSSRuleProcessor* aProcessor) { if (! mRuleProcessors) { - mRuleProcessors = new nsAutoTArray(); + mRuleProcessors = new AutoTArray(); if (!mRuleProcessors) return NS_ERROR_OUT_OF_MEMORY; } diff --git a/layout/style/CSSStyleSheet.h b/layout/style/CSSStyleSheet.h index fcf1f0b82bf..f6c0f91987f 100644 --- a/layout/style/CSSStyleSheet.h +++ b/layout/style/CSSStyleSheet.h @@ -110,7 +110,7 @@ private: size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const; - nsAutoTArray mSheets; + AutoTArray mSheets; nsCOMPtr mSheetURI; // for error reports, etc. nsCOMPtr mOriginalSheetURI; // for GetHref. Can be null. nsCOMPtr mBaseURI; // for resolving relative URIs @@ -426,7 +426,7 @@ protected: CSSStyleSheetInner* mInner; - nsAutoTArray* mRuleProcessors; + AutoTArray* mRuleProcessors; nsTArray mStyleSets; friend class ::nsMediaList; diff --git a/layout/style/CounterStyleManager.cpp b/layout/style/CounterStyleManager.cpp index 8846f80daaa..0055ef2c99a 100644 --- a/layout/style/CounterStyleManager.cpp +++ b/layout/style/CounterStyleManager.cpp @@ -121,7 +121,7 @@ GetAlphabeticCounterText(CounterValue aOrdinal, // The precise length of this array should be // ceil(log((double) aOrdinal / n * (n - 1) + 1) / log(n)). // The max length is slightly smaller than which defined below. - nsAutoTArray::digits> indexes; + AutoTArray::digits> indexes; while (aOrdinal > 0) { --aOrdinal; indexes.AppendElement(aOrdinal % n); @@ -150,7 +150,7 @@ GetNumericCounterText(CounterValue aOrdinal, } auto n = aSymbols.Length(); - nsAutoTArray::digits> indexes; + AutoTArray::digits> indexes; while (aOrdinal > 0) { indexes.AppendElement(aOrdinal % n); aOrdinal /= n; diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp index 4f8e6f194d0..5d59976c1e0 100644 --- a/layout/style/Declaration.cpp +++ b/layout/style/Declaration.cpp @@ -1442,7 +1442,7 @@ Declaration::ToString(nsAString& aString) const int32_t count = mOrder.Length(); int32_t index; - nsAutoTArray shorthandsUsed; + AutoTArray shorthandsUsed; for (index = 0; index < count; index++) { nsCSSProperty property = GetPropertyAt(index); diff --git a/layout/style/Declaration.h b/layout/style/Declaration.h index 54b07eab2b4..1d4a3e7d46b 100644 --- a/layout/style/Declaration.h +++ b/layout/style/Declaration.h @@ -419,7 +419,7 @@ private: // Subtracting eCSSProperty_COUNT from those values that represent custom // properties results in an index into mVariableOrder, which identifies the // specific variable the custom property declaration is for. - nsAutoTArray mOrder; + AutoTArray mOrder; // variable names of custom properties found in mOrder nsTArray mVariableOrder; diff --git a/layout/style/FontFace.h b/layout/style/FontFace.h index 4893b4c3960..0b65f7d3611 100644 --- a/layout/style/FontFace.h +++ b/layout/style/FontFace.h @@ -55,14 +55,14 @@ public: virtual void SetLoadState(UserFontLoadState aLoadState) override; virtual void GetUserFontSets(nsTArray& aResult) override; - const nsAutoTArray& GetFontFaces() { return mFontFaces; } + const AutoTArray& GetFontFaces() { return mFontFaces; } protected: // The FontFace objects that use this user font entry. We need to store // an array of these, not just a single pointer, since the user font // cache can return the same entry for different FontFaces that have // the same descriptor values and come from the same origin. - nsAutoTArray mFontFaces; + AutoTArray mFontFaces; }; NS_DECL_CYCLE_COLLECTING_ISUPPORTS diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index 372bfeea41d..6a18c330dd6 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -282,7 +282,7 @@ FontFaceSet::FindMatchingFontFaces(const nsAString& aFont, continue; } - nsAutoTArray entries; + AutoTArray entries; bool needsBold; family->FindAllFontsForStyle(style, entries, needsBold); diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index e557c4d1fea..ec87c3a0220 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -1801,7 +1801,7 @@ Loader::SheetComplete(SheetLoadData* aLoadData, nsresult aStatus) // 8 is probably big enough for all our common cases. It's not likely that // imports will nest more than 8 deep, and multiple sheets with the same URI // are rare. - nsAutoTArray, 8> datasToNotify; + AutoTArray, 8> datasToNotify; DoSheetComplete(aLoadData, aStatus, datasToNotify); // Now it's safe to go ahead and notify observers diff --git a/layout/style/Loader.h b/layout/style/Loader.h index d2082eb2a53..8b6117e2abb 100644 --- a/layout/style/Loader.h +++ b/layout/style/Loader.h @@ -553,7 +553,7 @@ private: // We're not likely to have many levels of @import... But likely to have // some. Allocate some storage, what the hell. - nsAutoTArray mParsingDatas; + AutoTArray mParsingDatas; // The array of posted stylesheet loaded events (SheetLoadDatas) we have. // Note that these are rare. diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index c798a7f07c1..be7bb610f47 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -2567,7 +2567,7 @@ StyleAnimationValue::ComputeValue(nsCSSProperty aProperty, return true; } - nsAutoTArray values; + AutoTArray values; bool ok = ComputeValues(aProperty, nsCSSProps::eIgnoreEnabledState, aTargetElement, styleRule, values, aIsContextSensitive); diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp index 126ff110c22..e72c4198cc7 100644 --- a/layout/style/StyleRule.cpp +++ b/layout/style/StyleRule.cpp @@ -566,7 +566,7 @@ nsCSSSelector::ToString(nsAString& aString, CSSStyleSheet* aSheet, // selectors are linked from right-to-left, so the next selector in // the linked list actually precedes this one in the resulting string - nsAutoTArray stack; + AutoTArray stack; for (const nsCSSSelector *s = this; s; s = s->mNext) { stack.AppendElement(s); } diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 41797272ec0..69e38cb3a90 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -619,7 +619,7 @@ protected: void SkipUntilOneOf(const char16_t* aStopSymbolChars); // For each character in aStopSymbolChars from the end of the array // to the start, calls SkipUntil with that character. - typedef nsAutoTArray StopSymbolCharStack; + typedef AutoTArray StopSymbolCharStack; void SkipUntilAllOf(const StopSymbolCharStack& aStopSymbolChars); // returns true if the stop symbol or EOF is found, and false for an // unexpected ')', ']' or '}'; this not safe to call outside variable @@ -2490,7 +2490,7 @@ CSSParserImpl::ResolveValueWithVariableReferencesRec( MOZ_ASSERT(aResult.IsEmpty()); // Stack of closing characters for currently open constructs. - nsAutoTArray stack; + AutoTArray stack; // The resolved value for this ResolveValueWithVariableReferencesRec call. nsString value; @@ -4126,7 +4126,7 @@ CSSParserImpl::ParseFontFeatureValueSet(nsCSSFontFeatureValuesRule } // -- ident integer+ [, ident integer+] - nsAutoTArray values; + AutoTArray values; // list of font-feature-values-declaration's for (;;) { @@ -4169,7 +4169,7 @@ CSSParserImpl::ParseFontFeatureValueSet(nsCSSFontFeatureValuesRule } // value list - nsAutoTArray featureSelectors; + AutoTArray featureSelectors; nsCSSValue intValue; while (ParseNonNegativeInteger(intValue)) { @@ -5008,7 +5008,7 @@ bool CSSParserImpl::SkipUntil(char16_t aStopSymbol) { nsCSSToken* tk = &mToken; - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(aStopSymbol); for (;;) { if (!GetToken(true)) { @@ -5044,7 +5044,7 @@ bool CSSParserImpl::SkipBalancedContentUntil(char16_t aStopSymbol) { nsCSSToken* tk = &mToken; - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(aStopSymbol); for (;;) { if (!GetToken(true)) { @@ -16794,7 +16794,7 @@ CSSParserImpl::ParseValueWithVariables(CSSVariableDeclarations::Type* aType, // Indexes into ')' characters in |stack| that correspond to "var(". This // is used to stop parsing when we encounter a '!' or ';' at the top level // of a variable reference's fallback. - nsAutoTArray references; + AutoTArray references; if (!GetToken(false)) { // Variable value was empty since we reached EOF. diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index 141431ca3a2..33f73518ae6 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -175,7 +175,7 @@ struct RuleHashTableEntry : public PLDHashEntryHdr { // If you add members that have heap allocated memory be sure to change the // logic in SizeOfRuleHashTable(). // Auto length 1, because we always have at least one entry in mRules. - nsAutoTArray mRules; + AutoTArray mRules; }; struct RuleHashTagTableEntry : public RuleHashTableEntry { @@ -812,7 +812,7 @@ struct AtomSelectorEntry : public PLDHashEntryHdr { nsIAtom *mAtom; // Auto length 2, because a decent fraction of these arrays ends up // with 2 elements, and each entry is cheap. - nsAutoTArray mSelectors; + AutoTArray mSelectors; }; static void @@ -4026,7 +4026,7 @@ TreeMatchContext::InitAncestors(Element *aElement) "for the assumption that GetParentNode() is non-null " "on all element ancestors of aElement to be true"); // Collect up the ancestors - nsAutoTArray ancestors; + AutoTArray ancestors; Element* cur = aElement; do { ancestors.AppendElement(cur); @@ -4048,7 +4048,7 @@ TreeMatchContext::InitStyleScopes(Element* aElement) if (MOZ_LIKELY(aElement)) { // Collect up the ancestors - nsAutoTArray ancestors; + AutoTArray ancestors; Element* cur = aElement; do { ancestors.AppendElement(cur); diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index c5222181613..870e13118f3 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -1640,7 +1640,7 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult, // functional values const nsCSSValueList *list = GetPairValue().mYValue.GetListValue(); - nsAutoTArray altValues; + AutoTArray altValues; nsStyleUtil::ComputeFunctionalAlternates(list, altValues); nsStyleUtil::SerializeFunctionalAlternates(altValues, out); diff --git a/layout/style/nsFontFaceUtils.cpp b/layout/style/nsFontFaceUtils.cpp index 92f6bd82761..02bac4342c9 100644 --- a/layout/style/nsFontFaceUtils.cpp +++ b/layout/style/nsFontFaceUtils.cpp @@ -107,7 +107,7 @@ ScheduleReflow(nsIPresShell* aShell, nsIFrame* aFrame) nsFontFaceUtils::MarkDirtyForFontChange(nsIFrame* aSubtreeRoot, const gfxUserFontEntry* aFont) { - nsAutoTArray subtrees; + AutoTArray subtrees; subtrees.AppendElement(aSubtreeRoot); nsIPresShell* ps = aSubtreeRoot->PresContext()->PresShell(); @@ -119,7 +119,7 @@ nsFontFaceUtils::MarkDirtyForFontChange(nsIFrame* aSubtreeRoot, subtrees.RemoveElementAt(subtrees.Length() - 1); // Check all descendants to see if they use the font - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(subtreeRoot); do { diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index f35694f6c5f..8aaace28b71 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -3956,7 +3956,7 @@ nsRuleNode::SetGenericFont(nsPresContext* aPresContext, nsStyleFont* aFont) { // walk up the contexts until a context with the desired generic font - nsAutoTArray contextPath; + AutoTArray contextPath; contextPath.AppendElement(aContext); nsStyleContext* higherContext = aContext->GetParent(); while (higherContext) { @@ -6686,8 +6686,8 @@ template static void SetImageLayerList(nsStyleContext* aStyleContext, const nsCSSValue& aValue, - nsAutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, - const nsAutoTArray &aParentLayers, + AutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, + const AutoTArray &aParentLayers, ComputedValueItem nsStyleImageLayers::Layer::* aResultLocation, ComputedValueItem aInitialValue, uint32_t aParentItemCount, @@ -6751,8 +6751,8 @@ template static void SetImageLayerPairList(nsStyleContext* aStyleContext, const nsCSSValue& aValue, - nsAutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, - const nsAutoTArray + AutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, + const AutoTArray &aParentLayers, ComputedValueItem nsStyleImageLayers::Layer::* aResultLocation, @@ -6818,7 +6818,7 @@ SetImageLayerPairList(nsStyleContext* aStyleContext, template static void -FillBackgroundList(nsAutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, +FillBackgroundList(AutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, ComputedValueItem nsStyleImageLayers::Layer::* aResultLocation, uint32_t aItemCount, uint32_t aFillCount) { @@ -10040,7 +10040,7 @@ nsRuleNode::Sweep() return true; } - nsAutoTArray sweepQueue; + AutoTArray sweepQueue; sweepQueue.AppendElement(this); while (!sweepQueue.IsEmpty()) { nsTArray::index_type last = sweepQueue.Length() - 1; diff --git a/layout/style/nsRuleProcessorData.h b/layout/style/nsRuleProcessorData.h index 35a5d11e295..3deefbc6f26 100644 --- a/layout/style/nsRuleProcessorData.h +++ b/layout/style/nsRuleProcessorData.h @@ -336,7 +336,7 @@ struct MOZ_STACK_CLASS TreeMatchContext { nsRuleWalker::VisitedHandlingType mVisitedHandling; // For matching :scope - nsAutoTArray mScopes; + AutoTArray mScopes; public: // The document we're working with. nsIDocument* const mDocument; @@ -380,7 +380,7 @@ struct MOZ_STACK_CLASS TreeMatchContext { // List of ancestor elements that define a style scope (due to having a //