From 3b4961b603d51e2fb0dba9b8eaefe894de40f703 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Sat, 1 Sep 2012 22:35:17 -0400 Subject: [PATCH] Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg --- accessible/src/atk/AccessibleWrap.cpp | 2 +- .../src/atk/ApplicationAccessibleWrap.cpp | 4 +- accessible/src/atk/nsMaiHyperlink.cpp | 2 +- accessible/src/base/FocusManager.h | 6 +- accessible/src/base/Logging.cpp | 14 +-- accessible/src/base/nsAccUtils.cpp | 2 +- accessible/src/base/nsCoreUtils.cpp | 2 +- .../src/generic/ApplicationAccessible.cpp | 6 +- accessible/src/generic/DocAccessible.cpp | 2 +- accessible/src/generic/ImageAccessible.cpp | 2 +- accessible/src/msaa/AccessibleWrap.cpp | 4 +- .../src/msaa/ia2AccessibleHyperlink.cpp | 4 +- accessible/src/xul/XULTreeAccessible.cpp | 4 +- accessible/src/xul/XULTreeGridAccessible.cpp | 2 +- browser/components/about/AboutRedirector.cpp | 8 +- .../components/feeds/src/nsFeedSniffer.cpp | 10 +- .../shell/src/nsGNOMEShellService.cpp | 18 +-- .../shell/src/nsMacShellService.cpp | 4 +- caps/src/nsNullPrincipal.cpp | 4 +- caps/src/nsNullPrincipalURI.cpp | 2 +- caps/src/nsPrincipal.cpp | 24 ++-- caps/src/nsScriptSecurityManager.cpp | 52 ++++----- chrome/src/nsChromeProtocolHandler.cpp | 6 +- chrome/src/nsChromeRegistry.cpp | 14 +-- chrome/src/nsChromeRegistryChrome.cpp | 8 +- content/base/src/FragmentOrElement.cpp | 2 +- content/base/src/Link.cpp | 14 +-- content/base/src/nsCSPService.cpp | 10 +- content/base/src/nsContentAreaDragDrop.cpp | 12 +- content/base/src/nsContentPolicy.cpp | 6 +- content/base/src/nsContentSink.cpp | 18 +-- content/base/src/nsContentUtils.cpp | 14 +-- content/base/src/nsCopySupport.cpp | 6 +- content/base/src/nsCrossSiteListenerProxy.cpp | 22 ++-- content/base/src/nsDOMFile.cpp | 4 +- content/base/src/nsDOMFileReader.cpp | 4 +- content/base/src/nsDOMSerializer.cpp | 2 +- content/base/src/nsDocument.cpp | 36 +++--- content/base/src/nsDocumentEncoder.cpp | 8 +- content/base/src/nsEventSource.cpp | 8 +- content/base/src/nsFrameMessageManager.cpp | 4 +- content/base/src/nsHTMLContentSerializer.cpp | 2 +- content/base/src/nsINode.cpp | 2 +- content/base/src/nsImageLoadingContent.cpp | 2 +- .../src/nsNoDataProtocolContentPolicy.cpp | 2 +- content/base/src/nsObjectLoadingContent.cpp | 16 +-- content/base/src/nsReferencedElement.cpp | 4 +- content/base/src/nsScriptLoader.cpp | 6 +- content/base/src/nsWebSocket.cpp | 16 +-- content/base/src/nsXMLHttpRequest.cpp | 40 +++---- content/base/test/TestGetURL.cpp | 4 +- content/canvas/src/WebGLContextGL.cpp | 10 +- content/events/src/nsEventListenerManager.cpp | 4 +- content/events/src/nsEventStateManager.cpp | 12 +- content/events/src/nsXMLEventsManager.cpp | 2 +- content/html/content/src/nsFormSubmission.cpp | 24 ++-- .../html/content/src/nsGenericHTMLElement.cpp | 8 +- .../html/content/src/nsHTMLAudioElement.cpp | 2 +- .../html/content/src/nsHTMLInputElement.cpp | 8 +- .../html/content/src/nsHTMLMediaElement.cpp | 8 +- .../html/content/src/nsHTMLSharedElement.cpp | 2 +- .../html/content/src/nsHTMLVideoElement.cpp | 2 +- .../content/src/nsMediaFragmentURIParser.cpp | 4 +- .../content/src/nsMediaFragmentURIParser.h | 2 +- content/html/document/src/ImageDocument.cpp | 8 +- content/html/document/src/MediaDocument.cpp | 6 +- content/html/document/src/PluginDocument.cpp | 2 +- .../html/document/src/nsHTMLContentSink.cpp | 4 +- content/html/document/src/nsHTMLDocument.cpp | 58 +++++----- content/media/MediaResource.cpp | 6 +- content/svg/content/src/SVGLengthList.cpp | 2 +- content/svg/content/src/SVGNumberList.cpp | 2 +- content/svg/content/src/SVGPointList.cpp | 2 +- content/svg/document/src/nsSVGDocument.cpp | 4 +- content/xbl/src/nsBindingManager.cpp | 2 +- content/xbl/src/nsXBLBinding.cpp | 6 +- content/xbl/src/nsXBLDocumentInfo.cpp | 4 +- content/xbl/src/nsXBLProtoImplField.cpp | 2 +- content/xbl/src/nsXBLProtoImplMethod.cpp | 2 +- content/xbl/src/nsXBLProtoImplProperty.cpp | 2 +- content/xbl/src/nsXBLPrototypeBinding.cpp | 12 +- content/xbl/src/nsXBLPrototypeHandler.cpp | 4 +- content/xbl/src/nsXBLService.cpp | 18 +-- content/xbl/src/nsXBLWindowKeyHandler.cpp | 2 +- content/xml/content/src/nsXMLStylesheetPI.cpp | 2 +- content/xml/document/src/nsXMLContentSink.cpp | 6 +- content/xml/document/src/nsXMLDocument.cpp | 6 +- content/xslt/src/base/txDouble.cpp | 2 +- .../src/xpath/txXPCOMExtensionFunction.cpp | 2 +- .../src/xslt/txMozillaStylesheetCompiler.cpp | 14 +-- content/xslt/src/xslt/txMozillaTextOutput.cpp | 2 +- content/xslt/src/xslt/txMozillaXMLOutput.cpp | 2 +- .../xslt/src/xslt/txMozillaXSLTProcessor.cpp | 2 +- content/xtf/src/nsXTFService.cpp | 2 +- content/xul/content/src/nsXULElement.cpp | 2 +- .../document/src/nsXULCommandDispatcher.cpp | 8 +- content/xul/document/src/nsXULDocument.cpp | 32 +++--- .../xul/document/src/nsXULPrototypeCache.cpp | 24 ++-- .../src/nsRDFConInstanceTestNode.cpp | 2 +- .../templates/src/nsRDFConMemberTestNode.cpp | 2 +- .../xul/templates/src/nsXULContentUtils.cpp | 4 +- .../templates/src/nsXULTemplateBuilder.cpp | 2 +- .../src/nsXULTemplateQueryProcessorRDF.cpp | 8 +- .../nsXULTemplateQueryProcessorStorage.cpp | 6 +- .../src/nsXULTemplateQueryProcessorXML.cpp | 2 +- .../templates/src/nsXULTemplateResultXML.cpp | 2 +- docshell/base/nsAboutRedirector.cpp | 4 +- docshell/base/nsDSURIContentListener.cpp | 2 +- docshell/base/nsDefaultURIFixup.cpp | 36 +++--- docshell/base/nsDocShell.cpp | 102 ++++++++--------- docshell/shistory/src/nsSHEntry.cpp | 2 +- docshell/shistory/src/nsSHistory.cpp | 4 +- dom/base/Navigator.cpp | 12 +- dom/base/nsDOMClassInfo.cpp | 2 +- dom/base/nsDOMException.cpp | 2 +- dom/base/nsDOMWindowUtils.cpp | 2 +- dom/base/nsFocusManager.cpp | 12 +- dom/base/nsGlobalWindow.cpp | 14 +-- dom/base/nsGlobalWindowCommands.cpp | 2 +- dom/base/nsHistory.cpp | 8 +- dom/base/nsJSEnvironment.cpp | 8 +- dom/base/nsJSTimeoutHandler.cpp | 2 +- dom/base/nsLocation.cpp | 18 +-- dom/base/nsScriptNameSpaceManager.cpp | 4 +- dom/base/nsStructuredCloneContainer.cpp | 6 +- dom/base/nsWindowMemoryReporter.cpp | 10 +- dom/bluetooth/linux/BluetoothDBusService.cpp | 2 +- dom/browser-element/BrowserElementParent.cpp | 2 +- dom/devicestorage/nsDeviceStorage.cpp | 2 +- dom/indexedDB/IDBCursor.cpp | 2 +- dom/indexedDB/IDBIndex.cpp | 10 +- dom/indexedDB/IDBKeyRange.h | 2 +- dom/indexedDB/IDBObjectStore.cpp | 10 +- dom/ipc/CrashReporterParent.cpp | 2 +- dom/ipc/TabChild.cpp | 2 +- dom/ipc/TabParent.cpp | 4 +- dom/plugins/base/nsNPAPIPlugin.cpp | 12 +- .../base/nsNPAPIPluginStreamListener.cpp | 2 +- dom/plugins/base/nsPluginHost.cpp | 48 ++++---- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 +- .../base/nsPluginStreamListenerPeer.cpp | 24 ++-- dom/plugins/base/nsPluginTags.cpp | 2 +- dom/plugins/base/nsPluginsDirDarwin.cpp | 8 +- dom/plugins/base/nsPluginsDirOS2.cpp | 8 +- dom/plugins/base/nsPluginsDirUnix.cpp | 8 +- dom/plugins/base/nsPluginsDirWin.cpp | 2 +- dom/plugins/ipc/PluginModuleParent.cpp | 2 +- dom/src/geolocation/nsGeolocation.cpp | 2 +- dom/src/json/nsJSON.cpp | 2 +- dom/src/jsurl/nsJSProtocolHandler.cpp | 6 +- dom/src/offline/nsDOMOfflineResourceList.cpp | 10 +- dom/src/storage/nsDOMStorage.cpp | 16 +-- dom/src/storage/nsDOMStorageDBWrapper.cpp | 10 +- dom/src/storage/nsDOMStorageMemoryDB.cpp | 8 +- dom/src/storage/nsDOMStoragePersistentDB.cpp | 18 +-- dom/system/OSFileConstants.cpp | 2 +- dom/system/gonk/Volume.cpp | 2 +- dom/system/gonk/VolumeCommand.cpp | 2 +- dom/system/gonk/nsVolumeService.cpp | 2 +- dom/workers/ChromeWorkerScope.cpp | 2 +- dom/workers/FileReaderSyncPrivate.cpp | 2 +- dom/workers/WorkerPrivate.cpp | 4 +- editor/composer/src/nsComposerCommands.cpp | 14 +-- editor/composer/src/nsEditingSession.cpp | 6 +- editor/composer/src/nsEditorSpellCheck.cpp | 2 +- editor/libeditor/base/nsEditor.cpp | 2 +- editor/libeditor/html/nsHTMLDataTransfer.cpp | 12 +- editor/libeditor/html/nsHTMLEditor.cpp | 2 +- editor/libeditor/text/nsPlaintextEditor.cpp | 4 +- .../appstartup/src/nsAppStartupNotifier.cpp | 4 +- embedding/components/find/src/nsFind.cpp | 2 +- .../printingui/src/win/nsPrintDialogUtil.cpp | 4 +- .../src/nsWebBrowserPersist.cpp | 94 ++++++++-------- .../windowwatcher/public/nsPromptUtils.h | 2 +- .../windowwatcher/src/nsWindowWatcher.cpp | 6 +- extensions/auth/nsAuthGSSAPI.cpp | 4 +- extensions/auth/nsAuthSASL.cpp | 2 +- extensions/auth/nsAuthSSPI.cpp | 2 +- extensions/auth/nsHttpNegotiateAuth.cpp | 6 +- extensions/cookie/nsCookiePermission.cpp | 4 +- extensions/cookie/nsPermissionManager.cpp | 14 +-- extensions/cookie/nsPermissionManager.h | 2 +- extensions/gio/nsGIOProtocolHandler.cpp | 4 +- .../gnomevfs/nsGnomeVFSProtocolHandler.cpp | 6 +- extensions/permissions/nsContentBlocker.cpp | 6 +- .../pref/autoconfig/src/nsAutoConfig.cpp | 2 +- .../pref/autoconfig/src/nsLDAPSyncQuery.cpp | 4 +- .../pref/autoconfig/src/nsReadConfig.cpp | 2 +- .../spellcheck/hunspell/src/mozHunspell.cpp | 2 +- .../spellcheck/src/mozPersonalDictionary.cpp | 2 +- extensions/widgetutils/src/nsWidgetUtils.cpp | 4 +- gfx/gl/GLContext.cpp | 6 +- gfx/gl/GLContextProviderCGL.mm | 2 +- gfx/gl/GLLibraryEGL.cpp | 2 +- gfx/layers/Layers.cpp | 18 +-- gfx/layers/opengl/LayerManagerOGL.cpp | 4 +- gfx/layers/opengl/LayerManagerOGLProgram.cpp | 4 +- gfx/src/gfxCrashReporterUtils.cpp | 2 +- gfx/src/nsColor.cpp | 4 +- gfx/src/nsThebesFontEnumerator.cpp | 4 +- gfx/thebes/gfxFT2FontList.cpp | 4 +- gfx/thebes/gfxFT2Fonts.cpp | 6 +- gfx/thebes/gfxFont.cpp | 12 +- gfx/thebes/gfxFont.h | 2 +- gfx/thebes/gfxFontconfigUtils.cpp | 10 +- gfx/thebes/gfxGraphiteShaper.cpp | 2 +- gfx/thebes/gfxOS2Fonts.cpp | 4 +- gfx/thebes/gfxOS2Platform.cpp | 2 +- gfx/thebes/gfxPangoFonts.cpp | 6 +- gfx/thebes/gfxPlatform.cpp | 14 +-- gfx/thebes/gfxPlatformGtk.cpp | 2 +- gfx/thebes/gfxQtPlatform.cpp | 2 +- gfx/thebes/gfxUserFontSet.cpp | 6 +- image/decoders/icon/android/nsIconChannel.cpp | 4 +- image/decoders/icon/gtk/nsIconChannel.cpp | 24 ++-- image/decoders/icon/mac/nsIconChannelCocoa.mm | 2 +- image/decoders/icon/nsIconURI.cpp | 16 +-- image/decoders/icon/os2/nsIconChannel.cpp | 4 +- image/decoders/icon/qt/nsIconChannel.cpp | 6 +- image/decoders/icon/win/nsIconChannel.cpp | 6 +- image/encoders/png/nsPNGEncoder.cpp | 2 +- image/public/ImageLogging.h | 2 +- image/src/imgLoader.cpp | 30 ++--- image/src/imgRequest.cpp | 16 +-- image/src/imgRequestProxy.cpp | 8 +- image/src/imgStatusTracker.cpp | 6 +- image/src/imgTools.cpp | 2 +- intl/hyphenation/src/nsHyphenationManager.cpp | 2 +- intl/locale/src/nsCharsetAlias.cpp | 6 +- intl/locale/src/nsLanguageAtomService.cpp | 2 +- intl/locale/src/os2/nsOS2Charset.cpp | 2 +- intl/locale/src/unix/nsCollationUnix.cpp | 2 +- intl/locale/src/unix/nsDateTimeFormatUnix.cpp | 2 +- intl/locale/src/unix/nsUNIXCharset.cpp | 6 +- intl/locale/src/windows/nsCollationWin.cpp | 2 +- intl/locale/src/windows/nsWinCharset.cpp | 2 +- intl/strres/src/nsStringBundle.cpp | 6 +- .../strres/src/nsStringBundleTextOverride.cpp | 8 +- intl/uconv/src/nsCharsetConverterManager.cpp | 14 +-- intl/uconv/src/nsConverterOutputStream.cpp | 2 +- intl/uconv/src/nsTextToSubURI.cpp | 4 +- intl/uconv/src/nsUTF8ConverterService.cpp | 2 +- intl/uconv/tests/TestUConv.cpp | 8 +- intl/uconv/tests/nsconv.cpp | 4 +- intl/uconv/tests/plattest.cpp | 2 +- intl/unicharutil/src/nsEntityConverter.cpp | 2 +- ipc/glue/GeckoChildProcessHost.cpp | 4 +- ipc/glue/IPCMessageUtils.h | 4 +- ipc/glue/WindowsMessageLoop.cpp | 4 +- js/jsd/jsd_xpc.cpp | 4 +- js/xpconnect/loader/mozJSComponentLoader.cpp | 12 +- js/xpconnect/loader/mozJSSubScriptLoader.cpp | 8 +- js/xpconnect/shell/xpcshell.cpp | 2 +- js/xpconnect/src/XPCComponents.cpp | 6 +- js/xpconnect/src/XPCConvert.cpp | 4 +- js/xpconnect/src/XPCJSRuntime.cpp | 2 +- js/xpconnect/src/XPCLocale.cpp | 2 +- js/xpconnect/src/XPCVariant.cpp | 2 +- js/xpconnect/src/nsScriptError.cpp | 2 +- js/xpconnect/src/nsXPConnect.cpp | 4 +- layout/base/nsFrameManager.cpp | 4 +- layout/base/nsPresContext.cpp | 6 +- layout/base/nsPresShell.cpp | 10 +- layout/base/nsStyleSheetService.cpp | 2 +- layout/build/nsContentDLF.cpp | 4 +- layout/generic/nsGfxScrollFrame.cpp | 8 +- layout/generic/nsImageFrame.cpp | 6 +- layout/generic/nsSelection.cpp | 2 +- layout/generic/nsTextFrameThebes.cpp | 2 +- layout/inspector/src/inCSSValueSearch.cpp | 2 +- layout/inspector/src/nsFontFace.cpp | 4 +- layout/mathml/nsMathMLChar.cpp | 12 +- layout/mathml/nsMathMLOperators.cpp | 4 +- layout/printing/nsPrintEngine.cpp | 4 +- layout/style/Loader.cpp | 12 +- layout/style/nsCSSKeywords.cpp | 4 +- layout/style/nsCSSProps.cpp | 8 +- layout/style/nsCSSRules.cpp | 10 +- layout/style/nsCSSStyleSheet.cpp | 4 +- layout/style/nsCSSValue.cpp | 2 +- layout/style/nsFontFaceLoader.cpp | 8 +- layout/style/nsHTMLCSSStyleSheet.cpp | 2 +- layout/style/nsHTMLStyleSheet.cpp | 2 +- layout/style/nsROCSSPrimitiveValue.cpp | 4 +- layout/style/nsStyleAnimation.cpp | 2 +- layout/style/test/TestCSSPropertyLookup.cpp | 4 +- layout/xul/base/src/nsXULTooltipListener.cpp | 2 +- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 2 +- modules/libjar/nsJAR.cpp | 30 ++--- modules/libjar/nsJARChannel.cpp | 10 +- modules/libjar/nsJARInputStream.cpp | 4 +- modules/libjar/nsJARURI.cpp | 32 +++--- modules/libpref/src/Preferences.cpp | 16 +-- modules/libpref/src/nsPrefBranch.cpp | 12 +- modules/libpref/src/prefapi.cpp | 8 +- netwerk/base/public/nsNetUtil.h | 32 +++--- netwerk/base/public/nsURIHashKey.h | 2 +- netwerk/base/src/nsBaseChannel.cpp | 4 +- netwerk/base/src/nsDirectoryIndexStream.cpp | 10 +- netwerk/base/src/nsIOService.cpp | 22 ++-- netwerk/base/src/nsIncrementalDownload.cpp | 6 +- netwerk/base/src/nsLoadGroup.cpp | 10 +- netwerk/base/src/nsPACMan.cpp | 8 +- netwerk/base/src/nsProtocolProxyService.cpp | 16 +-- netwerk/base/src/nsSimpleURI.cpp | 6 +- netwerk/base/src/nsSocketTransport2.cpp | 4 +- netwerk/base/src/nsStandardURL.cpp | 46 ++++---- netwerk/base/src/nsURIChecker.cpp | 2 +- netwerk/base/src/nsURLHelper.cpp | 10 +- netwerk/base/src/nsURLHelperOS2.cpp | 8 +- netwerk/base/src/nsURLHelperOSX.cpp | 10 +- netwerk/base/src/nsURLHelperUnix.cpp | 6 +- netwerk/base/src/nsURLHelperWin.cpp | 8 +- netwerk/base/src/nsURLParsers.cpp | 2 +- netwerk/cache/nsCache.cpp | 2 +- netwerk/cache/nsCacheEntryDescriptor.cpp | 2 +- netwerk/cache/nsCacheService.cpp | 4 +- netwerk/cache/nsDeleteDir.cpp | 8 +- netwerk/cache/nsDiskCacheDeviceSQL.cpp | 30 ++--- netwerk/cookie/CookieServiceChild.cpp | 2 +- netwerk/cookie/nsCookieService.cpp | 52 ++++----- netwerk/dns/nsDNSService2.cpp | 6 +- netwerk/dns/nsEffectiveTLDService.cpp | 10 +- netwerk/dns/nsIDNService.cpp | 10 +- netwerk/mime/nsMIMEHeaderParamImpl.cpp | 32 +++--- netwerk/protocol/about/nsAboutBloat.cpp | 6 +- netwerk/protocol/about/nsAboutCache.cpp | 6 +- netwerk/protocol/about/nsAboutCacheEntry.cpp | 8 +- .../protocol/about/nsAboutProtocolHandler.cpp | 2 +- netwerk/protocol/about/nsAboutProtocolUtils.h | 2 +- netwerk/protocol/data/nsDataChannel.cpp | 2 +- netwerk/protocol/data/nsDataHandler.cpp | 2 +- netwerk/protocol/device/nsDeviceChannel.cpp | 8 +- netwerk/protocol/file/nsFileChannel.cpp | 4 +- .../protocol/file/nsFileProtocolHandler.cpp | 8 +- netwerk/protocol/ftp/nsFTPChannel.cpp | 2 +- .../protocol/ftp/nsFtpConnectionThread.cpp | 50 ++++----- netwerk/protocol/ftp/nsFtpProtocolHandler.cpp | 6 +- .../protocol/http/ConnectionDiagnostics.cpp | 2 +- netwerk/protocol/http/HttpBaseChannel.cpp | 26 ++--- netwerk/protocol/http/HttpChannelChild.cpp | 4 +- netwerk/protocol/http/NullHttpTransaction.cpp | 2 +- netwerk/protocol/http/PHttpChannelParams.h | 4 +- netwerk/protocol/http/nsHttpAuthCache.cpp | 8 +- netwerk/protocol/http/nsHttpBasicAuth.cpp | 2 +- netwerk/protocol/http/nsHttpChannel.cpp | 68 ++++++------ netwerk/protocol/http/nsHttpChannel.h | 4 +- .../http/nsHttpChannelAuthProvider.cpp | 38 +++---- netwerk/protocol/http/nsHttpConnection.cpp | 4 +- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 4 +- netwerk/protocol/http/nsHttpDigestAuth.cpp | 26 ++--- netwerk/protocol/http/nsHttpHandler.cpp | 8 +- netwerk/protocol/http/nsHttpNTLMAuth.cpp | 6 +- netwerk/protocol/http/nsHttpTransaction.cpp | 6 +- netwerk/protocol/res/nsResProtocolHandler.cpp | 24 ++-- .../viewsource/nsViewSourceChannel.cpp | 12 +- .../viewsource/nsViewSourceHandler.cpp | 2 +- .../protocol/websocket/WebSocketChannel.cpp | 16 +-- .../websocket/WebSocketChannelParent.cpp | 2 +- .../protocol/wyciwyg/WyciwygChannelParent.cpp | 2 +- netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp | 8 +- .../wyciwyg/nsWyciwygProtocolHandler.cpp | 2 +- netwerk/socket/nsSocketProviderService.cpp | 2 +- .../converters/mozTXTToHTMLConv.cpp | 2 +- .../streamconv/converters/nsBinHexDecoder.cpp | 2 +- .../converters/nsDirIndexParser.cpp | 4 +- .../converters/nsFTPDirListingConv.cpp | 8 +- .../streamconv/converters/nsIndexedToHTML.cpp | 16 +-- .../converters/nsMultiMixedConv.cpp | 8 +- .../converters/nsUnknownDecoder.cpp | 10 +- .../src/nsStreamConverterService.cpp | 28 ++--- netwerk/test/PropertiesTest.cpp | 2 +- netwerk/test/TestCookie.cpp | 6 +- netwerk/test/TestDNS.cpp | 4 +- netwerk/test/TestFileInput2.cpp | 6 +- netwerk/test/TestIDN.cpp | 2 +- netwerk/test/TestPerf.cpp | 4 +- netwerk/test/TestProtocols.cpp | 10 +- netwerk/test/TestServ.cpp | 2 +- netwerk/test/TestStandardURL.cpp | 14 +-- netwerk/test/TestStreamTransport.cpp | 4 +- netwerk/test/urltest.cpp | 6 +- parser/html/nsHtml5MetaScannerCppSupplement.h | 4 +- parser/html/nsHtml5Parser.cpp | 2 +- parser/html/nsHtml5SpeculativeLoad.cpp | 2 +- parser/html/nsHtml5StreamParser.cpp | 14 +-- parser/html/nsHtml5TreeOpExecutor.cpp | 2 +- parser/html/nsHtml5TreeOperation.cpp | 4 +- parser/html/nsParserUtils.cpp | 2 +- parser/htmlparser/src/nsExpatDriver.cpp | 6 +- parser/htmlparser/src/nsHTMLEntities.cpp | 8 +- parser/htmlparser/src/nsParser.cpp | 12 +- parser/xml/src/nsSAXXMLReader.cpp | 6 +- .../src/nsProfileDirServiceProvider.cpp | 4 +- .../dirserviceprovider/src/nsProfileLock.cpp | 8 +- .../src/nsProfileStringTypes.h | 2 +- rdf/base/src/nsRDFContainerUtils.cpp | 2 +- rdf/base/src/nsRDFContentSink.cpp | 8 +- rdf/base/src/nsRDFService.cpp | 8 +- rdf/base/src/nsRDFService.h | 2 +- rdf/base/src/nsRDFXMLDataSource.cpp | 14 +-- rdf/base/src/nsRDFXMLSerializer.cpp | 24 ++-- rdf/base/src/rdfTriplesSerializer.cpp | 2 +- rdf/datasource/src/nsFileSystemDataSource.cpp | 6 +- rdf/datasource/src/nsLocalStore.cpp | 2 +- rdf/tests/dsds/nsRDFDataSourceDS.cpp | 2 +- rdf/util/src/nsRDFResource.cpp | 2 +- .../boot/src/nsSecureBrowserUIImpl.cpp | 2 +- .../boot/src/nsSecurityWarningDialogs.cpp | 4 +- .../src/nsStrictTransportSecurityService.cpp | 10 +- .../ssl/src/SSLServerCertVerification.cpp | 2 +- .../manager/ssl/src/TransportSecurityInfo.cpp | 6 +- security/manager/ssl/src/nsCRLInfo.cpp | 2 +- security/manager/ssl/src/nsCRLManager.cpp | 20 ++-- .../manager/ssl/src/nsCertOverrideService.cpp | 26 ++--- security/manager/ssl/src/nsCertTree.cpp | 12 +- .../manager/ssl/src/nsClientAuthRemember.cpp | 10 +- security/manager/ssl/src/nsCrypto.cpp | 4 +- .../manager/ssl/src/nsIdentityChecking.cpp | 2 +- security/manager/ssl/src/nsNSSCertHelper.cpp | 2 +- .../manager/ssl/src/nsNSSCertificateDB.cpp | 8 +- security/manager/ssl/src/nsNSSComponent.cpp | 14 +-- security/manager/ssl/src/nsNSSIOLayer.cpp | 6 +- security/manager/ssl/src/nsNTLMAuthModule.cpp | 4 +- .../manager/ssl/src/nsUsageArrayHelper.cpp | 2 +- startupcache/StartupCacheUtils.cpp | 12 +- storage/src/VacuumManager.cpp | 16 +-- storage/src/mozStorageBindingParams.cpp | 4 +- storage/src/mozStorageConnection.cpp | 14 +-- storage/src/mozStoragePrivateHelpers.cpp | 4 +- storage/src/mozStorageRow.cpp | 2 +- storage/src/mozStorageStatement.cpp | 8 +- storage/src/mozStorageStatementParams.cpp | 2 +- storage/src/variantToSQLiteT_impl.h | 2 +- storage/test/storage_test_harness.h | 4 +- storage/test/test_binding_params.cpp | 14 +-- .../components/alerts/mac/mozGrowlDelegate.mm | 2 +- .../alerts/mac/nsAlertsImageLoadListener.mm | 2 +- .../autocomplete/nsAutoCompleteController.cpp | 6 +- .../components/commandlines/nsCommandLine.cpp | 16 +-- toolkit/components/ctypes/ctypes.cpp | 2 +- .../downloads/nsDownloadManager.cpp | 14 +-- .../downloads/nsDownloadScanner.cpp | 6 +- toolkit/components/intl/nsCharsetMenu.cpp | 14 +-- .../nsParentalControlsServiceWin.cpp | 10 +- .../components/places/AsyncFaviconHelpers.cpp | 14 +-- toolkit/components/places/Database.cpp | 12 +- toolkit/components/places/Helpers.cpp | 8 +- toolkit/components/places/History.cpp | 4 +- toolkit/components/places/SQLFunctions.cpp | 8 +- .../components/places/nsAndroidHistory.cpp | 6 +- .../places/nsAnnoProtocolHandler.cpp | 10 +- .../components/places/nsAnnotationService.cpp | 12 +- .../components/places/nsFaviconService.cpp | 26 ++--- toolkit/components/places/nsNavBookmarks.cpp | 32 +++--- toolkit/components/places/nsNavHistory.cpp | 104 +++++++++--------- toolkit/components/places/nsNavHistory.h | 2 +- .../components/places/nsNavHistoryQuery.cpp | 34 +++--- .../components/places/nsNavHistoryResult.cpp | 34 +++--- .../components/places/nsNavHistoryResult.h | 2 +- .../places/nsPlacesExportService.cpp | 22 ++-- .../places/tests/cpp/test_IHistory.cpp | 2 +- .../components/remote/nsXRemoteService.cpp | 8 +- toolkit/components/startup/nsAppStartup.cpp | 2 +- toolkit/components/startup/nsUserInfoMac.mm | 6 +- toolkit/components/startup/nsUserInfoUnix.cpp | 6 +- toolkit/components/telemetry/Telemetry.cpp | 12 +- .../components/url-classifier/Classifier.cpp | 6 +- toolkit/components/url-classifier/Entries.h | 2 +- .../components/url-classifier/HashStore.cpp | 6 +- toolkit/components/url-classifier/HashStore.h | 2 +- .../components/url-classifier/LookupCache.cpp | 10 +- .../url-classifier/ProtocolParser.cpp | 8 +- .../nsCheckSummedOutputStream.h | 2 +- .../nsUrlClassifierDBService.cpp | 8 +- .../nsUrlClassifierStreamUpdater.cpp | 10 +- .../url-classifier/nsUrlClassifierUtils.cpp | 20 ++-- .../tests/TestUrlClassifierUtils.cpp | 2 +- toolkit/crashreporter/nsExceptionHandler.cpp | 26 ++--- toolkit/profile/nsToolkitProfileService.cpp | 12 +- toolkit/system/gnome/nsAlertsIconListener.cpp | 2 +- toolkit/system/gnome/nsGConfService.cpp | 6 +- toolkit/system/gnome/nsGIOService.cpp | 6 +- toolkit/system/gnome/nsGnomeVFSService.cpp | 4 +- .../osxproxy/nsOSXSystemProxySettings.mm | 18 +-- .../system/unixproxy/nsLibProxySettings.cpp | 2 +- .../unixproxy/nsUnixSystemProxySettings.cpp | 24 ++-- .../nsWindowsSystemProxySettings.cpp | 26 ++--- toolkit/xre/ProfileReset.cpp | 2 +- toolkit/xre/nsAppRunner.cpp | 42 +++---- toolkit/xre/nsConsoleWriter.cpp | 2 +- toolkit/xre/nsNativeAppSupportOS2.cpp | 16 +-- toolkit/xre/nsNativeAppSupportQt.cpp | 2 +- toolkit/xre/nsNativeAppSupportUnix.cpp | 6 +- toolkit/xre/nsNativeAppSupportWin.cpp | 6 +- toolkit/xre/nsUpdateDriver.cpp | 34 +++--- toolkit/xre/nsUpdateDriver.h | 2 +- toolkit/xre/nsX11ErrorHandler.cpp | 4 +- toolkit/xre/nsXREDirProvider.cpp | 24 ++-- tools/profiler/TableTicker.cpp | 10 +- uriloader/base/nsDocLoader.cpp | 20 ++-- uriloader/base/nsURILoader.cpp | 8 +- .../exthandler/android/nsMIMEInfoAndroid.cpp | 12 +- .../exthandler/mac/nsLocalHandlerAppMac.mm | 2 +- uriloader/exthandler/mac/nsMIMEInfoMac.mm | 2 +- .../exthandler/mac/nsOSHelperAppService.mm | 6 +- uriloader/exthandler/nsContentHandlerApp.cpp | 2 +- uriloader/exthandler/nsDBusHandlerApp.cpp | 6 +- .../exthandler/nsExternalHelperAppService.cpp | 64 +++++------ .../exthandler/nsExternalProtocolHandler.cpp | 4 +- uriloader/exthandler/nsLocalHandlerApp.cpp | 2 +- uriloader/exthandler/nsMIMEInfoImpl.cpp | 6 +- uriloader/exthandler/os2/nsMIMEInfoOS2.cpp | 28 ++--- .../exthandler/os2/nsOSHelperAppService.cpp | 28 ++--- uriloader/exthandler/unix/nsGNOMERegistry.cpp | 12 +- uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 12 +- .../exthandler/unix/nsOSHelperAppService.cpp | 12 +- uriloader/exthandler/win/nsMIMEInfoWin.cpp | 12 +- .../exthandler/win/nsOSHelperAppService.cpp | 2 +- .../prefetch/OfflineCacheUpdateChild.cpp | 2 +- uriloader/prefetch/OfflineCacheUpdateGlue.cpp | 2 +- uriloader/prefetch/nsOfflineCacheUpdate.cpp | 32 +++--- uriloader/prefetch/nsPrefetchService.cpp | 8 +- widget/android/GfxInfo.cpp | 2 +- widget/android/nsDeviceContextAndroid.cpp | 4 +- widget/cocoa/GfxInfo.mm | 4 +- widget/cocoa/nsAppShell.mm | 2 +- widget/cocoa/nsChildView.mm | 2 +- widget/cocoa/nsClipboard.mm | 4 +- widget/cocoa/nsMacCursor.mm | 2 +- widget/cocoa/nsMenuItemX.mm | 2 +- widget/cocoa/nsPrintSettingsX.mm | 4 +- widget/gtk2/nsCUPSShim.cpp | 2 +- widget/gtk2/nsClipboard.cpp | 4 +- widget/gtk2/nsDeviceContextSpecG.cpp | 8 +- widget/gtk2/nsFilePicker.cpp | 12 +- widget/gtk2/nsPSPrinters.cpp | 6 +- widget/gtk2/nsPrintSettingsGTK.cpp | 2 +- widget/gtk2/nsSound.cpp | 8 +- widget/gtk2/nsWindow.cpp | 8 +- widget/os2/nsDeviceContextSpecOS2.cpp | 10 +- widget/os2/nsDragService.cpp | 20 ++-- widget/os2/nsFilePicker.cpp | 12 +- widget/os2/nsOS2Uni.cpp | 2 +- widget/os2/nsPrintOS2.cpp | 2 +- widget/os2/nsRwsService.cpp | 6 +- widget/os2/nsSound.cpp | 4 +- widget/os2/nsWindow.cpp | 2 +- widget/os2/os2FrameWindow.cpp | 2 +- widget/qt/nsClipboard.cpp | 6 +- widget/qt/nsFilePicker.cpp | 4 +- widget/qt/nsSound.cpp | 2 +- widget/qt/nsWindow.cpp | 4 +- widget/tests/TestAppShellSteadyState.cpp | 2 +- widget/tests/TestWinTSF.cpp | 2 +- widget/windows/GfxInfo.cpp | 2 +- widget/windows/JumpListBuilder.cpp | 2 +- widget/windows/JumpListItem.cpp | 4 +- widget/windows/WinTaskbar.cpp | 2 +- widget/windows/WinUtils.cpp | 4 +- widget/windows/WinUtils.h | 2 +- widget/windows/nsClipboard.cpp | 4 +- widget/windows/nsDataObj.cpp | 10 +- widget/windows/nsDataObjCollection.cpp | 2 +- widget/windows/nsIMM32Handler.cpp | 2 +- widget/windows/nsImageClipboard.cpp | 2 +- widget/windows/nsSound.cpp | 2 +- widget/windows/nsTextStore.cpp | 2 +- widget/windows/nsWindow.cpp | 6 +- widget/windows/nsWindowGfx.cpp | 2 +- widget/xpwidgets/GfxInfoX11.cpp | 2 +- widget/xpwidgets/PuppetWidget.cpp | 6 +- widget/xpwidgets/nsBaseWidget.cpp | 8 +- widget/xpwidgets/nsBaseWidget.h | 6 +- widget/xpwidgets/nsHTMLFormatConverter.cpp | 2 +- widget/xpwidgets/nsPrimitiveHelpers.cpp | 6 +- widget/xpwidgets/nsPrintOptionsImpl.cpp | 4 +- widget/xpwidgets/nsTransferable.cpp | 4 +- xpcom/base/MapsMemoryReporter.cpp | 16 +-- xpcom/base/nsTraceRefcntImpl.cpp | 2 +- xpcom/build/FileLocation.cpp | 2 +- xpcom/build/Omnijar.cpp | 2 +- xpcom/build/mozPoisonWriteMac.cpp | 2 +- xpcom/components/ManifestParser.cpp | 2 +- xpcom/components/nsCategoryManager.cpp | 2 +- xpcom/components/nsComponentManager.cpp | 4 +- xpcom/components/nsNativeComponentLoader.cpp | 6 +- xpcom/ds/nsAtomTable.cpp | 2 +- xpcom/ds/nsHashtable.cpp | 2 +- xpcom/ds/nsStaticNameTable.cpp | 2 +- xpcom/ds/nsVariant.cpp | 10 +- xpcom/glue/BlockingResourceBase.cpp | 2 +- xpcom/glue/GenericModule.cpp | 2 +- xpcom/glue/nsCategoryCache.cpp | 6 +- xpcom/glue/nsINIParser.cpp | 2 +- xpcom/glue/nsStringAPI.h | 2 +- xpcom/io/Base64.cpp | 4 +- xpcom/io/nsDirectoryService.cpp | 2 +- xpcom/io/nsLocalFileCommon.cpp | 4 +- xpcom/io/nsLocalFileOS2.cpp | 48 ++++---- xpcom/io/nsLocalFileUnix.cpp | 36 +++--- xpcom/string/public/nsString.h | 4 +- xpcom/string/public/nsStringFwd.h | 2 +- xpcom/string/public/nsTString.h | 2 +- .../string/public/string-template-def-char.h | 2 +- xpcom/tests/TestFile.cpp | 6 +- xpcom/tests/TestHashtables.cpp | 12 +- xpcom/tests/TestStrings.cpp | 14 +-- xpcom/tests/TestTArray.cpp | 2 +- xpcom/tests/nsIFileEnumerator.cpp | 2 +- xpcom/threads/nsEnvironment.cpp | 12 +- xpfe/appshell/src/nsAppShellService.cpp | 2 +- xpfe/appshell/src/nsContentTreeOwner.cpp | 4 +- xpfe/appshell/src/nsWebShellWindow.cpp | 2 +- .../directory/nsDirectoryViewer.cpp | 4 +- .../windowds/nsWindowDataSource.cpp | 2 +- xulrunner/app/nsXULRunnerApp.cpp | 8 +- 617 files changed, 2504 insertions(+), 2504 deletions(-) diff --git a/accessible/src/atk/AccessibleWrap.cpp b/accessible/src/atk/AccessibleWrap.cpp index e4d04894fed3..c852e81a7f79 100644 --- a/accessible/src/atk/AccessibleWrap.cpp +++ b/accessible/src/atk/AccessibleWrap.cpp @@ -724,7 +724,7 @@ ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes) nsCOMPtr propElem(do_QueryInterface(sup)); NS_ENSURE_TRUE(propElem, objAttributeSet); - nsCAutoString name; + nsAutoCString name; rv = propElem->GetKey(name); NS_ENSURE_SUCCESS(rv, objAttributeSet); diff --git a/accessible/src/atk/ApplicationAccessibleWrap.cpp b/accessible/src/atk/ApplicationAccessibleWrap.cpp index 00f8d6f04384..cb99cf70bf05 100644 --- a/accessible/src/atk/ApplicationAccessibleWrap.cpp +++ b/accessible/src/atk/ApplicationAccessibleWrap.cpp @@ -786,7 +786,7 @@ LoadGtkModule(GnomeAccessibilityModule& aModule) //try to load the module with "gtk-2.0/modules" appended char *curLibPath = PR_GetLibraryPath(); - nsCAutoString libPath(curLibPath); + nsAutoCString libPath(curLibPath); #if defined(LINUX) && defined(__x86_64__) libPath.Append(":/usr/lib64:/usr/lib"); #else @@ -803,7 +803,7 @@ LoadGtkModule(GnomeAccessibilityModule& aModule) subLen = libPath.Length() - loc1; else subLen = loc2 - loc1; - nsCAutoString sub(Substring(libPath, loc1, subLen)); + nsAutoCString sub(Substring(libPath, loc1, subLen)); sub.Append("/gtk-2.0/modules/"); sub.Append(aModule.libName); aModule.lib = PR_LoadLibrary(sub.get()); diff --git a/accessible/src/atk/nsMaiHyperlink.cpp b/accessible/src/atk/nsMaiHyperlink.cpp index ce20a61fc1ba..3180a027b330 100644 --- a/accessible/src/atk/nsMaiHyperlink.cpp +++ b/accessible/src/atk/nsMaiHyperlink.cpp @@ -186,7 +186,7 @@ getUriCB(AtkHyperlink *aLink, gint aLinkIndex) if (!uri) return nullptr; - nsCAutoString cautoStr; + nsAutoCString cautoStr; nsresult rv = uri->GetSpec(cautoStr); NS_ENSURE_SUCCESS(rv, nullptr); diff --git a/accessible/src/base/FocusManager.h b/accessible/src/base/FocusManager.h index 97f2c7845423..3493049c0531 100644 --- a/accessible/src/base/FocusManager.h +++ b/accessible/src/base/FocusManager.h @@ -156,9 +156,9 @@ private: if (aNode) { \ if (aNode->IsElement()) { \ dom::Element* targetElm = aNode->AsElement(); \ - nsCAutoString tag; \ + nsAutoCString tag; \ targetElm->Tag()->ToUTF8String(tag); \ - nsCAutoString id; \ + nsAutoCString id; \ nsIAtom* atomid = targetElm->GetID(); \ if (atomid) \ atomid->ToUTF8String(id); \ @@ -166,7 +166,7 @@ private: } else if (aNode->IsNodeOfType(nsINode::eDOCUMENT)) { \ nsCOMPtr document = do_QueryInterface(aNode); \ nsIURI* uri = document->GetDocumentURI(); \ - nsCAutoString spec; \ + nsAutoCString spec; \ uri->GetSpec(spec); \ printf("document: %p; uri: %s", (void*)aNode, spec.get()); \ } \ diff --git a/accessible/src/base/Logging.cpp b/accessible/src/base/Logging.cpp index 2f2e860a8462..caba787425c9 100644 --- a/accessible/src/base/Logging.cpp +++ b/accessible/src/base/Logging.cpp @@ -80,7 +80,7 @@ static void LogDocURI(nsIDocument* aDocumentNode) { nsIURI* uri = aDocumentNode->GetDocumentURI(); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); printf("uri: %s", spec.get()); } @@ -90,7 +90,7 @@ LogDocShellState(nsIDocument* aDocumentNode) { printf("docshell busy: "); - nsCAutoString docShellBusy; + nsAutoCString docShellBusy; nsCOMPtr container = aDocumentNode->GetContainer(); if (container) { nsCOMPtr docShell = do_QueryInterface(container); @@ -296,7 +296,7 @@ static void LogRequest(nsIRequest* aRequest) { if (aRequest) { - nsCAutoString name; + nsAutoCString name; aRequest->GetName(name); printf(" request spec: %s\n", name.get()); uint32_t loadFlags = 0; @@ -407,7 +407,7 @@ logging::DocLoad(const char* aMsg, nsIDocument* aDocumentNode) void logging::DocLoadEventFired(AccEvent* aEvent) { - nsCAutoString strEventType; + nsAutoCString strEventType; GetDocLoadEventType(aEvent, strEventType); if (!strEventType.IsEmpty()) printf(" fire: %s\n", strEventType.get()); @@ -416,7 +416,7 @@ logging::DocLoadEventFired(AccEvent* aEvent) void logging::DocLoadEventHandled(AccEvent* aEvent) { - nsCAutoString strEventType; + nsAutoCString strEventType; GetDocLoadEventType(aEvent, strEventType); if (strEventType.IsEmpty()) return; @@ -574,11 +574,11 @@ logging::Node(const char* aDescr, nsINode* aNode) dom::Element* elm = aNode->AsElement(); - nsCAutoString tag; + nsAutoCString tag; elm->Tag()->ToUTF8String(tag); nsIAtom* idAtom = elm->GetID(); - nsCAutoString id; + nsAutoCString id; if (idAtom) idAtom->ToUTF8String(id); diff --git a/accessible/src/base/nsAccUtils.cpp b/accessible/src/base/nsAccUtils.cpp index 9c9ea657c8b0..cdde713ac30f 100644 --- a/accessible/src/base/nsAccUtils.cpp +++ b/accessible/src/base/nsAccUtils.cpp @@ -40,7 +40,7 @@ nsAccUtils::SetAccAttr(nsIPersistentProperties *aAttributes, nsIAtom *aAttrName, const nsAString& aAttrValue) { nsAutoString oldValue; - nsCAutoString attrName; + nsAutoCString attrName; aAttributes->SetStringProperty(nsAtomCString(aAttrName), aAttrValue, oldValue); } diff --git a/accessible/src/base/nsCoreUtils.cpp b/accessible/src/base/nsCoreUtils.cpp index e58b837771d7..290a575a1f0e 100644 --- a/accessible/src/base/nsCoreUtils.cpp +++ b/accessible/src/base/nsCoreUtils.cpp @@ -475,7 +475,7 @@ nsCoreUtils::IsErrorPage(nsIDocument *aDocument) if (!isAboutScheme) return false; - nsCAutoString path; + nsAutoCString path; uri->GetPath(path); NS_NAMED_LITERAL_CSTRING(neterror, "neterror"); diff --git a/accessible/src/generic/ApplicationAccessible.cpp b/accessible/src/generic/ApplicationAccessible.cpp index 07ef6e5abe99..5989eb0d80de 100644 --- a/accessible/src/generic/ApplicationAccessible.cpp +++ b/accessible/src/generic/ApplicationAccessible.cpp @@ -218,7 +218,7 @@ ApplicationAccessible::GetAppName(nsAString& aName) if (!mAppInfo) return NS_ERROR_FAILURE; - nsCAutoString cname; + nsAutoCString cname; nsresult rv = mAppInfo->GetName(cname); NS_ENSURE_SUCCESS(rv, rv); @@ -234,7 +234,7 @@ ApplicationAccessible::GetAppVersion(nsAString& aVersion) if (!mAppInfo) return NS_ERROR_FAILURE; - nsCAutoString cversion; + nsAutoCString cversion; nsresult rv = mAppInfo->GetVersion(cversion); NS_ENSURE_SUCCESS(rv, rv); @@ -257,7 +257,7 @@ ApplicationAccessible::GetPlatformVersion(nsAString& aVersion) if (!mAppInfo) return NS_ERROR_FAILURE; - nsCAutoString cversion; + nsAutoCString cversion; nsresult rv = mAppInfo->GetPlatformVersion(cversion); NS_ENSURE_SUCCESS(rv, rv); diff --git a/accessible/src/generic/DocAccessible.cpp b/accessible/src/generic/DocAccessible.cpp index 02ab889b62e4..ecd14d6df7b2 100644 --- a/accessible/src/generic/DocAccessible.cpp +++ b/accessible/src/generic/DocAccessible.cpp @@ -386,7 +386,7 @@ DocAccessible::GetURL(nsAString& aURL) nsCOMPtr container = mDocument->GetContainer(); nsCOMPtr webNav(do_GetInterface(container)); - nsCAutoString theURL; + nsAutoCString theURL; if (webNav) { nsCOMPtr pURI; webNav->GetCurrentURI(getter_AddRefs(pURI)); diff --git a/accessible/src/generic/ImageAccessible.cpp b/accessible/src/generic/ImageAccessible.cpp index a3464517330d..46b7c51bbc2e 100644 --- a/accessible/src/generic/ImageAccessible.cpp +++ b/accessible/src/generic/ImageAccessible.cpp @@ -136,7 +136,7 @@ ImageAccessible::DoAction(uint8_t aIndex) if (!uri) return NS_ERROR_INVALID_ARG; - nsCAutoString utf8spec; + nsAutoCString utf8spec; uri->GetSpec(utf8spec); NS_ConvertUTF8toUTF16 spec(utf8spec); diff --git a/accessible/src/msaa/AccessibleWrap.cpp b/accessible/src/msaa/AccessibleWrap.cpp index 08470c9adf6c..1b7dd26b8086 100644 --- a/accessible/src/msaa/AccessibleWrap.cpp +++ b/accessible/src/msaa/AccessibleWrap.cpp @@ -1568,7 +1568,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent) NS_ENSURE_TRUE(hWnd, NS_ERROR_FAILURE); nsAutoString tag; - nsCAutoString id; + nsAutoCString id; nsIContent* cnt = accessible->GetContent(); if (cnt) { cnt->Tag()->ToString(tag); @@ -1678,7 +1678,7 @@ AccessibleWrap::ConvertToIA2Attributes(nsIPersistentProperties *aAttributes, if (!propElem) return E_FAIL; - nsCAutoString name; + nsAutoCString name; if (NS_FAILED(propElem->GetKey(name))) return E_FAIL; diff --git a/accessible/src/msaa/ia2AccessibleHyperlink.cpp b/accessible/src/msaa/ia2AccessibleHyperlink.cpp index f47e569a40da..3f7869b60620 100644 --- a/accessible/src/msaa/ia2AccessibleHyperlink.cpp +++ b/accessible/src/msaa/ia2AccessibleHyperlink.cpp @@ -88,12 +88,12 @@ __try { if (!uri) return S_FALSE; - nsCAutoString prePath; + nsAutoCString prePath; nsresult rv = uri->GetPrePath(prePath); if (NS_FAILED(rv)) return GetHRESULT(rv); - nsCAutoString path; + nsAutoCString path; rv = uri->GetPath(path); if (NS_FAILED(rv)) return GetHRESULT(rv); diff --git a/accessible/src/xul/XULTreeAccessible.cpp b/accessible/src/xul/XULTreeAccessible.cpp index c6fdfaa89eba..dde25e51ae59 100644 --- a/accessible/src/xul/XULTreeAccessible.cpp +++ b/accessible/src/xul/XULTreeAccessible.cpp @@ -199,7 +199,7 @@ XULTreeAccessible::ChildAtPoint(int32_t aX, int32_t aY, int32_t row = -1; nsCOMPtr column; - nsCAutoString childEltUnused; + nsAutoCString childEltUnused; mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column), childEltUnused); @@ -1028,7 +1028,7 @@ XULTreeItemAccessibleBase::DispatchClickEvent(nsIContent* aContent, // Get column and pseudo element. nsCOMPtr column; - nsCAutoString pseudoElm; + nsAutoCString pseudoElm; if (aActionIndex == eAction_Click) { // Key column is visible and clickable. diff --git a/accessible/src/xul/XULTreeGridAccessible.cpp b/accessible/src/xul/XULTreeGridAccessible.cpp index 0a44efb4995f..8e189a4d0d5a 100644 --- a/accessible/src/xul/XULTreeGridAccessible.cpp +++ b/accessible/src/xul/XULTreeGridAccessible.cpp @@ -367,7 +367,7 @@ XULTreeGridRowAccessible::ChildAtPoint(int32_t aX, int32_t aY, int32_t row = -1; nsCOMPtr column; - nsCAutoString childEltUnused; + nsAutoCString childEltUnused; mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column), childEltUnused); diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index 9133ebb66d16..4d1adc7ef99c 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -80,10 +80,10 @@ static RedirEntry kRedirMap[] = { }; static const int kRedirTotal = NS_ARRAY_LENGTH(kRedirMap); -static nsCAutoString +static nsAutoCString GetAboutModuleName(nsIURI *aURI) { - nsCAutoString path; + nsAutoCString path; aURI->GetPath(path); int32_t f = path.FindChar('#'); @@ -104,7 +104,7 @@ AboutRedirector::NewChannel(nsIURI *aURI, nsIChannel **result) NS_ENSURE_ARG_POINTER(aURI); NS_ASSERTION(result, "must not be null"); - nsCAutoString path = GetAboutModuleName(aURI); + nsAutoCString path = GetAboutModuleName(aURI); nsresult rv; nsCOMPtr ioService = do_GetIOService(&rv); @@ -141,7 +141,7 @@ AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result) { NS_ENSURE_ARG_POINTER(aURI); - nsCAutoString name = GetAboutModuleName(aURI); + nsAutoCString name = GetAboutModuleName(aURI); for (int i = 0; i < kRedirTotal; i++) { if (name.Equals(kRedirMap[i].id)) { diff --git a/browser/components/feeds/src/nsFeedSniffer.cpp b/browser/components/feeds/src/nsFeedSniffer.cpp index 0b06ede0d9db..075512d17722 100644 --- a/browser/components/feeds/src/nsFeedSniffer.cpp +++ b/browser/components/feeds/src/nsFeedSniffer.cpp @@ -55,7 +55,7 @@ nsFeedSniffer::ConvertEncodedData(nsIRequest* request, if (!httpChannel) return NS_ERROR_NO_INTERFACE; - nsCAutoString contentEncoding; + nsAutoCString contentEncoding; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"), contentEncoding); if (!contentEncoding.IsEmpty()) { @@ -205,7 +205,7 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, return NS_ERROR_NO_INTERFACE; // Check that this is a GET request, since you can't subscribe to a POST... - nsCAutoString method; + nsAutoCString method; channel->GetRequestMethod(method); if (!method.Equals("GET")) { sniffedType.Truncate(); @@ -222,7 +222,7 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, nsCOMPtr originalURI; channel->GetOriginalURI(getter_AddRefs(originalURI)); - nsCAutoString scheme; + nsAutoCString scheme; originalURI->GetScheme(scheme); if (scheme.EqualsLiteral("view-source")) { sniffedType.Truncate(); @@ -233,7 +233,7 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, // something specific that we think is a reliable indication of a feed, don't // bother sniffing since we assume the site maintainer knows what they're // doing. - nsCAutoString contentType; + nsAutoCString contentType; channel->GetContentType(contentType); bool noSniff = contentType.EqualsLiteral(TYPE_RSS) || contentType.EqualsLiteral(TYPE_ATOM); @@ -242,7 +242,7 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, // the feed: protocol. This is also a reliable indication. // The value of the header doesn't matter. if (!noSniff) { - nsCAutoString sniffHeader; + nsAutoCString sniffHeader; nsresult foundHeader = channel->GetRequestHeader(NS_LITERAL_CSTRING("X-Moz-Is-Feed"), sniffHeader); diff --git a/browser/components/shell/src/nsGNOMEShellService.cpp b/browser/components/shell/src/nsGNOMEShellService.cpp index 1bfa1c65a2a3..82526f6bd14c 100644 --- a/browser/components/shell/src/nsGNOMEShellService.cpp +++ b/browser/components/shell/src/nsGNOMEShellService.cpp @@ -179,7 +179,7 @@ nsGNOMEShellService::CheckHandlerMatchesAppName(const nsACString &handler) const { gint argc; gchar **argv; - nsCAutoString command(handler); + nsAutoCString command(handler); // The string will be something of the form: [/path/to/]browser "%s" // We want to remove all of the parameters and get just the binary name. @@ -207,7 +207,7 @@ nsGNOMEShellService::IsDefaultBrowser(bool aStartupCheck, nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); bool enabled; - nsCAutoString handler; + nsAutoCString handler; nsCOMPtr gioApp; for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) { @@ -254,7 +254,7 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes, nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if (gconf) { - nsCAutoString appKeyValue; + nsAutoCString appKeyValue; if (mAppIsInPath) { // mAppPath is in the users path, so use only the basename as the launcher gchar *tmp = g_path_get_basename(mAppPath.get()); @@ -406,7 +406,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement, if (!container) return rv; // Set desktop wallpaper filling style - nsCAutoString options; + nsAutoCString options; if (aPosition == BACKGROUND_TILE) options.Assign("wallpaper"); else if (aPosition == BACKGROUND_STRETCH) @@ -419,7 +419,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement, options.Assign("centered"); // Write the background file to the home directory. - nsCAutoString filePath(PR_GetEnv("HOME")); + nsAutoCString filePath(PR_GetEnv("HOME")); // get the product brand name from localized strings nsString brandName; @@ -499,7 +499,7 @@ nsGNOMEShellService::GetDesktopBackgroundColor(uint32_t *aColor) nsCOMPtr gsettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); nsCOMPtr background_settings; - nsCAutoString background; + nsAutoCString background; if (gsettings) { gsettings->GetCollectionForSchema( @@ -551,7 +551,7 @@ NS_IMETHODIMP nsGNOMEShellService::SetDesktopBackgroundColor(uint32_t aColor) { NS_ASSERTION(aColor <= 0xffffff, "aColor has extra bits"); - nsCAutoString colorString; + nsAutoCString colorString; ColorToCString(aColor, colorString); nsCOMPtr gsettings = @@ -579,7 +579,7 @@ nsGNOMEShellService::SetDesktopBackgroundColor(uint32_t aColor) NS_IMETHODIMP nsGNOMEShellService::OpenApplication(int32_t aApplication) { - nsCAutoString scheme; + nsAutoCString scheme; if (aApplication == APPLICATION_MAIL) scheme.Assign("mailto"); else if (aApplication == APPLICATION_NEWS) @@ -600,7 +600,7 @@ nsGNOMEShellService::OpenApplication(int32_t aApplication) return NS_ERROR_FAILURE; bool enabled; - nsCAutoString appCommand; + nsAutoCString appCommand; gconf->GetAppForProtocol(scheme, &enabled, appCommand); if (!enabled) diff --git a/browser/components/shell/src/nsMacShellService.cpp b/browser/components/shell/src/nsMacShellService.cpp index ca0f5a4adf5e..5444ee59cb38 100644 --- a/browser/components/shell/src/nsMacShellService.cpp +++ b/browser/components/shell/src/nsMacShellService.cpp @@ -160,7 +160,7 @@ nsMacShellService::SetDesktopBackground(nsIDOMElement* aElement, return NS_ERROR_NOT_IMPLEMENTED; } - nsCAutoString fileName; + nsAutoCString fileName; imageURL->GetFileName(fileName); nsCOMPtr fileLocator (do_GetService("@mozilla.org/file/directory_service;1", &rv)); @@ -247,7 +247,7 @@ nsMacShellService::OnStateChange(nsIWebProgress* aWebProgress, if (!exists) return NS_OK; - nsCAutoString nativePath; + nsAutoCString nativePath; mBackgroundFile->GetNativePath(nativePath); AEDesc tAEDesc = { typeNull, nil }; diff --git a/caps/src/nsNullPrincipal.cpp b/caps/src/nsNullPrincipal.cpp index 70a1a7052e3e..4a0a03edacfd 100644 --- a/caps/src/nsNullPrincipal.cpp +++ b/caps/src/nsNullPrincipal.cpp @@ -113,7 +113,7 @@ nsNullPrincipal::GetScriptLocation(nsACString &aStr) #ifdef DEBUG void nsNullPrincipal::dumpImpl() { - nsCAutoString str; + nsAutoCString str; mURI->GetSpec(str); fprintf(stderr, "nsNullPrincipal (%p) = %s\n", this, str.get()); } @@ -246,7 +246,7 @@ nsNullPrincipal::GetOrigin(char** aOrigin) { *aOrigin = nullptr; - nsCAutoString str; + nsAutoCString str; nsresult rv = mURI->GetSpec(str); NS_ENSURE_SUCCESS(rv, rv); diff --git a/caps/src/nsNullPrincipalURI.cpp b/caps/src/nsNullPrincipalURI.cpp index 097e4380b0b5..5c9405488be4 100644 --- a/caps/src/nsNullPrincipalURI.cpp +++ b/caps/src/nsNullPrincipalURI.cpp @@ -55,7 +55,7 @@ nsNullPrincipalURI::GetAsciiHost(nsACString &_host) NS_IMETHODIMP nsNullPrincipalURI::GetAsciiSpec(nsACString &_spec) { - nsCAutoString buffer; + nsAutoCString buffer; (void)GetSpec(buffer); NS_EscapeURL(buffer, esc_OnlyNonASCII | esc_AlwaysCopy, _spec); return NS_OK; diff --git a/caps/src/nsPrincipal.cpp b/caps/src/nsPrincipal.cpp index 85e011c66d16..f6919ccc566e 100644 --- a/caps/src/nsPrincipal.cpp +++ b/caps/src/nsPrincipal.cpp @@ -134,7 +134,7 @@ nsBasePrincipal::CertificateEquals(nsIPrincipal *aOther) if (!mCert) return true; - nsCAutoString str; + nsAutoCString str; aOther->GetFingerprint(str); if (!str.Equals(mCert->fingerprint)) return false; @@ -190,7 +190,7 @@ nsBasePrincipal::CanEnableCapability(const char *capability, int16_t *result) for(;;) { const char *space = PL_strchr(start, ' '); int32_t len = space ? space - start : strlen(start); - nsCAutoString capString(start, len); + nsAutoCString capString(start, len); nsCStringKey key(capString); int16_t value = mCapabilities ? (int16_t)NS_PTR_TO_INT32(mCapabilities->Get(&key)) : 0; @@ -237,7 +237,7 @@ nsBasePrincipal::SetCanEnableCapability(const char *capability, for(;;) { const char *space = PL_strchr(start, ' '); int len = space ? space - start : strlen(start); - nsCAutoString capString(start, len); + nsAutoCString capString(start, len); nsCStringKey key(capString); mCapabilities->Put(&key, NS_INT32_TO_PTR(canEnable)); if (!space) { @@ -263,7 +263,7 @@ nsBasePrincipal::IsCapabilityEnabled(const char *capability, void *annotation, for(;;) { const char *space = PL_strchr(start, ' '); int len = space ? space - start : strlen(start); - nsCAutoString capString(start, len); + nsAutoCString capString(start, len); nsCStringKey key(capString); *result = (ht->Get(&key) == (void *) AnnotationEnabled); if (!*result) { @@ -312,7 +312,7 @@ nsBasePrincipal::SetCapability(const char *capability, void **annotation, for(;;) { const char *space = PL_strchr(start, ' '); int len = space ? space - start : strlen(start); - nsCAutoString capString(start, len); + nsAutoCString capString(start, len); nsCStringKey key(capString); nsHashtable *ht = static_cast(*annotation); ht->Put(&key, (void *) value); @@ -524,7 +524,7 @@ nsBasePrincipal::GetPreferences(char** aPrefName, char** aID, } //-- Capabilities - nsCAutoString grantedListStr, deniedListStr; + nsAutoCString grantedListStr, deniedListStr; if (mCapabilities) { CapabilityList capList = CapabilityList(); capList.granted = &grantedListStr; @@ -602,7 +602,7 @@ FreeAnnotationEntry(nsIObjectInputStream* aStream, nsHashKey* aKey, #ifdef DEBUG void nsPrincipal::dumpImpl() { - nsCAutoString str; + nsAutoCString str; GetScriptLocation(str); fprintf(stderr, "nsPrincipal (%p) = %s\n", static_cast(this), str.get()); } @@ -680,7 +680,7 @@ nsPrincipal::GetOriginForURI(nsIURI* aURI, char **aOrigin) return NS_ERROR_FAILURE; } - nsCAutoString hostPort; + nsAutoCString hostPort; // chrome: URLs don't have a meaningful origin, so make // sure we just get the full spec for them. @@ -708,7 +708,7 @@ nsPrincipal::GetOriginForURI(nsIURI* aURI, char **aOrigin) hostPort.AppendInt(port, 10); } - nsCAutoString scheme; + nsAutoCString scheme; rv = origin->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); @@ -717,7 +717,7 @@ nsPrincipal::GetOriginForURI(nsIURI* aURI, char **aOrigin) else { // Some URIs (e.g., nsSimpleURI) don't support asciiHost. Just // get the full spec. - nsCAutoString spec; + nsAutoCString spec; // XXX nsMozIconURI and nsJARURI don't implement this correctly, they // both fall back to GetSpec. That needs to be fixed. rv = origin->GetAsciiSpec(spec); @@ -1319,7 +1319,7 @@ nsPrincipal::GetAppStatus() NS_ENSURE_SUCCESS(app->GetAppStatus(&status), nsIPrincipal::APP_STATUS_NOT_INSTALLED); - nsCAutoString origin; + nsAutoCString origin; NS_ENSURE_SUCCESS(GetOrigin(getter_Copies(origin)), nsIPrincipal::APP_STATUS_NOT_INSTALLED); nsString appOrigin; @@ -1332,7 +1332,7 @@ nsPrincipal::GetAppStatus() NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(appURI), appOrigin), nsIPrincipal::APP_STATUS_NOT_INSTALLED); - nsCAutoString appOriginPunned; + nsAutoCString appOriginPunned; NS_ENSURE_SUCCESS(GetOriginForURI(appURI, getter_Copies(appOriginPunned)), nsIPrincipal::APP_STATUS_NOT_INSTALLED); diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp index 49b135b0dabe..90b37ca4e116 100644 --- a/caps/src/nsScriptSecurityManager.cpp +++ b/caps/src/nsScriptSecurityManager.cpp @@ -123,11 +123,11 @@ GetOriginFromURI(nsIURI* aURI, nsACString& aOrigin) nsCOMPtr uri = NS_GetInnermostURI(aURI); NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED); - nsCAutoString hostPort; + nsAutoCString hostPort; nsresult rv = uri->GetHostPort(hostPort); if (NS_SUCCEEDED(rv)) { - nsCAutoString scheme; + nsAutoCString scheme; rv = uri->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); aOrigin = scheme + NS_LITERAL_CSTRING("://") + hostPort; @@ -668,7 +668,7 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(uint32_t aAction, // methods all the time ClassInfoData classInfoData(aClassInfo, aClassName); #ifdef DEBUG_CAPS_CheckPropertyAccessImpl - nsCAutoString propertyName; + nsAutoCString propertyName; propertyName.AssignWithConversion((PRUnichar*)IDToString(cx, aProperty)); printf("### CanAccess(%s.%s, %i) ", classInfoData.GetName(), propertyName.get(), aAction); @@ -830,8 +830,8 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(uint32_t aAction, objectPrincipal = nullptr; NS_ConvertUTF8toUTF16 className(classInfoData.GetName()); - nsCAutoString subjectOrigin; - nsCAutoString subjectDomain; + nsAutoCString subjectOrigin; + nsAutoCString subjectDomain; if (!nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin) { nsCOMPtr uri, domain; subjectPrincipal->GetURI(getter_AddRefs(uri)); @@ -848,8 +848,8 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(uint32_t aAction, NS_ConvertUTF8toUTF16 subjectOriginUnicode(subjectOrigin); NS_ConvertUTF8toUTF16 subjectDomainUnicode(subjectDomain); - nsCAutoString objectOrigin; - nsCAutoString objectDomain; + nsAutoCString objectOrigin; + nsAutoCString objectDomain; if (!nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin && objectPrincipal) { nsCOMPtr uri, domain; @@ -1065,7 +1065,7 @@ nsScriptSecurityManager::LookupPolicy(nsIPrincipal* aPrincipal, } else { - nsCAutoString origin; + nsAutoCString origin; rv = GetPrincipalDomainOrigin(aPrincipal, origin); NS_ENSURE_SUCCESS(rv, rv); @@ -1096,7 +1096,7 @@ nsScriptSecurityManager::LookupPolicy(nsIPrincipal* aPrincipal, DomainEntry *de = (DomainEntry*) mOriginToPolicyMap->Get(&key); if (!de) { - nsCAutoString scheme(start, colon-start+1); + nsAutoCString scheme(start, colon-start+1); nsCStringKey schemeKey(scheme); de = (DomainEntry*) mOriginToPolicyMap->Get(&schemeKey); } @@ -1261,10 +1261,10 @@ nsScriptSecurityManager::CheckLoadURIFromScript(JSContext *cx, nsIURI *aURI) } // Report error. - nsCAutoString spec; + nsAutoCString spec; if (NS_FAILED(aURI->GetAsciiSpec(spec))) return NS_ERROR_FAILURE; - nsCAutoString msg("Access to '"); + nsAutoCString msg("Access to '"); msg.Append(spec); msg.AppendLiteral("' from script denied"); SetPendingException(cx, msg.get()); @@ -1362,7 +1362,7 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, nsCOMPtr targetBaseURI = NS_GetInnermostURI(aTargetURI); //-- get the target scheme - nsCAutoString targetScheme; + nsAutoCString targetScheme; nsresult rv = targetBaseURI->GetScheme(targetScheme); if (NS_FAILED(rv)) return rv; @@ -1387,7 +1387,7 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, } //-- get the source scheme - nsCAutoString sourceScheme; + nsAutoCString sourceScheme; rv = sourceBaseURI->GetScheme(sourceScheme); if (NS_FAILED(rv)) return rv; @@ -1536,12 +1536,12 @@ nsScriptSecurityManager::ReportError(JSContext* cx, const nsAString& messageTag, NS_ENSURE_TRUE(aSource && aTarget, NS_ERROR_NULL_POINTER); // Get the source URL spec - nsCAutoString sourceSpec; + nsAutoCString sourceSpec; rv = aSource->GetAsciiSpec(sourceSpec); NS_ENSURE_SUCCESS(rv, rv); // Get the target URL spec - nsCAutoString targetSpec; + nsAutoCString targetSpec; rv = aTarget->GetAsciiSpec(targetSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -2562,7 +2562,7 @@ nsScriptSecurityManager::EnableCapability(const char *capability) if (canEnable != nsIPrincipal::ENABLE_GRANTED) { - nsCAutoString val; + nsAutoCString val; bool hasCert; nsresult rv; principal->GetHasCertificate(&hasCert); @@ -2636,7 +2636,7 @@ nsScriptSecurityManager::CanCreateWrapper(JSContext *cx, { //-- Access denied, report an error NS_ConvertUTF8toUTF16 strName("CreateWrapperDenied"); - nsCAutoString origin; + nsAutoCString origin; nsresult rv2; nsIPrincipal* subjectPrincipal = doGetSubjectPrincipal(&rv2); if (NS_SUCCEEDED(rv2) && subjectPrincipal) { @@ -2692,7 +2692,7 @@ nsScriptSecurityManager::CanCreateInstance(JSContext *cx, if (NS_FAILED(rv)) { //-- Access denied, report an error - nsCAutoString errorMsg("Permission denied to create instance of class. CID="); + nsAutoCString errorMsg("Permission denied to create instance of class. CID="); char cidStr[NSID_LENGTH]; aCID.ToProvidedString(cidStr); errorMsg.Append(cidStr); @@ -2723,7 +2723,7 @@ nsScriptSecurityManager::CanGetService(JSContext *cx, if (NS_FAILED(rv)) { //-- Access denied, report an error - nsCAutoString errorMsg("Permission denied to get service. CID="); + nsAutoCString errorMsg("Permission denied to get service. CID="); char cidStr[NSID_LENGTH]; aCID.ToProvidedString(cidStr); errorMsg.Append(cidStr); @@ -3135,7 +3135,7 @@ nsScriptSecurityManager::InitPolicies() *policyCurrent = '\0'; policyCurrent++; - nsCAutoString sitesPrefName( + nsAutoCString sitesPrefName( NS_LITERAL_CSTRING(sPolicyPrefix) + nsDependentCString(nameBegin) + NS_LITERAL_CSTRING(".sites")); @@ -3237,7 +3237,7 @@ nsScriptSecurityManager::InitDomainPolicy(JSContext* cx, DomainPolicy* aDomainPolicy) { nsresult rv; - nsCAutoString policyPrefix(NS_LITERAL_CSTRING(sPolicyPrefix) + + nsAutoCString policyPrefix(NS_LITERAL_CSTRING(sPolicyPrefix) + nsDependentCString(aPolicyName) + NS_LITERAL_CSTRING(".")); uint32_t prefixLength = policyPrefix.Length() - 1; // subtract the '.' @@ -3430,9 +3430,9 @@ nsScriptSecurityManager::InitPrincipals(uint32_t aPrefCount, const char** aPrefN return NS_ERROR_FAILURE; } - nsCAutoString grantedPrefName; - nsCAutoString deniedPrefName; - nsCAutoString subjectNamePrefName; + nsAutoCString grantedPrefName; + nsAutoCString deniedPrefName; + nsAutoCString subjectNamePrefName; nsresult rv = GetPrincipalPrefNames(aPrefNames[c], grantedPrefName, deniedPrefName, @@ -3562,7 +3562,7 @@ GetExtendedOrigin(nsIURI* aURI, uint32_t aAppId, bool aInMozBrowser, aAppId = nsIScriptSecurityManager::NO_APP_ID; } - nsCAutoString origin; + nsAutoCString origin; nsPrincipal::GetOriginForURI(aURI, getter_Copies(origin)); // Fallback. @@ -3606,7 +3606,7 @@ PrintPropertyPolicy(PLDHashTable *table, PLDHashEntryHdr *entry, uint32_t number, void *arg) { PropertyPolicy* pp = (PropertyPolicy*)entry; - nsCAutoString prop(" "); + nsAutoCString prop(" "); JSContext* cx = (JSContext*)arg; prop.AppendInt((uint32_t)pp->key); prop += ' '; diff --git a/chrome/src/nsChromeProtocolHandler.cpp b/chrome/src/nsChromeProtocolHandler.cpp index 1c4ad3fa8e58..e1c3a9e55390 100644 --- a/chrome/src/nsChromeProtocolHandler.cpp +++ b/chrome/src/nsChromeProtocolHandler.cpp @@ -151,7 +151,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, rv = nsChromeRegistry::gChromeRegistry->ConvertChromeURL(aURI, getter_AddRefs(resolvedURI)); if (NS_FAILED(rv)) { #ifdef DEBUG - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); printf("Couldn't convert chrome URL: %s\n", spec.get()); #endif @@ -173,7 +173,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, bool exists = false; file->Exists(&exists); if (!exists) { - nsCAutoString path; + nsAutoCString path; file->GetNativePath(path); printf("Chrome file doesn't exist: %s\n", path.get()); } @@ -191,7 +191,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, // Get a system principal for content files and set the owner // property of the result nsCOMPtr url = do_QueryInterface(aURI); - nsCAutoString path; + nsAutoCString path; rv = url->GetPath(path); if (StringBeginsWith(path, NS_LITERAL_CSTRING("/content/"))) { diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index 7affbbbd81c6..d8cfd08c14fa 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -165,7 +165,7 @@ nsChromeRegistry::GetProviderAndPath(nsIURL* aChromeURL, NS_ASSERTION(isChrome, "Non-chrome URI?"); #endif - nsCAutoString path; + nsAutoCString path; rv = aChromeURL->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); @@ -207,12 +207,12 @@ nsChromeRegistry::Canonify(nsIURL* aChromeURL) nsresult rv; - nsCAutoString provider, path; + nsAutoCString provider, path; rv = GetProviderAndPath(aChromeURL, provider, path); NS_ENSURE_SUCCESS(rv, rv); if (path.IsEmpty()) { - nsCAutoString package; + nsAutoCString package; rv = aChromeURL->GetHost(package); NS_ENSURE_SUCCESS(rv, rv); @@ -277,7 +277,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult) nsCOMPtr chromeURL (do_QueryInterface(aChromeURI)); NS_ENSURE_TRUE(chromeURL, NS_NOINTERFACE); - nsCAutoString package, provider, path; + nsAutoCString package, provider, path; rv = chromeURL->GetHostPort(package); NS_ENSURE_SUCCESS(rv, rv); @@ -564,7 +564,7 @@ nsChromeRegistry::AllowScriptsForPackage(nsIURI* aChromeURI, bool *aResult) nsCOMPtr url (do_QueryInterface(aChromeURI)); NS_ENSURE_TRUE(url, NS_NOINTERFACE); - nsCAutoString provider, file; + nsAutoCString provider, file; rv = GetProviderAndPath(url, provider, file); NS_ENSURE_SUCCESS(rv, rv); @@ -593,7 +593,7 @@ nsChromeRegistry::AllowContentToAccess(nsIURI *aURI, bool *aResult) return NS_ERROR_UNEXPECTED; } - nsCAutoString package; + nsAutoCString package; rv = url->GetHostPort(package); NS_ENSURE_SUCCESS(rv, rv); @@ -618,7 +618,7 @@ nsChromeRegistry::WrappersEnabled(nsIURI *aURI) if (NS_FAILED(rv) || !isChrome) return false; - nsCAutoString package; + nsAutoCString package; rv = chromeURL->GetHostPort(package); if (NS_FAILED(rv)) return false; diff --git a/chrome/src/nsChromeRegistryChrome.cpp b/chrome/src/nsChromeRegistryChrome.cpp index ced24aa1211d..9a9d15ec27b5 100644 --- a/chrome/src/nsChromeRegistryChrome.cpp +++ b/chrome/src/nsChromeRegistryChrome.cpp @@ -237,7 +237,7 @@ nsChromeRegistryChrome::IsLocaleRTL(const nsACString& package, bool *aResult) { *aResult = false; - nsCAutoString locale; + nsAutoCString locale; GetSelectedLocale(package, locale); if (locale.Length() < 2) return NS_OK; @@ -245,7 +245,7 @@ nsChromeRegistryChrome::IsLocaleRTL(const nsACString& package, bool *aResult) // first check the intl.uidirection. preference, and if that is not // set, check the same preference but with just the first two characters of // the locale. If that isn't set, default to left-to-right. - nsCAutoString prefString = NS_LITERAL_CSTRING("intl.uidirection.") + locale; + nsAutoCString prefString = NS_LITERAL_CSTRING("intl.uidirection.") + locale; nsCOMPtr prefBranch (do_GetService(NS_PREFSERVICE_CONTRACTID)); if (!prefBranch) return NS_OK; @@ -255,7 +255,7 @@ nsChromeRegistryChrome::IsLocaleRTL(const nsACString& package, bool *aResult) if (dir.IsEmpty()) { int32_t hyphen = prefString.FindChar('-'); if (hyphen >= 1) { - nsCAutoString shortPref(Substring(prefString, 0, hyphen)); + nsAutoCString shortPref(Substring(prefString, 0, hyphen)); prefBranch->GetCharPref(shortPref.get(), getter_Copies(dir)); } } @@ -291,7 +291,7 @@ nsChromeRegistryChrome::SelectLocaleFromPref(nsIPrefBranch* prefs) if (NS_SUCCEEDED(rv) && matchOSLocale) { // compute lang and region code only when needed! - nsCAutoString uiLocale; + nsAutoCString uiLocale; rv = getUILangCountry(uiLocale); if (NS_SUCCEEDED(rv)) mSelectedLocale = uiLocale; diff --git a/content/base/src/FragmentOrElement.cpp b/content/base/src/FragmentOrElement.cpp index 1a0012aab583..eb83a66e4fdb 100644 --- a/content/base/src/FragmentOrElement.cpp +++ b/content/base/src/FragmentOrElement.cpp @@ -1697,7 +1697,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement) char name[512]; uint32_t nsid = tmp->GetNameSpaceID(); nsAtomCString localName(tmp->NodeInfo()->NameAtom()); - nsCAutoString uri; + nsAutoCString uri; if (tmp->OwnerDoc()->GetDocumentURI()) { tmp->OwnerDoc()->GetDocumentURI()->GetSpec(uri); } diff --git a/content/base/src/Link.cpp b/content/base/src/Link.cpp index 19f6a5d17f17..c19cc8c0edb6 100644 --- a/content/base/src/Link.cpp +++ b/content/base/src/Link.cpp @@ -286,7 +286,7 @@ Link::GetProtocol(nsAString &_protocol) _protocol.AssignLiteral("http"); } else { - nsCAutoString scheme; + nsAutoCString scheme; (void)uri->GetScheme(scheme); CopyASCIItoUTF16(scheme, _protocol); } @@ -305,7 +305,7 @@ Link::GetHost(nsAString &_host) return NS_OK; } - nsCAutoString hostport; + nsAutoCString hostport; nsresult rv = uri->GetHostPort(hostport); if (NS_SUCCEEDED(rv)) { CopyUTF8toUTF16(hostport, _host); @@ -324,7 +324,7 @@ Link::GetHostname(nsAString &_hostname) return NS_OK; } - nsCAutoString host; + nsAutoCString host; nsresult rv = uri->GetHost(host); // Note that failure to get the host from the URI is not necessarily a bad // thing. Some URIs do not have a host. @@ -347,7 +347,7 @@ Link::GetPathname(nsAString &_pathname) return NS_OK; } - nsCAutoString file; + nsAutoCString file; nsresult rv = url->GetFilePath(file); NS_ENSURE_SUCCESS(rv, rv); CopyUTF8toUTF16(file, _pathname); @@ -367,7 +367,7 @@ Link::GetSearch(nsAString &_search) return NS_OK; } - nsCAutoString search; + nsAutoCString search; nsresult rv = url->GetQuery(search); if (NS_SUCCEEDED(rv) && !search.IsEmpty()) { CopyUTF8toUTF16(NS_LITERAL_CSTRING("?") + search, _search); @@ -410,7 +410,7 @@ Link::GetHash(nsAString &_hash) return NS_OK; } - nsCAutoString ref; + nsAutoCString ref; nsresult rv = uri->GetRef(ref); if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) { NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes! @@ -492,7 +492,7 @@ Link::SetHrefAttribute(nsIURI *aURI) { NS_ASSERTION(aURI, "Null URI is illegal!"); - nsCAutoString href; + nsAutoCString href; (void)aURI->GetSpec(href); (void)mElement->SetAttr(kNameSpaceID_None, nsGkAtoms::href, NS_ConvertUTF8toUTF16(href), true); diff --git a/content/base/src/nsCSPService.cpp b/content/base/src/nsCSPService.cpp index d24c12d69495..b4893c353584 100644 --- a/content/base/src/nsCSPService.cpp +++ b/content/base/src/nsCSPService.cpp @@ -65,7 +65,7 @@ CSPService::ShouldLoad(uint32_t aContentType, #ifdef PR_LOGGING { - nsCAutoString location; + nsAutoCString location; aContentLocation->GetSpec(location); PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSPService::ShouldLoad called for %s", location.get())); @@ -108,7 +108,7 @@ CSPService::ShouldLoad(uint32_t aContentType, } #ifdef PR_LOGGING else { - nsCAutoString uriSpec; + nsAutoCString uriSpec; aContentLocation->GetSpec(uriSpec); PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("COULD NOT get nsINode for location: %s", uriSpec.get())); @@ -167,7 +167,7 @@ CSPService::ShouldProcess(uint32_t aContentType, } #ifdef PR_LOGGING else { - nsCAutoString uriSpec; + nsAutoCString uriSpec; aContentLocation->GetSpec(uriSpec); PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("COULD NOT get nsINode for location: %s", uriSpec.get())); @@ -234,7 +234,7 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel, #ifdef PR_LOGGING if (newUri) { - nsCAutoString newUriSpec("None"); + nsAutoCString newUriSpec("None"); newUri->GetSpec(newUriSpec); PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSPService::AsyncOnChannelRedirect called for %s", @@ -268,7 +268,7 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel, // The redirecting channel isn't a writable property bag, we won't be able // to enforce the load policy if it redirects again, so we stop it now. - nsCAutoString newUriSpec; + nsAutoCString newUriSpec; rv = newUri->GetSpec(newUriSpec); const PRUnichar *formatParams[] = { NS_ConvertUTF8toUTF16(newUriSpec).get() }; if (NS_SUCCEEDED(rv)) { diff --git a/content/base/src/nsContentAreaDragDrop.cpp b/content/base/src/nsContentAreaDragDrop.cpp index 63cff8317fec..98dfaa220ba6 100644 --- a/content/base/src/nsContentAreaDragDrop.cpp +++ b/content/base/src/nsContentAreaDragDrop.cpp @@ -291,7 +291,7 @@ DragDataProducer::GetAnchorURL(nsIContent* inNode, nsAString& outURL) return; } - nsCAutoString spec; + nsAutoCString spec; linkURI->GetSpec(spec); CopyUTF8toUTF16(spec, outURL); } @@ -527,7 +527,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer, nsCOMPtr imageURI; image->GetCurrentURI(getter_AddRefs(imageURI)); if (imageURI) { - nsCAutoString spec; + nsAutoCString spec; imageURI->GetSpec(spec); CopyUTF8toUTF16(spec, mUrlString); } @@ -561,7 +561,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer, nsCOMPtr imgUrl(do_QueryInterface(imgUri)); if (imgUrl) { - nsCAutoString extension; + nsAutoCString extension; imgUrl->GetFileExtension(extension); nsXPIDLCString mimeType; @@ -572,7 +572,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer, getter_AddRefs(mimeInfo)); if (mimeInfo) { - nsCAutoString spec; + nsAutoCString spec; imgUrl->GetSpec(spec); // pass out the image source string @@ -589,13 +589,13 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer, imgUrl = do_QueryInterface(imgUri); - nsCAutoString primaryExtension; + nsAutoCString primaryExtension; mimeInfo->GetPrimaryExtension(primaryExtension); imgUrl->SetFileExtension(primaryExtension); } - nsCAutoString fileName; + nsAutoCString fileName; imgUrl->GetFileName(fileName); NS_UnescapeURL(fileName); diff --git a/content/base/src/nsContentPolicy.cpp b/content/base/src/nsContentPolicy.cpp index 01bd46752c90..1bbd27a7c615 100644 --- a/content/base/src/nsContentPolicy.cpp +++ b/content/base/src/nsContentPolicy.cpp @@ -54,7 +54,7 @@ nsContentPolicy::~nsContentPolicy() #define WARN_IF_URI_UNINITIALIZED(uri,name) \ PR_BEGIN_MACRO \ if ((uri)) { \ - nsCAutoString spec; \ + nsAutoCString spec; \ (uri)->GetAsciiSpec(spec); \ if (spec.IsEmpty()) { \ NS_WARNING(name " is uninitialized, fix caller"); \ @@ -151,11 +151,11 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod, } else { \ resultName = "(null ptr)"; \ } \ - nsCAutoString spec("None"); \ + nsAutoCString spec("None"); \ if (contentLocation) { \ contentLocation->GetSpec(spec); \ } \ - nsCAutoString refSpec("None"); \ + nsAutoCString refSpec("None"); \ if (requestingLocation) { \ requestingLocation->GetSpec(refSpec); \ } \ diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp index 8e836236397e..9a7e21104c9a 100644 --- a/content/base/src/nsContentSink.cpp +++ b/content/base/src/nsContentSink.cpp @@ -256,7 +256,7 @@ nsContentSink::ProcessHTTPHeaders(nsIChannel* aChannel) // Note that the only header we care about is the "link" header, since we // have all the infrastructure for kicking off stylesheet loads. - nsCAutoString linkHeader; + nsAutoCString linkHeader; nsresult rv = httpchannel->GetResponseHeader(NS_LITERAL_CSTRING("link"), linkHeader); @@ -412,7 +412,7 @@ nsContentSink::Decode5987Format(nsAString& aEncoded) { if (NS_FAILED(rv)) return false; - nsCAutoString asciiValue; + nsAutoCString asciiValue; const PRUnichar* encstart = aEncoded.BeginReading(); const PRUnichar* encend = aEncoded.EndReading(); @@ -429,7 +429,7 @@ nsContentSink::Decode5987Format(nsAString& aEncoded) { } nsAutoString decoded; - nsCAutoString language; + nsAutoCString language; rv = mimehdrpar->DecodeRFC5987Param(asciiValue, language, decoded); if (NS_FAILED(rv)) @@ -860,7 +860,7 @@ nsContentSink::PrefetchDNS(const nsAString &aHref) if (!uri) { return; } - nsCAutoString host; + nsAutoCString host; uri->GetHost(host); CopyUTF8toUTF16(host, hostname); } @@ -886,7 +886,7 @@ nsContentSink::SelectDocAppCache(nsIApplicationCache *aLoadApplicationCache, "mDocument must implement nsIApplicationCacheContainer."); if (aLoadApplicationCache) { - nsCAutoString groupID; + nsAutoCString groupID; rv = aLoadApplicationCache->GetGroupID(groupID); NS_ENSURE_SUCCESS(rv, rv); @@ -909,7 +909,7 @@ nsContentSink::SelectDocAppCache(nsIApplicationCache *aLoadApplicationCache, // the cache the document was loaded from - associate the document with // that cache and invoke the cache update process. #ifdef DEBUG - nsCAutoString docURISpec, clientID; + nsAutoCString docURISpec, clientID; mDocumentURI->GetAsciiSpec(docURISpec); aLoadApplicationCache->GetClientID(clientID); SINK_TRACE(gContentSinkLogModuleInfo, SINK_TRACE_CALLS, @@ -963,7 +963,7 @@ nsContentSink::SelectDocAppCacheNoManifest(nsIApplicationCache *aLoadApplication "mDocument must implement nsIApplicationCacheContainer."); #ifdef DEBUG - nsCAutoString docURISpec, clientID; + nsAutoCString docURISpec, clientID; mDocumentURI->GetAsciiSpec(docURISpec); aLoadApplicationCache->GetClientID(clientID); SINK_TRACE(gContentSinkLogModuleInfo, SINK_TRACE_CALLS, @@ -975,7 +975,7 @@ nsContentSink::SelectDocAppCacheNoManifest(nsIApplicationCache *aLoadApplication // Return the uri and invoke the update process for the selected // application cache. - nsCAutoString groupID; + nsAutoCString groupID; rv = aLoadApplicationCache->GetGroupID(groupID); NS_ENSURE_SUCCESS(rv, rv); @@ -1082,7 +1082,7 @@ nsContentSink::ProcessOfflineManifest(const nsAString& aManifestSpec) bool fetchedWithHTTPGetOrEquiv = false; nsCOMPtr httpChannel(do_QueryInterface(mDocument->GetChannel())); if (httpChannel) { - nsCAutoString method; + nsAutoCString method; rv = httpChannel->GetRequestMethod(method); if (NS_SUCCEEDED(rv)) fetchedWithHTTPGetOrEquiv = method.Equals("GET"); diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index e79bb765a2ce..3584d5f94ec5 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -665,13 +665,13 @@ nsContentUtils::URIIsChromeOrInPref(nsIURI *aURI, const char *aPref) return false; } - nsCAutoString scheme; + nsAutoCString scheme; aURI->GetScheme(scheme); if (scheme.EqualsLiteral("chrome")) { return true; } - nsCAutoString prePathUTF8; + nsAutoCString prePathUTF8; aURI->GetPrePath(prePathUTF8); NS_ConvertUTF8toUTF16 prePath(prePathUTF8); @@ -3270,7 +3270,7 @@ nsContentUtils::ReportToConsole(uint32_t aErrorFlags, } NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; if (!aLineNumber) { JSContext *cx = nullptr; sThreadJSContextStack->Peek(&cx); @@ -3359,7 +3359,7 @@ nsContentUtils::GetWrapperSafeScriptFilename(nsIDocument *aDocument, // followed by the string " -> " to the URI of the script we're // loading here so that script in that URI gets the same wrapper // automation that the chrome document expects. - nsCAutoString spec; + nsAutoCString spec; docURI->GetSpec(spec); spec.AppendASCII(" -> "); spec.Append(aScriptURI); @@ -3701,7 +3701,7 @@ nsContentUtils::GuessCharset(const char *aData, uint32_t aDataLen, const nsAdoptingCString& detectorName = Preferences::GetLocalizedCString("intl.charset.detector"); if (!detectorName.IsEmpty()) { - nsCAutoString detectorContractID; + nsAutoCString detectorContractID; detectorContractID.AssignLiteral(NS_CHARSET_DETECTOR_CONTRACTID_BASE); detectorContractID += detectorName; detector = do_CreateInstance(detectorContractID.get()); @@ -4737,7 +4737,7 @@ nsContentUtils::GetLinkLocation(Element* aElement, nsString& aLocationString) { nsCOMPtr hrefURI = aElement->GetHrefURI(); if (hrefURI) { - nsCAutoString specUTF8; + nsAutoCString specUTF8; nsresult rv = hrefURI->GetSpec(specUTF8); if (NS_SUCCEEDED(rv)) CopyUTF8toUTF16(specUTF8, aLocationString); @@ -5528,7 +5528,7 @@ nsContentUtils::SplitURIAtHash(nsIURI *aURI, NS_ENSURE_ARG_POINTER(aURI); - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/base/src/nsCopySupport.cpp b/content/base/src/nsCopySupport.cpp index c39da6e80beb..7cf8ab33ff78 100644 --- a/content/base/src/nsCopySupport.cpp +++ b/content/base/src/nsCopySupport.cpp @@ -220,7 +220,7 @@ SelectionCopyHelper(nsISelection *aSel, nsIDocument *aDoc, // Try and get source URI of the items that are being dragged nsIURI *uri = aDoc->GetDocumentURI(); if (uri) { - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); if (!spec.IsEmpty()) { nsAutoString shortcut; @@ -428,7 +428,7 @@ nsCopySupport::GetContents(const nsACString& aMimeType, uint32_t aFlags, nsISele nsCOMPtr docEncoder; - nsCAutoString encoderContractID(NS_DOC_ENCODER_CONTRACTID_BASE); + nsAutoCString encoderContractID(NS_DOC_ENCODER_CONTRACTID_BASE); encoderContractID.Append(aMimeType); docEncoder = do_CreateInstance(encoderContractID.get()); @@ -477,7 +477,7 @@ nsCopySupport::ImageCopy(nsIImageLoadingContent* aImageElement, NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); - nsCAutoString location; + nsAutoCString location; rv = uri->GetSpec(location); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/base/src/nsCrossSiteListenerProxy.cpp b/content/base/src/nsCrossSiteListenerProxy.cpp index 0859d42fbb36..2f5ac26209b6 100644 --- a/content/base/src/nsCrossSiteListenerProxy.cpp +++ b/content/base/src/nsCrossSiteListenerProxy.cpp @@ -294,14 +294,14 @@ nsPreflightCache::GetCacheKey(nsIURI* aURI, nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri)); NS_ENSURE_SUCCESS(rv, false); - nsCAutoString scheme, host, port; + nsAutoCString scheme, host, port; if (uri) { uri->GetScheme(scheme); uri->GetHost(host); port.AppendInt(NS_GetRealPort(uri)); } - nsCAutoString cred; + nsAutoCString cred; if (aWithCredentials) { _retval.AssignLiteral("cred"); } @@ -309,7 +309,7 @@ nsPreflightCache::GetCacheKey(nsIURI* aURI, _retval.AssignLiteral("nocred"); } - nsCAutoString spec; + nsAutoCString spec; rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, false); @@ -512,13 +512,13 @@ nsCORSListenerProxy::CheckRequestApproved(nsIRequest* aRequest) NS_ENSURE_TRUE(http, NS_ERROR_DOM_BAD_URI); // Check the Access-Control-Allow-Origin header - nsCAutoString allowedOriginHeader; + nsAutoCString allowedOriginHeader; rv = http->GetResponseHeader( NS_LITERAL_CSTRING("Access-Control-Allow-Origin"), allowedOriginHeader); NS_ENSURE_SUCCESS(rv, rv); if (mWithCredentials || !allowedOriginHeader.EqualsLiteral("*")) { - nsCAutoString origin; + nsAutoCString origin; rv = nsContentUtils::GetASCIIOrigin(mRequestingPrincipal, origin); NS_ENSURE_SUCCESS(rv, rv); @@ -529,7 +529,7 @@ nsCORSListenerProxy::CheckRequestApproved(nsIRequest* aRequest) // Check Access-Control-Allow-Credentials header if (mWithCredentials) { - nsCAutoString allowCredentialsHeader; + nsAutoCString allowCredentialsHeader; rv = http->GetResponseHeader( NS_LITERAL_CSTRING("Access-Control-Allow-Credentials"), allowCredentialsHeader); NS_ENSURE_SUCCESS(rv, rv); @@ -547,7 +547,7 @@ nsCORSListenerProxy::CheckRequestApproved(nsIRequest* aRequest) return NS_ERROR_DOM_BAD_URI; } - nsCAutoString headerVal; + nsAutoCString headerVal; // The "Access-Control-Allow-Methods" header contains a comma separated // list of method names. http->GetResponseHeader(NS_LITERAL_CSTRING("Access-Control-Allow-Methods"), @@ -758,7 +758,7 @@ nsCORSListenerProxy::UpdateChannel(nsIChannel* aChannel, bool aAllowDataURI) NS_ENSURE_TRUE(userpass.IsEmpty(), NS_ERROR_DOM_BAD_URI); // Add the Origin header - nsCAutoString origin; + nsAutoCString origin; rv = nsContentUtils::GetASCIIOrigin(mRequestingPrincipal, origin); NS_ENSURE_SUCCESS(rv, rv); @@ -776,7 +776,7 @@ nsCORSListenerProxy::UpdateChannel(nsIChannel* aChannel, bool aAllowDataURI) NS_ENSURE_SUCCESS(rv, rv); if (!mPreflightHeaders.IsEmpty()) { - nsCAutoString headers; + nsAutoCString headers; for (uint32_t i = 0; i < mPreflightHeaders.Length(); ++i) { if (i != 0) { headers += ','; @@ -853,7 +853,7 @@ nsCORSPreflightListener::AddResultToCache(nsIRequest *aRequest) NS_ASSERTION(http, "Request was not http"); // The "Access-Control-Max-Age" header should return an age in seconds. - nsCAutoString headerVal; + nsAutoCString headerVal; http->GetResponseHeader(NS_LITERAL_CSTRING("Access-Control-Max-Age"), headerVal); if (headerVal.IsEmpty()) { @@ -1044,7 +1044,7 @@ NS_StartCORSPreflight(nsIChannel* aRequestChannel, { *aPreflightChannel = nullptr; - nsCAutoString method; + nsAutoCString method; nsCOMPtr httpChannel(do_QueryInterface(aRequestChannel)); NS_ENSURE_TRUE(httpChannel, NS_ERROR_UNEXPECTED); httpChannel->GetRequestMethod(method); diff --git a/content/base/src/nsDOMFile.cpp b/content/base/src/nsDOMFile.cpp index c1f2f362614d..1b0aa03a4cc4 100644 --- a/content/base/src/nsDOMFile.cpp +++ b/content/base/src/nsDOMFile.cpp @@ -540,7 +540,7 @@ nsDOMFileFile::GetType(nsAString &aType) do_GetService(NS_MIMESERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString mimeType; + nsAutoCString mimeType; rv = mimeService->GetTypeFromFile(mFile, mimeType); if (NS_FAILED(rv)) { mimeType.Truncate(); @@ -713,7 +713,7 @@ nsDOMFileInternalUrlHolder::nsDOMFileInternalUrlHolder(nsIDOMBlob* aFile, nsDOMFileInternalUrlHolder::~nsDOMFileInternalUrlHolder() { if (!mUrl.IsEmpty()) { - nsCAutoString narrowUrl; + nsAutoCString narrowUrl; CopyUTF16toUTF8(mUrl, narrowUrl); nsBlobProtocolHandler::RemoveFileDataEntry(narrowUrl); } diff --git a/content/base/src/nsDOMFileReader.cpp b/content/base/src/nsDOMFileReader.cpp index c3a97116ee10..4ce7088bd184 100644 --- a/content/base/src/nsDOMFileReader.cpp +++ b/content/base/src/nsDOMFileReader.cpp @@ -437,7 +437,7 @@ nsDOMFileReader::GetAsText(const nsACString &aCharset, nsAString& aResult) { nsresult rv; - nsCAutoString charsetGuess; + nsAutoCString charsetGuess; if (!aCharset.IsEmpty()) { charsetGuess = aCharset; } else { @@ -445,7 +445,7 @@ nsDOMFileReader::GetAsText(const nsACString &aCharset, NS_ENSURE_SUCCESS(rv, rv); } - nsCAutoString charset; + nsAutoCString charset; rv = nsCharsetAlias::GetPreferred(charsetGuess, charset); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/base/src/nsDOMSerializer.cpp b/content/base/src/nsDOMSerializer.cpp index 8caca8700396..950ddce00fbe 100644 --- a/content/base/src/nsDOMSerializer.cpp +++ b/content/base/src/nsDOMSerializer.cpp @@ -66,7 +66,7 @@ SetUpEncoder(nsIDOMNode *aRoot, const nsACString& aCharset, if (NS_FAILED(rv)) return rv; - nsCAutoString charset(aCharset); + nsAutoCString charset(aCharset); if (charset.IsEmpty()) { nsCOMPtr doc = do_QueryInterface(domDoc); NS_ASSERTION(doc, "Need a document"); diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index cf67e8abbccd..65ec50bb4434 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -960,7 +960,7 @@ nsExternalResourceMap::PendingLoad::SetupViewer(nsIRequest* aRequest, } } - nsCAutoString type; + nsAutoCString type; chan->GetContentType(type); nsCOMPtr loadGroup; @@ -1801,14 +1801,14 @@ static const char* kNSURIs[] = { NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument) if (NS_UNLIKELY(cb.WantDebugInfo())) { char name[512]; - nsCAutoString loadedAsData; + nsAutoCString loadedAsData; if (tmp->IsLoadedAsData()) { loadedAsData.AssignLiteral("data"); } else { loadedAsData.AssignLiteral("normal"); } uint32_t nsid = tmp->GetDefaultNamespaceID(); - nsCAutoString uri; + nsAutoCString uri; if (tmp->mDocumentURI) tmp->mDocumentURI->GetSpec(uri); if (nsid < ArrayLength(kNSURIs)) { @@ -2098,7 +2098,7 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup, #ifdef PR_LOGGING if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get()); } @@ -2353,7 +2353,7 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) { nsCOMPtr uri; aChannel->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; if (uri) uri->GetSpec(spec); PR_LogPrint("DOCUMENT %p StartDocumentLoad %s", this, spec.get()); @@ -2388,7 +2388,7 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, Reset(aChannel, aLoadGroup); } - nsCAutoString contentType; + nsAutoCString contentType; if (NS_SUCCEEDED(aChannel->GetContentType(contentType))) { // XXX this is only necessary for viewsource: nsACString::const_iterator start, end, semicolon; @@ -3006,7 +3006,7 @@ nsDocument::SetDocumentCharacterSet(const nsACString& aCharSetID) mCharacterSet = aCharSetID; #ifdef DEBUG - nsCAutoString canonicalName; + nsAutoCString canonicalName; nsCharsetAlias::GetPreferred(aCharSetID, canonicalName); NS_ASSERTION(canonicalName.Equals(aCharSetID), "charset name must be canonical"); @@ -3145,10 +3145,10 @@ nsDocument::TryChannelCharset(nsIChannel *aChannel, } if (aChannel) { - nsCAutoString charsetVal; + nsAutoCString charsetVal; nsresult rv = aChannel->GetContentCharset(charsetVal); if (NS_SUCCEEDED(rv)) { - nsCAutoString preferred; + nsAutoCString preferred; rv = nsCharsetAlias::GetPreferred(charsetVal, preferred); if(NS_SUCCEEDED(rv)) { aCharset = preferred; @@ -3692,7 +3692,7 @@ nsDocument::EnsureCatalogStyleSheet(const char *aStyleSheetURI) nsIStyleSheet* sheet = GetCatalogStyleSheetAt(i); NS_ASSERTION(sheet, "unexpected null stylesheet in the document"); if (sheet) { - nsCAutoString uriStr; + nsAutoCString uriStr; sheet->GetSheetURI()->GetSpec(uriStr); if (uriStr.Equals(aStyleSheetURI)) return; @@ -5324,7 +5324,7 @@ nsDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult) int32_t namespaceID; nsCOMPtr tag = BindingManager()->ResolveTag(content, &namespaceID); - nsCAutoString contractID("@mozilla.org/layout/xul-boxobject"); + nsAutoCString contractID("@mozilla.org/layout/xul-boxobject"); if (namespaceID == kNameSpaceID_XUL) { if (tag == nsGkAtoms::browser || tag == nsGkAtoms::editor || @@ -5913,7 +5913,7 @@ NS_IMETHODIMP nsDocument::GetDocumentURI(nsAString& aDocumentURI) { if (mDocumentURI) { - nsCAutoString uri; + nsAutoCString uri; mDocumentURI->GetSpec(uri); CopyUTF8toUTF16(uri, aDocumentURI); } else { @@ -6663,7 +6663,7 @@ nsDocument::RetrieveRelevantHeaders(nsIChannel *aChannel) nsresult rv; if (httpChannel) { - nsCAutoString tmp; + nsAutoCString tmp; rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("last-modified"), tmp); @@ -6698,7 +6698,7 @@ nsDocument::RetrieveRelevantHeaders(nsIChannel *aChannel) 0 }; - nsCAutoString headerVal; + nsAutoCString headerVal; const char *const *name = headers; while (*name) { rv = @@ -6725,7 +6725,7 @@ nsDocument::RetrieveRelevantHeaders(nsIChannel *aChannel) } } } else { - nsCAutoString contentDisp; + nsAutoCString contentDisp; rv = aChannel->GetContentDispositionHeader(contentDisp); if (NS_SUCCEEDED(rv)) { SetHeaderData(nsGkAtoms::headerContentDisposition, @@ -6969,7 +6969,7 @@ nsDocument::CanSavePresentation(nsIRequest *aNewRequest) nsCOMPtr request = do_QueryInterface(elem); if (request && request != aNewRequest && request != baseChannel) { #ifdef DEBUG_PAGE_CACHE - nsCAutoString requestName, docSpec; + nsAutoCString requestName, docSpec; request->GetName(requestName); if (mDocumentURI) mDocumentURI->GetSpec(docSpec); @@ -7853,7 +7853,7 @@ nsDocument::SetScrollToRef(nsIURI *aDocumentURI) return; } - nsCAutoString ref; + nsAutoCString ref; // Since all URI's that pass through here aren't URL's we can't // rely on the nsIURI implementation for providing a way for @@ -7891,7 +7891,7 @@ nsDocument::ScrollToRef() } nsUnescape(tmpstr); - nsCAutoString unescapedRef; + nsAutoCString unescapedRef; unescapedRef.Assign(tmpstr); nsMemory::Free(tmpstr); diff --git a/content/base/src/nsDocumentEncoder.cpp b/content/base/src/nsDocumentEncoder.cpp index e96c2aaad024..ab2926989155 100644 --- a/content/base/src/nsDocumentEncoder.cpp +++ b/content/base/src/nsDocumentEncoder.cpp @@ -567,7 +567,7 @@ ConvertAndWrite(const nsAString& aString, startCharLength = charLength; NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString charXferString; + nsAutoCString charXferString; if (!EnsureStringLength(charXferString, charLength)) return NS_ERROR_OUT_OF_MEMORY; @@ -608,7 +608,7 @@ ConvertAndWrite(const nsAString& aString, rv = aStream->Write(finish_buf, charLength, &written); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString entString("&#"); + nsAutoCString entString("&#"); if (NS_IS_HIGH_SURROGATE(unicodeBuf[unicodeLength - 1]) && unicodeLength < startLength && NS_IS_LOW_SURROGATE(unicodeBuf[unicodeLength])) { entString.AppendInt(SURROGATE_TO_UCS4(unicodeBuf[unicodeLength - 1], @@ -619,7 +619,7 @@ ConvertAndWrite(const nsAString& aString, entString.AppendInt(unicodeBuf[unicodeLength - 1]); entString.Append(';'); - // Since entString is an nsCAutoString we know entString.get() + // Since entString is an nsAutoCString we know entString.get() // returns a null-terminated string, so no need for extra // null-termination before calling Write() here. @@ -1038,7 +1038,7 @@ nsDocumentEncoder::EncodeToString(nsAString& aOutputString) if (!mSerializer) { - nsCAutoString progId(NS_CONTENTSERIALIZER_CONTRACTID_PREFIX); + nsAutoCString progId(NS_CONTENTSERIALIZER_CONTRACTID_PREFIX); AppendUTF16toUTF8(mMimeType, progId); mSerializer = do_CreateInstance(progId.get()); diff --git a/content/base/src/nsEventSource.cpp b/content/base/src/nsEventSource.cpp index f688d25f8bf7..3bd03cc0652f 100644 --- a/content/base/src/nsEventSource.cpp +++ b/content/base/src/nsEventSource.cpp @@ -283,7 +283,7 @@ nsEventSource::Init(nsIPrincipal* aPrincipal, rv = nsContentUtils::GetUTFOrigin(srcURI, origin); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = srcURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -442,7 +442,7 @@ nsEventSource::OnStartRequest(nsIRequest *aRequest, rv = httpChannel->GetRequestSucceeded(&requestSucceeded); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString contentType; + nsAutoCString contentType; rv = httpChannel->GetContentType(contentType); NS_ENSURE_SUCCESS(rv, rv); @@ -1111,7 +1111,7 @@ nsEventSource::PrintErrorOnConsole(const char *aBundleURI, nsresult nsEventSource::ConsoleError() { - nsCAutoString targetSpec; + nsAutoCString targetSpec; nsresult rv = mSrc->GetSpec(targetSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -1234,7 +1234,7 @@ nsEventSource::CheckCanRequestSrc(nsIURI* aSrc) nsContentUtils::GetSecurityManager()); isValidContentLoadPolicy = NS_SUCCEEDED(rv) && NS_CP_ACCEPTED(shouldLoad); - nsCAutoString targetURIScheme; + nsAutoCString targetURIScheme; rv = srcToTest->GetScheme(targetURIScheme); if (NS_SUCCEEDED(rv)) { // We only have the http support for now diff --git a/content/base/src/nsFrameMessageManager.cpp b/content/base/src/nsFrameMessageManager.cpp index 20b269e05ec2..acedbc1dadae 100644 --- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -716,7 +716,7 @@ ContentScriptErrorReporter(JSContext* aCx, #ifdef DEBUG // Print it to stderr as well, for the benefit of those invoking // mozilla with -console. - nsCAutoString error; + nsAutoCString error; error.Assign("JavaScript "); if (JSREPORT_IS_STRICT(flags)) { error.Append("strict "); @@ -907,7 +907,7 @@ nsFrameScriptExecutor::TryCacheLoadAndCompileScript(const nsAString& aURL, dataString.get(), dataString.Length()); if (script) { - nsCAutoString scheme; + nsAutoCString scheme; uri->GetScheme(scheme); // We don't cache data: scripts! if (!scheme.EqualsLiteral("data")) { diff --git a/content/base/src/nsHTMLContentSerializer.cpp b/content/base/src/nsHTMLContentSerializer.cpp index 24fa7b8f9d83..f0ca3bf98134 100644 --- a/content/base/src/nsHTMLContentSerializer.cpp +++ b/content/base/src/nsHTMLContentSerializer.cpp @@ -506,7 +506,7 @@ nsHTMLContentSerializer::AppendAndTranslateEntities(const nsAString& aStr, nsReadingIterator iter; const char **entityTable = mInAttribute ? kAttrEntities : kEntities; - nsCAutoString entityReplacement; + nsAutoCString entityReplacement; for (aStr.BeginReading(iter); iter != done_reading; diff --git a/content/base/src/nsINode.cpp b/content/base/src/nsINode.cpp index 980dffd77667..beb6ac36104b 100644 --- a/content/base/src/nsINode.cpp +++ b/content/base/src/nsINode.cpp @@ -584,7 +584,7 @@ nsINode::GetDOMBaseURI(nsAString &aURI) const { nsCOMPtr baseURI = GetBaseURI(); - nsCAutoString spec; + nsAutoCString spec; if (baseURI) { baseURI->GetSpec(spec); } diff --git a/content/base/src/nsImageLoadingContent.cpp b/content/base/src/nsImageLoadingContent.cpp index 3ab8ce77bc73..dc60121d09c6 100644 --- a/content/base/src/nsImageLoadingContent.cpp +++ b/content/base/src/nsImageLoadingContent.cpp @@ -64,7 +64,7 @@ static void PrintReqURL(imgIRequest* req) { return; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); printf("spec='%s'\n", spec.get()); } diff --git a/content/base/src/nsNoDataProtocolContentPolicy.cpp b/content/base/src/nsNoDataProtocolContentPolicy.cpp index 5d9f10a1a9fd..ca8ee3cd668c 100644 --- a/content/base/src/nsNoDataProtocolContentPolicy.cpp +++ b/content/base/src/nsNoDataProtocolContentPolicy.cpp @@ -42,7 +42,7 @@ nsNoDataProtocolContentPolicy::ShouldLoad(uint32_t aContentType, // The following are just quick-escapes for the most common cases // where we would allow the content to be loaded anyway. - nsCAutoString scheme; + nsAutoCString scheme; aContentLocation->GetScheme(scheme); if (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https") || diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index 4ccd8ed1c399..f8cffb5a75ba 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -444,7 +444,7 @@ IsSuccessfulRequest(nsIRequest* aRequest) static bool CanHandleURI(nsIURI* aURI) { - nsCAutoString scheme; + nsAutoCString scheme; if (NS_FAILED(aURI->GetScheme(scheme))) { return false; } @@ -511,7 +511,7 @@ GetExtensionFromURI(nsIURI* uri, nsCString& ext) bool IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType) { - nsCAutoString ext; + nsAutoCString ext; GetExtensionFromURI(uri, ext); if (ext.IsEmpty()) { @@ -1101,8 +1101,8 @@ nsObjectLoadingContent::CheckLoadPolicy(int16_t *aContentPolicy) nsContentUtils::GetSecurityManager()); NS_ENSURE_SUCCESS(rv, false); if (NS_CP_REJECTED(*aContentPolicy)) { - nsCAutoString uri; - nsCAutoString baseUri; + nsAutoCString uri; + nsAutoCString baseUri; mURI->GetSpec(uri); mURI->GetSpec(baseUri); LOG(("OBJLC [%p]: Content policy denied load of %s (base %s)", @@ -1175,7 +1175,7 @@ nsObjectLoadingContent::UpdateObjectParameters() LOG(("OBJLC [%p]: Updating object parameters", this)); nsresult rv; - nsCAutoString newMime; + nsAutoCString newMime; nsCOMPtr newURI; nsCOMPtr newBaseURI; ObjectType newType; @@ -1379,7 +1379,7 @@ nsObjectLoadingContent::UpdateObjectParameters() // Set the type we'll use for dispatch on the channel. Otherwise we could // end up trying to dispatch to a nsFrameLoader, which will complain that // it couldn't find a way to handle application/octet-stream - nsCAutoString typeHint, dummy; + nsAutoCString typeHint, dummy; NS_ParseContentType(newMime, typeHint, dummy); if (!typeHint.IsEmpty()) { mChannel->SetContentType(typeHint); @@ -2154,9 +2154,9 @@ nsObjectLoadingContent::PluginCrashed(nsIPluginTag* aPluginTag, // Note that aPluginTag in invalidated after we're called, so copy // out any data we need now. - nsCAutoString pluginName; + nsAutoCString pluginName; aPluginTag->GetName(pluginName); - nsCAutoString pluginFilename; + nsAutoCString pluginFilename; aPluginTag->GetFilename(pluginFilename); nsCOMPtr ev = diff --git a/content/base/src/nsReferencedElement.cpp b/content/base/src/nsReferencedElement.cpp index d3bee4a5d38c..7be718d6ea64 100644 --- a/content/base/src/nsReferencedElement.cpp +++ b/content/base/src/nsReferencedElement.cpp @@ -25,13 +25,13 @@ nsReferencedElement::Reset(nsIContent* aFromContent, nsIURI* aURI, if (!aURI) return; - nsCAutoString refPart; + nsAutoCString refPart; aURI->GetRef(refPart); // Unescape %-escapes in the reference. The result will be in the // origin charset of the URL, hopefully... NS_UnescapeURL(refPart); - nsCAutoString charset; + nsAutoCString charset; aURI->GetOriginCharset(charset); nsAutoString ref; nsresult rv = nsContentUtils::ConvertStringFromCharset(charset, refPart, ref); diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 4c08a471b439..2551d710d777 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -616,7 +616,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement) PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSP blocked inline scripts (2)")); // gather information to log with violation report nsIURI* uri = mDocument->GetDocumentURI(); - nsCAutoString asciiSpec; + nsAutoCString asciiSpec; uri->GetAsciiSpec(asciiSpec); nsAutoString scriptText; aElement->GetScriptText(scriptText); @@ -829,7 +829,7 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest, // It's very important to use aRequest->mURI, not the final URI of the channel // aRequest ended up getting script data from, as the script filename. - nsCAutoString url; + nsAutoCString url; nsContentUtils::GetWrapperSafeScriptFilename(mDocument, aRequest->mURI, url); bool isUndefined; @@ -995,7 +995,7 @@ nsScriptLoader::ConvertToUTF16(nsIChannel* aChannel, const uint8_t* aData, return NS_OK; } - nsCAutoString characterSet; + nsAutoCString characterSet; nsresult rv = NS_OK; if (aChannel) { diff --git a/content/base/src/nsWebSocket.cpp b/content/base/src/nsWebSocket.cpp index 5b74e6198512..0559af7574c3 100644 --- a/content/base/src/nsWebSocket.cpp +++ b/content/base/src/nsWebSocket.cpp @@ -189,7 +189,7 @@ nsWebSocket::ConsoleError() NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread"); nsresult rv; - nsCAutoString targetSpec; + nsAutoCString targetSpec; rv = mURI->GetSpec(targetSpec); if (NS_FAILED(rv)) { NS_WARNING("Failed to get targetSpec"); @@ -948,17 +948,17 @@ nsWebSocket::ParseURL(const nsString& aURL) nsCOMPtr parsedURL(do_QueryInterface(uri, &rv)); NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR); - nsCAutoString fragment; + nsAutoCString fragment; rv = parsedURL->GetRef(fragment); NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && fragment.IsEmpty(), NS_ERROR_DOM_SYNTAX_ERR); - nsCAutoString scheme; + nsAutoCString scheme; rv = parsedURL->GetScheme(scheme); NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && !scheme.IsEmpty(), NS_ERROR_DOM_SYNTAX_ERR); - nsCAutoString host; + nsAutoCString host; rv = parsedURL->GetAsciiHost(host); NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && !host.IsEmpty(), NS_ERROR_DOM_SYNTAX_ERR); @@ -969,14 +969,14 @@ nsWebSocket::ParseURL(const nsString& aURL) rv = NS_CheckPortSafety(port, scheme.get()); NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR); - nsCAutoString filePath; + nsAutoCString filePath; rv = parsedURL->GetFilePath(filePath); if (filePath.IsEmpty()) { filePath.AssignLiteral("/"); } NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR); - nsCAutoString query; + nsAutoCString query; rv = parsedURL->GetQuery(query); NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR); @@ -1093,7 +1093,7 @@ nsWebSocket::UpdateURI() nsresult rv = mChannel->GetURI(getter_AddRefs(uri)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = uri->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); CopyUTF8toUTF16(spec, mEffectiveURL); @@ -1342,7 +1342,7 @@ nsWebSocket::Close(uint16_t code, const nsAString & reason, uint8_t argc) closeCode = code; } - nsCAutoString closeReason; + nsAutoCString closeReason; if (argc >= 2) { CopyUTF16toUTF8(reason, closeReason); diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index b9b25a88597f..507272941f0b 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -223,7 +223,7 @@ nsMultipartProxyListener::OnStartRequest(nsIRequest *aRequest, nsCOMPtr channel(do_QueryInterface(aRequest)); NS_ENSURE_TRUE(channel, NS_ERROR_UNEXPECTED); - nsCAutoString contentType; + nsAutoCString contentType; nsresult rv = channel->GetContentType(contentType); if (!contentType.EqualsLiteral("multipart/x-mixed-replace")) { @@ -683,7 +683,7 @@ nsXMLHttpRequest::DetectCharset() channel = mChannel; } - nsCAutoString charsetVal; + nsAutoCString charsetVal; nsresult rv = channel ? channel->GetContentCharset(charsetVal) : NS_ERROR_FAILURE; if (NS_SUCCEEDED(rv)) { @@ -884,7 +884,7 @@ nsXMLHttpRequest::CreatePartialBlob() return NS_OK; } - nsCAutoString contentType; + nsAutoCString contentType; if (mLoadTotal == mLoadTransferred) { mChannel->GetContentType(contentType); } @@ -1328,7 +1328,7 @@ nsXMLHttpRequest::GetAllResponseHeaders(nsString& aResponseHeaders) } // Even non-http channels supply content type. - nsCAutoString value; + nsAutoCString value; if (NS_SUCCEEDED(mChannel->GetContentType(value))) { aResponseHeaders.AppendLiteral("Content-Type: "); AppendASCIItoUTF16(value, aResponseHeaders); @@ -1445,7 +1445,7 @@ nsXMLHttpRequest::GetResponseHeader(const nsACString& header, } if (!safeHeader) { - nsCAutoString headerVal; + nsAutoCString headerVal; // The "Access-Control-Expose-Headers" header contains a comma separated // list of method names. httpChannel-> @@ -1613,7 +1613,7 @@ nsXMLHttpRequest::CheckChannelForCrossSiteRequest(nsIChannel* aChannel) nsCOMPtr httpChannel = do_QueryInterface(aChannel); NS_ENSURE_TRUE(httpChannel, NS_ERROR_DOM_BAD_URI); - nsCAutoString method; + nsAutoCString method; httpChannel->GetRequestMethod(method); if (!mCORSUnsafeHeaders.IsEmpty() || (mUpload && mUpload->HasListeners()) || @@ -1749,7 +1749,7 @@ nsXMLHttpRequest::Open(const nsACString& method, const nsACString& url, // XXXbz this is wrong: we should only be looking at whether // user/password were passed, not at the values! See bug 759624. if (user.WasPassed() && !user.Value().IsEmpty()) { - nsCAutoString userpass; + nsAutoCString userpass; CopyUTF16toUTF8(user.Value(), userpass); if (password.WasPassed() && !password.Value().IsEmpty()) { userpass.Append(':'); @@ -1899,7 +1899,7 @@ bool nsXMLHttpRequest::CreateDOMFile(nsIRequest *request) } bool fromFile = false; if (file) { - nsCAutoString contentType; + nsAutoCString contentType; mChannel->GetContentType(contentType); nsCOMPtr cacheToken; if (cc) { @@ -2071,7 +2071,7 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt) mResponseType == XML_HTTP_RESPONSE_TYPE_DOCUMENT; nsCOMPtr httpChannel(do_QueryInterface(mChannel)); if (parseBody && httpChannel) { - nsCAutoString method; + nsAutoCString method; httpChannel->GetRequestMethod(method); parseBody = !method.EqualsLiteral("HEAD"); } @@ -2084,7 +2084,7 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt) // parse non-XML data. This also protects us from the situation // where we have an XML document and sink, but HTML (or other) // parser, which can produce unreliable results. - nsCAutoString type; + nsAutoCString type; channel->GetContentType(type); if ((mResponseType == XML_HTTP_RESPONSE_TYPE_DOCUMENT) && @@ -2264,7 +2264,7 @@ nsXMLHttpRequest::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult } else { // Smaller files may be written in cache map instead of separate files. // Also, no-store response cannot be written in persistent cache. - nsCAutoString contentType; + nsAutoCString contentType; mChannel->GetContentType(contentType); mBuilder->GetBlobInternal(NS_ConvertASCIItoUTF16(contentType), false, getter_AddRefs(mResponseBlob)); @@ -2697,7 +2697,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) // Ignore argument if method is GET, there is no point in trying to // upload anything - nsCAutoString method; + nsAutoCString method; nsCOMPtr httpChannel(do_QueryInterface(mChannel)); if (httpChannel) { @@ -2779,8 +2779,8 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) if ((aVariant || !aBody.IsNull()) && httpChannel && !method.EqualsLiteral("GET")) { - nsCAutoString charset; - nsCAutoString defaultContentType; + nsAutoCString charset; + nsAutoCString defaultContentType; nsCOMPtr postDataStream; rv = GetRequestBody(aVariant, aBody, getter_AddRefs(postDataStream), @@ -2790,7 +2790,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) if (postDataStream) { // If no content type header was set by the client, we set it to // application/xml. - nsCAutoString contentType; + nsAutoCString contentType; if (NS_FAILED(httpChannel-> GetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), contentType)) || @@ -2800,7 +2800,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) // We don't want to set a charset for streams. if (!charset.IsEmpty()) { - nsCAutoString specifiedCharset; + nsAutoCString specifiedCharset; bool haveCharset; int32_t charsetStart, charsetEnd; rv = NS_ExtractCharsetFromContentType(contentType, specifiedCharset, @@ -2826,7 +2826,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) // table, hence might be differently cased). if (!specifiedCharset.Equals(charset, nsCaseInsensitiveCStringComparator())) { - nsCAutoString newCharset("; charset="); + nsAutoCString newCharset("; charset="); newCharset.Append(charset); contentType.Replace(charsetStart, charsetEnd - charsetStart, newCharset); @@ -2876,11 +2876,11 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) } if (httpChannel) { - nsCAutoString contentTypeHeader; + nsAutoCString contentTypeHeader; rv = httpChannel->GetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), contentTypeHeader); if (NS_SUCCEEDED(rv)) { - nsCAutoString contentType, charset; + nsAutoCString contentType, charset; rv = NS_ParseContentType(contentTypeHeader, contentType, charset); NS_ENSURE_SUCCESS(rv, rv); @@ -2960,7 +2960,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) // if the channel doesn't know any content type. // This means that we always try to parse local files as XML // ignoring return value, as this is not critical - nsCAutoString contentType; + nsAutoCString contentType; if (NS_FAILED(mChannel->GetContentType(contentType)) || contentType.IsEmpty() || contentType.Equals(UNKNOWN_CONTENT_TYPE)) { diff --git a/content/base/test/TestGetURL.cpp b/content/base/test/TestGetURL.cpp index ae2411542889..db48266113ac 100644 --- a/content/base/test/TestGetURL.cpp +++ b/content/base/test/TestGetURL.cpp @@ -55,7 +55,7 @@ nsresult TestGetURL(const nsCString& aURL) rv = xhr->GetResponseText(response); TEST_ENSURE_SUCCESS(rv, "GetResponse failed!"); - nsCAutoString responseUTF8 = NS_ConvertUTF16toUTF8(response); + nsAutoCString responseUTF8 = NS_ConvertUTF16toUTF8(response); printf("#BEGIN\n"); printf("%s", responseUTF8.get()); printf("\n#EOF\n"); @@ -74,7 +74,7 @@ int main(int argc, char** argv) if (xpcom.failed()) return 1; - nsCAutoString targetURL(argv[1]); + nsAutoCString targetURL(argv[1]); int retval = 0; if (NS_FAILED(TestGetURL(targetURL))) { diff --git a/content/canvas/src/WebGLContextGL.cpp b/content/canvas/src/WebGLContextGL.cpp index e0c3f309f1ae..b51e914d72c3 100644 --- a/content/canvas/src/WebGLContextGL.cpp +++ b/content/canvas/src/WebGLContextGL.cpp @@ -3017,7 +3017,7 @@ void WebGLContext::GetProgramInfoLog(WebGLProgram *prog, nsAString& retval, ErrorResult& rv) { - nsCAutoString s; + nsAutoCString s; GetProgramInfoLog(prog, s, rv); if (s.IsVoid()) retval.SetIsVoid(true); @@ -3769,7 +3769,7 @@ WebGLContext::LinkProgram(WebGLProgram *program, ErrorResult& rv) // but it seems saner to keep a single way of obtaining shader infologs. ErrorResult rv; - nsCAutoString log; + nsAutoCString log; bool alreadyReportedShaderInfoLog = false; @@ -5021,7 +5021,7 @@ WebGLContext::CompileShader(WebGLShader *shader) ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &len); if (len) { - nsCAutoString info; + nsAutoCString info; info.SetLength(len); ShGetInfoLog(compiler, info.BeginWriting()); shader->SetTranslationFailure(info); @@ -5097,7 +5097,7 @@ WebGLContext::CompileShader(WebGLShader *shader) int len = 0; ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &len); - nsCAutoString translatedSrc; + nsAutoCString translatedSrc; translatedSrc.SetLength(len); ShGetObjectCode(compiler, translatedSrc.BeginWriting()); @@ -5339,7 +5339,7 @@ void WebGLContext::GetShaderInfoLog(WebGLShader *shader, nsAString& retval, ErrorResult& rv) { - nsCAutoString s; + nsAutoCString s; GetShaderInfoLog(shader, s, rv); if (s.IsVoid()) retval.SetIsVoid(true); diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 87ea7f0bde39..ea848c8df768 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -632,7 +632,7 @@ nsEventListenerManager::SetEventHandler(nsIAtom *aName, if ( !inlineOK ) { // gather information to log with violation report nsIURI* uri = doc->GetDocumentURI(); - nsCAutoString asciiSpec; + nsAutoCString asciiSpec; if (uri) uri->GetAsciiSpec(asciiSpec); nsAutoString scriptSample, attr, tagName(NS_LITERAL_STRING("UNKNOWN")); @@ -753,7 +753,7 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS } uint32_t lineNo = 0; - nsCAutoString url (NS_LITERAL_CSTRING("-moz-evil:lying-event-listener")); + nsAutoCString url (NS_LITERAL_CSTRING("-moz-evil:lying-event-listener")); nsCOMPtr doc; if (content) { doc = content->OwnerDoc(); diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 239660901e2a..c8681a2b2bf0 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -188,7 +188,7 @@ PrintDocTree(nsIDocShellTreeItem* aParentItem, int aLevel) static_cast(presContext ? presContext->EventStateManager() : nullptr), uri ? ' ' : '\n'); if (uri) { - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); printf("\"%s\"\n", spec.get()); } @@ -5358,25 +5358,25 @@ nsEventStateManager::WheelPrefs::Init( } mInit[aIndex] = true; - nsCAutoString basePrefName; + nsAutoCString basePrefName; GetBasePrefName(aIndex, basePrefName); - nsCAutoString prefNameX(basePrefName); + nsAutoCString prefNameX(basePrefName); prefNameX.AppendLiteral("delta_multiplier_x"); mMultiplierX[aIndex] = static_cast(Preferences::GetInt(prefNameX.get(), 100)) / 100; - nsCAutoString prefNameY(basePrefName); + nsAutoCString prefNameY(basePrefName); prefNameY.AppendLiteral("delta_multiplier_y"); mMultiplierY[aIndex] = static_cast(Preferences::GetInt(prefNameY.get(), 100)) / 100; - nsCAutoString prefNameZ(basePrefName); + nsAutoCString prefNameZ(basePrefName); prefNameZ.AppendLiteral("delta_multiplier_z"); mMultiplierZ[aIndex] = static_cast(Preferences::GetInt(prefNameZ.get(), 100)) / 100; - nsCAutoString prefNameAction(basePrefName); + nsAutoCString prefNameAction(basePrefName); prefNameAction.AppendLiteral("action"); mActions[aIndex] = static_cast(Preferences::GetInt(prefNameAction.get(), diff --git a/content/events/src/nsXMLEventsManager.cpp b/content/events/src/nsXMLEventsManager.cpp index de61cc9a5036..c3caff609046 100644 --- a/content/events/src/nsXMLEventsManager.cpp +++ b/content/events/src/nsXMLEventsManager.cpp @@ -42,7 +42,7 @@ bool nsXMLEventsListener::InitXMLEventsListener(nsIDocument * aDocument, if (aContent->GetAttr(nameSpaceID, nsGkAtoms::handler, handlerURIStr)) { hasHandlerURI = true; - nsCAutoString handlerRef; + nsAutoCString handlerRef; nsCOMPtr handlerURI; bool equals = false; nsIURI *docURI = aDocument->GetDocumentURI(); diff --git a/content/html/content/src/nsFormSubmission.cpp b/content/html/content/src/nsFormSubmission.cpp index da496a555296..818476c1bd8c 100644 --- a/content/html/content/src/nsFormSubmission.cpp +++ b/content/html/content/src/nsFormSubmission.cpp @@ -128,7 +128,7 @@ nsFSURLEncoded::AddNameValuePair(const nsAString& aName, NS_ENSURE_SUCCESS(rv, rv); // Encode name - nsCAutoString convName; + nsAutoCString convName; rv = URLEncode(aName, convName); NS_ENSURE_SUCCESS(rv, rv); @@ -260,7 +260,7 @@ nsFSURLEncoded::GetEncodedSubmission(nsIURI* aURI, aURI->SchemeIs("mailto", &isMailto); if (isMailto) { - nsCAutoString path; + nsAutoCString path; rv = aURI->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); @@ -318,12 +318,12 @@ nsFSURLEncoded::GetEncodedSubmission(nsIURI* aURI, url->SetQuery(mQueryString); } else { - nsCAutoString path; + nsAutoCString path; rv = aURI->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); // Bug 42616: Trim off named anchor and save it to add later int32_t namedAnchorPos = path.FindChar('#'); - nsCAutoString namedAnchor; + nsAutoCString namedAnchor; if (kNotFound != namedAnchorPos) { path.Right(namedAnchor, (path.Length() - namedAnchorPos)); path.Truncate(namedAnchorPos); @@ -358,7 +358,7 @@ nsFSURLEncoded::URLEncode(const nsAString& aStr, nsCString& aEncoded) nsLinebreakConverter::eLinebreakNet); NS_ENSURE_TRUE(convertedBuf, NS_ERROR_OUT_OF_MEMORY); - nsCAutoString encodedBuf; + nsAutoCString encodedBuf; nsresult rv = EncodeVal(nsDependentString(convertedBuf), encodedBuf, false); nsMemory::Free(convertedBuf); NS_ENSURE_SUCCESS(rv, rv); @@ -408,7 +408,7 @@ nsFSMultipartFormData::AddNameValuePair(const nsAString& aName, const nsAString& aValue) { nsCString valueStr; - nsCAutoString encodedVal; + nsAutoCString encodedVal; nsresult rv = EncodeVal(aValue, encodedVal, false); NS_ENSURE_SUCCESS(rv, rv); @@ -417,7 +417,7 @@ nsFSMultipartFormData::AddNameValuePair(const nsAString& aName, nsLinebreakConverter::eLinebreakAny, nsLinebreakConverter::eLinebreakNet)); - nsCAutoString nameStr; + nsAutoCString nameStr; rv = EncodeVal(aName, nameStr, true); NS_ENSURE_SUCCESS(rv, rv); @@ -440,7 +440,7 @@ nsFSMultipartFormData::AddNameFilePair(const nsAString& aName, nsIDOMBlob* aBlob) { // Encode the control name - nsCAutoString nameStr; + nsAutoCString nameStr; nsresult rv = EncodeVal(aName, nameStr, true); NS_ENSURE_SUCCESS(rv, rv); @@ -532,7 +532,7 @@ nsFSMultipartFormData::GetEncodedSubmission(nsIURI* aURI, = do_CreateInstance("@mozilla.org/network/mime-input-stream;1", &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString contentType; + nsAutoCString contentType; GetContentType(contentType); mimeStream->AddHeader("Content-Type", contentType.get()); mimeStream->SetAddContentLength(true); @@ -621,7 +621,7 @@ nsFSTextPlain::GetEncodedSubmission(nsIURI* aURI, bool isMailto = false; aURI->SchemeIs("mailto", &isMailto); if (isMailto) { - nsCAutoString path; + nsAutoCString path; rv = aURI->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); @@ -677,7 +677,7 @@ nsEncodingFormSubmission::nsEncodingFormSubmission(const nsACString& aCharset, nsIContent* aOriginatingElement) : nsFormSubmission(aCharset, aOriginatingElement) { - nsCAutoString charset(aCharset); + nsAutoCString charset(aCharset); // canonical name is passed so that we just have to check against // *our* canonical names listed in charsetaliases.properties if (charset.EqualsLiteral("ISO-8859-1")) { @@ -817,7 +817,7 @@ GetSubmissionFromForm(nsGenericHTMLElement* aForm, } // Get charset - nsCAutoString charset; + nsAutoCString charset; GetSubmitCharset(aForm, charset); // We now have a canonical charset name, so we only have to check it diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 1d7d446088bf..acd93b9829a7 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -2221,7 +2221,7 @@ nsGenericHTMLElement::GetPrimaryPresState(nsGenericHTMLElement* aContent, nsresult result = NS_OK; - nsCAutoString key; + nsAutoCString key; nsCOMPtr history = GetLayoutHistoryAndKey(aContent, false, key); if (history) { @@ -2288,7 +2288,7 @@ bool nsGenericHTMLElement::RestoreFormControlState(nsGenericHTMLElement* aContent, nsIFormControl* aControl) { - nsCAutoString key; + nsAutoCString key; nsCOMPtr history = GetLayoutHistoryAndKey(aContent, true, key); if (!history) { return false; @@ -2952,7 +2952,7 @@ nsGenericHTMLElement::GetURIAttr(nsIAtom* aAttr, nsIAtom* aBaseAttr, nsAString& return NS_OK; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); CopyUTF8toUTF16(spec, aResult); return NS_OK; @@ -3023,7 +3023,7 @@ nsGenericHTMLElement::GetURIListAttr(nsIAtom* aAttr, nsAString& aResult) nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(attrURI), uriPart, doc, baseURI); if (attrURI) { - nsCAutoString spec; + nsAutoCString spec; attrURI->GetSpec(spec); AppendUTF8toUTF16(spec, aResult); } else { diff --git a/content/html/content/src/nsHTMLAudioElement.cpp b/content/html/content/src/nsHTMLAudioElement.cpp index 2c4a59a058b6..224866678a10 100644 --- a/content/html/content/src/nsHTMLAudioElement.cpp +++ b/content/html/content/src/nsHTMLAudioElement.cpp @@ -219,7 +219,7 @@ nsHTMLAudioElement::MozCurrentSampleOffset(uint64_t *aRetVal) nsresult nsHTMLAudioElement::SetAcceptHeader(nsIHttpChannel* aChannel) { - nsCAutoString value( + nsAutoCString value( #ifdef MOZ_WEBM "audio/webm," #endif diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp index ba47878fd7a2..8732f59a3519 100644 --- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -4254,7 +4254,7 @@ nsHTMLInputElement::GetValidationMessage(nsAString& aValidationMessage, case VALIDITY_STATE_VALUE_MISSING: { nsXPIDLString message; - nsCAutoString key; + nsAutoCString key; switch (mType) { case NS_FORM_INPUT_FILE: @@ -4277,7 +4277,7 @@ nsHTMLInputElement::GetValidationMessage(nsAString& aValidationMessage, case VALIDITY_STATE_TYPE_MISMATCH: { nsXPIDLString message; - nsCAutoString key; + nsAutoCString key; if (mType == NS_FORM_INPUT_EMAIL) { key.AssignLiteral("FormValidationInvalidEmail"); } else if (mType == NS_FORM_INPUT_URL) { @@ -4410,7 +4410,7 @@ nsHTMLInputElement::IsValidEmailAddressList(const nsAString& aValue) bool nsHTMLInputElement::IsValidEmailAddress(const nsAString& aValue) { - nsCAutoString value = NS_ConvertUTF16toUTF8(aValue); + nsAutoCString value = NS_ConvertUTF16toUTF8(aValue); uint32_t i = 0; uint32_t length = value.Length(); @@ -4419,7 +4419,7 @@ nsHTMLInputElement::IsValidEmailAddress(const nsAString& aValue) if (idnSrv) { bool ace; if (NS_SUCCEEDED(idnSrv->IsACE(value, &ace)) && !ace) { - nsCAutoString punyCodedValue; + nsAutoCString punyCodedValue; if (NS_SUCCEEDED(idnSrv->ConvertUTF8toACE(value, punyCodedValue))) { value = punyCodedValue; length = value.Length(); diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp index e7ff5ea492a7..449318d411c9 100644 --- a/content/html/content/src/nsHTMLMediaElement.cpp +++ b/content/html/content/src/nsHTMLMediaElement.cpp @@ -506,7 +506,7 @@ NS_IMETHODIMP nsHTMLMediaElement::GetEnded(bool *aEnded) /* readonly attribute DOMString currentSrc; */ NS_IMETHODIMP nsHTMLMediaElement::GetCurrentSrc(nsAString & aCurrentSrc) { - nsCAutoString src; + nsAutoCString src; GetCurrentSpec(src); aCurrentSrc = NS_ConvertUTF8toUTF16(src); return NS_OK; @@ -535,7 +535,7 @@ nsHTMLMediaElement::OnChannelRedirect(nsIChannel *aChannel, NS_NAMED_LITERAL_CSTRING(rangeHdr, "Range"); - nsCAutoString rangeVal; + nsAutoCString rangeVal; if (NS_SUCCEEDED(http->GetRequestHeader(rangeHdr, rangeVal))) { NS_ENSURE_STATE(!rangeVal.IsEmpty()); @@ -2432,7 +2432,7 @@ nsresult nsHTMLMediaElement::InitializeDecoderForChannel(nsIChannel *aChannel, NS_ASSERTION(mLoadingSrc, "mLoadingSrc must already be set"); NS_ASSERTION(mDecoder == nullptr, "Shouldn't have a decoder"); - nsCAutoString mimeType; + nsAutoCString mimeType; aChannel->GetContentType(mimeType); nsRefPtr decoder = CreateDecoder(mimeType); @@ -2676,7 +2676,7 @@ nsresult nsHTMLMediaElement::NewURIFromString(const nsAutoString& aURISpec, nsIU void nsHTMLMediaElement::ProcessMediaFragmentURI() { - nsCAutoString ref; + nsAutoCString ref; GetCurrentSpec(ref); nsMediaFragmentURIParser parser(ref); parser.Parse(); diff --git a/content/html/content/src/nsHTMLSharedElement.cpp b/content/html/content/src/nsHTMLSharedElement.cpp index bd965f4e6cde..53e724084443 100644 --- a/content/html/content/src/nsHTMLSharedElement.cpp +++ b/content/html/content/src/nsHTMLSharedElement.cpp @@ -216,7 +216,7 @@ nsHTMLSharedElement::GetHref(nsAString& aValue) return NS_OK; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); CopyUTF8toUTF16(spec, aValue); diff --git a/content/html/content/src/nsHTMLVideoElement.cpp b/content/html/content/src/nsHTMLVideoElement.cpp index 00c53a3878f9..3656c582260d 100644 --- a/content/html/content/src/nsHTMLVideoElement.cpp +++ b/content/html/content/src/nsHTMLVideoElement.cpp @@ -150,7 +150,7 @@ nsHTMLVideoElement::GetAttributeMappingFunction() const nsresult nsHTMLVideoElement::SetAcceptHeader(nsIHttpChannel* aChannel) { - nsCAutoString value( + nsAutoCString value( #ifdef MOZ_WEBM "video/webm," #endif diff --git a/content/html/content/src/nsMediaFragmentURIParser.cpp b/content/html/content/src/nsMediaFragmentURIParser.cpp index 98f60a71515a..474c9b8d4b34 100644 --- a/content/html/content/src/nsMediaFragmentURIParser.cpp +++ b/content/html/content/src/nsMediaFragmentURIParser.cpp @@ -259,8 +259,8 @@ void nsMediaFragmentURIParser::Parse() const nsCSubstring& nv = tokenizer.nextToken(); int32_t index = nv.FindChar('='); if (index >= 0) { - nsCAutoString name; - nsCAutoString value; + nsAutoCString name; + nsAutoCString value; NS_UnescapeURL(StringHead(nv, index), esc_Ref | esc_AlwaysCopy, name); NS_UnescapeURL(Substring(nv, index + 1, nv.Length()), esc_Ref | esc_AlwaysCopy, value); diff --git a/content/html/content/src/nsMediaFragmentURIParser.h b/content/html/content/src/nsMediaFragmentURIParser.h index 879221fcc8c1..2845e794034a 100644 --- a/content/html/content/src/nsMediaFragmentURIParser.h +++ b/content/html/content/src/nsMediaFragmentURIParser.h @@ -65,7 +65,7 @@ private: bool ParseNPTSS(nsDependentSubstring& aString, uint32_t& aSecond); // Fragment portion of the URI given on construction - nsCAutoString mHash; + nsAutoCString mHash; // An array of name/value pairs containing the media fragments // parsed from the URI. diff --git a/content/html/document/src/ImageDocument.cpp b/content/html/document/src/ImageDocument.cpp index 0e51880d9173..69299045f77a 100644 --- a/content/html/document/src/ImageDocument.cpp +++ b/content/html/document/src/ImageDocument.cpp @@ -174,7 +174,7 @@ ImageListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt) nsCOMPtr channelURI; channel->GetURI(getter_AddRefs(channelURI)); - nsCAutoString mimeType; + nsAutoCString mimeType; channel->GetContentType(mimeType); nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager(); @@ -544,7 +544,7 @@ ImageDocument::OnStopDecode(imgIRequest *aRequest, // mImageContent can be null if the document is already destroyed if (NS_FAILED(aStatus) && mStringBundle && mImageContent) { - nsCAutoString src; + nsAutoCString src; mDocumentURI->GetSpec(src); NS_ConvertUTF8toUTF16 srcString(src); const PRUnichar* formatString[] = { srcString.get() }; @@ -655,7 +655,7 @@ ImageDocument::CreateSyntheticDocument() nsCOMPtr imageLoader = do_QueryInterface(mImageContent); NS_ENSURE_TRUE(imageLoader, NS_ERROR_UNEXPECTED); - nsCAutoString src; + nsAutoCString src; mDocumentURI->GetSpec(src); // Push a null JSContext on the stack so that code that runs within @@ -718,7 +718,7 @@ ImageDocument::CheckOverflowing(bool changeState) void ImageDocument::UpdateTitleAndCharset() { - nsCAutoString typeStr; + nsAutoCString typeStr; nsCOMPtr imageRequest; nsCOMPtr imageLoader = do_QueryInterface(mImageContent); if (imageLoader) { diff --git a/content/html/document/src/MediaDocument.cpp b/content/html/document/src/MediaDocument.cpp index 5b4655ea5135..70b7eddb4547 100644 --- a/content/html/document/src/MediaDocument.cpp +++ b/content/html/document/src/MediaDocument.cpp @@ -163,7 +163,7 @@ MediaDocument::StartDocumentLoad(const char* aCommand, // not being able to set the charset is not critical. NS_ENSURE_TRUE(docShell, NS_OK); - nsCAutoString charset; + nsAutoCString charset; nsCOMPtr csAtom; docShell->GetParentCharset(getter_AddRefs(csAtom)); @@ -298,12 +298,12 @@ MediaDocument::GetFileName(nsAString& aResult) if (!url) return; - nsCAutoString fileName; + nsAutoCString fileName; url->GetFileName(fileName); if (fileName.IsEmpty()) return; - nsCAutoString docCharset; + nsAutoCString docCharset; // Now that the charset is set in |StartDocumentLoad| to the charset of // the document viewer instead of a bogus value ("ISO-8859-1" set in // |nsDocument|'s ctor), the priority is given to the current charset. diff --git a/content/html/document/src/PluginDocument.cpp b/content/html/document/src/PluginDocument.cpp index e61cd10548b8..7cc3125917b2 100644 --- a/content/html/document/src/PluginDocument.cpp +++ b/content/html/document/src/PluginDocument.cpp @@ -281,7 +281,7 @@ PluginDocument::CreateSyntheticPluginDocument() false); // set URL - nsCAutoString src; + nsAutoCString src; mDocumentURI->GetSpec(src); mPluginContent->SetAttr(kNameSpaceID_None, nsGkAtoms::src, NS_ConvertUTF8toUTF16(src), false); diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index 6458c57442f7..440b446348a8 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -1427,7 +1427,7 @@ HTMLContentSink::Init(nsIDocument* aDoc, mContextStack.AppendElement(mCurrentContext); #ifdef DEBUG - nsCAutoString spec; + nsAutoCString spec; (void)aURI->GetSpec(spec); SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_CALLS, ("HTMLContentSink::Init: this=%p url='%s'", @@ -2131,7 +2131,7 @@ HTMLContentSink::DumpContentModel() Element* root = mDocument->GetRootElement(); if (root) { if (mDocumentURI) { - nsCAutoString buf; + nsAutoCString buf; mDocumentURI->GetSpec(buf); fputs(buf.get(), out); } diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index a9f99c041f0e..d72540767930 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -327,7 +327,7 @@ nsHTMLDocument::TryHintCharset(nsIMarkupDocumentViewer* aMarkupDV, nsresult rv = aMarkupDV->GetHintCharacterSetSource(&requestCharsetSource); if(NS_SUCCEEDED(rv) && kCharsetUninitialized != requestCharsetSource) { - nsCAutoString requestCharset; + nsAutoCString requestCharset; rv = aMarkupDV->GetHintCharacterSet(requestCharset); aMarkupDV->SetHintCharacterSetSource((int32_t)(kCharsetUninitialized)); @@ -357,7 +357,7 @@ nsHTMLDocument::TryUserForcedCharset(nsIMarkupDocumentViewer* aMarkupDV, if(kCharsetFromUserForced <= aCharsetSource) return true; - nsCAutoString forceCharsetFromDocShell; + nsAutoCString forceCharsetFromDocShell; if (aMarkupDV) { rv = aMarkupDV->GetForceCharacterSet(forceCharsetFromDocShell); } @@ -491,7 +491,7 @@ nsHTMLDocument::TryDefaultCharset( nsIMarkupDocumentViewer* aMarkupDV, if(kCharsetFromUserDefault <= aCharsetSource) return true; - nsCAutoString defaultCharsetFromDocShell; + nsAutoCString defaultCharsetFromDocShell; if (aMarkupDV) { nsresult rv = aMarkupDV->GetDefaultCharacterSet(defaultCharsetFromDocShell); @@ -540,7 +540,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, return NS_ERROR_DOM_INVALID_STATE_ERR; } - nsCAutoString contentType; + nsAutoCString contentType; aChannel->GetContentType(contentType); bool view = !strcmp(aCommand, "view") || @@ -586,7 +586,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, // GetSpec can be expensive for some URIs, so check the scheme first. bool isAbout = false; if (uri && NS_SUCCEEDED(uri->SchemeIs("about", &isAbout)) && isAbout) { - nsCAutoString str; + nsAutoCString str; uri->GetSpec(str); if (str.EqualsLiteral("about:blank")) { loadAsHtml5 = false; @@ -680,7 +680,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, } } - nsCAutoString urlSpec; + nsAutoCString urlSpec; uri->GetSpec(urlSpec); #ifdef DEBUG_charset printf("Determining charset for %s\n", urlSpec.get()); @@ -688,12 +688,12 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, // These are the charset source and charset for our document int32_t charsetSource; - nsCAutoString charset; + nsAutoCString charset; // These are the charset source and charset for the parser. This can differ // from that for the document if the channel is a wyciwyg channel. int32_t parserCharsetSource; - nsCAutoString parserCharset; + nsAutoCString parserCharset; nsCOMPtr wyciwygChannel; @@ -751,14 +751,14 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, // check if current doc is from POST command nsCOMPtr httpChannel(do_QueryInterface(aChannel)); if (httpChannel) { - nsCAutoString methodStr; + nsAutoCString methodStr; rv = httpChannel->GetRequestMethod(methodStr); isPostPage = (NS_SUCCEEDED(rv) && methodStr.EqualsLiteral("POST")); } if (isPostPage && muCV && kCharsetFromHintPrevDoc > charsetSource) { - nsCAutoString requestCharset; + nsAutoCString requestCharset; muCV->GetPrevDocCharacterSet(requestCharset); if (!requestCharset.IsEmpty()) { charsetSource = kCharsetFromHintPrevDoc; @@ -772,7 +772,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, parserCharsetSource = charsetSource < kCharsetFromChannel ? kCharsetFromChannel : charsetSource; - nsCAutoString cachedCharset; + nsAutoCString cachedCharset; int32_t cachedSource; rv = wyciwygChannel->GetCharsetAndSource(&cachedSource, cachedCharset); if (NS_SUCCEEDED(rv)) { @@ -936,7 +936,7 @@ nsHTMLDocument::GetDomain(nsAString& aDomain) return NS_ERROR_FAILURE; } - nsCAutoString hostName; + nsAutoCString hostName; if (NS_SUCCEEDED(uri->GetHost(hostName))) { CopyUTF8toUTF16(hostName, aDomain); @@ -963,10 +963,10 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain) return NS_ERROR_FAILURE; } - nsCAutoString newURIString; + nsAutoCString newURIString; if (NS_FAILED(uri->GetScheme(newURIString))) return NS_ERROR_FAILURE; - nsCAutoString path; + nsAutoCString path; if (NS_FAILED(uri->GetPath(path))) return NS_ERROR_FAILURE; newURIString.AppendLiteral("://"); @@ -980,7 +980,7 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain) // Check new domain - must be a superdomain of the current host // For example, a page from foo.bar.com may set domain to bar.com, // but not to ar.com, baz.com, or fi.foo.bar.com. - nsCAutoString current, domain; + nsAutoCString current, domain; if (NS_FAILED(uri->GetAsciiHost(current))) current.Truncate(); if (NS_FAILED(newURI->GetAsciiHost(domain))) @@ -997,7 +997,7 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain) if (!tldService) return NS_ERROR_NOT_AVAILABLE; - nsCAutoString currentBaseDomain; + nsAutoCString currentBaseDomain; ok = NS_SUCCEEDED(tldService->GetBaseDomain(uri, 0, currentBaseDomain)); NS_ASSERTION(StringEndsWith(domain, currentBaseDomain) == (domain.Length() >= currentBaseDomain.Length()), @@ -1015,7 +1015,7 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain) NS_IMETHODIMP nsHTMLDocument::GetURL(nsAString& aURL) { - nsCAutoString str; + nsAutoCString str; if (mDocumentURI) { mDocumentURI->GetSpec(str); @@ -1321,12 +1321,12 @@ nsHTMLDocument::Open(const nsAString& aContentTypeOrUrl, return NS_ERROR_DOM_INVALID_STATE_ERR; } - nsCAutoString contentType; + nsAutoCString contentType; contentType.AssignLiteral("text/html"); if (aOptionalArgCount > 0) { nsAutoString type; nsContentUtils::ASCIIToLower(aContentTypeOrUrl, type); - nsCAutoString actualType, dummy; + nsAutoCString actualType, dummy; NS_ParseContentType(NS_ConvertUTF16toUTF8(type), actualType, dummy); if (!actualType.EqualsLiteral("text/html") && !type.EqualsLiteral("replace")) { @@ -1408,8 +1408,8 @@ nsHTMLDocument::Open(const nsAString& aContentTypeOrUrl, #ifdef DEBUG nsCOMPtr callerDocURI = callerDoc->GetDocumentURI(); nsCOMPtr thisURI = nsIDocument::GetDocumentURI(); - nsCAutoString callerSpec; - nsCAutoString thisSpec; + nsAutoCString callerSpec; + nsAutoCString thisSpec; if (callerDocURI) { callerDocURI->GetSpec(callerSpec); } @@ -2220,7 +2220,7 @@ nsresult nsHTMLDocument::CreateAndAddWyciwygChannel(void) { nsresult rv = NS_OK; - nsCAutoString url, originalSpec; + nsAutoCString url, originalSpec; mDocumentURI->GetSpec(originalSpec); @@ -3081,7 +3081,7 @@ static bool ConvertToMidasInternalCommand(const nsAString & inCommandID, nsACString& outCommandID) { - nsCAutoString dummyCString; + nsAutoCString dummyCString; nsAutoString dummyString; bool dummyBool; return ConvertToMidasInternalCommandInner(inCommandID, dummyString, @@ -3154,7 +3154,7 @@ nsHTMLDocument::ExecCommand(const nsAString& commandID, *_retval = false; - nsCAutoString cmdToDispatch, paramStr; + nsAutoCString cmdToDispatch, paramStr; bool isBool, boolVal; if (!ConvertToMidasInternalCommand(commandID, value, cmdToDispatch, paramStr, @@ -3245,7 +3245,7 @@ nsHTMLDocument::QueryCommandEnabled(const nsAString& commandID, NS_ENSURE_ARG_POINTER(_retval); *_retval = false; - nsCAutoString cmdToDispatch; + nsAutoCString cmdToDispatch; if (!ConvertToMidasInternalCommand(commandID, cmdToDispatch)) { // Return false return NS_OK; @@ -3273,7 +3273,7 @@ nsHTMLDocument::QueryCommandIndeterm(const nsAString & commandID, NS_ENSURE_ARG_POINTER(_retval); *_retval = false; - nsCAutoString cmdToDispatch; + nsAutoCString cmdToDispatch; if (!ConvertToMidasInternalCommand(commandID, cmdToDispatch)) { // Return false return NS_OK; @@ -3312,7 +3312,7 @@ nsHTMLDocument::QueryCommandState(const nsAString & commandID, bool *_retval) NS_ENSURE_ARG_POINTER(_retval); *_retval = false; - nsCAutoString cmdToDispatch, paramToCheck; + nsAutoCString cmdToDispatch, paramToCheck; bool dummy, dummy2; if (!ConvertToMidasInternalCommand(commandID, commandID, cmdToDispatch, paramToCheck, @@ -3381,7 +3381,7 @@ nsHTMLDocument::QueryCommandSupported(const nsAString & commandID, NS_ENSURE_ARG_POINTER(_retval); // commandID is supported if it can be converted to a Midas command - nsCAutoString cmdToDispatch; + nsAutoCString cmdToDispatch; *_retval = ConvertToMidasInternalCommand(commandID, cmdToDispatch); return NS_OK; @@ -3394,7 +3394,7 @@ nsHTMLDocument::QueryCommandValue(const nsAString & commandID, { _retval.SetLength(0); - nsCAutoString cmdToDispatch, paramStr; + nsAutoCString cmdToDispatch, paramStr; if (!ConvertToMidasInternalCommand(commandID, cmdToDispatch)) { // Return empty string return NS_OK; diff --git a/content/media/MediaResource.cpp b/content/media/MediaResource.cpp index f1af3316503e..8a4b8779319f 100644 --- a/content/media/MediaResource.cpp +++ b/content/media/MediaResource.cpp @@ -166,7 +166,7 @@ ChannelMediaResource::OnStartRequest(nsIRequest* aRequest) return NS_OK; } - nsCAutoString ranges; + nsAutoCString ranges; hc->GetResponseHeader(NS_LITERAL_CSTRING("Accept-Ranges"), ranges); bool acceptsRanges = ranges.EqualsLiteral("bytes"); @@ -180,7 +180,7 @@ ChannelMediaResource::OnStartRequest(nsIRequest* aRequest) // 3) X-AMZ-Meta-Content-Duration. // 4) X-Content-Duration. // 5) Perform a seek in the decoder to find the value. - nsCAutoString durationText; + nsAutoCString durationText; nsresult ec = NS_OK; rv = hc->GetResponseHeader(NS_LITERAL_CSTRING("Content-Duration"), durationText); if (NS_FAILED(rv)) { @@ -482,7 +482,7 @@ void ChannelMediaResource::SetupChannelHeaders() // requests, and therefore seeking, early. nsCOMPtr hc = do_QueryInterface(mChannel); if (hc) { - nsCAutoString rangeString("bytes="); + nsAutoCString rangeString("bytes="); rangeString.AppendInt(mOffset); rangeString.Append("-"); hc->SetRequestHeader(NS_LITERAL_CSTRING("Range"), rangeString, false); diff --git a/content/svg/content/src/SVGLengthList.cpp b/content/svg/content/src/SVGLengthList.cpp index f09443f9bf53..f77dba1fca09 100644 --- a/content/svg/content/src/SVGLengthList.cpp +++ b/content/svg/content/src/SVGLengthList.cpp @@ -57,7 +57,7 @@ SVGLengthList::SetValueFromString(const nsAString& aValue) nsCharSeparatedTokenizerTemplate tokenizer(aValue, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL); - nsCAutoString str; // outside loop to minimize memory churn + nsAutoCString str; // outside loop to minimize memory churn while (tokenizer.hasMoreTokens()) { SVGLength length; diff --git a/content/svg/content/src/SVGNumberList.cpp b/content/svg/content/src/SVGNumberList.cpp index df6c413751b9..8414bb7d97ce 100644 --- a/content/svg/content/src/SVGNumberList.cpp +++ b/content/svg/content/src/SVGNumberList.cpp @@ -58,7 +58,7 @@ SVGNumberList::SetValueFromString(const nsAString& aValue) nsCharSeparatedTokenizerTemplate tokenizer(aValue, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL); - nsCAutoString str; // outside loop to minimize memory churn + nsAutoCString str; // outside loop to minimize memory churn while (tokenizer.hasMoreTokens()) { CopyUTF16toUTF8(tokenizer.nextToken(), str); // NS_ConvertUTF16toUTF8 diff --git a/content/svg/content/src/SVGPointList.cpp b/content/svg/content/src/SVGPointList.cpp index 0f835dbd74e0..6679e1178790 100644 --- a/content/svg/content/src/SVGPointList.cpp +++ b/content/svg/content/src/SVGPointList.cpp @@ -72,7 +72,7 @@ SVGPointList::SetValueFromString(const nsAString& aValue) nsCharSeparatedTokenizerTemplate tokenizer(aValue, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL); - nsCAutoString str1, str2; // outside loop to minimize memory churn + nsAutoCString str1, str2; // outside loop to minimize memory churn while (tokenizer.hasMoreTokens()) { CopyUTF16toUTF8(tokenizer.nextToken(), str1); diff --git a/content/svg/document/src/nsSVGDocument.cpp b/content/svg/document/src/nsSVGDocument.cpp index 93ad18d79fbe..0abeed9ecf5a 100644 --- a/content/svg/document/src/nsSVGDocument.cpp +++ b/content/svg/document/src/nsSVGDocument.cpp @@ -48,7 +48,7 @@ nsSVGDocument::GetDomain(nsAString& aDomain) SetDOMStringToNull(aDomain); if (mDocumentURI) { - nsCAutoString domain; + nsAutoCString domain; nsresult rv = mDocumentURI->GetHost(domain); if (domain.IsEmpty() || NS_FAILED(rv)) return rv; @@ -65,7 +65,7 @@ nsSVGDocument::GetURL(nsAString& aURL) SetDOMStringToNull(aURL); if (mDocumentURI) { - nsCAutoString url; + nsAutoCString url; nsresult rv = mDocumentURI->GetSpec(url); if (url.IsEmpty() || NS_FAILED(rv)) return rv; diff --git a/content/xbl/src/nsBindingManager.cpp b/content/xbl/src/nsBindingManager.cpp index 664c0279fe53..a3616263c4d4 100644 --- a/content/xbl/src/nsBindingManager.cpp +++ b/content/xbl/src/nsBindingManager.cpp @@ -1123,7 +1123,7 @@ MarkForDeath(nsISupports *aKey, nsXBLBinding *aBinding, void* aClosure) if (aBinding->MarkedForDeath()) return PL_DHASH_NEXT; // Already marked for death. - nsCAutoString path; + nsAutoCString path; aBinding->PrototypeBinding()->DocURI()->GetPath(path); if (!strncmp(path.get(), "/skin", 5)) diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index 0c9aac361fe0..9ed505b04a2d 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -757,8 +757,8 @@ nsXBLBinding::GenerateAnonymousContent() // See if there's an includes attribute. if (nsContentUtils::HasNonEmptyAttr(content, kNameSpaceID_None, nsGkAtoms::includes)) { - nsCAutoString message("An XBL Binding with URI "); - nsCAutoString uri; + nsAutoCString message("An XBL Binding with URI "); + nsAutoCString uri; mPrototypeBinding->BindingURI()->GetSpec(uri); message += uri; message += " is still using the deprecated\n syntax! Use instead!\n"; @@ -1338,7 +1338,7 @@ nsXBLBinding::DoInitJSClass(JSContext *cx, JSObject *global, JSObject *obj, JSObject** aClassObject) { // First ensure our JS class is initialized. - nsCAutoString className(aClassName); + nsAutoCString className(aClassName); JSObject* parent_proto = nullptr; // If we have an "obj" we can set this JSAutoRequest ar(cx); diff --git a/content/xbl/src/nsXBLDocumentInfo.cpp b/content/xbl/src/nsXBLDocumentInfo.cpp index fd8e7f2fb056..ca50fc1b8bf7 100644 --- a/content/xbl/src/nsXBLDocumentInfo.cpp +++ b/content/xbl/src/nsXBLDocumentInfo.cpp @@ -593,7 +593,7 @@ nsXBLDocumentInfo::ReadPrototypeBindings(nsIURI* aURI, nsXBLDocumentInfo** aDocI { *aDocInfo = nullptr; - nsCAutoString spec(kXBLCachePrefix); + nsAutoCString spec(kXBLCachePrefix); nsresult rv = PathifyURI(aURI, spec); NS_ENSURE_SUCCESS(rv, rv); @@ -663,7 +663,7 @@ nsXBLDocumentInfo::WritePrototypeBindings() if (!nsContentUtils::IsSystemPrincipal(mDocument->NodePrincipal())) return NS_OK; - nsCAutoString spec(kXBLCachePrefix); + nsAutoCString spec(kXBLCachePrefix); nsresult rv = PathifyURI(DocumentURI(), spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/xbl/src/nsXBLProtoImplField.cpp b/content/xbl/src/nsXBLProtoImplField.cpp index 6700d35848e2..dd93671013bd 100644 --- a/content/xbl/src/nsXBLProtoImplField.cpp +++ b/content/xbl/src/nsXBLProtoImplField.cpp @@ -97,7 +97,7 @@ nsXBLProtoImplField::InstallField(nsIScriptContext* aContext, // protect |result| here. nsresult rv; - nsCAutoString uriSpec; + nsAutoCString uriSpec; aBindingDocURI->GetSpec(uriSpec); JSContext* cx = aContext->GetNativeContext(); diff --git a/content/xbl/src/nsXBLProtoImplMethod.cpp b/content/xbl/src/nsXBLProtoImplMethod.cpp index 9d8b35e5127c..a0c69c63a3d4 100644 --- a/content/xbl/src/nsXBLProtoImplMethod.cpp +++ b/content/xbl/src/nsXBLProtoImplMethod.cpp @@ -193,7 +193,7 @@ nsXBLProtoImplMethod::CompileMember(nsIScriptContext* aContext, const nsCString& // Now that we have a body and args, compile the function // and then define it. NS_ConvertUTF16toUTF8 cname(mName); - nsCAutoString functionUri(aClassStr); + nsAutoCString functionUri(aClassStr); int32_t hash = functionUri.RFindChar('#'); if (hash != kNotFound) { functionUri.Truncate(hash); diff --git a/content/xbl/src/nsXBLProtoImplProperty.cpp b/content/xbl/src/nsXBLProtoImplProperty.cpp index 161071df79b6..06fda162a5d1 100644 --- a/content/xbl/src/nsXBLProtoImplProperty.cpp +++ b/content/xbl/src/nsXBLProtoImplProperty.cpp @@ -193,7 +193,7 @@ nsXBLProtoImplProperty::CompileMember(nsIScriptContext* aContext, const nsCStrin // We have a property. nsresult rv = NS_OK; - nsCAutoString functionUri; + nsAutoCString functionUri; if (mGetterText || mSetterText) { functionUri = aClassStr; int32_t hash = functionUri.RFindChar('#'); diff --git a/content/xbl/src/nsXBLPrototypeBinding.cpp b/content/xbl/src/nsXBLPrototypeBinding.cpp index 0c7bfac77b59..95deff6d878f 100644 --- a/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -1456,7 +1456,7 @@ public: } nsXBLDocumentInfo* mDocInfo; - nsCAutoString mID; + nsAutoCString mID; }; nsresult @@ -1469,13 +1469,13 @@ nsXBLPrototypeBinding::Read(nsIObjectInputStream* aStream, // nsXBLContentSink::ConstructBinding doesn't create a binding with an empty // id, so we don't here either. - nsCAutoString id; + nsAutoCString id; nsresult rv = aStream->ReadCString(id); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(!id.IsEmpty(), NS_ERROR_FAILURE); - nsCAutoString baseBindingURI; + nsAutoCString baseBindingURI; rv = aStream->ReadCString(baseBindingURI); NS_ENSURE_SUCCESS(rv, rv); mCheckedBaseProto = true; @@ -1545,7 +1545,7 @@ nsXBLPrototypeBinding::Read(nsIObjectInputStream* aStream, XBLPrototypeSetupCleanup cleanup(aDocInfo, id); - nsCAutoString className; + nsAutoCString className; rv = aStream->ReadCString(className); NS_ENSURE_SUCCESS(rv, rv); @@ -1679,13 +1679,13 @@ nsXBLPrototypeBinding::Write(nsIObjectOutputStream* aStream) nsresult rv = aStream->Write8(flags); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString id; + nsAutoCString id; mBindingURI->GetRef(id); rv = aStream->WriteStringZ(id.get()); NS_ENSURE_SUCCESS(rv, rv); // write out the extends and display attribute values - nsCAutoString extends; + nsAutoCString extends; ResolveBaseBinding(); if (mBaseBindingURI) mBaseBindingURI->GetSpec(extends); diff --git a/content/xbl/src/nsXBLPrototypeHandler.cpp b/content/xbl/src/nsXBLPrototypeHandler.cpp index c32e11f6c469..077a8242b2c2 100644 --- a/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -329,7 +329,7 @@ nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal, if (handlerText.IsEmpty()) return NS_ERROR_FAILURE; - nsCAutoString bindingURI; + nsAutoCString bindingURI; mPrototypeBinding->DocURI()->GetSpec(bindingURI); uint32_t argCount; @@ -623,7 +623,7 @@ static const keyCodeData gKeyCodes[] = { int32_t nsXBLPrototypeHandler::GetMatchingKeyCode(const nsAString& aKeyName) { - nsCAutoString keyName; + nsAutoCString keyName; keyName.AssignWithConversion(aKeyName); ToUpperCase(keyName); // We want case-insensitive comparison with data // stored as uppercase. diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp index ff8c00835b42..05e8af3e5cdb 100644 --- a/content/xbl/src/nsXBLService.cpp +++ b/content/xbl/src/nsXBLService.cpp @@ -85,7 +85,7 @@ IsAncestorBinding(nsIDocument* aDocument, if (bindingRecursion < NS_MAX_XBL_BINDING_RECURSION) { continue; } - nsCAutoString spec; + nsAutoCString spec; aChildBindingURI->GetSpec(spec); NS_ConvertUTF8toUTF16 bindingURI(spec); const PRUnichar* params[] = { bindingURI.get() }; @@ -471,7 +471,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL, nsCOMPtr document = aContent->OwnerDoc(); - nsCAutoString urlspec; + nsAutoCString urlspec; if (nsContentUtils::GetWrapperSafeScriptFilename(document, aURL, urlspec)) { // Block an attempt to load a binding that has special wrapper // automation needs. @@ -508,9 +508,9 @@ nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL, if (!newBinding) { #ifdef DEBUG - nsCAutoString spec; + nsAutoCString spec; aURL->GetSpec(spec); - nsCAutoString str(NS_LITERAL_CSTRING("Failed to locate XBL binding. XBL is now using id instead of name to reference bindings. Make sure you have switched over. The invalid binding name is: ") + spec); + nsAutoCString str(NS_LITERAL_CSTRING("Failed to locate XBL binding. XBL is now using id instead of name to reference bindings. Make sure you have switched over. The invalid binding name is: ") + spec); NS_ERROR(str.get()); #endif return NS_OK; @@ -759,7 +759,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, if (!aURI) return NS_ERROR_FAILURE; - nsCAutoString ref; + nsAutoCString ref; aURI->GetRef(ref); nsCOMPtr boundDocument = aBoundElement->OwnerDoc(); @@ -777,11 +777,11 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, if (!protoBinding) { #ifdef DEBUG - nsCAutoString uriSpec; + nsAutoCString uriSpec; aURI->GetSpec(uriSpec); - nsCAutoString doc; + nsAutoCString doc; boundDocument->GetDocumentURI()->GetSpec(doc); - nsCAutoString message("Unable to locate an XBL binding for URI "); + nsAutoCString message("Unable to locate an XBL binding for URI "); message += uriSpec; message += " in document "; message += doc; @@ -824,7 +824,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, rv = aDontExtendURIs[index]->Equals(baseBindingURI, &equal); NS_ENSURE_SUCCESS(rv, rv); if (equal) { - nsCAutoString spec, basespec; + nsAutoCString spec, basespec; protoBinding->BindingURI()->GetSpec(spec); NS_ConvertUTF8toUTF16 protoSpec(spec); baseBindingURI->GetSpec(basespec); diff --git a/content/xbl/src/nsXBLWindowKeyHandler.cpp b/content/xbl/src/nsXBLWindowKeyHandler.cpp index c3caa26e0fbd..0b7bcc59eec9 100644 --- a/content/xbl/src/nsXBLWindowKeyHandler.cpp +++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp @@ -124,7 +124,7 @@ nsXBLSpecialDocInfo::GetAllHandlers(const char* aType, nsXBLPrototypeHandler** aUserHandler) { if (mUserHTMLBindings) { - nsCAutoString type(aType); + nsAutoCString type(aType); type.Append("User"); GetHandlers(mUserHTMLBindings, type, aUserHandler); } diff --git a/content/xml/content/src/nsXMLStylesheetPI.cpp b/content/xml/content/src/nsXMLStylesheetPI.cpp index 3dbf04c8b2b3..b7a4674caf21 100644 --- a/content/xml/content/src/nsXMLStylesheetPI.cpp +++ b/content/xml/content/src/nsXMLStylesheetPI.cpp @@ -144,7 +144,7 @@ nsXMLStylesheetPI::GetStyleSheetURL(bool* aIsInline) } nsIURI *baseURL; - nsCAutoString charset; + nsAutoCString charset; nsIDocument *document = OwnerDoc(); baseURL = mOverriddenBaseURI ? mOverriddenBaseURI.get() : diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index decb1da95c8e..74ad4701aad1 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -169,7 +169,7 @@ nsXMLContentSink::WillBuildModel(nsDTDMode aDTDMode) // Check for correct load-command for maybe prettyprinting if (mPrettyPrintXML) { - nsCAutoString command; + nsAutoCString command; GetParser()->GetCommand(command); if (!command.EqualsLiteral("view")) { mPrettyPrintXML = false; @@ -697,7 +697,7 @@ nsXMLContentSink::ProcessStyleLink(nsIContent* aElement, nsresult rv = NS_OK; mPrettyPrintXML = false; - nsCAutoString cmd; + nsAutoCString cmd; if (mParser) GetParser()->GetCommand(cmd); if (cmd.EqualsASCII(kLoadAsData)) @@ -1223,7 +1223,7 @@ nsXMLContentSink::HandleDoctypeDecl(const nsAString & aSubset, mCSSLoader->LoadSheetSync(uri, true, true, getter_AddRefs(sheet)); #ifdef DEBUG - nsCAutoString uriStr; + nsAutoCString uriStr; uri->GetSpec(uriStr); printf("Loading catalog stylesheet: %s ... %s\n", uriStr.get(), sheet.get() ? "Done" : "Failed"); #endif diff --git a/content/xml/document/src/nsXMLDocument.cpp b/content/xml/document/src/nsXMLDocument.cpp index ec69daa8d4f6..4e03446a235d 100644 --- a/content/xml/document/src/nsXMLDocument.cpp +++ b/content/xml/document/src/nsXMLDocument.cpp @@ -309,7 +309,7 @@ nsXMLDocument::Load(const nsAString& aUrl, bool *aReturn) do_QueryInterface(nsContentUtils::GetDocumentFromContext()); nsIURI *baseURI = mDocumentURI; - nsCAutoString charset; + nsAutoCString charset; if (callingDoc) { baseURI = callingDoc->GetDocBaseURI(); @@ -357,7 +357,7 @@ nsXMLDocument::Load(const nsAString& aUrl, bool *aReturn) bool isChrome = false; if (NS_FAILED(uri->SchemeIs("chrome", &isChrome)) || !isChrome) { - nsCAutoString spec; + nsAutoCString spec; if (mDocumentURI) mDocumentURI->GetSpec(spec); @@ -503,7 +503,7 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand, int32_t charsetSource = kCharsetFromDocTypeDefault; - nsCAutoString charset(NS_LITERAL_CSTRING("UTF-8")); + nsAutoCString charset(NS_LITERAL_CSTRING("UTF-8")); TryChannelCharset(aChannel, charsetSource, charset, nullptr); nsCOMPtr aUrl; diff --git a/content/xslt/src/base/txDouble.cpp b/content/xslt/src/base/txDouble.cpp index 90b9bf1205c8..8a0219ade213 100644 --- a/content/xslt/src/base/txDouble.cpp +++ b/content/xslt/src/base/txDouble.cpp @@ -109,7 +109,7 @@ public: return mSign*PR_strtod(mBuffer.get(), 0); } private: - nsCAutoString mBuffer; + nsAutoCString mBuffer; enum { eWhitestart, eDecimal, diff --git a/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp b/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp index 278a92d3babf..954528fc3720 100644 --- a/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp +++ b/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp @@ -179,7 +179,7 @@ LookupFunction(const char *aContractID, nsIAtom* aName, nsIID &aIID, // have uppercase letters they might cause false matches (both fooBar and // foo-bar matching fooBar). const PRUnichar *name = aName->GetUTF16String(); - nsCAutoString methodName; + nsAutoCString methodName; PRUnichar letter; bool upperNext = false; while ((letter = *name)) { diff --git a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp index f38de55330b2..0be21f9dcc58 100644 --- a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp +++ b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp @@ -59,7 +59,7 @@ getSpec(nsIChannel* aChannel, nsAString& aSpec) return; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); AppendUTF8toUTF16(spec, aSpec); } @@ -255,8 +255,8 @@ txStylesheetSink::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) nsCOMPtr channel = do_QueryInterface(aRequest); // check channel's charset... - nsCAutoString charsetVal; - nsCAutoString charset; + nsAutoCString charsetVal; + nsAutoCString charset; if (NS_SUCCEEDED(channel->GetContentCharset(charsetVal))) { if (NS_SUCCEEDED(nsCharsetAlias::GetPreferred(charsetVal, charset))) { charsetSource = kCharsetFromChannel; @@ -270,7 +270,7 @@ txStylesheetSink::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) nsCOMPtr parser = do_QueryInterface(aContext); parser->SetDocumentCharset(charset, charsetSource); - nsCAutoString contentType; + nsAutoCString contentType; channel->GetContentType(contentType); // Time to sniff! Note: this should go away once file channels do @@ -498,7 +498,7 @@ nsresult TX_LoadSheet(nsIURI* aUri, txMozillaXSLTProcessor* aProcessor, nsILoadGroup* aLoadGroup, nsIPrincipal* aCallerPrincipal) { - nsCAutoString spec; + nsAutoCString spec; aUri->GetSpec(spec); PR_LOG(txLog::xslt, PR_LOG_ALWAYS, ("TX_LoadSheet: %s\n", spec.get())); @@ -668,7 +668,7 @@ txSyncCompileObserver::loadURI(const nsAString& aUri, nsCOMPtr doc = do_QueryInterface(document); rv = handleNode(doc, aCompiler); if (NS_FAILED(rv)) { - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); aCompiler->cancel(rv, nullptr, NS_ConvertUTF8toUTF16(spec).get()); return rv; @@ -703,7 +703,7 @@ TX_CompileStylesheet(nsINode* aNode, txMozillaXSLTProcessor* aProcessor, } NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); NS_ConvertUTF8toUTF16 baseURI(spec); diff --git a/content/xslt/src/xslt/txMozillaTextOutput.cpp b/content/xslt/src/xslt/txMozillaTextOutput.cpp index 1bb26f0d3b57..33826174cbf9 100644 --- a/content/xslt/src/xslt/txMozillaTextOutput.cpp +++ b/content/xslt/src/xslt/txMozillaTextOutput.cpp @@ -150,7 +150,7 @@ txMozillaTextOutput::createResultDocument(nsIDOMDocument* aSourceDocument) // Set the charset if (!mOutputFormat.mEncoding.IsEmpty()) { NS_LossyConvertUTF16toASCII charset(mOutputFormat.mEncoding); - nsCAutoString canonicalCharset; + nsAutoCString canonicalCharset; if (NS_SUCCEEDED(nsCharsetAlias::GetPreferred(charset, canonicalCharset))) { diff --git a/content/xslt/src/xslt/txMozillaXMLOutput.cpp b/content/xslt/src/xslt/txMozillaXMLOutput.cpp index a1b967a7075e..043a671e2758 100644 --- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp +++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp @@ -827,7 +827,7 @@ txMozillaXMLOutput::createResultDocument(const nsSubstring& aName, int32_t aNsID // Set the charset if (!mOutputFormat.mEncoding.IsEmpty()) { NS_LossyConvertUTF16toASCII charset(mOutputFormat.mEncoding); - nsCAutoString canonicalCharset; + nsAutoCString canonicalCharset; if (NS_SUCCEEDED(nsCharsetAlias::GetPreferred(charset, canonicalCharset))) { mDocument->SetDocumentCharacterSetSource(kCharsetFromOtherComponent); mDocument->SetDocumentCharacterSet(canonicalCharset); diff --git a/content/xslt/src/xslt/txMozillaXSLTProcessor.cpp b/content/xslt/src/xslt/txMozillaXSLTProcessor.cpp index cddcc0cda58d..14d40287b28b 100644 --- a/content/xslt/src/xslt/txMozillaXSLTProcessor.cpp +++ b/content/xslt/src/xslt/txMozillaXSLTProcessor.cpp @@ -1006,7 +1006,7 @@ txMozillaXSLTProcessor::LoadStyleSheet(nsIURI* aUri, nsILoadGroup* aLoadGroup) if (NS_FAILED(rv) && mObserver) { // This is most likely a network or security error, just // use the uri as context. - nsCAutoString spec; + nsAutoCString spec; aUri->GetSpec(spec); CopyUTF8toUTF16(spec, mSourceText); nsresult status = NS_ERROR_GET_MODULE(rv) == NS_ERROR_MODULE_XSLT ? rv : diff --git a/content/xtf/src/nsXTFService.cpp b/content/xtf/src/nsXTFService.cpp index 1d488be27852..81dac930f1b2 100644 --- a/content/xtf/src/nsXTFService.cpp +++ b/content/xtf/src/nsXTFService.cpp @@ -77,7 +77,7 @@ nsXTFService::CreateElement(nsIContent** aResult, // Check if we have an xtf factory for the given namespaceid in our cache: if (!mFactoryHash.Get(aNodeInfo.get()->NamespaceID(), getter_AddRefs(factory))) { // No. See if there is one registered with the component manager: - nsCAutoString xtf_contract_id(NS_XTF_ELEMENT_FACTORY_CONTRACTID_PREFIX); + nsAutoCString xtf_contract_id(NS_XTF_ELEMENT_FACTORY_CONTRACTID_PREFIX); nsAutoString uri; aNodeInfo.get()->GetNamespaceURI(uri); AppendUTF16toUTF8(uri, xtf_contract_id); diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index 8644282a35d3..e0a198fe21d8 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -2489,7 +2489,7 @@ nsXULPrototypeScript::Compile(const PRUnichar* aText, return NS_ERROR_UNEXPECTED; } - nsCAutoString urlspec; + nsAutoCString urlspec; nsContentUtils::GetWrapperSafeScriptFilename(aDocument, aURI, urlspec); // Ok, compile it to create a prototype script object! diff --git a/content/xul/document/src/nsXULCommandDispatcher.cpp b/content/xul/document/src/nsXULCommandDispatcher.cpp index d378a985b02c..e56d73ecf769 100644 --- a/content/xul/document/src/nsXULCommandDispatcher.cpp +++ b/content/xul/document/src/nsXULCommandDispatcher.cpp @@ -272,7 +272,7 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement, #ifdef DEBUG if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { - nsCAutoString eventsC, targetsC, aeventsC, atargetsC; + nsAutoCString eventsC, targetsC, aeventsC, atargetsC; eventsC.AssignWithConversion(updater->mEvents); targetsC.AssignWithConversion(updater->mTargets); CopyUTF16toUTF8(aEvents, aeventsC); @@ -300,7 +300,7 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement, } #ifdef DEBUG if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { - nsCAutoString aeventsC, atargetsC; + nsAutoCString aeventsC, atargetsC; CopyUTF16toUTF8(aEvents, aeventsC); CopyUTF16toUTF8(aTargets, atargetsC); @@ -335,7 +335,7 @@ nsXULCommandDispatcher::RemoveCommandUpdater(nsIDOMElement* aElement) if (updater->mElement == aElement) { #ifdef DEBUG if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { - nsCAutoString eventsC, targetsC; + nsAutoCString eventsC, targetsC; eventsC.AssignWithConversion(updater->mEvents); targetsC.AssignWithConversion(updater->mTargets); PR_LOG(gLog, PR_LOG_NOTICE, @@ -401,7 +401,7 @@ nsXULCommandDispatcher::UpdateCommands(const nsAString& aEventName) #ifdef DEBUG if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { - nsCAutoString aeventnameC; + nsAutoCString aeventnameC; CopyUTF16toUTF8(aEventName, aeventnameC); PR_LOG(gLog, PR_LOG_NOTICE, ("xulcmd[%p] update %p event=%s", diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 5f1b6072cb6d..e4433d653b20 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -428,7 +428,7 @@ nsXULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, nsCOMPtr uri; nsresult rv = aChannel->GetOriginalURI(getter_AddRefs(uri)); if (NS_SUCCEEDED(rv)) { - nsCAutoString urlspec; + nsAutoCString urlspec; rv = uri->GetSpec(urlspec); if (NS_SUCCEEDED(rv)) { PR_LOG(gXULLog, PR_LOG_WARNING, @@ -611,7 +611,7 @@ nsXULDocument::EndLoad() OnPrototypeLoadDone(true); #ifdef PR_LOGGING if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) { - nsCAutoString urlspec; + nsAutoCString urlspec; rv = uri->GetSpec(urlspec); if (NS_SUCCEEDED(rv)) { PR_LOG(gXULLog, PR_LOG_WARNING, @@ -1440,7 +1440,7 @@ nsXULDocument::Persist(nsIContent* aElement, int32_t aNameSpaceID, // Add it to the persisted set for this document (if it's not // there already). { - nsCAutoString docurl; + nsAutoCString docurl; rv = mDocumentURI->GetSpec(docurl); if (NS_FAILED(rv)) return rv; @@ -2131,7 +2131,7 @@ nsXULDocument::ApplyPersistentAttributesInternal() { nsCOMArray elements; - nsCAutoString docurl; + nsAutoCString docurl; mDocumentURI->GetSpec(docurl); nsCOMPtr doc; @@ -2358,7 +2358,7 @@ nsXULDocument::PrepareToWalk() if (PR_LOG_TEST(gXULLog, PR_LOG_ERROR)) { nsCOMPtr url = mCurrentPrototype->GetURI(); - nsCAutoString urlspec; + nsAutoCString urlspec; rv = url->GetSpec(urlspec); if (NS_FAILED(rv)) return rv; @@ -2633,9 +2633,9 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, #ifdef PR_LOGGING if (PR_LOG_TEST(gXULLog, PR_LOG_DEBUG)) { - nsCAutoString urlspec; + nsAutoCString urlspec; aURI->GetSpec(urlspec); - nsCAutoString parentDoc; + nsAutoCString parentDoc; nsCOMPtr uri; nsresult rv = mChannel->GetOriginalURI(getter_AddRefs(uri)); if (NS_SUCCEEDED(rv)) @@ -3308,7 +3308,7 @@ nsXULDocument::ReportMissingOverlay(nsIURI* aURI) { NS_PRECONDITION(aURI, "Must have a URI"); - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); NS_ConvertUTF8toUTF16 utfSpec(spec); @@ -3427,7 +3427,7 @@ nsXULDocument::OnStreamComplete(nsIStreamLoader* aLoader, nsCOMPtr uri; channel->GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString uriSpec; + nsAutoCString uriSpec; uri->GetSpec(uriSpec); printf("Failed to load %s\n", uriSpec.get()); } @@ -3907,7 +3907,7 @@ nsXULDocument::OverlayForwardReference::Resolve() #ifdef PR_LOGGING if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) { - nsCAutoString idC; + nsAutoCString idC; idC.AssignWithConversion(id); PR_LOG(gXULLog, PR_LOG_NOTICE, ("xul: overlay resolved '%s'", @@ -4078,15 +4078,15 @@ nsXULDocument::OverlayForwardReference::~OverlayForwardReference() nsAutoString id; mOverlay->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id); - nsCAutoString idC; + nsAutoCString idC; idC.AssignWithConversion(id); nsIURI *protoURI = mDocument->mCurrentPrototype->GetURI(); - nsCAutoString urlspec; + nsAutoCString urlspec; protoURI->GetSpec(urlspec); nsCOMPtr docURI; - nsCAutoString parentDoc; + nsAutoCString parentDoc; nsresult rv = mDocument->mChannel->GetOriginalURI(getter_AddRefs(docURI)); if (NS_SUCCEEDED(rv)) docURI->GetSpec(parentDoc); @@ -4135,7 +4135,7 @@ nsXULDocument::BroadcasterHookup::~BroadcasterHookup() attribute.AssignLiteral("*"); } - nsCAutoString attributeC,broadcasteridC; + nsAutoCString attributeC,broadcasteridC; attributeC.AssignWithConversion(attribute); broadcasteridC.AssignWithConversion(broadcasterID); PR_LOG(gXULLog, PR_LOG_WARNING, @@ -4348,7 +4348,7 @@ nsXULDocument::CheckBroadcasterHookup(Element* aElement, if (! content) return rv; - nsCAutoString attributeC,broadcasteridC; + nsAutoCString attributeC,broadcasteridC; attributeC.AssignWithConversion(attribute); broadcasteridC.AssignWithConversion(broadcasterID); PR_LOG(gXULLog, PR_LOG_NOTICE, @@ -4610,7 +4610,7 @@ nsXULDocument::IsDocumentRightToLeft() if (!reg) return false; - nsCAutoString package; + nsAutoCString package; bool isChrome; if (NS_SUCCEEDED(mDocumentURI->SchemeIs("chrome", &isChrome)) && isChrome) { diff --git a/content/xul/document/src/nsXULPrototypeCache.cpp b/content/xul/document/src/nsXULPrototypeCache.cpp index 20087fe56357..902e7464fdd5 100644 --- a/content/xul/document/src/nsXULPrototypeCache.cpp +++ b/content/xul/document/src/nsXULPrototypeCache.cpp @@ -215,9 +215,9 @@ nsXULPrototypeCache::PutScript(nsIURI* aURI, JSScript* aScriptObject) CacheScriptEntry existingEntry; if (mScriptTable.Get(aURI, &existingEntry)) { #ifdef DEBUG - nsCAutoString scriptName; + nsAutoCString scriptName; aURI->GetSpec(scriptName); - nsCAutoString message("Loaded script "); + nsAutoCString message("Loaded script "); message += scriptName; message += " twice (bug 392650)"; NS_WARNING(message.get()); @@ -266,7 +266,7 @@ nsXULPrototypeCache::PutXBLDocumentInfo(nsXBLDocumentInfo* aDocumentInfo) static PLDHashOperator FlushSkinXBL(nsIURI* aKey, nsRefPtr& aDocInfo, void* aClosure) { - nsCAutoString str; + nsAutoCString str; aKey->GetPath(str); PLDHashOperator ret = PL_DHASH_NEXT; @@ -281,7 +281,7 @@ FlushSkinXBL(nsIURI* aKey, nsRefPtr& aDocInfo, void* aClosure static PLDHashOperator FlushSkinSheets(nsIURI* aKey, nsRefPtr& aSheet, void* aClosure) { - nsCAutoString str; + nsAutoCString str; aSheet->GetSheetURI()->GetPath(str); PLDHashOperator ret = PL_DHASH_NEXT; @@ -391,7 +391,7 @@ nsXULPrototypeCache::WritePrototype(nsXULPrototypeDocument* aPrototypeDocument) nsresult nsXULPrototypeCache::GetInputStream(nsIURI* uri, nsIObjectInputStream** stream) { - nsCAutoString spec(kXULCachePrefix); + nsAutoCString spec(kXULCachePrefix); nsresult rv = PathifyURI(uri, spec); if (NS_FAILED(rv)) return NS_ERROR_NOT_AVAILABLE; @@ -467,7 +467,7 @@ nsXULPrototypeCache::FinishOutputStream(nsIURI* uri) &len); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec(kXULCachePrefix); + nsAutoCString spec(kXULCachePrefix); rv = PathifyURI(uri, spec); if (NS_FAILED(rv)) return NS_ERROR_NOT_AVAILABLE; @@ -487,7 +487,7 @@ nsXULPrototypeCache::HasData(nsIURI* uri, bool* exists) *exists = true; return NS_OK; } - nsCAutoString spec(kXULCachePrefix); + nsAutoCString spec(kXULCachePrefix); nsresult rv = PathifyURI(uri, spec); if (NS_FAILED(rv)) { *exists = false; @@ -535,7 +535,7 @@ nsXULPrototypeCache::BeginCaching(nsIURI* aURI) { nsresult rv, tmp; - nsCAutoString path; + nsAutoCString path; aURI->GetPath(path); if (!StringEndsWith(path, NS_LITERAL_CSTRING(".xul"))) return NS_ERROR_NOT_AVAILABLE; @@ -574,25 +574,25 @@ nsXULPrototypeCache::BeginCaching(nsIURI* aURI) rv = NS_GetSpecialDirectory(NS_APP_CHROME_DIR, getter_AddRefs(chromeDir)); if (NS_FAILED(rv)) return rv; - nsCAutoString chromePath; + nsAutoCString chromePath; rv = chromeDir->GetNativePath(chromePath); if (NS_FAILED(rv)) return rv; // XXXbe we assume the first package's locale is the same as the locale of // all subsequent packages of cached chrome URIs.... - nsCAutoString package; + nsAutoCString package; rv = aURI->GetHost(package); if (NS_FAILED(rv)) return rv; nsCOMPtr chromeReg = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv); - nsCAutoString locale; + nsAutoCString locale; rv = chromeReg->GetSelectedLocale(package, locale); if (NS_FAILED(rv)) return rv; - nsCAutoString fileChromePath, fileLocale; + nsAutoCString fileChromePath, fileLocale; nsAutoArrayPtr buf; uint32_t len, amtRead; diff --git a/content/xul/templates/src/nsRDFConInstanceTestNode.cpp b/content/xul/templates/src/nsRDFConInstanceTestNode.cpp index 1f4952a87690..bf243a42c539 100644 --- a/content/xul/templates/src/nsRDFConInstanceTestNode.cpp +++ b/content/xul/templates/src/nsRDFConInstanceTestNode.cpp @@ -40,7 +40,7 @@ nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent, { #ifdef PR_LOGGING if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { - nsCAutoString props; + nsAutoCString props; nsResourceSet& containmentProps = aProcessor->ContainmentProperties(); nsResourceSet::ConstIterator last = containmentProps.Last(); diff --git a/content/xul/templates/src/nsRDFConMemberTestNode.cpp b/content/xul/templates/src/nsRDFConMemberTestNode.cpp index 761e2f516e52..281ef5410f9c 100644 --- a/content/xul/templates/src/nsRDFConMemberTestNode.cpp +++ b/content/xul/templates/src/nsRDFConMemberTestNode.cpp @@ -28,7 +28,7 @@ nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent, { #ifdef PR_LOGGING if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { - nsCAutoString props; + nsAutoCString props; nsResourceSet& containmentProps = aProcessor->ContainmentProperties(); nsResourceSet::ConstIterator last = containmentProps.Last(); diff --git a/content/xul/templates/src/nsXULContentUtils.cpp b/content/xul/templates/src/nsXULContentUtils.cpp index 5f7183493c9c..2c21fb5c7c9a 100644 --- a/content/xul/templates/src/nsXULContentUtils.cpp +++ b/content/xul/templates/src/nsXULContentUtils.cpp @@ -312,7 +312,7 @@ nsXULContentUtils::MakeElementURI(nsIDocument* aDocument, rv = docURI->GetSpec(aURI); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString ref; + nsAutoCString ref; NS_EscapeURL(NS_ConvertUTF16toUTF8(aElementID), esc_FilePath | esc_AlwaysCopy, ref); aURI.Append('#'); @@ -353,7 +353,7 @@ nsXULContentUtils::MakeElementID(nsIDocument* aDocument, aDocument->GetDocumentCharacterSet().get()); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString ref; + nsAutoCString ref; uri->GetRef(ref); CopyUTF8toUTF16(ref, aElementID); diff --git a/content/xul/templates/src/nsXULTemplateBuilder.cpp b/content/xul/templates/src/nsXULTemplateBuilder.cpp index e35ae6abf19f..f95c8cf34d81 100644 --- a/content/xul/templates/src/nsXULTemplateBuilder.cpp +++ b/content/xul/templates/src/nsXULTemplateBuilder.cpp @@ -1227,7 +1227,7 @@ nsXULTemplateBuilder::LoadDataSources(nsIDocument* aDocument, NS_ENSURE_TRUE(mQueryProcessor, NS_ERROR_OUT_OF_MEMORY); } else { - nsCAutoString cid(NS_QUERY_PROCESSOR_CONTRACTID_PREFIX); + nsAutoCString cid(NS_QUERY_PROCESSOR_CONTRACTID_PREFIX); AppendUTF16toUTF8(querytype, cid); mQueryProcessor = do_CreateInstance(cid.get(), &rv); diff --git a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp index b05c87b3992d..f977d6c48f67 100644 --- a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp +++ b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp @@ -244,7 +244,7 @@ nsXULTemplateQueryProcessorRDF::GetDatasource(nsIArray* aDataSources, continue; nsCOMPtr ds; - nsCAutoString uristrC; + nsAutoCString uristrC; uri->GetSpec(uristrC); rv = gRDFService->GetDataSource(uristrC.get(), getter_AddRefs(ds)); @@ -254,7 +254,7 @@ nsXULTemplateQueryProcessorRDF::GetDatasource(nsIArray* aDataSources, // be accessible for any number of reasons, including // security, a bad URL, etc. #ifdef DEBUG - nsCAutoString msg; + nsAutoCString msg; msg.Append("unable to load datasource '"); msg.Append(uristrC); msg.Append('\''); @@ -1065,7 +1065,7 @@ nsXULTemplateQueryProcessorRDF::Log(const char* aOperation, if (NS_FAILED(rv)) return rv; - nsCAutoString targetstrC; + nsAutoCString targetstrC; targetstrC.AssignWithConversion(targetStr); PR_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" --[%s]-->[%s]", @@ -1296,7 +1296,7 @@ nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag, nsAutoString tagstr; aTag->ToString(tagstr); - nsCAutoString tagstrC; + nsAutoCString tagstrC; tagstrC.AssignWithConversion(tagstr); PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("xultemplate[%p] unrecognized condition test <%s>", diff --git a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp index 521a4beb0e49..08467cac9223 100644 --- a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp +++ b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp @@ -44,7 +44,7 @@ nsXULTemplateResultSetStorage::nsXULTemplateResultSetStorage(mozIStorageStatemen return; } for (uint32_t c = 0; c < count; c++) { - nsCAutoString name; + nsAutoCString name; rv = aStatement->GetColumnName(c, name); if (NS_SUCCEEDED(rv)) { nsCOMPtr columnName = do_GetAtom(NS_LITERAL_CSTRING("?") + name); @@ -187,13 +187,13 @@ nsXULTemplateQueryProcessorStorage::GetDatasource(nsIArray* aDataSources, NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr databaseFile; - nsCAutoString scheme; + nsAutoCString scheme; rv = uri->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); if (scheme.EqualsLiteral("profile")) { - nsCAutoString path; + nsAutoCString path; rv = uri->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp b/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp index 3a0f2ced118f..318cc2d65bd1 100644 --- a/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp +++ b/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp @@ -149,7 +149,7 @@ nsXULTemplateQueryProcessorXML::GetDatasource(nsIArray* aDataSources, if (!uri) return NS_ERROR_UNEXPECTED; - nsCAutoString uriStr; + nsAutoCString uriStr; rv = uri->GetSpec(uriStr); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/xul/templates/src/nsXULTemplateResultXML.cpp b/content/xul/templates/src/nsXULTemplateResultXML.cpp index 93d4f9a98272..c2e617191a3a 100644 --- a/content/xul/templates/src/nsXULTemplateResultXML.cpp +++ b/content/xul/templates/src/nsXULTemplateResultXML.cpp @@ -29,7 +29,7 @@ nsXULTemplateResultXML::nsXULTemplateResultXML(nsXMLQuery* aQuery, nsCOMPtr id = content->GetID(); if (id) { nsCOMPtr uri = content->GetBaseURI(); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); mId = NS_ConvertUTF8toUTF16(spec); diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp index e026e9a84d31..454770c7d74c 100644 --- a/docshell/base/nsAboutRedirector.cpp +++ b/docshell/base/nsAboutRedirector.cpp @@ -76,7 +76,7 @@ nsAboutRedirector::NewChannel(nsIURI *aURI, nsIChannel **result) nsresult rv; - nsCAutoString path; + nsAutoCString path; rv = NS_GetAboutModuleName(aURI, path); if (NS_FAILED(rv)) return rv; @@ -123,7 +123,7 @@ nsAboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result) { NS_ENSURE_ARG_POINTER(aURI); - nsCAutoString name; + nsAutoCString name; nsresult rv = NS_GetAboutModuleName(aURI, name); NS_ENSURE_SUCCESS(rv, rv); diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index b039ed2a55f5..3b3d6ed988ef 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -390,7 +390,7 @@ bool nsDSURIContentListener::CheckFrameOptions(nsIRequest *request) return true; } - nsCAutoString xfoHeaderCValue; + nsAutoCString xfoHeaderCValue; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("X-Frame-Options"), xfoHeaderCValue); NS_ConvertUTF8toUTF16 xfoHeaderValue(xfoHeaderCValue); diff --git a/docshell/base/nsDefaultURIFixup.cpp b/docshell/base/nsDefaultURIFixup.cpp index ff027547ac70..83b7d9e335cb 100644 --- a/docshell/base/nsDefaultURIFixup.cpp +++ b/docshell/base/nsDefaultURIFixup.cpp @@ -47,7 +47,7 @@ nsDefaultURIFixup::CreateExposableURI(nsIURI *aURI, nsIURI **aReturn) bool isWyciwyg = false; aURI->SchemeIs("wyciwyg", &isWyciwyg); - nsCAutoString userPass; + nsAutoCString userPass; aURI->GetUserPass(userPass); // most of the time we can just AddRef and return @@ -62,7 +62,7 @@ nsDefaultURIFixup::CreateExposableURI(nsIURI *aURI, nsIURI **aReturn) nsCOMPtr uri; if (isWyciwyg) { - nsCAutoString path; + nsAutoCString path; nsresult rv = aURI->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); @@ -82,7 +82,7 @@ nsDefaultURIFixup::CreateExposableURI(nsIURI *aURI, nsIURI **aReturn) } // Get the charset of the original URI so we can pass it to our fixed up URI. - nsCAutoString charset; + nsAutoCString charset; aURI->GetOriginCharset(charset); rv = NS_NewURI(getter_AddRefs(uri), @@ -119,7 +119,7 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, uint32_t aFixupF nsresult rv; *aURI = nullptr; - nsCAutoString uriString(aStringURI); + nsAutoCString uriString(aStringURI); uriString.Trim(" "); // Cleanup the empty spaces that might be on each end. // Eliminate embedded newlines, which single-line text fields now allow: @@ -129,7 +129,7 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, uint32_t aFixupF nsCOMPtr ioService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString scheme; + nsAutoCString scheme; ioService->ExtractScheme(aStringURI, scheme); // View-source is a pseudo scheme. We're interested in fixing up the stuff @@ -148,7 +148,7 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, uint32_t aFixupF newFixupFlags, getter_AddRefs(uri)); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); uriString.Assign(NS_LITERAL_CSTRING("view-source:") + spec); } @@ -182,8 +182,8 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, uint32_t aFixupF // slash. The forward slash test is to stop before trampling over // URIs which legitimately contain a mix of both forward and // backward slashes. - nsCAutoString::iterator start; - nsCAutoString::iterator end; + nsAutoCString::iterator start; + nsAutoCString::iterator end; uriString.BeginWriting(start); uriString.EndWriting(end); while (start != end) { @@ -280,7 +280,7 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, uint32_t aFixupF hostPos = uriString.Length(); // extract host name - nsCAutoString hostSpec; + nsAutoCString hostSpec; uriString.Left(hostSpec, hostPos); // insert url spec corresponding to host name @@ -322,7 +322,7 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword, NS_ENSURE_STATE(Preferences::GetRootBranch()); // Strip leading "?" and leading/trailing spaces from aKeyword - nsCAutoString keyword(aKeyword); + nsAutoCString keyword(aKeyword); if (StringBeginsWith(keyword, NS_LITERAL_CSTRING("?"))) { keyword.Cut(0, 1); } @@ -337,7 +337,7 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword, // If the pref is set and non-empty, use it. if (!url.IsEmpty()) { // Escape keyword, then prepend URL - nsCAutoString spec; + nsAutoCString spec; if (!NS_Escape(keyword, spec, url_XPAlphas)) { return NS_ERROR_OUT_OF_MEMORY; } @@ -410,14 +410,14 @@ bool nsDefaultURIFixup::MakeAlternateURI(nsIURI *aURI) } // Security - URLs with user / password info should NOT be fixed up - nsCAutoString userpass; + nsAutoCString userpass; aURI->GetUserPass(userpass); if (!userpass.IsEmpty()) { return false; } - nsCAutoString oldHost; - nsCAutoString newHost; + nsAutoCString oldHost; + nsAutoCString newHost; aURI->GetHost(oldHost); // Count the dots @@ -436,7 +436,7 @@ bool nsDefaultURIFixup::MakeAlternateURI(nsIURI *aURI) // Get the prefix and suffix to stick onto the new hostname. By default these // are www. & .com but they could be any other value, e.g. www. & .org - nsCAutoString prefix("www."); + nsAutoCString prefix("www."); nsAdoptingCString prefPrefix = Preferences::GetCString("browser.fixup.alternate.prefix"); if (prefPrefix) @@ -444,7 +444,7 @@ bool nsDefaultURIFixup::MakeAlternateURI(nsIURI *aURI) prefix.Assign(prefPrefix); } - nsCAutoString suffix(".com"); + nsAutoCString suffix(".com"); nsAdoptingCString prefSuffix = Preferences::GetCString("browser.fixup.alternate.suffix"); if (prefSuffix) @@ -531,7 +531,7 @@ bool nsDefaultURIFixup::IsLikelyFTP(const nsCString &aHostSpec) nsresult nsDefaultURIFixup::FileURIFixup(const nsACString& aStringURI, nsIURI** aURI) { - nsCAutoString uriSpecOut; + nsAutoCString uriSpecOut; nsresult rv = ConvertFileToStringURI(aStringURI, uriSpecOut); if (NS_SUCCEEDED(rv)) @@ -748,7 +748,7 @@ const char * nsDefaultURIFixup::GetFileSystemCharset() if (mFsCharset.IsEmpty()) { nsresult rv; - nsCAutoString charset; + nsAutoCString charset; nsCOMPtr plat(do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) rv = plat->GetCharset(kPlatformCharsetSel_FileName, charset); diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 0d4126269a04..e68aeec378f7 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -401,7 +401,7 @@ OnPingTimeout(nsITimer *timer, void *closure) static bool IsSameHost(nsIURI *uri1, nsIURI *uri2) { - nsCAutoString host1, host2; + nsAutoCString host1, host2; uri1->GetAsciiHost(host1); uri2->GetAsciiHost(host2); return host1.Equals(host2); @@ -1280,7 +1280,7 @@ nsDocShell::LoadURI(nsIURI * aURI, #if defined(PR_LOGGING) && defined(DEBUG) if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { - nsCAutoString uristr; + nsAutoCString uristr; aURI->GetAsciiSpec(uristr); PR_LOG(gDocShellLog, PR_LOG_DEBUG, ("nsDocShell[%p]: loading %s with flags 0x%08x", @@ -1842,7 +1842,7 @@ nsDocShell::SetCurrentURI(nsIURI *aURI, nsIRequest *aRequest, { #ifdef PR_LOGGING if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) { - nsCAutoString spec; + nsAutoCString spec; if (aURI) aURI->GetSpec(spec); PR_LogPrint("DOCSHELL %p SetCurrentURI %s\n", this, spec.get()); @@ -4025,8 +4025,8 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, bool addHostPort = false; nsresult rv = NS_OK; nsAutoString messageStr; - nsCAutoString cssClass; - nsCAutoString errorPage; + nsAutoCString cssClass; + nsAutoCString errorPage; errorPage.AssignLiteral("neterror"); @@ -4034,7 +4034,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, if (NS_ERROR_UNKNOWN_PROTOCOL == aError) { NS_ENSURE_ARG_POINTER(aURI); // extract the scheme - nsCAutoString scheme; + nsAutoCString scheme; aURI->GetScheme(scheme); CopyASCIItoUTF16(scheme, formatStrs[0]); formatStrCount = 1; @@ -4047,7 +4047,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, else if (NS_ERROR_UNKNOWN_HOST == aError) { NS_ENSURE_ARG_POINTER(aURI); // Get the host - nsCAutoString host; + nsAutoCString host; nsCOMPtr innermostURI = NS_GetInnermostURI(aURI); innermostURI->GetHost(host); CopyUTF8toUTF16(host, formatStrs[0]); @@ -4067,7 +4067,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, else if (NS_ERROR_NET_TIMEOUT == aError) { NS_ENSURE_ARG_POINTER(aURI); // Get the host - nsCAutoString host; + nsAutoCString host; aURI->GetHost(host); CopyUTF8toUTF16(host, formatStrs[0]); formatStrCount = 1; @@ -4148,7 +4148,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, } } } else if (NS_ERROR_PHISHING_URI == aError || NS_ERROR_MALWARE_URI == aError) { - nsCAutoString host; + nsAutoCString host; aURI->GetHost(host); CopyUTF8toUTF16(host, formatStrs[0]); formatStrCount = 1; @@ -4255,7 +4255,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, else { if (addHostPort) { // Build up the host:port string. - nsCAutoString hostport; + nsAutoCString hostport; if (aURI) { aURI->GetHostPort(hostport); } else { @@ -4264,7 +4264,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, CopyUTF8toUTF16(hostport, formatStrs[formatStrCount++]); } - nsCAutoString spec; + nsAutoCString spec; rv = NS_ERROR_NOT_AVAILABLE; if (aURI) { // displaying "file://" is aesthetically unpleasing and could even be @@ -4276,7 +4276,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, else aURI->GetSpec(spec); - nsCAutoString charset; + nsAutoCString charset; // unescape and convert from origin charset aURI->GetOriginCharset(charset); nsCOMPtr textToSubURI( @@ -4340,10 +4340,10 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL, { #if defined(PR_LOGGING) && defined(DEBUG) if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); - nsCAutoString chanName; + nsAutoCString chanName; if (aFailedChannel) aFailedChannel->GetName(chanName); else @@ -4365,8 +4365,8 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL, mLSHE->AbandonBFCacheEntry(); } - nsCAutoString url; - nsCAutoString charset; + nsAutoCString url; + nsAutoCString charset; if (aURI) { nsresult rv = aURI->GetSpec(url); @@ -5694,7 +5694,7 @@ nsDocShell::SetupRefreshURIFromHeader(nsIURI * aBaseURI, // uriAttrib is empty or the URI specified MOZ_ASSERT(aPrincipal); - nsCAutoString uriAttrib; + nsAutoCString uriAttrib; int32_t seconds = 0; bool specifiesSeconds = false; @@ -5890,7 +5890,7 @@ NS_IMETHODIMP nsDocShell::SetupRefreshURI(nsIChannel * aChannel) nsresult rv; nsCOMPtr httpChannel(do_QueryInterface(aChannel, &rv)); if (NS_SUCCEEDED(rv)) { - nsCAutoString refreshHeader; + nsAutoCString refreshHeader; rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("refresh"), refreshHeader); @@ -6141,7 +6141,7 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest, nsCOMPtr channel(do_QueryInterface(aRequest)); nsCOMPtr uri; channel->GetURI(getter_AddRefs(uri)); - nsCAutoString aURI; + nsAutoCString aURI; uri->GetAsciiSpec(aURI); nsCOMPtr wcwgChannel(do_QueryInterface(aRequest)); @@ -6487,7 +6487,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress, // nsCOMPtr newURI; - nsCAutoString oldSpec; + nsAutoCString oldSpec; url->GetSpec(oldSpec); // @@ -6497,10 +6497,10 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress, bool keywordsEnabled = Preferences::GetBool("keyword.enabled", false); - nsCAutoString host; + nsAutoCString host; url->GetHost(host); - nsCAutoString scheme; + nsAutoCString scheme; url->GetScheme(scheme); int32_t dotLoc = host.FindChar('.'); @@ -6540,7 +6540,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress, // Since we don't have access to the exact original string // that was entered by the user, this will just have to do. bool isACE; - nsCAutoString utf8Host; + nsAutoCString utf8Host; nsCOMPtr idnSrv = do_GetService(NS_IDNSERVICE_CONTRACTID); if (idnSrv && @@ -6597,7 +6597,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress, bool sameURI = false; url->Equals(newURI, &sameURI); if (!sameURI) { - nsCAutoString newSpec; + nsAutoCString newSpec; newURI->GetSpec(newSpec); NS_ConvertUTF8toUTF16 newSpecW(newSpec); @@ -6960,7 +6960,7 @@ nsDocShell::CaptureState() #ifdef DEBUG_PAGE_CACHE nsCOMPtr uri; mOSHE->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; if (uri) uri->GetSpec(spec); printf("Saving presentation into session history\n"); @@ -7120,7 +7120,7 @@ nsDocShell::RestorePresentation(nsISHEntry *aSHEntry, bool *aRestoring) nsCOMPtr uri; aSHEntry->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; if (uri) uri->GetSpec(spec); #endif @@ -7894,11 +7894,11 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer) NS_ERROR_FAILURE); nsCOMPtr parent(do_QueryInterface(parentAsItem)); - nsCAutoString defaultCharset; - nsCAutoString forceCharset; - nsCAutoString hintCharset; + nsAutoCString defaultCharset; + nsAutoCString forceCharset; + nsAutoCString hintCharset; int32_t hintCharsetSource; - nsCAutoString prevDocCharset; + nsAutoCString prevDocCharset; int32_t minFontSize; float textZoom; float pageZoom; @@ -8293,7 +8293,7 @@ nsDocShell::InternalLoad(nsIURI * aURI, #ifdef PR_LOGGING if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) { - nsCAutoString spec; + nsAutoCString spec; if (aURI) aURI->GetSpec(spec); PR_LogPrint("DOCSHELL %p InternalLoad %s\n", this, spec.get()); @@ -8478,7 +8478,7 @@ nsDocShell::InternalLoad(nsIURI * aURI, nsDependentString name(aWindowTarget); nsCOMPtr newWin; - nsCAutoString spec; + nsAutoCString spec; if (aURI) aURI->GetSpec(spec); rv = win->OpenNoNavigate(NS_ConvertUTF8toUTF16(spec), @@ -8638,7 +8638,7 @@ nsDocShell::InternalLoad(nsIURI * aURI, // Split mCurrentURI and aURI on the '#' character. Make sure we read // the return values of SplitURIAtHash; if it fails, we don't want to // allow a short-circuited navigation. - nsCAutoString curBeforeHash, curHash, newBeforeHash, newHash; + nsAutoCString curBeforeHash, curHash, newBeforeHash, newHash; nsresult splitRv1, splitRv2; splitRv1 = mCurrentURI ? nsContentUtils::SplitURIAtHash(mCurrentURI, @@ -9362,7 +9362,7 @@ AppendSegmentToString(nsIInputStream *in, { // aFromSegment now contains aCount bytes of data. - nsCAutoString *buf = static_cast(closure); + nsAutoCString *buf = static_cast(closure); buf->Append(fromRawSegment, count); // Indicate that we have consumed all of aFromSegment @@ -9378,7 +9378,7 @@ nsDocShell::AddHeadersToChannel(nsIInputStream *aHeadersData, NS_ENSURE_STATE(httpChannel); uint32_t numRead; - nsCAutoString headersString; + nsAutoCString headersString; nsresult rv = aHeadersData->ReadSegments(AppendSegmentToString, &headersString, PR_UINT32_MAX, @@ -9386,8 +9386,8 @@ nsDocShell::AddHeadersToChannel(nsIInputStream *aHeadersData, NS_ENSURE_SUCCESS(rv, rv); // used during the manipulation of the String from the InputStream - nsCAutoString headerName; - nsCAutoString headerValue; + nsAutoCString headerName; + nsAutoCString headerValue; int32_t crlf; int32_t colon; @@ -9644,10 +9644,10 @@ nsDocShell::OnNewURI(nsIURI * aURI, nsIChannel * aChannel, nsISupports* aOwner, #if defined(PR_LOGGING) && defined(DEBUG) if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); - nsCAutoString chanName; + nsAutoCString chanName; if (aChannel) aChannel->GetName(chanName); else @@ -10023,10 +10023,10 @@ nsDocShell::AddState(nsIVariant *aData, const nsAString& aTitle, if (!docBaseURI) return NS_ERROR_FAILURE; - nsCAutoString spec; + nsAutoCString spec; docBaseURI->GetSpec(spec); - nsCAutoString charset; + nsAutoCString charset; rv = docBaseURI->GetOriginCharset(charset); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); @@ -10056,7 +10056,7 @@ nsDocShell::AddState(nsIVariant *aData, const nsAString& aTitle, // It's very important that we check that newURI is of the same // origin as mCurrentURI, not docBaseURI, because a page can // set docBaseURI arbitrarily to any domain. - nsCAutoString currentUserPass, newUserPass; + nsAutoCString currentUserPass, newUserPass; NS_ENSURE_SUCCESS(mCurrentURI->GetUserPass(currentUserPass), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(newURI->GetUserPass(newUserPass), @@ -10223,7 +10223,7 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI * aURI) // should just do a spec compare, rather than two gets of the scheme and // then the path. -Gagan nsresult rv; - nsCAutoString buf, pref; + nsAutoCString buf, pref; rv = aURI->GetScheme(buf); if (NS_FAILED(rv)) @@ -10258,10 +10258,10 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, nsIChannel * aChannel, #if defined(PR_LOGGING) && defined(DEBUG) if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); - nsCAutoString chanName; + nsAutoCString chanName; if (aChannel) aChannel->GetName(chanName); else @@ -10443,7 +10443,7 @@ nsDocShell::LoadHistoryEntry(nsISHEntry * aEntry, uint32_t aLoadType) nsCOMPtr uri; nsCOMPtr postData; nsCOMPtr referrerURI; - nsCAutoString contentType; + nsAutoCString contentType; nsCOMPtr owner; NS_ENSURE_TRUE(aEntry, NS_ERROR_FAILURE); @@ -10940,7 +10940,7 @@ nsDocShell::ChannelIsPost(nsIChannel* aChannel) return false; } - nsCAutoString method; + nsAutoCString method; httpChannel->GetRequestMethod(method); return method.Equals("POST"); } @@ -11880,7 +11880,7 @@ nsDocShell::OnLinkClickSync(nsIContent *aContent, nsCOMPtr extProtService = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID); if (extProtService) { - nsCAutoString scheme; + nsAutoCString scheme; aURI->GetScheme(scheme); if (!scheme.IsEmpty()) { // if the URL scheme does not correspond to an exposed protocol, then we @@ -11926,7 +11926,7 @@ nsDocShell::OnLinkClickSync(nsIContent *aContent, if (anchor) { anchor->GetType(typeHint); NS_ConvertUTF16toUTF8 utf8Hint(typeHint); - nsCAutoString type, dummy; + nsAutoCString type, dummy; NS_ParseContentType(utf8Hint, type, dummy); CopyUTF8toUTF16(type, typeHint); } @@ -11985,11 +11985,11 @@ nsDocShell::OnOverLink(nsIContent* aContent, return rv; // use url origin charset to unescape the URL - nsCAutoString charset; + nsAutoCString charset; rv = aURI->GetOriginCharset(charset); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/docshell/shistory/src/nsSHEntry.cpp b/docshell/shistory/src/nsSHEntry.cpp index 88bb01ade7cf..ab55f0f48cc0 100644 --- a/docshell/shistory/src/nsSHEntry.cpp +++ b/docshell/shistory/src/nsSHEntry.cpp @@ -197,7 +197,7 @@ NS_IMETHODIMP nsSHEntry::GetTitle(PRUnichar** aTitle) // Check for empty title... if (mTitle.IsEmpty() && mURI) { // Default title is the URL. - nsCAutoString spec; + nsAutoCString spec; if (NS_SUCCEEDED(mURI->GetSpec(spec))) AppendUTF8toUTF16(spec, mTitle); } diff --git a/docshell/shistory/src/nsSHistory.cpp b/docshell/shistory/src/nsSHistory.cpp index a55d5e7f23e9..a1430f285740 100644 --- a/docshell/shistory/src/nsSHistory.cpp +++ b/docshell/shistory/src/nsSHistory.cpp @@ -72,7 +72,7 @@ static PRLogModuleInfo* gLogModule = PR_LOG_DEFINE("nsSHistory"); #define LOG_SPEC(format, uri) \ PR_BEGIN_MACRO \ if (PR_LOG_TEST(gLogModule, PR_LOG_DEBUG)) { \ - nsCAutoString _specStr(NS_LITERAL_CSTRING("(null)"));\ + nsAutoCString _specStr(NS_LITERAL_CSTRING("(null)"));\ if (uri) { \ uri->GetSpec(_specStr); \ } \ @@ -555,7 +555,7 @@ nsSHistory::PrintHistory() } #if 0 - nsCAutoString url; + nsAutoCString url; if (uri) uri->GetSpec(url); diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 526a4b12e15b..a52f01204666 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -240,7 +240,7 @@ Navigator::GetAppCodeName(nsAString& aAppCodeName) service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString appName; + nsAutoCString appName; rv = service->GetAppName(appName); CopyASCIItoUTF16(appName, aAppCodeName); @@ -340,7 +340,7 @@ Navigator::GetOscpu(nsAString& aOSCPU) service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString oscpu; + nsAutoCString oscpu; rv = service->GetOscpu(oscpu); CopyASCIItoUTF16(oscpu, aOSCPU); @@ -480,7 +480,7 @@ Navigator::GetBuildID(nsAString& aBuildID) return NS_ERROR_NOT_IMPLEMENTED; } - nsCAutoString buildID; + nsAutoCString buildID; nsresult rv = appInfo->GetAppBuildID(buildID); if (NS_FAILED(rv)) { return rv; @@ -1389,7 +1389,7 @@ NS_GetNavigatorUserAgent(nsAString& aUserAgent) service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString ua; + nsAutoCString ua; rv = service->GetUserAgent(ua); CopyASCIItoUTF16(ua, aUserAgent); @@ -1433,7 +1433,7 @@ NS_GetNavigatorPlatform(nsAString& aPlatform) // XXX Communicator uses compiled-in build-time string defines // to indicate the platform it was compiled *for*, not what it is // currently running *on* which is what this does. - nsCAutoString plat; + nsAutoCString plat; rv = service->GetOscpu(plat); CopyASCIItoUTF16(plat, aPlatform); #endif @@ -1459,7 +1459,7 @@ NS_GetNavigatorAppVersion(nsAString& aAppVersion) service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString str; + nsAutoCString str; rv = service->GetAppVersion(str); CopyASCIItoUTF16(str, aAppVersion); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index c30728a4baec..2d7bcf7f79a6 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -2304,7 +2304,7 @@ nsDOMClassInfo::RegisterExternalClasses() NS_ENSURE_SUCCESS(rv, rv); nsXPIDLCString contractId; - nsCAutoString categoryEntry; + nsAutoCString categoryEntry; nsCOMPtr entry; while (NS_SUCCEEDED(e->GetNext(getter_AddRefs(entry)))) { diff --git a/dom/base/nsDOMException.cpp b/dom/base/nsDOMException.cpp index 8d5f5a323a84..bbe9dd4a00bf 100644 --- a/dom/base/nsDOMException.cpp +++ b/dom/base/nsDOMException.cpp @@ -319,7 +319,7 @@ nsDOMException::ToString(char **aReturn) static const char format[] = "[Exception... \"%s\" code: \"%d\" nsresult: \"0x%x (%s)\" location: \"%s\"]"; - nsCAutoString location; + nsAutoCString location; if (mInner) { nsXPIDLCString filename; diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index d436ececf8ae..8d95a1ad0bc5 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -2142,7 +2142,7 @@ nsDOMWindowUtils::GoOnline() nsCOMPtr documentURI; documentURI = doc->GetDocumentURI(); - nsCAutoString spec; + nsAutoCString spec; documentURI->GetSpec(spec); if (!StringBeginsWith(spec, NS_LITERAL_CSTRING("about:neterror?"))) return NS_ERROR_DOM_SECURITY_ERR; diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index 1d2966409e42..c7e0ef50f13d 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -82,7 +82,7 @@ PRLogModuleInfo* gFocusNavigationLog; #define LOGTAG(log, format, content) \ { \ - nsCAutoString tag(NS_LITERAL_CSTRING("(none)")); \ + nsAutoCString tag(NS_LITERAL_CSTRING("(none)")); \ if (content) { \ content->Tag()->ToUTF8String(tag); \ } \ @@ -488,7 +488,7 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement, if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) { nsIDocument* doc = mFocusedWindow->GetExtantDoc(); if (doc && doc->GetDocumentURI()) { - nsCAutoString spec; + nsAutoCString spec; doc->GetDocumentURI()->GetSpec(spec); LOGFOCUS((" Focused Window: %p %s", mFocusedWindow.get(), spec.get())); } @@ -652,7 +652,7 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow) #ifdef PR_LOGGING if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get())); - nsCAutoString spec; + nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); if (doc && doc->GetDocumentURI()) { doc->GetDocumentURI()->GetSpec(spec); @@ -750,7 +750,7 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow) #ifdef PR_LOGGING if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get())); - nsCAutoString spec; + nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); if (doc && doc->GetDocumentURI()) { doc->GetDocumentURI()->GetSpec(spec); @@ -858,7 +858,7 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus) #ifdef PR_LOGGING if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get())); - nsCAutoString spec; + nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); if (doc && doc->GetDocumentURI()) { doc->GetDocumentURI()->GetSpec(spec); @@ -910,7 +910,7 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow) #ifdef PR_LOGGING if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get())); - nsCAutoString spec; + nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); if (doc && doc->GetDocumentURI()) { doc->GetDocumentURI()->GetSpec(spec); diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 3134a5fe63d6..1ee17c870cbf 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -823,7 +823,7 @@ nsGlobalWindow::~nsGlobalWindow() #ifdef DEBUG if (!PR_GetEnv("MOZ_QUIET")) { - nsCAutoString url; + nsAutoCString url; if (mLastOpenedURI) { mLastOpenedURI->GetSpec(url); } @@ -2190,7 +2190,7 @@ nsGlobalWindow::InnerSetNewDocument(nsIDocument* aDocument) #ifdef PR_LOGGING if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { nsIURI *uri = aDocument->GetDocumentURI(); - nsCAutoString spec; + nsAutoCString spec; if (uri) uri->GetSpec(spec); PR_LogPrint("DOMWINDOW %p SetNewDocument %s", this, spec.get()); @@ -4667,7 +4667,7 @@ nsGlobalWindow::MakeScriptDialogTitle(nsAString &aOutTitle) nsCOMPtr fixedURI; rv = fixup->CreateExposableURI(uri, getter_AddRefs(fixedURI)); if (NS_SUCCEEDED(rv) && fixedURI) { - nsCAutoString host; + nsAutoCString host; fixedURI->GetHost(host); if (!host.IsEmpty()) { @@ -4675,7 +4675,7 @@ nsGlobalWindow::MakeScriptDialogTitle(nsAString &aOutTitle) // schemes (e.g. file:) we fall back to the localized // generic string - nsCAutoString prepath; + nsAutoCString prepath; fixedURI->GetPrePath(prepath); NS_ConvertUTF8toUTF16 ucsPrePath(prepath); @@ -7974,14 +7974,14 @@ nsGlobalWindow::DispatchAsyncHashchange(nsIURI *aOldURI, nsIURI *aNewURI) // Make sure that aOldURI and aNewURI are identical up to the '#', and that // their hashes are different. - nsCAutoString oldBeforeHash, oldHash, newBeforeHash, newHash; + nsAutoCString oldBeforeHash, oldHash, newBeforeHash, newHash; nsContentUtils::SplitURIAtHash(aOldURI, oldBeforeHash, oldHash); nsContentUtils::SplitURIAtHash(aNewURI, newBeforeHash, newHash); NS_ENSURE_STATE(oldBeforeHash.Equals(newBeforeHash)); NS_ENSURE_STATE(!oldHash.Equals(newHash)); - nsCAutoString oldSpec, newSpec; + nsAutoCString oldSpec, newSpec; aOldURI->GetSpec(oldSpec); aNewURI->GetSpec(newSpec); @@ -10234,7 +10234,7 @@ nsGlobalWindow::BuildURIfromBase(const char *aURL, nsIURI **aBuiltURI, /* resolve the URI, which could be relative to the calling window (note the algorithm to get the base URI should match the one used to actually kick off the load in nsWindowWatcher.cpp). */ - nsCAutoString charset(NS_LITERAL_CSTRING("UTF-8")); // default to utf-8 + nsAutoCString charset(NS_LITERAL_CSTRING("UTF-8")); // default to utf-8 nsIURI* baseURI = nullptr; nsCOMPtr uriToLoad; nsCOMPtr sourceWindow; diff --git a/dom/base/nsGlobalWindowCommands.cpp b/dom/base/nsGlobalWindowCommands.cpp index cfb567086b66..34ea8a4609e5 100644 --- a/dom/base/nsGlobalWindowCommands.cpp +++ b/dom/base/nsGlobalWindowCommands.cpp @@ -577,7 +577,7 @@ nsClipboardGetContentsCommand::DoClipboardCommand(const char *aCommandName, nsIC { NS_ENSURE_ARG(aParams); - nsCAutoString mimeType("text/plain"); + nsAutoCString mimeType("text/plain"); nsXPIDLCString format; // nsICommandParams needs to use nsACString if (NS_SUCCEEDED(aParams->GetCStringValue("format", getter_Copies(format)))) diff --git a/dom/base/nsHistory.cpp b/dom/base/nsHistory.cpp index 5f6d918a4b08..2a02d124e147 100644 --- a/dom/base/nsHistory.cpp +++ b/dom/base/nsHistory.cpp @@ -80,7 +80,7 @@ nsHistory::GetCurrent(nsAString& aCurrent) return NS_ERROR_DOM_SECURITY_ERR; int32_t curIndex=0; - nsCAutoString curURL; + nsAutoCString curURL; nsCOMPtr sHistory; // Get SessionHistory from docshell @@ -112,7 +112,7 @@ nsHistory::GetPrevious(nsAString& aPrevious) return NS_ERROR_DOM_SECURITY_ERR; int32_t curIndex; - nsCAutoString prevURL; + nsAutoCString prevURL; nsCOMPtr sHistory; // Get session History from docshell @@ -144,7 +144,7 @@ nsHistory::GetNext(nsAString& aNext) return NS_ERROR_DOM_SECURITY_ERR; int32_t curIndex; - nsCAutoString nextURL; + nsAutoCString nextURL; nsCOMPtr sHistory; // Get session History from docshell @@ -356,7 +356,7 @@ nsHistory::Item(uint32_t aIndex, nsAString& aReturn) } if (uri) { - nsCAutoString urlCString; + nsAutoCString urlCString; rv = uri->GetSpec(urlCString); CopyUTF8toUTF16(urlCString, aReturn); diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 549f68a119ed..d0e3b7c661da 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -532,7 +532,7 @@ NS_ScriptErrorReporter(JSContext *cx, #ifdef DEBUG // Print it to stderr as well, for the benefit of those invoking // mozilla with -console. - nsCAutoString error; + nsAutoCString error; error.Assign("JavaScript "); if (JSREPORT_IS_STRICT(report->flags)) error.Append("strict "); @@ -616,7 +616,7 @@ PrintWinURI(nsGlobalWindow *win) return; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); printf("%s\n", spec.get()); } @@ -642,7 +642,7 @@ PrintWinCodebase(nsGlobalWindow *win) return; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); printf("%s\n", spec.get()); } @@ -2267,7 +2267,7 @@ nsJSContext::AddSupportsPrimitiveTojsvals(nsISupports *aArg, jsval *aArgv) nsCOMPtr p(do_QueryInterface(argPrimitive)); NS_ENSURE_TRUE(p, NS_ERROR_UNEXPECTED); - nsCAutoString data; + nsAutoCString data; p->GetData(data); diff --git a/dom/base/nsJSTimeoutHandler.cpp b/dom/base/nsJSTimeoutHandler.cpp index 116c42c47ada..260a54649382 100644 --- a/dom/base/nsJSTimeoutHandler.cpp +++ b/dom/base/nsJSTimeoutHandler.cpp @@ -77,7 +77,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSScriptTimeoutHandler) NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsJSScriptTimeoutHandler) if (NS_UNLIKELY(cb.WantDebugInfo())) { - nsCAutoString name("nsJSScriptTimeoutHandler"); + nsAutoCString name("nsJSScriptTimeoutHandler"); if (tmp->mExpr) { name.AppendLiteral(" ["); name.Append(tmp->mFileName); diff --git a/dom/base/nsLocation.cpp b/dom/base/nsLocation.cpp index 178534ee963e..7bc0bf2aa839 100644 --- a/dom/base/nsLocation.cpp +++ b/dom/base/nsLocation.cpp @@ -348,7 +348,7 @@ nsLocation::GetHash(nsAString& aHash) return rv; } - nsCAutoString ref; + nsAutoCString ref; nsAutoString unicodeRef; rv = uri->GetRef(ref); @@ -357,7 +357,7 @@ nsLocation::GetHash(nsAString& aHash) do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) { - nsCAutoString charset; + nsAutoCString charset; uri->GetOriginCharset(charset); rv = textToSubURI->UnEscapeURIForUI(charset, ref, unicodeRef); @@ -420,7 +420,7 @@ nsLocation::GetHost(nsAString& aHost) result = GetURI(getter_AddRefs(uri), true); if (uri) { - nsCAutoString hostport; + nsAutoCString hostport; result = uri->GetHostPort(hostport); @@ -459,7 +459,7 @@ nsLocation::GetHostname(nsAString& aHostname) result = GetURI(getter_AddRefs(uri), true); if (uri) { - nsCAutoString host; + nsAutoCString host; result = uri->GetHost(host); @@ -498,7 +498,7 @@ nsLocation::GetHref(nsAString& aHref) result = GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString uriString; + nsAutoCString uriString; result = uri->GetSpec(uriString); @@ -572,7 +572,7 @@ nsLocation::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase, nsCOMPtr docShell(do_QueryReferent(mDocShell)); - nsCAutoString docCharset; + nsAutoCString docCharset; if (NS_SUCCEEDED(GetDocumentCharacterSetForURI(aHref, docCharset))) result = NS_NewURI(getter_AddRefs(newUri), aHref, docCharset.get(), aBase); else @@ -631,7 +631,7 @@ nsLocation::GetPathname(nsAString& aPathname) nsCOMPtr url(do_QueryInterface(uri)); if (url) { - nsCAutoString file; + nsAutoCString file; result = url->GetFilePath(file); @@ -727,7 +727,7 @@ nsLocation::GetProtocol(nsAString& aProtocol) result = GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString protocol; + nsAutoCString protocol; result = uri->GetScheme(protocol); @@ -769,7 +769,7 @@ nsLocation::GetSearch(nsAString& aSearch) nsCOMPtr url(do_QueryInterface(uri)); if (url) { - nsCAutoString search; + nsAutoCString search; result = url->GetQuery(search); diff --git a/dom/base/nsScriptNameSpaceManager.cpp b/dom/base/nsScriptNameSpaceManager.cpp index 6d0a8d6a1ef3..e610d5810963 100644 --- a/dom/base/nsScriptNameSpaceManager.cpp +++ b/dom/base/nsScriptNameSpaceManager.cpp @@ -263,7 +263,7 @@ nsScriptNameSpaceManager::RegisterExternalInterfaces(bool aAsProto) NS_ENSURE_SUCCESS(rv, rv); nsXPIDLCString IID_string; - nsCAutoString category_entry; + nsAutoCString category_entry; const char* if_name; nsCOMPtr entry; nsCOMPtr if_info; @@ -679,7 +679,7 @@ nsScriptNameSpaceManager::AddCategoryEntryToHash(nsICategoryManager* aCategoryMa return NS_OK; } - nsCAutoString categoryEntry; + nsAutoCString categoryEntry; nsresult rv = strWrapper->GetData(categoryEntry); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/base/nsStructuredCloneContainer.cpp b/dom/base/nsStructuredCloneContainer.cpp index e3b85a50d890..3bd8d3196852 100644 --- a/dom/base/nsStructuredCloneContainer.cpp +++ b/dom/base/nsStructuredCloneContainer.cpp @@ -94,7 +94,7 @@ nsStructuredCloneContainer::InitFromBase64(const nsAString &aData, NS_ConvertUTF16toUTF8 data(aData); - nsCAutoString binaryData; + nsAutoCString binaryData; nsresult rv = Base64Decode(data, binaryData); NS_ENSURE_SUCCESS(rv, rv); @@ -140,8 +140,8 @@ nsStructuredCloneContainer::GetDataAsBase64(nsAString &aOut) NS_ENSURE_STATE(mData); aOut.Truncate(); - nsCAutoString binaryData(reinterpret_cast(mData), mSize); - nsCAutoString base64Data; + nsAutoCString binaryData(reinterpret_cast(mData), mSize); + nsAutoCString base64Data; nsresult rv = Base64Encode(binaryData, base64Data); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/base/nsWindowMemoryReporter.cpp b/dom/base/nsWindowMemoryReporter.cpp index 3dd867bcadfe..773e2f34ddb2 100644 --- a/dom/base/nsWindowMemoryReporter.cpp +++ b/dom/base/nsWindowMemoryReporter.cpp @@ -113,7 +113,7 @@ CollectWindowReports(nsGlobalWindow *aWindow, nsIMemoryMultiReporterCallback *aCb, nsISupports *aClosure) { - nsCAutoString windowPath("explicit/window-objects/"); + nsAutoCString windowPath("explicit/window-objects/"); // Avoid calling aWindow->GetTop() if there's no outer window. It will work // just fine, but will spew a lot of warnings. @@ -151,7 +151,7 @@ CollectWindowReports(nsGlobalWindow *aWindow, #define REPORT(_pathTail, _amount, _desc) \ do { \ if (_amount > 0) { \ - nsCAutoString path(windowPath); \ + nsAutoCString path(windowPath); \ path += _pathTail; \ nsresult rv; \ rv = aCb->Callback(EmptyCString(), path, nsIMemoryReporter::KIND_HEAP,\ @@ -530,7 +530,7 @@ CheckForGhostWindowsEnumerator(nsISupports *aKey, TimeStamp& aTimeStamp, nsCOMPtr uri = GetWindowURI(window); - nsCAutoString domain; + nsAutoCString domain; if (uri) { // GetBaseDomain works fine if |uri| is null, but it outputs a warning // which ends up overrunning the mochitest logs. @@ -584,7 +584,7 @@ GetNonDetachedWindowDomainsEnumerator(const uint64_t& aId, nsGlobalWindow* aWind nsCOMPtr uri = GetWindowURI(aWindow); - nsCAutoString domain; + nsAutoCString domain; if (uri) { data->tldService->GetBaseDomain(uri, 0, domain); } @@ -698,7 +698,7 @@ ReportGhostWindowsEnumerator(nsUint64HashKey* aIDHashKey, void* aClosure) return PL_DHASH_NEXT; } - nsCAutoString path; + nsAutoCString path; path.AppendLiteral("ghost-windows/"); AppendWindowURI(window, path); diff --git a/dom/bluetooth/linux/BluetoothDBusService.cpp b/dom/bluetooth/linux/BluetoothDBusService.cpp index 81c1fe8dfe5a..951068030967 100644 --- a/dom/bluetooth/linux/BluetoothDBusService.cpp +++ b/dom/bluetooth/linux/BluetoothDBusService.cpp @@ -900,7 +900,7 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData) ArrayLength(sManagerProperties)); } else { #ifdef DEBUG - nsCAutoString signalStr; + nsAutoCString signalStr; signalStr += dbus_message_get_member(aMsg); signalStr += " Signal not handled!"; NS_WARNING(signalStr.get()); diff --git a/dom/browser-element/BrowserElementParent.cpp b/dom/browser-element/BrowserElementParent.cpp index 630c97a60111..80987b74b83a 100644 --- a/dom/browser-element/BrowserElementParent.cpp +++ b/dom/browser-element/BrowserElementParent.cpp @@ -203,7 +203,7 @@ BrowserElementParent::OpenWindowInProcess(nsIDOMWindow* aOpenerWindow, CreateIframe(openerFrameElement, aName, /* aRemote = */ false); NS_ENSURE_TRUE(popupFrameElement, false); - nsCAutoString spec; + nsAutoCString spec; if (aURI) { aURI->GetSpec(spec); } diff --git a/dom/devicestorage/nsDeviceStorage.cpp b/dom/devicestorage/nsDeviceStorage.cpp index 6554abd2c246..b5dca82d098f 100644 --- a/dom/devicestorage/nsDeviceStorage.cpp +++ b/dom/devicestorage/nsDeviceStorage.cpp @@ -171,7 +171,7 @@ DeviceStorageFile::IsType(nsAString& aType) PRIntervalTime iStart = PR_IntervalNow(); #endif - nsCAutoString mimeType; + nsAutoCString mimeType; nsCOMPtr mimeService = do_GetService(NS_MIMESERVICE_CONTRACTID); if (!mimeService) { return false; diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp index 935154b1f76f..ef8828eee9ee 100644 --- a/dom/indexedDB/IDBCursor.cpp +++ b/dom/indexedDB/IDBCursor.cpp @@ -794,7 +794,7 @@ ContinueHelper::DoDatabaseWork(mozIStorageConnection* aConnection) // (less than, if we're running a PREV cursor) or equal to the key that was // specified. - nsCAutoString query; + nsAutoCString query; if (mCursor->mContinueToKey.IsUnset()) { query.Assign(mCursor->mContinueQuery); } diff --git a/dom/indexedDB/IDBIndex.cpp b/dom/indexedDB/IDBIndex.cpp index 1b1fe52c9d2f..4f364f956d7e 100644 --- a/dom/indexedDB/IDBIndex.cpp +++ b/dom/indexedDB/IDBIndex.cpp @@ -1705,7 +1705,7 @@ OpenKeyCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection) mKeyRange->GetBindingClause(value, keyRangeClause); } - nsCAutoString directionClause(" ORDER BY value "); + nsAutoCString directionClause(" ORDER BY value "); switch (mDirection) { case IDBCursor::NEXT: case IDBCursor::NEXT_UNIQUE: @@ -1760,7 +1760,7 @@ OpenKeyCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection) NS_ENSURE_SUCCESS(rv, rv); // Now we need to make the query to get the next match. - nsCAutoString queryStart = NS_LITERAL_CSTRING("SELECT value, object_data_key" + nsAutoCString queryStart = NS_LITERAL_CSTRING("SELECT value, object_data_key" " FROM ") + table + NS_LITERAL_CSTRING(" WHERE index_id = :id"); @@ -2033,7 +2033,7 @@ OpenCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection) mKeyRange->GetBindingClause(value, keyRangeClause); } - nsCAutoString directionClause(" ORDER BY index_table.value "); + nsAutoCString directionClause(" ORDER BY index_table.value "); switch (mDirection) { case IDBCursor::NEXT: case IDBCursor::NEXT_UNIQUE: @@ -2100,7 +2100,7 @@ OpenCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection) NS_ENSURE_SUCCESS(rv, rv); // Now we need to make the query to get the next match. - nsCAutoString queryStart = + nsAutoCString queryStart = NS_LITERAL_CSTRING("SELECT index_table.value, " "index_table.object_data_key, object_data.data, " "object_data.file_ids FROM ") + @@ -2353,7 +2353,7 @@ CountHelper::DoDatabaseWork(mozIStorageConnection* aConnection) NS_NAMED_LITERAL_CSTRING(upperKeyName, "upper_key"); NS_NAMED_LITERAL_CSTRING(value, "value"); - nsCAutoString keyRangeClause; + nsAutoCString keyRangeClause; if (mKeyRange) { if (!mKeyRange->Lower().IsUnset()) { AppendConditionClause(value, lowerKeyName, false, diff --git a/dom/indexedDB/IDBKeyRange.h b/dom/indexedDB/IDBKeyRange.h index cbaf1535aae4..4890db96d8df 100644 --- a/dom/indexedDB/IDBKeyRange.h +++ b/dom/indexedDB/IDBKeyRange.h @@ -98,7 +98,7 @@ public: spacecolon + lowerKey; } else { - nsCAutoString clause; + nsAutoCString clause; if (!Lower().IsUnset()) { // Lower key is set. diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index 76d3a668f510..6db64f457552 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -3147,7 +3147,7 @@ OpenCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection) mKeyRange->GetBindingClause(keyValue, keyRangeClause); } - nsCAutoString directionClause; + nsAutoCString directionClause; switch (mDirection) { case IDBCursor::NEXT: case IDBCursor::NEXT_UNIQUE: @@ -3202,7 +3202,7 @@ OpenCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection) // Now we need to make the query to get the next match. keyRangeClause.Truncate(); - nsCAutoString continueToKeyRangeClause; + nsAutoCString continueToKeyRangeClause; NS_NAMED_LITERAL_CSTRING(currentKey, "current_key"); NS_NAMED_LITERAL_CSTRING(rangeKey, "range_key"); @@ -3653,7 +3653,7 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection) NS_NAMED_LITERAL_CSTRING(lowerKeyName, "lower_key"); NS_NAMED_LITERAL_CSTRING(upperKeyName, "upper_key"); - nsCAutoString keyRangeClause; + nsAutoCString keyRangeClause; if (mKeyRange) { if (!mKeyRange->Lower().IsUnset()) { keyRangeClause = NS_LITERAL_CSTRING(" AND key_value"); @@ -3678,7 +3678,7 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection) } } - nsCAutoString limitClause; + nsAutoCString limitClause; if (mLimit != PR_UINT32_MAX) { limitClause.AssignLiteral(" LIMIT "); limitClause.AppendInt(mLimit); @@ -3886,7 +3886,7 @@ CountHelper::DoDatabaseWork(mozIStorageConnection* aConnection) NS_NAMED_LITERAL_CSTRING(lowerKeyName, "lower_key"); NS_NAMED_LITERAL_CSTRING(upperKeyName, "upper_key"); - nsCAutoString keyRangeClause; + nsAutoCString keyRangeClause; if (mKeyRange) { if (!mKeyRange->Lower().IsUnset()) { keyRangeClause = NS_LITERAL_CSTRING(" AND key_value"); diff --git a/dom/ipc/CrashReporterParent.cpp b/dom/ipc/CrashReporterParent.cpp index f2a9f38fd4a3..0dc926f9a02b 100644 --- a/dom/ipc/CrashReporterParent.cpp +++ b/dom/ipc/CrashReporterParent.cpp @@ -112,7 +112,7 @@ CrashReporterParent::GenerateChildData(const AnnotationTable* processNotes) { MOZ_ASSERT(mInitialized); - nsCAutoString type; + nsAutoCString type; switch (mProcessType) { case GeckoProcessType_Content: type = NS_LITERAL_CSTRING("content"); diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 3035cff397c2..c3b0f7179881 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -520,7 +520,7 @@ TabChild::BrowserFrameProvideWindow(nsIDOMWindow* aOpener, // We release this ref in DeallocPBrowserChild nsRefPtr(newChild).forget().get(), chromeFlags, mIsBrowserElement, this); - nsCAutoString spec; + nsAutoCString spec; if (aURI) { aURI->GetSpec(spec); } diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index f45fc3037395..a1b96bb41efc 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -201,7 +201,7 @@ void TabParent::LoadURL(nsIURI* aURI) { if (!mShown) { - nsCAutoString spec; + nsAutoCString spec; if (aURI) { aURI->GetSpec(spec); } @@ -915,7 +915,7 @@ TabParent::HandleDelayedDialogs() data->mName, data->mFeatures, params, mFrameElement); } else if (ww) { - nsCAutoString url; + nsAutoCString url; if (data->mType) { if (data->mType == nsIDialogCreator::SELECT_DIALOG) { url.Assign("chrome://global/content/selectDialog.xul"); diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index a76636a5a5e4..efc95c5d7be1 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -272,7 +272,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag) // of "dom.ipc.plugins.enabled" // The "filename.dll" part can contain shell wildcard pattern - nsCAutoString prefFile(aPluginTag->mFullPath.get()); + nsAutoCString prefFile(aPluginTag->mFullPath.get()); int32_t slashPos = prefFile.RFindCharInSet("/\\"); if (kNotFound == slashPos) return false; @@ -281,14 +281,14 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag) #ifdef XP_MACOSX #if defined(__i386__) - nsCAutoString prefGroupKey("dom.ipc.plugins.enabled.i386."); + nsAutoCString prefGroupKey("dom.ipc.plugins.enabled.i386."); #elif defined(__x86_64__) - nsCAutoString prefGroupKey("dom.ipc.plugins.enabled.x86_64."); + nsAutoCString prefGroupKey("dom.ipc.plugins.enabled.x86_64."); #elif defined(__ppc__) - nsCAutoString prefGroupKey("dom.ipc.plugins.enabled.ppc."); + nsAutoCString prefGroupKey("dom.ipc.plugins.enabled.ppc."); #endif #else - nsCAutoString prefGroupKey("dom.ipc.plugins.enabled."); + nsAutoCString prefGroupKey("dom.ipc.plugins.enabled."); #endif // Java plugins include a number of different file names, @@ -1496,7 +1496,7 @@ _evaluate(NPP npp, NPObject* npobj, NPString *script, NPVariant *result) nsIPrincipal *principal = doc->NodePrincipal(); - nsCAutoString specStr; + nsAutoCString specStr; const char *spec; nsCOMPtr uri; diff --git a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp index 473551d1b9f5..aca8809ff077 100644 --- a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp +++ b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp @@ -849,7 +849,7 @@ nsNPAPIPluginStreamListener::HandleRedirectNotification(nsIChannel *oldChannel, if (NS_SUCCEEDED(oldHttpChannel->GetResponseStatus(&status))) { nsCOMPtr uri; if (NS_SUCCEEDED(newHttpChannel->GetURI(getter_AddRefs(uri))) && uri) { - nsCAutoString spec; + nsAutoCString spec; if (NS_SUCCEEDED(uri->GetAsciiSpec(spec))) { // At this point the plugin will be responsible for making the callback // so save the callback object. diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index a2914c93095d..24ae5fb1c77a 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -236,7 +236,7 @@ nsInvalidPluginTag::~nsInvalidPluginTag() static bool IsTypeInList(nsCString &aMimeType, nsCString aTypeList) { - nsCAutoString searchStr; + nsAutoCString searchStr; searchStr.Assign(','); searchStr.Append(aTypeList); searchStr.Append(','); @@ -246,7 +246,7 @@ IsTypeInList(nsCString &aMimeType, nsCString aTypeList) searchStr.BeginReading(start); searchStr.EndReading(end); - nsCAutoString commaSeparated; + nsAutoCString commaSeparated; commaSeparated.Assign(','); commaSeparated += aMimeType; commaSeparated.Append(','); @@ -522,7 +522,7 @@ nsresult nsPluginHost::UserAgent(const char **retstring) if (NS_FAILED(res)) return res; - nsCAutoString uaString; + nsAutoCString uaString; res = http->GetUserAgent(uaString); if (NS_SUCCEEDED(res)) { @@ -764,7 +764,7 @@ nsresult nsPluginHost::FindProxyForURL(const char* url, char* *result) if (NS_FAILED(res)) return res; - nsCAutoString host, type; + nsAutoCString host, type; int32_t port = -1; // These won't fail, and even if they do... we'll be ok. @@ -913,7 +913,7 @@ nsPluginHost::InstantiateEmbeddedPluginInstance(const char *aMimeType, nsIURI* a NS_ENSURE_ARG_POINTER(aOwner); #ifdef PLUGIN_LOGGING - nsCAutoString urlSpec; + nsAutoCString urlSpec; if (aURL) aURL->GetAsciiSpec(urlSpec); @@ -998,9 +998,9 @@ nsPluginHost::InstantiateEmbeddedPluginInstance(const char *aMimeType, nsIURI* a // Also set bCanHandleInternally to true if aAllowOpeningStreams is // false; we don't want to do any network traffic in that case. bool bCanHandleInternally = false; - nsCAutoString scheme; + nsAutoCString scheme; if (aURL && NS_SUCCEEDED(aURL->GetScheme(scheme))) { - nsCAutoString contractID(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX); + nsAutoCString contractID(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX); contractID += scheme; ToLowerCase(contractID); nsCOMPtr handler = do_GetService(contractID.get()); @@ -1048,7 +1048,7 @@ nsPluginHost::InstantiateEmbeddedPluginInstance(const char *aMimeType, nsIURI* a instanceOwner.forget(aOwner); #ifdef PLUGIN_LOGGING - nsCAutoString urlSpec2; + nsAutoCString urlSpec2; if (aURL != nullptr) aURL->GetAsciiSpec(urlSpec2); PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL, @@ -1068,7 +1068,7 @@ nsresult nsPluginHost::InstantiateFullPagePluginInstance(const char *aMimeType, nsIStreamListener **aStreamListener) { #ifdef PLUGIN_LOGGING - nsCAutoString urlSpec; + nsAutoCString urlSpec; aURI->GetSpec(urlSpec); PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsPluginHost::InstantiateFullPagePlugin Begin mime=%s, url=%s\n", @@ -1189,7 +1189,7 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType, nsIPluginInstanceOwner *aOwner) { #ifdef PLUGIN_LOGGING - nsCAutoString urlSpec; + nsAutoCString urlSpec; if (aURL != nullptr) aURL->GetSpec(urlSpec); PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL, @@ -1208,7 +1208,7 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType, nsCOMPtr url = do_QueryInterface(aURL); if (!url) return NS_ERROR_FAILURE; - nsCAutoString fileExtension; + nsAutoCString fileExtension; url->GetFileExtension(fileExtension); // if we don't have an extension or no plugin for this extension, @@ -1259,7 +1259,7 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType, } #ifdef PLUGIN_LOGGING - nsCAutoString urlSpec2; + nsAutoCString urlSpec2; if (aURL) aURL->GetSpec(urlSpec2); @@ -1787,7 +1787,7 @@ nsPluginHost::RegisterPlayPreviewMimeType(const nsACString& mimeType) NS_IMETHODIMP nsPluginHost::UnregisterPlayPreviewMimeType(const nsACString& mimeType) { - nsCAutoString mimeTypeToRemove(mimeType); + nsAutoCString mimeTypeToRemove(mimeType); for (uint32_t i = mPlayPreviewMimeTypes.Length(); i > 0;) { nsCString mt = mPlayPreviewMimeTypes[--i]; if (PL_strcasecmp(mt.get(), mimeTypeToRemove.get()) == 0) { @@ -2003,7 +2003,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir, *aPluginsChanged = false; #ifdef PLUGIN_LOGGING - nsCAutoString dirPath; + nsAutoCString dirPath; pluginsDir->GetNativePath(dirPath); PLUGIN_LOG(PLUGIN_LOG_BASIC, ("nsPluginHost::ScanPluginsDirectory dir=%s\n", dirPath.get())); @@ -2601,7 +2601,7 @@ nsPluginHost::WritePluginInfo() if (NS_FAILED(rv)) return rv; - nsCAutoString filename(kPluginRegistryFilename); + nsAutoCString filename(kPluginRegistryFilename); filename.Append(".tmp"); rv = pluginReg->AppendNative(filename); if (NS_FAILED(rv)) @@ -2616,7 +2616,7 @@ nsPluginHost::WritePluginInfo() return NS_ERROR_FAILURE; } - nsCAutoString arch; + nsAutoCString arch; rv = runtime->GetXPCOMABI(arch); if (NS_FAILED(rv)) { return rv; @@ -2830,7 +2830,7 @@ nsPluginHost::ReadPluginInfo() return rv; } - nsCAutoString arch; + nsAutoCString arch; if (NS_FAILED(runtime->GetXPCOMABI(arch))) { return rv; } @@ -2856,7 +2856,7 @@ nsPluginHost::ReadPluginInfo() while (reader.NextLine()) { const char *filename; const char *fullpath; - nsCAutoString derivedFileName; + nsAutoCString derivedFileName; if (hasInvalidPlugins && *reader.LinePtr() == '[') { break; @@ -3228,10 +3228,10 @@ nsPluginHost::AddHeadersToChannel(const char *aHeadersData, } // used during the manipulation of the String from the aHeadersData - nsCAutoString headersString; - nsCAutoString oneHeader; - nsCAutoString headerName; - nsCAutoString headerValue; + nsAutoCString headersString; + nsAutoCString oneHeader; + nsAutoCString headerName; + nsAutoCString headerValue; int32_t crlf = 0; int32_t colon = 0; @@ -3674,7 +3674,7 @@ nsPluginHost::CreateTempFileToPost(const char *aPostDataURL, nsIFile **aTmpFile) { nsresult rv; int64_t fileSize; - nsCAutoString filename; + nsAutoCString filename; // stat file == get size & convert file:///c:/ to c: if needed nsCOMPtr inFile; @@ -3705,7 +3705,7 @@ nsPluginHost::CreateTempFileToPost(const char *aPostDataURL, nsIFile **aTmpFile) if (NS_FAILED(rv)) return rv; - nsCAutoString inFileName; + nsAutoCString inFileName; inFile->GetNativeLeafName(inFileName); // XXX hack around bug 70083 inFileName.Insert(NS_LITERAL_CSTRING("post-"), 0); diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 34180429e3ec..e26e933870fe 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -3385,7 +3385,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void) static_cast(mPluginWindow->ws_info); ws_info->display = DefaultXDisplay(); - nsCAutoString description; + nsAutoCString description; GetPluginDescription(description); NS_NAMED_LITERAL_CSTRING(flash10Head, "Shockwave Flash 10."); mFlash10Quirks = StringBeginsWith(description, flash10Head); diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index 6739c6a4d6d1..89d46c8d9316 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -318,7 +318,7 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, nsNPAPIPluginStreamListener* aListener) { #ifdef PLUGIN_LOGGING - nsCAutoString urlSpec; + nsAutoCString urlSpec; if (aURL != nullptr) aURL->GetAsciiSpec(urlSpec); PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL, @@ -348,7 +348,7 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbedded(nsIURI *aURL, nsObjectLoadingContent *aContent) { #ifdef PLUGIN_LOGGING - nsCAutoString urlSpec; + nsAutoCString urlSpec; aURL->GetSpec(urlSpec); PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL, @@ -451,7 +451,7 @@ nsPluginStreamListenerPeer::SetupPluginCacheFile(nsIChannel* channel) if (!url) return NS_ERROR_FAILURE; - nsCAutoString filename; + nsAutoCString filename; url->GetFileName(filename); if (NS_FAILED(rv)) return rv; @@ -573,7 +573,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, mLength = length; } - nsCAutoString aContentType; // XXX but we already got the type above! + nsAutoCString aContentType; // XXX but we already got the type above! rv = channel->GetContentType(aContentType); if (NS_FAILED(rv)) return rv; @@ -681,7 +681,7 @@ nsPluginStreamListenerPeer::MakeByteRangeString(NPByteRange* aRangeList, nsACStr return; int32_t requestCnt = 0; - nsCAutoString string("bytes="); + nsAutoCString string("bytes="); for (NPByteRange * range = aRangeList; range != nullptr; range = range->next) { // XXX zero length? @@ -709,7 +709,7 @@ nsPluginStreamListenerPeer::MakeByteRangeString(NPByteRange* aRangeList, nsACStr nsresult nsPluginStreamListenerPeer::RequestRead(NPByteRange* rangeList) { - nsCAutoString rangeString; + nsAutoCString rangeString; int32_t numRequests; MakeByteRangeString(rangeList, rangeString, &numRequests); @@ -1016,7 +1016,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request, if (!channel) return NS_ERROR_FAILURE; // Set the content type to ensure we don't pass null to the plugin - nsCAutoString aContentType; + nsAutoCString aContentType; rv = channel->GetContentType(aContentType); if (NS_FAILED(rv) && !mRequestFailed) return rv; @@ -1155,7 +1155,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request, // nsPluginStreamType_AsFile stream type and we have to save decompressed // file into local plugin cache, because necko cache contains original // compressed file. - nsCAutoString contentEncoding; + nsAutoCString contentEncoding; if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"), contentEncoding))) { useLocalCache = true; @@ -1165,7 +1165,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request, uint32_t length; GetLength(&length); if (length) { - nsCAutoString range; + nsAutoCString range; if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("accept-ranges"), range)) && range.Equals(NS_LITERAL_CSTRING("bytes"), nsCaseInsensitiveCStringComparator())) { mSeekable = true; @@ -1175,7 +1175,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request, // we require a content len // get Last-Modified header for plugin info - nsCAutoString lastModified; + nsAutoCString lastModified; if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("last-modified"), lastModified)) && !lastModified.IsEmpty()) { PRTime time64; @@ -1223,7 +1223,7 @@ nsPluginStreamListenerPeer::OnFileAvailable(nsIFile* aFile) if (!mPStreamListener) return NS_ERROR_FAILURE; - nsCAutoString path; + nsAutoCString path; rv = aFile->GetNativePath(path); if (NS_FAILED(rv)) return rv; @@ -1351,7 +1351,7 @@ nsPluginStreamListenerPeer::AsyncOnChannelRedirect(nsIChannel *oldChannel, nsICh return rv; } if (responseStatus == 307) { - nsCAutoString method; + nsAutoCString method; rv = oldHttpChannel->GetRequestMethod(method); if (NS_FAILED(rv)) { return rv; diff --git a/dom/plugins/base/nsPluginTags.cpp b/dom/plugins/base/nsPluginTags.cpp index 91fced8ca8bd..50bc472325da 100644 --- a/dom/plugins/base/nsPluginTags.cpp +++ b/dom/plugins/base/nsPluginTags.cpp @@ -211,7 +211,7 @@ nsresult nsPluginTag::EnsureMembersAreUTF8() do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString charset; + nsAutoCString charset; rv = pcs->GetCharset(kPlatformCharsetSel_FileName, charset); NS_ENSURE_SUCCESS(rv, rv); if (!charset.LowerCaseEqualsLiteral("utf-8")) { diff --git a/dom/plugins/base/nsPluginsDirDarwin.cpp b/dom/plugins/base/nsPluginsDirDarwin.cpp index faf56b7bff30..54e0764e4722 100644 --- a/dom/plugins/base/nsPluginsDirDarwin.cpp +++ b/dom/plugins/base/nsPluginsDirDarwin.cpp @@ -299,7 +299,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary) #ifdef __LP64__ char executablePath[PATH_MAX]; executablePath[0] = '\0'; - nsCAutoString bundlePath; + nsAutoCString bundlePath; mPlugin->GetNativePath(bundlePath); CFStringRef pathRef = ::CFStringCreateWithCString(NULL, bundlePath.get(), kCFStringEncodingUTF8); if (pathRef) { @@ -320,7 +320,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary) ::CFRelease(pathRef); } #else - nsCAutoString bundlePath; + nsAutoCString bundlePath; mPlugin->GetNativePath(bundlePath); const char *executablePath = bundlePath.get(); #endif @@ -409,7 +409,7 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary) memset(&info, 0, sizeof(info)); // Try to get a bundle reference. - nsCAutoString path; + nsAutoCString path; if (NS_FAILED(rv = mPlugin->GetNativePath(path))) return rv; CFBundleRef bundle = getPluginBundle(path.get()); @@ -418,7 +418,7 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary) info.fFullPath = PL_strdup(path.get()); // fill in file name - nsCAutoString fileName; + nsAutoCString fileName; if (NS_FAILED(rv = mPlugin->GetNativeLeafName(fileName))) return rv; info.fFileName = PL_strdup(fileName.get()); diff --git a/dom/plugins/base/nsPluginsDirOS2.cpp b/dom/plugins/base/nsPluginsDirOS2.cpp index 5f758bdf1819..523b1c62808f 100644 --- a/dom/plugins/base/nsPluginsDirOS2.cpp +++ b/dom/plugins/base/nsPluginsDirOS2.cpp @@ -138,7 +138,7 @@ static void FreeStringArray(uint32_t variants, char ** array) bool nsPluginsDir::IsPluginFile(nsIFile* file) { - nsCAutoString leaf; + nsAutoCString leaf; if (NS_FAILED(file->GetNativeLeafName(leaf))) return false; @@ -172,7 +172,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary) if (!mPlugin) return NS_ERROR_NULL_POINTER; - nsCAutoString temp; + nsAutoCString temp; mPlugin->GetNativePath(temp); *outLibrary = PR_LoadLibrary(temp.get()); @@ -189,11 +189,11 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo &info, PRLibrary **outLibrary) char failure[ CCHMAXPATH] = ""; APIRET ret; - nsCAutoString path; + nsAutoCString path; if (NS_FAILED(rv = mPlugin->GetNativePath(path))) return rv; - nsCAutoString fileName; + nsAutoCString fileName; if (NS_FAILED(rv = mPlugin->GetNativeLeafName(fileName))) return rv; diff --git a/dom/plugins/base/nsPluginsDirUnix.cpp b/dom/plugins/base/nsPluginsDirUnix.cpp index 2803ad06ef1f..8f136acc2186 100644 --- a/dom/plugins/base/nsPluginsDirUnix.cpp +++ b/dom/plugins/base/nsPluginsDirUnix.cpp @@ -209,7 +209,7 @@ static void LoadExtraSharedLibs() bool nsPluginsDir::IsPluginFile(nsIFile* file) { - nsCAutoString filename; + nsAutoCString filename; if (NS_FAILED(file->GetNativeLeafName(filename))) return false; @@ -258,7 +258,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary) return NS_ERROR_FILE_NOT_FOUND; nsresult rv; - nsCAutoString path; + nsAutoCString path; rv = mPlugin->GetNativePath(path); if (NS_FAILED(rv)) return rv; @@ -348,12 +348,12 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary) return rv; } - nsCAutoString path; + nsAutoCString path; if (NS_FAILED(rv = mPlugin->GetNativePath(path))) return rv; info.fFullPath = PL_strdup(path.get()); - nsCAutoString fileName; + nsAutoCString fileName; if (NS_FAILED(rv = mPlugin->GetNativeLeafName(fileName))) return rv; info.fFileName = PL_strdup(fileName.get()); diff --git a/dom/plugins/base/nsPluginsDirWin.cpp b/dom/plugins/base/nsPluginsDirWin.cpp index e9c8c88b52ec..baa910c509dc 100644 --- a/dom/plugins/base/nsPluginsDirWin.cpp +++ b/dom/plugins/base/nsPluginsDirWin.cpp @@ -188,7 +188,7 @@ static bool CanLoadPlugin(const PRUnichar* aBinaryPath) // The file name must be in the form "np*.dll" bool nsPluginsDir::IsPluginFile(nsIFile* file) { - nsCAutoString path; + nsAutoCString path; if (NS_FAILED(file->GetNativePath(path))) return false; diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 7ae777a9bd69..410b8c477bac 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -385,7 +385,7 @@ PluginModuleParent::ProcessFirstMinidump() uint32_t sequence = PR_UINT32_MAX; nsCOMPtr dumpFile; - nsCAutoString flashProcessType; + nsAutoCString flashProcessType; TakeMinidump(getter_AddRefs(dumpFile), &sequence); #ifdef MOZ_CRASHREPORTER_INJECTOR diff --git a/dom/src/geolocation/nsGeolocation.cpp b/dom/src/geolocation/nsGeolocation.cpp index 331738cbfd4a..76820b4c5cd3 100644 --- a/dom/src/geolocation/nsGeolocation.cpp +++ b/dom/src/geolocation/nsGeolocation.cpp @@ -549,7 +549,7 @@ nsresult nsGeolocationService::Init() nsCOMPtr elemString = do_QueryInterface(elem); - nsCAutoString name; + nsAutoCString name; elemString->GetData(name); nsXPIDLCString spec; diff --git a/dom/src/json/nsJSON.cpp b/dom/src/json/nsJSON.cpp index 2003e1ed0b58..960bbf86171d 100644 --- a/dom/src/json/nsJSON.cpp +++ b/dom/src/json/nsJSON.cpp @@ -620,7 +620,7 @@ nsJSONListener::ProcessBytes(const char* aBuffer, uint32_t aByteLength) { nsresult rv; // Check for BOM, or sniff charset - nsCAutoString charset; + nsAutoCString charset; if (mNeedsConverter && !mDecoder) { if (!nsContentUtils::CheckForBOM((const unsigned char*) mSniffBuffer.get(), mSniffBuffer.Length(), charset)) { diff --git a/dom/src/jsurl/nsJSProtocolHandler.cpp b/dom/src/jsurl/nsJSProtocolHandler.cpp index 2a7b046c6ebc..fccbe87c7a66 100644 --- a/dom/src/jsurl/nsJSProtocolHandler.cpp +++ b/dom/src/jsurl/nsJSProtocolHandler.cpp @@ -173,7 +173,7 @@ nsresult nsJSThunk::EvaluateScript(nsIChannel *aChannel, // gather information to log with violation report nsCOMPtr uri; principal->GetURI(getter_AddRefs(uri)); - nsCAutoString asciiSpec; + nsAutoCString asciiSpec; uri->GetAsciiSpec(asciiSpec); csp->LogViolationDetails(nsIContentSecurityPolicy::VIOLATION_TYPE_INLINE_SCRIPT, NS_ConvertUTF8toUTF16(asciiSpec), @@ -222,7 +222,7 @@ nsresult nsJSThunk::EvaluateScript(nsIChannel *aChannel, if (!scriptContext) return NS_ERROR_FAILURE; - nsCAutoString script(mScript); + nsAutoCString script(mScript); // Unescape the script NS_UnescapeURL(script); @@ -1217,7 +1217,7 @@ nsJSProtocolHandler::NewURI(const nsACString &aSpec, if (!aCharset || !nsCRT::strcasecmp("UTF-8", aCharset)) rv = url->SetSpec(aSpec); else { - nsCAutoString utf8Spec; + nsAutoCString utf8Spec; rv = EnsureUTF8Spec(PromiseFlatCString(aSpec), aCharset, utf8Spec); if (NS_SUCCEEDED(rv)) { if (utf8Spec.IsEmpty()) diff --git a/dom/src/offline/nsDOMOfflineResourceList.cpp b/dom/src/offline/nsDOMOfflineResourceList.cpp index f0ce99beefa6..f46527cbb320 100644 --- a/dom/src/offline/nsDOMOfflineResourceList.cpp +++ b/dom/src/offline/nsDOMOfflineResourceList.cpp @@ -243,7 +243,7 @@ nsDOMOfflineResourceList::MozHasItem(const nsAString& aURI, bool* aExists) return NS_ERROR_DOM_INVALID_STATE_ERR; } - nsCAutoString key; + nsAutoCString key; rv = GetCacheKey(aURI, key); NS_ENSURE_SUCCESS(rv, rv); @@ -327,7 +327,7 @@ nsDOMOfflineResourceList::MozAdd(const nsAString& aURI) rv = NS_NewURI(getter_AddRefs(requestedURI), aURI); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString scheme; + nsAutoCString scheme; rv = requestedURI->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); @@ -353,7 +353,7 @@ nsDOMOfflineResourceList::MozAdd(const nsAString& aURI) do_CreateInstance(NS_OFFLINECACHEUPDATE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString clientID; + nsAutoCString clientID; rv = appCache->GetClientID(clientID); NS_ENSURE_SUCCESS(rv, rv); @@ -387,7 +387,7 @@ nsDOMOfflineResourceList::MozRemove(const nsAString& aURI) return NS_ERROR_DOM_INVALID_STATE_ERR; } - nsCAutoString key; + nsAutoCString key; rv = GetCacheKey(aURI, key); NS_ENSURE_SUCCESS(rv, rv); @@ -753,7 +753,7 @@ nsDOMOfflineResourceList::GetCacheKey(nsIURI *aURI, nsCString &aKey) NS_ENSURE_SUCCESS(rv, rv); // url fragments aren't used in cache keys - nsCAutoString::const_iterator specStart, specEnd; + nsAutoCString::const_iterator specStart, specEnd; aKey.BeginReading(specStart); aKey.EndReading(specEnd); if (FindCharInReadable('#', specStart, specEnd)) { diff --git a/dom/src/storage/nsDOMStorage.cpp b/dom/src/storage/nsDOMStorage.cpp index 2dd0fbcd6116..8b60723ae4f0 100644 --- a/dom/src/storage/nsDOMStorage.cpp +++ b/dom/src/storage/nsDOMStorage.cpp @@ -308,7 +308,7 @@ ClearStorage(nsDOMStorageEntry* aEntry, void* userArg) static PLDHashOperator ClearStorageIfDomainMatches(nsDOMStorageEntry* aEntry, void* userArg) { - nsCAutoString* aKey = static_cast (userArg); + nsAutoCString* aKey = static_cast (userArg); if (StringBeginsWith(aEntry->mStorage->GetScopeDBKey(), *aKey)) { aEntry->mStorage->ClearAll(); } @@ -338,12 +338,12 @@ GetOfflineDomains(nsTArray& aDomains) rv = perm->GetCapability(&capability); NS_ENSURE_SUCCESS(rv, rv); if (capability != nsIPermissionManager::DENY_ACTION) { - nsCAutoString type; + nsAutoCString type; rv = perm->GetType(type); NS_ENSURE_SUCCESS(rv, rv); if (type.EqualsLiteral("offline-app")) { - nsCAutoString host; + nsAutoCString host; rv = perm->GetHost(host); NS_ENSURE_SUCCESS(rv, rv); @@ -384,7 +384,7 @@ nsDOMStorageManager::Observe(nsISupports *aSubject, // Check for cookie permission change nsCOMPtr perm(do_QueryInterface(aSubject)); if (perm) { - nsCAutoString type; + nsAutoCString type; perm->GetType(type); if (type != NS_LITERAL_CSTRING("cookie")) return NS_OK; @@ -395,7 +395,7 @@ nsDOMStorageManager::Observe(nsISupports *aSubject, nsDependentString(aData) != NS_LITERAL_STRING("deleted")) return NS_OK; - nsCAutoString host; + nsAutoCString host; perm->GetHost(host); if (host.IsEmpty()) return NS_OK; @@ -411,7 +411,7 @@ nsDOMStorageManager::Observe(nsISupports *aSubject, obsserv->NotifyObservers(nullptr, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, nullptr); } else if (!strcmp(aTopic, "browser:purge-domain-data")) { // Convert the domain name to the ACE format - nsCAutoString aceDomain; + nsAutoCString aceDomain; nsresult rv; nsCOMPtr converter = do_GetService(NS_IDNSERVICE_CONTRACTID); if (converter) { @@ -424,7 +424,7 @@ nsDOMStorageManager::Observe(nsISupports *aSubject, aceDomain); } - nsCAutoString key; + nsAutoCString key; rv = nsDOMStorageDBWrapper::CreateDomainScopeDBKey(aceDomain, key); NS_ENSURE_SUCCESS(rv, rv); @@ -1407,7 +1407,7 @@ nsDOMStorage::CanUseStorage(DOMStorageBase* aStorage /* = NULL */) // IsCallerChrome(). nsCOMPtr subjectURI; - nsCAutoString unused; + nsAutoCString unused; if (NS_FAILED(GetPrincipalURIAndHost(subjectPrincipal, getter_AddRefs(subjectURI), unused))) { diff --git a/dom/src/storage/nsDOMStorageDBWrapper.cpp b/dom/src/storage/nsDOMStorageDBWrapper.cpp index bd2581be043b..c186ef4dae85 100644 --- a/dom/src/storage/nsDOMStorageDBWrapper.cpp +++ b/dom/src/storage/nsDOMStorageDBWrapper.cpp @@ -251,7 +251,7 @@ nsDOMStorageDBWrapper::CreateOriginScopeDBKey(nsIURI* aUri, nsACString& aKey) if (NS_FAILED(rv)) return rv; - nsCAutoString scheme; + nsAutoCString scheme; rv = aUri->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); @@ -272,7 +272,7 @@ nsDOMStorageDBWrapper::CreateDomainScopeDBKey(nsIURI* aUri, nsACString& aKey) { nsresult rv; - nsCAutoString domainScope; + nsAutoCString domainScope; rv = aUri->GetAsciiHost(domainScope); NS_ENSURE_SUCCESS(rv, rv); @@ -324,7 +324,7 @@ nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(const nsACString& aAsciiDomain, { nsresult rv; - nsCAutoString subdomainsDBKey; + nsAutoCString subdomainsDBKey; if (aEffectiveTLDplus1Only) { nsCOMPtr eTLDService(do_GetService( NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv)); @@ -334,7 +334,7 @@ nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(const nsACString& aAsciiDomain, rv = NS_NewURI(getter_AddRefs(uri), NS_LITERAL_CSTRING("http://") + aAsciiDomain); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString eTLDplusOne; + nsAutoCString eTLDplusOne; rv = eTLDService->GetBaseDomain(uri, 0, eTLDplusOne); if (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS == rv) { // XXX bug 357323 - what to do for localhost/file exactly? @@ -359,7 +359,7 @@ nsresult nsDOMStorageDBWrapper::GetDomainFromScopeKey(const nsACString& aScope, nsACString& aDomain) { - nsCAutoString reverseDomain, scope; + nsAutoCString reverseDomain, scope; scope = aScope; scope.Left(reverseDomain, scope.FindChar(':')-1); diff --git a/dom/src/storage/nsDOMStorageMemoryDB.cpp b/dom/src/storage/nsDOMStorageMemoryDB.cpp index 5cc2e5d58dfd..2ecbee830243 100644 --- a/dom/src/storage/nsDOMStorageMemoryDB.cpp +++ b/dom/src/storage/nsDOMStorageMemoryDB.cpp @@ -307,7 +307,7 @@ nsresult nsDOMStorageMemoryDB::RemoveOwner(const nsACString& aOwner, bool aIncludeSubDomains) { - nsCAutoString subdomainsDBKey; + nsAutoCString subdomainsDBKey; nsDOMStorageDBWrapper::CreateDomainScopeDBKey(aOwner, subdomainsDBKey); if (!aIncludeSubDomains) @@ -338,7 +338,7 @@ nsDOMStorageMemoryDB::RemoveOwners(const nsTArray &aOwners, } for (uint32_t i = 0; i < aOwners.Length(); i++) { - nsCAutoString quotaKey; + nsAutoCString quotaKey; nsDOMStorageDBWrapper::CreateDomainScopeDBKey( NS_ConvertUTF16toUTF8(aOwners[i]), quotaKey); @@ -381,7 +381,7 @@ nsDOMStorageMemoryDB::GetUsage(const nsACString& aDomain, { nsresult rv; - nsCAutoString quotadomainDBKey; + nsAutoCString quotadomainDBKey; rv = nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(aDomain, aIncludeSubDomains, false, @@ -407,7 +407,7 @@ GetUsageEnum(const nsACString& key, if (StringBeginsWith(key, struc->mSubdomain)) { if (struc->mExcludeOfflineFromUsage) { - nsCAutoString domain; + nsAutoCString domain; nsresult rv = nsDOMStorageDBWrapper::GetDomainFromScopeKey(key, domain); if (NS_SUCCEEDED(rv) && IsOfflineAllowed(domain)) return PL_DHASH_NEXT; diff --git a/dom/src/storage/nsDOMStoragePersistentDB.cpp b/dom/src/storage/nsDOMStoragePersistentDB.cpp index 93ad303c00b3..d2688b944f9e 100644 --- a/dom/src/storage/nsDOMStoragePersistentDB.cpp +++ b/dom/src/storage/nsDOMStoragePersistentDB.cpp @@ -44,11 +44,11 @@ nsReverseStringSQLFunction::OnFunctionCall( { nsresult rv; - nsCAutoString stringToReverse; + nsAutoCString stringToReverse; rv = aFunctionArguments->GetUTF8String(0, stringToReverse); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString result; + nsAutoCString result; ReverseString(stringToReverse, result); nsCOMPtr outVar(do_CreateInstance( @@ -83,11 +83,11 @@ nsIsOfflineSQLFunction::OnFunctionCall( { nsresult rv; - nsCAutoString scope; + nsAutoCString scope; rv = aFunctionArguments->GetUTF8String(0, scope); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString domain; + nsAutoCString domain; rv = nsDOMStorageDBWrapper::GetDomainFromScopeKey(scope, domain); NS_ENSURE_SUCCESS(rv, rv); @@ -671,7 +671,7 @@ nsDOMStoragePersistentDB::RemoveOwner(const nsACString& aOwner, NS_ENSURE_STATE(stmt); mozStorageStatementScoper scope(stmt); - nsCAutoString subdomainsDBKey; + nsAutoCString subdomainsDBKey; nsDOMStorageDBWrapper::CreateDomainScopeDBKey(aOwner, subdomainsDBKey); if (DomainMaybeCached(subdomainsDBKey)) { @@ -744,7 +744,7 @@ nsDOMStoragePersistentDB::RemoveOwners(const nsTArray &aOwners, NS_ENSURE_SUCCESS(rv, rv); for (uint32_t i = 0; i < aOwners.Length(); i++) { - nsCAutoString quotaKey; + nsAutoCString quotaKey; rv = nsDOMStorageDBWrapper::CreateDomainScopeDBKey( NS_ConvertUTF16toUTF8(aOwners[i]), quotaKey); @@ -757,7 +757,7 @@ nsDOMStoragePersistentDB::RemoveOwners(const nsTArray &aOwners, quotaKey.AppendLiteral(":"); quotaKey.AppendLiteral("*"); - nsCAutoString paramName; + nsAutoCString paramName; paramName.Assign("scope"); paramName.AppendInt(i); @@ -812,7 +812,7 @@ nsDOMStoragePersistentDB::GetUsage(const nsACString& aDomain, { nsresult rv; - nsCAutoString quotadomainDBKey; + nsAutoCString quotadomainDBKey; rv = nsDOMStorageDBWrapper::CreateQuotaDomainDBKey(aDomain, aIncludeSubDomains, false, @@ -878,7 +878,7 @@ nsDOMStoragePersistentDB::GetUsageInternal(const nsACString& aQuotaDomainDBKey, NS_ENSURE_STATE(stmt); mozStorageStatementScoper scope(stmt); - nsCAutoString scopeValue(aQuotaDomainDBKey); + nsAutoCString scopeValue(aQuotaDomainDBKey); scopeValue += NS_LITERAL_CSTRING("*"); rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), scopeValue); diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp index 5ec2a7b7df11..6033741d4e54 100644 --- a/dom/system/OSFileConstants.cpp +++ b/dom/system/OSFileConstants.cpp @@ -607,7 +607,7 @@ bool DefineOSFileConstants(JSContext *cx, JSObject *global) nsCOMPtr runtime = do_GetService(XULRUNTIME_SERVICE_CONTRACTID); if (runtime) { - nsCAutoString os; + nsAutoCString os; DebugOnly rv = runtime->GetOS(os); MOZ_ASSERT(NS_SUCCEEDED(rv)); diff --git a/dom/system/gonk/Volume.cpp b/dom/system/gonk/Volume.cpp index ba0425ab4848..727211becb43 100644 --- a/dom/system/gonk/Volume.cpp +++ b/dom/system/gonk/Volume.cpp @@ -174,7 +174,7 @@ Volume::HandleVoldResponse(int aResponseCode, nsCWhitespaceTokenizer &aTokenizer // // So we parse out the state after the string " to " while (aTokenizer.hasMoreTokens()) { - nsCAutoString token(aTokenizer.nextToken()); + nsAutoCString token(aTokenizer.nextToken()); if (token.Equals("to")) { nsresult errCode; token = aTokenizer.nextToken(); diff --git a/dom/system/gonk/VolumeCommand.cpp b/dom/system/gonk/VolumeCommand.cpp index a97c21217c60..d244658506dd 100644 --- a/dom/system/gonk/VolumeCommand.cpp +++ b/dom/system/gonk/VolumeCommand.cpp @@ -46,7 +46,7 @@ VolumeActionCommand::VolumeActionCommand(Volume *aVolume, : VolumeCommand(aCallback), mVolume(aVolume) { - nsCAutoString cmd; + nsAutoCString cmd; cmd = "volume "; cmd += aAction; diff --git a/dom/system/gonk/nsVolumeService.cpp b/dom/system/gonk/nsVolumeService.cpp index 45e1f10c259e..72ac53073645 100644 --- a/dom/system/gonk/nsVolumeService.cpp +++ b/dom/system/gonk/nsVolumeService.cpp @@ -93,7 +93,7 @@ NS_IMETHODIMP nsVolumeService::GetVolumeByPath(const nsAString &aPath, nsIVolume nsVolume::Array::index_type volIndex; for (volIndex = 0; volIndex < numVolumes; volIndex++) { nsRefPtr vol = mVolumeArray[volIndex]; - nsCAutoString volMountPointSlash = NS_ConvertUTF16toUTF8(vol->MountPoint()); + nsAutoCString volMountPointSlash = NS_ConvertUTF16toUTF8(vol->MountPoint()); volMountPointSlash.Append(NS_LITERAL_CSTRING("/")); nsDependentCSubstring testStr(realPathBuf, volMountPointSlash.Length()); if (volMountPointSlash.Equals(testStr)) { diff --git a/dom/workers/ChromeWorkerScope.cpp b/dom/workers/ChromeWorkerScope.cpp index c8d30d4d52d2..175fd58da2e3 100644 --- a/dom/workers/ChromeWorkerScope.cpp +++ b/dom/workers/ChromeWorkerScope.cpp @@ -25,7 +25,7 @@ UnicodeToNative(JSContext* aCx, const jschar* aSource, size_t aSourceLen) { nsDependentString unicode(aSource, aSourceLen); - nsCAutoString native; + nsAutoCString native; if (NS_FAILED(NS_CopyUnicodeToNative(unicode, native))) { JS_ReportError(aCx, "Could not convert string to native charset!"); return nullptr; diff --git a/dom/workers/FileReaderSyncPrivate.cpp b/dom/workers/FileReaderSyncPrivate.cpp index b8d71563aebd..688f26ed7194 100644 --- a/dom/workers/FileReaderSyncPrivate.cpp +++ b/dom/workers/FileReaderSyncPrivate.cpp @@ -194,7 +194,7 @@ FileReaderSyncPrivate::GuessCharset(nsIInputStream *aStream, const nsACString& detectorName = runtime->GetDetectorName(); if (!detectorName.IsEmpty()) { - nsCAutoString detectorContractID; + nsAutoCString detectorContractID; detectorContractID.AssignLiteral(NS_CHARSET_DETECTOR_CONTRACTID_BASE); detectorContractID += detectorName; detector = do_CreateInstance(detectorContractID.get()); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 7a99493b8ba5..b46de927a77c 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -1552,7 +1552,7 @@ public: if (!mWorkerPrivate) { #ifdef DEBUG - nsCAutoString message("Unable to report memory for "); + nsAutoCString message("Unable to report memory for "); message += NS_LITERAL_CSTRING("Worker (") + mAddressString + NS_LITERAL_CSTRING(")! It is either using ctypes or is in " "the process of being destroyed"); @@ -2404,7 +2404,7 @@ WorkerPrivateParent::SetBaseURI(nsIURI* aBaseURI) if (NS_SUCCEEDED(aBaseURI->GetPort(&port)) && port != -1) { mLocationInfo.mPort.AppendInt(port); - nsCAutoString host(mLocationInfo.mHostname); + nsAutoCString host(mLocationInfo.mHostname); host.AppendLiteral(":"); host.Append(mLocationInfo.mPort); diff --git a/editor/composer/src/nsComposerCommands.cpp b/editor/composer/src/nsComposerCommands.cpp index d550131d936a..10fe08512558 100644 --- a/editor/composer/src/nsComposerCommands.cpp +++ b/editor/composer/src/nsComposerCommands.cpp @@ -636,7 +636,7 @@ nsParagraphStateCommand::GetCurrentState(nsIEditor *aEditor, nsresult rv = htmlEditor->GetParagraphState(&outMixed, outStateString); if (NS_SUCCEEDED(rv)) { - nsCAutoString tOutStateString; + nsAutoCString tOutStateString; tOutStateString.AssignWithConversion(outStateString); aParams->SetBooleanValue(STATE_MIXED,outMixed); aParams->SetCStringValue(STATE_ATTRIBUTE, tOutStateString.get()); @@ -715,7 +715,7 @@ nsFontSizeStateCommand::nsFontSizeStateCommand() { } -// nsCAutoString tOutStateString; +// nsAutoCString tOutStateString; // tOutStateString.AssignWithConversion(outStateString); nsresult nsFontSizeStateCommand::GetCurrentState(nsIEditor *aEditor, @@ -735,7 +735,7 @@ nsFontSizeStateCommand::GetCurrentState(nsIEditor *aEditor, outStateString); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString tOutStateString; + nsAutoCString tOutStateString; tOutStateString.AssignWithConversion(outStateString); aParams->SetBooleanValue(STATE_MIXED, anyHas && !allHas); aParams->SetCStringValue(STATE_ATTRIBUTE, tOutStateString.get()); @@ -798,7 +798,7 @@ nsFontColorStateCommand::GetCurrentState(nsIEditor *aEditor, nsresult rv = htmlEditor->GetFontColorState(&outMixed, outStateString); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString tOutStateString; + nsAutoCString tOutStateString; tOutStateString.AssignWithConversion(outStateString); aParams->SetBooleanValue(STATE_MIXED, outMixed); aParams->SetCStringValue(STATE_ATTRIBUTE, tOutStateString.get()); @@ -839,7 +839,7 @@ nsHighlightColorStateCommand::GetCurrentState(nsIEditor *aEditor, nsresult rv = htmlEditor->GetHighlightColorState(&outMixed, outStateString); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString tOutStateString; + nsAutoCString tOutStateString; tOutStateString.AssignWithConversion(outStateString); aParams->SetBooleanValue(STATE_MIXED, outMixed); aParams->SetCStringValue(STATE_ATTRIBUTE, tOutStateString.get()); @@ -896,7 +896,7 @@ nsBackgroundColorStateCommand::GetCurrentState(nsIEditor *aEditor, nsresult rv = htmlEditor->GetBackgroundColorState(&outMixed, outStateString); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString tOutStateString; + nsAutoCString tOutStateString; tOutStateString.AssignWithConversion(outStateString); aParams->SetBooleanValue(STATE_MIXED, outMixed); aParams->SetCStringValue(STATE_ATTRIBUTE, tOutStateString.get()); @@ -953,7 +953,7 @@ nsAlignCommand::GetCurrentState(nsIEditor *aEditor, nsICommandParams *aParams) outStateString.AssignLiteral("justify"); break; } - nsCAutoString tOutStateString; + nsAutoCString tOutStateString; tOutStateString.AssignWithConversion(outStateString); aParams->SetBooleanValue(STATE_MIXED,outMixed); aParams->SetCStringValue(STATE_ATTRIBUTE, tOutStateString.get()); diff --git a/editor/composer/src/nsEditingSession.cpp b/editor/composer/src/nsEditingSession.cpp index 296f5dc68bcf..5f49c819439f 100644 --- a/editor/composer/src/nsEditingSession.cpp +++ b/editor/composer/src/nsEditingSession.cpp @@ -307,7 +307,7 @@ nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *aWindow) // Note: the doc gets this from the network channel during StartPageLoad, // so we don't have to get it from there ourselves nsCOMPtr doc; - nsCAutoString mimeCType; + nsAutoCString mimeCType; //then lets check the mime type if (NS_SUCCEEDED(aWindow->GetDocument(getter_AddRefs(doc))) && doc) @@ -626,7 +626,7 @@ nsEditingSession::OnStateChange(nsIWebProgress *aWebProgress, nsCOMPtr channel(do_QueryInterface(aRequest)); if (channel) { - nsCAutoString contentType; + nsAutoCString contentType; channel->GetContentType(contentType); if (!contentType.IsEmpty()) printf(" ++++++ MIMETYPE = %s\n", contentType.get()); @@ -1077,7 +1077,7 @@ nsEditingSession::EndPageLoad(nsIWebProgress *aWebProgress, printf("uri %s\n", spec.get()); } - nsCAutoString contentType; + nsAutoCString contentType; aChannel->GetContentType(contentType); if (!contentType.IsEmpty()) printf(" flags = %d, status = %d, MIMETYPE = %s\n", diff --git a/editor/composer/src/nsEditorSpellCheck.cpp b/editor/composer/src/nsEditorSpellCheck.cpp index 9eb39024fc88..67e8cf354329 100644 --- a/editor/composer/src/nsEditorSpellCheck.cpp +++ b/editor/composer/src/nsEditorSpellCheck.cpp @@ -658,7 +658,7 @@ nsEditorSpellCheck::UpdateCurrentDictionary() mozilla::services::GetXULChromeRegistryService(); if (packageRegistry) { - nsCAutoString utf8DictName; + nsAutoCString utf8DictName; rv = packageRegistry->GetSelectedLocale(NS_LITERAL_CSTRING("global"), utf8DictName); AppendUTF8toUTF16(utf8DictName, dictName); diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index 679af18a6316..5bde3ea9d6b4 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -5260,7 +5260,7 @@ nsEditor::DumpNode(nsIDOMNode *aNode, int32_t indent) nsCOMPtr textNode = do_QueryInterface(aNode); nsAutoString str; textNode->GetData(str); - nsCAutoString cstr; + nsAutoCString cstr; LossyCopyUTF16toASCII(str, cstr); cstr.ReplaceChar('\n', ' '); printf(" %s\n", cstr.get()); diff --git a/editor/libeditor/html/nsHTMLDataTransfer.cpp b/editor/libeditor/html/nsHTMLDataTransfer.cpp index 0cd59bc52bd1..8f330ce27757 100644 --- a/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -1037,7 +1037,7 @@ FindIntegerAfterString(const char *aLeadingString, if (numBack == -1) return false; - nsCAutoString numStr(Substring(aCStr, numFront, numBack-numFront)); + nsAutoCString numStr(Substring(aCStr, numFront, numBack-numFront)); nsresult errorCode; foundNumber = numStr.ToInteger(&errorCode); return true; @@ -1099,7 +1099,7 @@ nsHTMLEditor::ParseCFHTML(nsCString & aCfhtml, PRUnichar **aStuffToPaste, PRUnic } // create context string - nsCAutoString contextUTF8(Substring(aCfhtml, startHTML, startFragment - startHTML) + + nsAutoCString contextUTF8(Substring(aCfhtml, startHTML, startFragment - startHTML) + NS_LITERAL_CSTRING("") + Substring(aCfhtml, endFragment, endHTML - endFragment)); @@ -1134,7 +1134,7 @@ nsHTMLEditor::ParseCFHTML(nsCString & aCfhtml, PRUnichar **aStuffToPaste, PRUnic } // create fragment string - nsCAutoString fragmentUTF8(Substring(aCfhtml, startFragment, endFragment-startFragment)); + nsAutoCString fragmentUTF8(Substring(aCfhtml, startFragment, endFragment-startFragment)); // remove the StartFragment/EndFragment comments from the fragment, if present RemoveFragComments(fragmentUTF8); @@ -1191,7 +1191,7 @@ nsresult nsHTMLEditor::InsertObject(const char* aType, nsISupports* aObject, boo nsCOMPtr mime = do_GetService("@mozilla.org/mime;1"); NS_ENSURE_TRUE(mime, NS_ERROR_FAILURE); - nsCAutoString contentType; + nsAutoCString contentType; rv = mime->GetTypeFromFile(fileObj, contentType); NS_ENSURE_SUCCESS(rv, rv); @@ -1286,7 +1286,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable nsCOMPtr textDataObj = do_QueryInterface(genericDataObj); if (textDataObj && len > 0) { - nsCAutoString cfhtml; + nsAutoCString cfhtml; textDataObj->GetData(cfhtml); NS_ASSERTION(cfhtml.Length() <= (len), "Invalid length!"); nsXPIDLString cfcontext, cffragment, cfselection; // cfselection left emtpy for now @@ -1324,7 +1324,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable } else { nsCOMPtr textDataObj(do_QueryInterface(genericDataObj)); if (textDataObj && len > 0) { - nsCAutoString text; + nsAutoCString text; textDataObj->GetData(text); NS_ASSERTION(text.Length() <= len, "Invalid length!"); stuffToPaste.Assign(NS_ConvertUTF8toUTF16(Substring(text, 0, len))); diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index fa5dc1be742d..ea4dacc3e572 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -3467,7 +3467,7 @@ nsHTMLEditor::StyleSheetLoaded(nsCSSStyleSheet* aSheet, bool aWasAlternate, if (NS_SUCCEEDED(rv)) { // Get the URI, then url spec from the sheet - nsCAutoString spec; + nsAutoCString spec; rv = aSheet->GetSheetURI()->GetSpec(spec); if (NS_SUCCEEDED(rv)) diff --git a/editor/libeditor/text/nsPlaintextEditor.cpp b/editor/libeditor/text/nsPlaintextEditor.cpp index 7f9752e5bbb5..6d3eb592a402 100644 --- a/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/editor/libeditor/text/nsPlaintextEditor.cpp @@ -1197,7 +1197,7 @@ nsPlaintextEditor::GetAndInitDocEncoder(const nsAString& aFormatType, { nsresult rv = NS_OK; - nsCAutoString formatType(NS_DOC_ENCODER_CONTRACTID_BASE); + nsAutoCString formatType(NS_DOC_ENCODER_CONTRACTID_BASE); LossyAppendUTF16toASCII(aFormatType, formatType); nsCOMPtr docEncoder (do_CreateInstance(formatType.get(), &rv)); NS_ENSURE_SUCCESS(rv, rv); @@ -1270,7 +1270,7 @@ nsPlaintextEditor::OutputToString(const nsAString& aFormatType, return rv; } - nsCAutoString charsetStr; + nsAutoCString charsetStr; rv = GetDocumentCharacterSet(charsetStr); if(NS_FAILED(rv) || charsetStr.IsEmpty()) charsetStr.AssignLiteral("ISO-8859-1"); diff --git a/embedding/components/appstartup/src/nsAppStartupNotifier.cpp b/embedding/components/appstartup/src/nsAppStartupNotifier.cpp index ce53c8c12157..92fb8975b391 100644 --- a/embedding/components/appstartup/src/nsAppStartupNotifier.cpp +++ b/embedding/components/appstartup/src/nsAppStartupNotifier.cpp @@ -48,7 +48,7 @@ NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *a nsCOMPtr category = do_QueryInterface(entry, &rv); if (NS_SUCCEEDED(rv)) { - nsCAutoString categoryEntry; + nsAutoCString categoryEntry; rv = category->GetData(categoryEntry); nsXPIDLCString contractId; @@ -81,7 +81,7 @@ NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *a } else { #ifdef DEBUG - nsCAutoString warnStr("Cannot create startup observer : "); + nsAutoCString warnStr("Cannot create startup observer : "); warnStr += contractId.get(); NS_WARNING(warnStr.get()); #endif diff --git a/embedding/components/find/src/nsFind.cpp b/embedding/components/find/src/nsFind.cpp index 2f9ebdcb9b26..aebc02696b88 100644 --- a/embedding/components/find/src/nsFind.cpp +++ b/embedding/components/find/src/nsFind.cpp @@ -1008,7 +1008,7 @@ nsFind::Find(const PRUnichar *aPatText, nsIDOMRange* aSearchRange, t1b = frag->Get1b(); t2b = nullptr; #ifdef DEBUG_FIND - nsCAutoString str1(t1b, fragLen); + nsAutoCString str1(t1b, fragLen); printf("1 byte, '%s'\n", str1.get()); #endif } diff --git a/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp b/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp index d54e4330df7c..c6b5ee2206a7 100644 --- a/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp +++ b/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp @@ -340,7 +340,7 @@ GetLocalizedString(nsIStringBundle* aStrBundle, const char* aKey, nsString& oVal // Set a multi-byte string in the control static void SetTextOnWnd(HWND aControl, const nsString& aStr) { - nsCAutoString text; + nsAutoCString text; if (NS_SUCCEEDED(NS_CopyUnicodeToNative(aStr, text))) { ::SetWindowText(aControl, text.get()); } @@ -445,7 +445,7 @@ static HWND CreateControl(LPCTSTR aType, const nsAString& aStr, const nsIntRect& aRect) { - nsCAutoString str; + nsAutoCString str; if (NS_FAILED(NS_CopyUnicodeToNative(aStr, str))) return NULL; diff --git a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp index 4fbf96ceb273..9a690b2b2210 100644 --- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp +++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp @@ -705,7 +705,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest( nsCOMPtr localFileOS2 = do_QueryInterface(localFile); if (localFileOS2) { - nsCAutoString url; + nsAutoCString url; uriSource->GetSpec(url); localFileOS2->SetFileSource(url); } @@ -877,7 +877,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnDataAvailable( "nsWebBrowserPersist::OnDataAvailable() no content length " "header, pushing what we have"); // we're done with this pass; see if we need to do upload - nsCAutoString contentType; + nsAutoCString contentType; channel->GetContentType(contentType); // if we don't have the right type of output stream then it's a local file nsCOMPtr storStream(do_QueryInterface(data->mStream)); @@ -1042,7 +1042,7 @@ nsresult nsWebBrowserPersist::SendErrorStatusChange( } else { - nsCAutoString fileurl; + nsAutoCString fileurl; aURI->GetSpec(fileurl); AppendUTF8toUTF16(fileurl, path); } @@ -1143,7 +1143,7 @@ nsresult nsWebBrowserPersist::AppendPathToURI(nsIURI *aURI, const nsAString & aP { NS_ENSURE_ARG_POINTER(aURI); - nsCAutoString newPath; + nsAutoCString newPath; nsresult rv = aURI->GetPath(newPath); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); @@ -1278,13 +1278,13 @@ nsresult nsWebBrowserPersist::SaveURIInternal( // Headers if (aExtraHeaders) { - nsCAutoString oneHeader; - nsCAutoString headerName; - nsCAutoString headerValue; + nsAutoCString oneHeader; + nsAutoCString headerName; + nsAutoCString headerValue; int32_t crlf = 0; int32_t colon = 0; const char *kWhitespace = "\b\t\r\n "; - nsCAutoString extraHeaders(aExtraHeaders); + nsAutoCString extraHeaders(aExtraHeaders); while (true) { crlf = extraHeaders.Find("\r\n", true); @@ -1333,7 +1333,7 @@ nsresult nsWebBrowserPersist::SaveChannelInternal( rv = NS_NewBufferedInputStream(getter_AddRefs(bufferedInputStream), fileInputStream, BUFFERED_OUTPUT_SIZE); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString contentType; + nsAutoCString contentType; aChannel->GetContentType(contentType); return StartUpload(bufferedInputStream, aFile, contentType); } @@ -1383,9 +1383,9 @@ nsWebBrowserPersist::GetExtensionForContentType(const PRUnichar *aContentType, P } nsCOMPtr mimeInfo; - nsCAutoString contentType; + nsAutoCString contentType; contentType.AssignWithConversion(aContentType); - nsCAutoString ext; + nsAutoCString ext; rv = mMIMEService->GetPrimaryExtension(contentType, EmptyCString(), ext); if (NS_SUCCEEDED(rv)) { @@ -1449,7 +1449,7 @@ nsWebBrowserPersist::GetDocEncoderContentType(nsIDOMDocument *aDocument, const P !contentType.Equals(defaultContentType, nsCaseInsensitiveStringComparator())) { // Check if there is an encoder for the desired content type - nsCAutoString contractID(NS_DOC_ENCODER_CONTRACTID_BASE); + nsAutoCString contractID(NS_DOC_ENCODER_CONTRACTID_BASE); AppendUTF16toUTF8(contentType, contractID); nsCOMPtr registrar; @@ -1501,7 +1501,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( mURI = doc->GetDocumentURI(); nsCOMPtr oldBaseURI = mCurrentBaseURI; - nsCAutoString oldCharset(mCurrentCharset); + nsAutoCString oldCharset(mCurrentCharset); // Store the base URI and the charset mCurrentBaseURI = doc->GetBaseURI(); @@ -1543,7 +1543,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( nsCOMPtr baseDir; localFile->GetParent(getter_AddRefs(baseDir)); - nsCAutoString relativePathToData; + nsAutoCString relativePathToData; nsCOMPtr dataDirParent; dataDirParent = localDataPath; while (dataDirParent) @@ -1560,7 +1560,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( nsAutoString dirName; dataDirParent->GetLeafName(dirName); - nsCAutoString newRelativePathToData; + nsAutoCString newRelativePathToData; newRelativePathToData = NS_ConvertUTF16toUTF8(dirName) + NS_LITERAL_CSTRING("/") + relativePathToData; @@ -1577,7 +1577,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( nsCOMPtr pathToBaseURL(do_QueryInterface(aFile)); if (pathToBaseURL) { - nsCAutoString relativePath; // nsACString + nsAutoCString relativePath; // nsACString if (NS_SUCCEEDED(pathToBaseURL->GetRelativeSpec(aDataPath, relativePath))) { mCurrentDataPathIsRelative = true; @@ -1659,7 +1659,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( nsCOMPtr localFileOS2 = do_QueryInterface(localDataPath); if (localFileOS2) { - nsCAutoString url; + nsAutoCString url; mCurrentBaseURI->GetSpec(url); localFileOS2->SetFileSource(url); } @@ -1683,8 +1683,8 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( !mContentType.IsEmpty() ? mContentType.get() : nullptr, getter_Copies(realContentType)); - nsCAutoString contentType; contentType.AssignWithConversion(realContentType); - nsCAutoString charType; // Empty + nsAutoCString contentType; contentType.AssignWithConversion(realContentType); + nsAutoCString charType; // Empty // Save the document rv = SaveDocumentWithFixup( @@ -1739,8 +1739,8 @@ nsresult nsWebBrowserPersist::SaveDocuments() !mContentType.IsEmpty() ? mContentType.get() : nullptr, getter_Copies(realContentType)); - nsCAutoString contentType; contentType.AssignWithConversion(realContentType.get()); - nsCAutoString charType; // Empty + nsAutoCString contentType; contentType.AssignWithConversion(realContentType.get()); + nsAutoCString charType; // Empty // Save the document, fixing up the links as it goes out rv = SaveDocumentWithFixup( @@ -1922,10 +1922,10 @@ nsWebBrowserPersist::CalculateUniqueFilename(nsIURI *aURI) nsresult rv; // Get the old filename - nsCAutoString filename; + nsAutoCString filename; rv = url->GetFileName(filename); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); - nsCAutoString directory; + nsAutoCString directory; rv = url->GetDirectory(directory); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); @@ -1936,8 +1936,8 @@ nsWebBrowserPersist::CalculateUniqueFilename(nsIURI *aURI) // preserve the dot whereas this code does to save some effort // later when everything is put back together. int32_t lastDot = filename.RFind("."); - nsCAutoString base; - nsCAutoString ext; + nsAutoCString base; + nsAutoCString ext; if (lastDot >= 0) { filename.Mid(base, 0, lastDot); @@ -1986,8 +1986,8 @@ nsWebBrowserPersist::CalculateUniqueFilename(nsIURI *aURI) if (base.IsEmpty() || !mFilenameList.IsEmpty()) { - nsCAutoString tmpPath; - nsCAutoString tmpBase; + nsAutoCString tmpPath; + nsAutoCString tmpBase; uint32_t duplicateCounter = 1; while (1) { @@ -2035,7 +2035,7 @@ nsWebBrowserPersist::CalculateUniqueFilename(nsIURI *aURI) } // Add name to list of those already used - nsCAutoString newFilepath(directory); + nsAutoCString newFilepath(directory); newFilepath.Append(filename); mFilenameList.AppendElement(newFilepath); @@ -2086,7 +2086,7 @@ nsWebBrowserPersist::MakeFilenameFromURI(nsIURI *aURI, nsString &aFilename) nsCOMPtr url(do_QueryInterface(aURI)); if (url) { - nsCAutoString nameFromURL; + nsAutoCString nameFromURL; url->GetFileName(nameFromURL); if (mPersistFlags & PERSIST_FLAGS_DONT_CHANGE_FILENAMES) { @@ -2148,7 +2148,7 @@ nsWebBrowserPersist::CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChanne NS_ENSURE_TRUE(mMIMEService, NS_ERROR_FAILURE); } - nsCAutoString contentType; + nsAutoCString contentType; // Get the content type from the channel aChannel->GetContentType(contentType); @@ -2176,7 +2176,7 @@ nsWebBrowserPersist::CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChanne nsCOMPtr url(do_QueryInterface(aURI)); NS_ENSURE_TRUE(url, NS_ERROR_FAILURE); - nsCAutoString newFileName; + nsAutoCString newFileName; url->GetFileName(newFileName); // Test if the current extension is current for the mime type @@ -2188,7 +2188,7 @@ nsWebBrowserPersist::CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChanne } // Append the mime file extension - nsCAutoString fileExt; + nsAutoCString fileExt; if (!hasExtension) { // Test if previous extension is acceptable @@ -3385,7 +3385,7 @@ nsWebBrowserPersist::FixupURI(nsAString &aURI) nsresult rv = NS_NewURI(getter_AddRefs(uri), aURI, mCurrentCharset.get(), mCurrentBaseURI); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = uri->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -3426,19 +3426,19 @@ nsWebBrowserPersist::FixupURI(nsAString &aURI) if (!url) return NS_ERROR_FAILURE; - nsCAutoString filename; + nsAutoCString filename; url->GetFileName(filename); - nsCAutoString rawPathURL(data->mRelativePathToData); + nsAutoCString rawPathURL(data->mRelativePathToData); rawPathURL.Append(filename); - nsCAutoString buf; + nsAutoCString buf; AppendUTF8toUTF16(NS_EscapeURL(rawPathURL, esc_FilePath, buf), newValue); } else { - nsCAutoString fileurl; + nsAutoCString fileurl; fileAsURI->GetSpec(fileurl); AppendUTF8toUTF16(fileurl, newValue); } @@ -3535,7 +3535,7 @@ nsWebBrowserPersist::FixupAnchor(nsIDOMNode *aNode) if (NS_SUCCEEDED(rv) && newURI) { newURI->SetUserPass(EmptyCString()); - nsCAutoString uriSpec; + nsAutoCString uriSpec; newURI->GetSpec(uriSpec); attrNode->SetNodeValue(NS_ConvertUTF8toUTF16(uriSpec)); } @@ -3555,7 +3555,7 @@ bool nsWebBrowserPersist::DocumentEncoderExists(const PRUnichar *aContentType) { // Check if there is an encoder for the desired content type. - nsCAutoString contractID(NS_DOC_ENCODER_CONTRACTID_BASE); + nsAutoCString contractID(NS_DOC_ENCODER_CONTRACTID_BASE); AppendUTF16toUTF8(aContentType, contractID); nsCOMPtr registrar; @@ -3596,7 +3596,7 @@ nsWebBrowserPersist::SaveSubframeContent( { nsCOMPtr url(do_QueryInterface(frameDoc->GetDocumentURI(), &rv)); - nsCAutoString extension; + nsAutoCString extension; if (NS_SUCCEEDED(rv)) { url->GetFileExtension(extension); @@ -3714,7 +3714,7 @@ nsWebBrowserPersist::SaveDocumentWithFixup( NS_ENSURE_TRUE(outputStream, NS_ERROR_FAILURE); // Get a document encoder instance - nsCAutoString contractID(NS_DOC_ENCODER_CONTRACTID_BASE); + nsAutoCString contractID(NS_DOC_ENCODER_CONTRACTID_BASE); contractID.Append(aFormatType); nsCOMPtr encoder = do_CreateInstance(contractID.get(), &rv); @@ -3732,7 +3732,7 @@ nsWebBrowserPersist::SaveDocumentWithFixup( if (mWrapColumn && (aFlags & ENCODE_FLAGS_WRAP)) encoder->SetWrapColumn(mWrapColumn); - nsCAutoString charsetStr(aSaveCharset); + nsAutoCString charsetStr(aSaveCharset); if (charsetStr.IsEmpty()) { nsCOMPtr doc = do_QueryInterface(aDocument); @@ -3764,7 +3764,7 @@ nsWebBrowserPersist::SaveDocumentWithFixup( nsCOMPtr localFileOS2 = do_QueryInterface(localFile); if (localFileOS2) { - nsCAutoString url; + nsAutoCString url; mCurrentBaseURI->GetSpec(url); localFileOS2->SetFileSource(url); } @@ -3782,7 +3782,7 @@ nsWebBrowserPersist::MakeAndStoreLocalFilenameInURIMap( { NS_ENSURE_ARG_POINTER(aURI); - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); @@ -4043,7 +4043,7 @@ nsWebBrowserPersist::SetDocumentBase( { return NS_ERROR_FAILURE; } - nsCAutoString uriSpec; + nsAutoCString uriSpec; aBaseURI->GetSpec(uriSpec); NS_ConvertUTF8toUTF16 href(uriSpec); baseElement->SetAttribute(NS_LITERAL_STRING("href"), href); @@ -4067,7 +4067,7 @@ void nsWebBrowserPersist::SetApplyConversionIfNeeded(nsIChannel *aChannel) nsCOMPtr sourceURL(do_QueryInterface(thisURI)); if (!sourceURL) return; - nsCAutoString extension; + nsAutoCString extension; sourceURL->GetFileExtension(extension); nsCOMPtr encEnum; @@ -4082,7 +4082,7 @@ void nsWebBrowserPersist::SetApplyConversionIfNeeded(nsIChannel *aChannel) rv = encEnum->HasMore(&hasMore); if (NS_SUCCEEDED(rv) && hasMore) { - nsCAutoString encType; + nsAutoCString encType; rv = encEnum->GetNext(encType); if (NS_SUCCEEDED(rv)) { diff --git a/embedding/components/windowwatcher/public/nsPromptUtils.h b/embedding/components/windowwatcher/public/nsPromptUtils.h index f6ece654a527..42355d5fc1f6 100644 --- a/embedding/components/windowwatcher/public/nsPromptUtils.h +++ b/embedding/components/windowwatcher/public/nsPromptUtils.h @@ -72,7 +72,7 @@ NS_GetAuthHostPort(nsIChannel* aChannel, nsIAuthInformation* aAuthInfo, proxied->GetProxyInfo(getter_AddRefs(info)); NS_ASSERTION(info, "proxy auth needs nsIProxyInfo"); - nsCAutoString idnhost; + nsAutoCString idnhost; info->GetHost(idnhost); info->GetPort(port); diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index f26a1e5bab7c..2bd5c3538d24 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -493,7 +493,7 @@ nsWindowWatcher::OpenWindowInternal(nsIDOMWindow *aParent, windowIsModalContentDialog = false; uint32_t chromeFlags; nsAutoString name; // string version of aName - nsCAutoString features; // string version of aFeatures + nsAutoCString features; // string version of aFeatures nsCOMPtr uriToLoad; // from aUrl, if any nsCOMPtr parentTreeOwner; // from the parent window, if any nsCOMPtr newDocShellItem; // from the new window @@ -832,7 +832,7 @@ nsWindowWatcher::OpenWindowInternal(nsIDOMWindow *aParent, nsCOMPtr parentMuCV = do_QueryInterface(parentCV); if (parentMuCV) { - nsCAutoString charset; + nsAutoCString charset; nsresult res = parentMuCV->GetDefaultCharacterSet(charset); if (NS_SUCCEEDED(res)) { newMuCV->SetDefaultCharacterSet(charset); @@ -1631,7 +1631,7 @@ nsWindowWatcher::WinHasOption(const char *aOptions, const char *aName, int32_t found = 0; #ifdef DEBUG - nsCAutoString options(aOptions); + nsAutoCString options(aOptions); NS_ASSERTION(options.FindCharInSet(" \n\r\t") == kNotFound, "There should be no whitespace in this string!"); #endif diff --git a/extensions/auth/nsAuthGSSAPI.cpp b/extensions/auth/nsAuthGSSAPI.cpp index a79ee54e593d..e828bebe3d26 100644 --- a/extensions/auth/nsAuthGSSAPI.cpp +++ b/extensions/auth/nsAuthGSSAPI.cpp @@ -212,7 +212,7 @@ LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char *prefix) gss_buffer_desc status1_string; gss_buffer_desc status2_string; OM_uint32 ret; - nsCAutoString errorStr; + nsAutoCString errorStr; errorStr.Assign(prefix); if (!gssLibrary) @@ -368,7 +368,7 @@ nsAuthGSSAPI::GetNextToken(const void *inToken, gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; gss_buffer_t in_token_ptr = GSS_C_NO_BUFFER; gss_name_t server; - nsCAutoString userbuf; + nsAutoCString userbuf; nsresult rv; LOG(("entering nsAuthGSSAPI::GetNextToken()\n")); diff --git a/extensions/auth/nsAuthSASL.cpp b/extensions/auth/nsAuthSASL.cpp index 37979e8acb46..8254b0fbd0c0 100644 --- a/extensions/auth/nsAuthSASL.cpp +++ b/extensions/auth/nsAuthSASL.cpp @@ -72,7 +72,7 @@ nsAuthSASL::GetNextToken(const void *inToken, void *unwrappedToken; char *message; uint32_t unwrappedTokenLen, messageLen; - nsCAutoString userbuf; + nsAutoCString userbuf; if (!mInnerModule) return NS_ERROR_NOT_INITIALIZED; diff --git a/extensions/auth/nsAuthSSPI.cpp b/extensions/auth/nsAuthSSPI.cpp index 37baa8d6e8a0..5afe134fe4a4 100644 --- a/extensions/auth/nsAuthSSPI.cpp +++ b/extensions/auth/nsAuthSSPI.cpp @@ -332,7 +332,7 @@ nsAuthSSPI::GetNextToken(const void *inToken, // Start hashing. We are always doing SHA256, but depending // on the certificate, a different alogirthm might be needed. - nsCAutoString hashString; + nsAutoCString hashString; nsresult rv; nsCOMPtr crypto; diff --git a/extensions/auth/nsHttpNegotiateAuth.cpp b/extensions/auth/nsHttpNegotiateAuth.cpp index 606a5bf8b88d..af56c698ed71 100644 --- a/extensions/auth/nsHttpNegotiateAuth.cpp +++ b/extensions/auth/nsHttpNegotiateAuth.cpp @@ -95,7 +95,7 @@ nsHttpNegotiateAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, return rv; uint32_t req_flags = nsIAuthModule::REQ_DEFAULT; - nsCAutoString service; + nsAutoCString service; if (isProxyAuth) { if (!TestBoolPref(kNegotiateAuthAllowProxies)) { @@ -302,7 +302,7 @@ nsHttpNegotiateAuth::TestBoolPref(const char *pref) bool nsHttpNegotiateAuth::TestNonFqdn(nsIURI *uri) { - nsCAutoString host; + nsAutoCString host; PRNetAddr addr; if (!TestBoolPref(kNegotiateAuthAllowNonFqdn)) @@ -323,7 +323,7 @@ nsHttpNegotiateAuth::TestPref(nsIURI *uri, const char *pref) if (!prefs) return false; - nsCAutoString scheme, host; + nsAutoCString scheme, host; int32_t port; if (NS_FAILED(uri->GetScheme(scheme))) diff --git a/extensions/cookie/nsCookiePermission.cpp b/extensions/cookie/nsCookiePermission.cpp index c5902ac4f928..9b7b4dde3b3d 100644 --- a/extensions/cookie/nsCookiePermission.cpp +++ b/extensions/cookie/nsCookiePermission.cpp @@ -249,7 +249,7 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI, // default to rejecting, in case the prompting process fails *aResult = false; - nsCAutoString hostPort; + nsAutoCString hostPort; aURI->GetHostPort(hostPort); if (!aCookie) { @@ -292,7 +292,7 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI, uint32_t countFromHost; nsCOMPtr cookieManager = do_GetService(NS_COOKIEMANAGER_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { - nsCAutoString rawHost; + nsAutoCString rawHost; aCookie->GetRawHost(rawHost); rv = cookieManager->CountCookiesFromHost(rawHost, &countFromHost); diff --git a/extensions/cookie/nsPermissionManager.cpp b/extensions/cookie/nsPermissionManager.cpp index 175fbd20d5e4..3258361750e0 100644 --- a/extensions/cookie/nsPermissionManager.cpp +++ b/extensions/cookie/nsPermissionManager.cpp @@ -601,7 +601,7 @@ nsPermissionManager::AddInternal(nsIPrincipal* aPrincipal, NotifyOperationType aNotifyOperation, DBOperationType aDBOperation) { - nsCAutoString host; + nsAutoCString host; nsresult rv = GetHostForPrincipal(aPrincipal, host); NS_ENSURE_SUCCESS(rv, rv); @@ -940,7 +940,7 @@ nsPermissionManager::CommonTestPermission(nsIPrincipal* aPrincipal, nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString host; + nsAutoCString host; rv = GetHostForPrincipal(aPrincipal, host); // No host doesn't mean an error. Just return the default. Unless this is @@ -1147,7 +1147,7 @@ nsPermissionManager::RemovePermissionsForApp(uint32_t aAppId) // remove those because doing so in EnumerateEntries() would fail because // we might happen to actually delete entries from the list. - nsCAutoString sql; + nsAutoCString sql; sql.AppendLiteral("DELETE FROM moz_hosts WHERE appId="); sql.AppendInt(aAppId); @@ -1158,9 +1158,9 @@ nsPermissionManager::RemovePermissionsForApp(uint32_t aAppId) mPermissionTable.EnumerateEntries(GetPermissionsForApp, &data); for (int32_t i=0; iGetHost(host); data.permissions[i]->GetIsInBrowserElement(&isInBrowserElement); @@ -1293,7 +1293,7 @@ nsPermissionManager::Read() NS_ENSURE_SUCCESS(rv, rv); int64_t id; - nsCAutoString host, type; + nsAutoCString host, type; uint32_t permission; uint32_t expireType; int64_t expireTime; @@ -1370,7 +1370,7 @@ nsPermissionManager::Import() * permission is an integer between 1 and 15 */ - nsCAutoString buffer; + nsAutoCString buffer; bool isMore = true; while (isMore && NS_SUCCEEDED(lineInputStream->ReadLine(buffer, &isMore))) { if (buffer.IsEmpty() || buffer.First() == '#') { diff --git a/extensions/cookie/nsPermissionManager.h b/extensions/cookie/nsPermissionManager.h index db6ce0f276e0..7d6e24585686 100644 --- a/extensions/cookie/nsPermissionManager.h +++ b/extensions/cookie/nsPermissionManager.h @@ -77,7 +77,7 @@ public: } PLDHashNumber GetHashCode() const { - nsCAutoString str; + nsAutoCString str; str.Assign(mHost); str.AppendInt(mAppId); str.AppendInt(static_cast(mIsInBrowserElement)); diff --git a/extensions/gio/nsGIOProtocolHandler.cpp b/extensions/gio/nsGIOProtocolHandler.cpp index 63cfff635afb..4108cd834888 100644 --- a/extensions/gio/nsGIOProtocolHandler.cpp +++ b/extensions/gio/nsGIOProtocolHandler.cpp @@ -770,7 +770,7 @@ mount_operation_ask_password (GMountOperation *mount_op, return; } - nsCAutoString scheme, hostPort; + nsAutoCString scheme, hostPort; uri->GetScheme(scheme); uri->GetHostPort(hostPort); @@ -1046,7 +1046,7 @@ nsGIOProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult) NS_ENSURE_ARG_POINTER(aURI); nsresult rv; - nsCAutoString spec; + nsAutoCString spec; rv = aURI->GetSpec(spec); if (NS_FAILED(rv)) return rv; diff --git a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp index a528f870b19f..0ed9c98ff5d5 100644 --- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp +++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp @@ -157,7 +157,7 @@ ProxiedAuthCallback(gconstpointer in, // that we originally gave to it. In spite of the likelihood of // false hits, this check is probably still valuable. // - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); int uriLen = strlen(authIn->uri); if (!StringHead(spec, uriLen).Equals(nsDependentCString(authIn->uri, uriLen))) @@ -168,7 +168,7 @@ ProxiedAuthCallback(gconstpointer in, } #endif - nsCAutoString scheme, hostPort; + nsAutoCString scheme, hostPort; uri->GetScheme(scheme); uri->GetHostPort(hostPort); @@ -901,7 +901,7 @@ nsGnomeVFSProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult) NS_ENSURE_ARG_POINTER(aURI); nsresult rv; - nsCAutoString spec; + nsAutoCString spec; rv = aURI->GetSpec(spec); if (NS_FAILED(rv)) return rv; diff --git a/extensions/permissions/nsContentBlocker.cpp b/extensions/permissions/nsContentBlocker.cpp index aecacf8d9090..a57ff9cbd296 100644 --- a/extensions/permissions/nsContentBlocker.cpp +++ b/extensions/permissions/nsContentBlocker.cpp @@ -149,7 +149,7 @@ nsContentBlocker::ShouldLoad(uint32_t aContentType, // we only want to check http, https, ftp // for chrome:// and resources and others, no need to check. - nsCAutoString scheme; + nsAutoCString scheme; aContentLocation->GetScheme(scheme); if (!scheme.LowerCaseEqualsLiteral("ftp") && !scheme.LowerCaseEqualsLiteral("http") && @@ -287,7 +287,7 @@ nsContentBlocker::TestPermission(nsIURI *aCurrentURI, // A more generic method somewhere would be nice - nsCAutoString currentHost; + nsAutoCString currentHost; rv = aCurrentURI->GetAsciiHost(currentHost); NS_ENSURE_SUCCESS(rv, rv); @@ -303,7 +303,7 @@ nsContentBlocker::TestPermission(nsIURI *aCurrentURI, const nsCSubstring &tail = Substring(currentHost, dot, currentHost.Length() - dot); - nsCAutoString firstHost; + nsAutoCString firstHost; rv = aFirstURI->GetAsciiHost(firstHost); NS_ENSURE_SUCCESS(rv, rv); diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp index 8e0f53d24734..13fad6edfb84 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp +++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp @@ -209,7 +209,7 @@ NS_IMETHODIMP nsAutoConfig::Observe(nsISupports *aSubject, nsresult nsAutoConfig::downloadAutoConfig() { nsresult rv; - nsCAutoString emailAddr; + nsAutoCString emailAddr; nsXPIDLCString urlName; static bool firstTime = true; diff --git a/extensions/pref/autoconfig/src/nsLDAPSyncQuery.cpp b/extensions/pref/autoconfig/src/nsLDAPSyncQuery.cpp index a04c40b89bbf..6f4f384aaa08 100644 --- a/extensions/pref/autoconfig/src/nsLDAPSyncQuery.cpp +++ b/extensions/pref/autoconfig/src/nsLDAPSyncQuery.cpp @@ -273,7 +273,7 @@ nsLDAPSyncQuery::StartLDAPSearch() // get the search filter associated with the directory server url; // - nsCAutoString urlFilter; + nsAutoCString urlFilter; rv = mServerURL->GetFilter(urlFilter); if (NS_FAILED(rv)) { FinishLDAPQuery(); @@ -282,7 +282,7 @@ nsLDAPSyncQuery::StartLDAPSearch() // get the base dn to search // - nsCAutoString dn; + nsAutoCString dn; rv = mServerURL->GetDn(dn); if (NS_FAILED(rv)) { FinishLDAPQuery(); diff --git a/extensions/pref/autoconfig/src/nsReadConfig.cpp b/extensions/pref/autoconfig/src/nsReadConfig.cpp index 90b94ce80294..49af8ad12c65 100644 --- a/extensions/pref/autoconfig/src/nsReadConfig.cpp +++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp @@ -260,7 +260,7 @@ nsresult nsReadConfig::openAndEvaluateJSFile(const char *aFileName, int32_t obsc if (NS_FAILED(rv)) return rv; - nsCAutoString location("resource://gre/defaults/autoconfig/"); + nsAutoCString location("resource://gre/defaults/autoconfig/"); location += aFileName; nsCOMPtr uri; diff --git a/extensions/spellcheck/hunspell/src/mozHunspell.cpp b/extensions/spellcheck/hunspell/src/mozHunspell.cpp index fa9efc23ee1f..0e9ff38eec5e 100644 --- a/extensions/spellcheck/hunspell/src/mozHunspell.cpp +++ b/extensions/spellcheck/hunspell/src/mozHunspell.cpp @@ -184,7 +184,7 @@ NS_IMETHODIMP mozHunspell::SetDictionary(const PRUnichar *aDictionary) if (!affFile) return NS_ERROR_FILE_NOT_FOUND; - nsCAutoString dictFileName, affFileName; + nsAutoCString dictFileName, affFileName; // XXX This isn't really good. nsIFile->NativePath isn't safe for all // character sets on Windows. diff --git a/extensions/spellcheck/src/mozPersonalDictionary.cpp b/extensions/spellcheck/src/mozPersonalDictionary.cpp index 0feaa02da4e8..b0e4ebd7dc96 100644 --- a/extensions/spellcheck/src/mozPersonalDictionary.cpp +++ b/extensions/spellcheck/src/mozPersonalDictionary.cpp @@ -166,7 +166,7 @@ NS_IMETHODIMP mozPersonalDictionary::Save() mDictionaryTable.EnumerateEntries(AddHostToStringArray, &array); uint32_t bytesWritten; - nsCAutoString utf8Key; + nsAutoCString utf8Key; for (uint32_t i = 0; i < array.Length(); ++i ) { CopyUTF16toUTF8(array[i], utf8Key); diff --git a/extensions/widgetutils/src/nsWidgetUtils.cpp b/extensions/widgetutils/src/nsWidgetUtils.cpp index a8b6d5027917..1670cc1acf18 100644 --- a/extensions/widgetutils/src/nsWidgetUtils.cpp +++ b/extensions/widgetutils/src/nsWidgetUtils.cpp @@ -277,9 +277,9 @@ nsWidgetUtils::ShouldLoad(uint32_t aContentType, if (!aContentLocation) return NS_OK; - nsCAutoString scheme; + nsAutoCString scheme; rv = aContentLocation->GetScheme(scheme); - nsCAutoString lscheme; + nsAutoCString lscheme; ToLowerCase(scheme, lscheme); if (!lscheme.EqualsLiteral("ftp") && !lscheme.EqualsLiteral("http") && diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index ac882822c6c2..810b29522d89 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -2890,7 +2890,7 @@ GLContext::UseBlitProgram() NS_ASSERTION(success, "Shader compilation failed!"); if (!success) { - nsCAutoString log; + nsAutoCString log; fGetShaderiv(shaders[i], LOCAL_GL_INFO_LOG_LENGTH, (GLint*) &len); log.SetCapacity(len); fGetShaderInfoLog(shaders[i], len, (GLint*) &len, (char*) log.BeginWriting()); @@ -2914,7 +2914,7 @@ GLContext::UseBlitProgram() NS_ASSERTION(success, "Shader linking failed!"); if (!success) { - nsCAutoString log; + nsAutoCString log; fGetProgramiv(mBlitProgram, LOCAL_GL_INFO_LOG_LENGTH, (GLint*) &len); log.SetCapacity(len); fGetProgramInfoLog(mBlitProgram, len, (GLint*) &len, (char*) log.BeginWriting()); @@ -2944,7 +2944,7 @@ GLContext::SetBlitFramebufferForDestTexture(GLuint aTexture) GLenum result = fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); if (aTexture && (result != LOCAL_GL_FRAMEBUFFER_COMPLETE)) { - nsCAutoString msg; + nsAutoCString msg; msg.Append("Framebuffer not complete -- error 0x"); msg.AppendInt(result, 16); // Note: if you are hitting this, it is likely that diff --git a/gfx/gl/GLContextProviderCGL.mm b/gfx/gl/GLContextProviderCGL.mm index 797b57549aa2..ff0b53c09ea3 100644 --- a/gfx/gl/GLContextProviderCGL.mm +++ b/gfx/gl/GLContextProviderCGL.mm @@ -339,7 +339,7 @@ protected: mGLContext->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, 0); if (!data) { - nsCAutoString failure; + nsAutoCString failure; failure += "Pixel buffer binding failed: "; failure.AppendPrintf("%dx%d\n", size.width, size.height); gfx::LogFailure(failure); diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index dc0fdc00861b..e7320ba193a0 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -44,7 +44,7 @@ static PRLibrary* LoadApitraceLibrary() // The firefox process can't write to /data/local, but it can write // to $GRE_HOME/ - nsCAutoString logPath; + nsAutoCString logPath; logPath.AppendPrintf("%s/%s", getenv("GRE_HOME"), logFile.get()); // apitrace uses the TRACE_FILE environment variable to determine where diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 2a33ce94f986..975f005a2ce7 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -884,13 +884,13 @@ Layer::Dump(FILE* aFile, const char* aPrefix, bool aDumpHtml) } if (Layer* mask = GetMaskLayer()) { - nsCAutoString pfx(aPrefix); + nsAutoCString pfx(aPrefix); pfx += " Mask layer: "; mask->Dump(aFile, pfx.get()); } if (Layer* kid = GetFirstChild()) { - nsCAutoString pfx(aPrefix); + nsAutoCString pfx(aPrefix); pfx += " "; if (aDumpHtml) { fprintf(aFile, "
    "); @@ -911,7 +911,7 @@ Layer::Dump(FILE* aFile, const char* aPrefix, bool aDumpHtml) void Layer::DumpSelf(FILE* aFile, const char* aPrefix) { - nsCAutoString str; + nsAutoCString str; PrintInfo(str, aPrefix); fprintf(FILEOrDefault(aFile), "%s\n", str.get()); } @@ -925,7 +925,7 @@ Layer::Log(const char* aPrefix) LogSelf(aPrefix); if (Layer* kid = GetFirstChild()) { - nsCAutoString pfx(aPrefix); + nsAutoCString pfx(aPrefix); pfx += " "; kid->Log(pfx.get()); } @@ -940,7 +940,7 @@ Layer::LogSelf(const char* aPrefix) if (!IsLogEnabled()) return; - nsCAutoString str; + nsAutoCString str; PrintInfo(str, aPrefix); MOZ_LAYERS_LOG(("%s", str.get())); } @@ -1083,7 +1083,7 @@ LayerManager::Dump(FILE* aFile, const char* aPrefix, bool aDumpHtml) } #endif - nsCAutoString pfx(aPrefix); + nsAutoCString pfx(aPrefix); pfx += " "; if (!GetRoot()) { fprintf(file, "%s(null)", pfx.get()); @@ -1106,7 +1106,7 @@ LayerManager::Dump(FILE* aFile, const char* aPrefix, bool aDumpHtml) void LayerManager::DumpSelf(FILE* aFile, const char* aPrefix) { - nsCAutoString str; + nsAutoCString str; PrintInfo(str, aPrefix); fprintf(FILEOrDefault(aFile), "%s\n", str.get()); } @@ -1119,7 +1119,7 @@ LayerManager::Log(const char* aPrefix) LogSelf(aPrefix); - nsCAutoString pfx(aPrefix); + nsAutoCString pfx(aPrefix); pfx += " "; if (!GetRoot()) { MOZ_LAYERS_LOG(("%s(null)", pfx.get())); @@ -1132,7 +1132,7 @@ LayerManager::Log(const char* aPrefix) void LayerManager::LogSelf(const char* aPrefix) { - nsCAutoString str; + nsAutoCString str; PrintInfo(str, aPrefix); MOZ_LAYERS_LOG(("%s", str.get())); } diff --git a/gfx/layers/opengl/LayerManagerOGL.cpp b/gfx/layers/opengl/LayerManagerOGL.cpp index 5a242330172e..a70fbd162825 100644 --- a/gfx/layers/opengl/LayerManagerOGL.cpp +++ b/gfx/layers/opengl/LayerManagerOGL.cpp @@ -1094,7 +1094,7 @@ LayerManagerOGL::SetupBackBuffer(int aWidth, int aHeight) GLenum result = mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) { - nsCAutoString msg; + nsAutoCString msg; msg.Append("Framebuffer not complete -- error 0x"); msg.AppendInt(result, 16); NS_RUNTIMEABORT(msg.get()); @@ -1257,7 +1257,7 @@ LayerManagerOGL::CreateFBOWithTexture(const nsIntRect& aRect, InitMode aInit, // PowerVR. See bug 695246. GLenum result = mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) { - nsCAutoString msg; + nsAutoCString msg; msg.Append("Framebuffer not complete -- error 0x"); msg.AppendInt(result, 16); msg.Append(", mFBOTextureTarget 0x"); diff --git a/gfx/layers/opengl/LayerManagerOGLProgram.cpp b/gfx/layers/opengl/LayerManagerOGLProgram.cpp index 5a4a4ad41763..155b28870693 100644 --- a/gfx/layers/opengl/LayerManagerOGLProgram.cpp +++ b/gfx/layers/opengl/LayerManagerOGLProgram.cpp @@ -279,7 +279,7 @@ ShaderProgramOGL::CreateShader(GLenum aShaderType, const char *aShaderSource) #endif ) { - nsCAutoString log; + nsAutoCString log; log.SetCapacity(len); mGL->fGetShaderInfoLog(sh, len, (GLint*) &len, (char*) log.BeginWriting()); log.SetLength(len); @@ -332,7 +332,7 @@ ShaderProgramOGL::CreateProgram(const char *aVertexShaderString, #endif ) { - nsCAutoString log; + nsAutoCString log; log.SetCapacity(len); mGL->fGetProgramInfoLog(result, len, (GLint*) &len, (char*) log.BeginWriting()); log.SetLength(len); diff --git a/gfx/src/gfxCrashReporterUtils.cpp b/gfx/src/gfxCrashReporterUtils.cpp index 73c0abb1a26f..c9d9209ceb0a 100644 --- a/gfx/src/gfxCrashReporterUtils.cpp +++ b/gfx/src/gfxCrashReporterUtils.cpp @@ -75,7 +75,7 @@ public: gFeaturesAlreadyReported = new nsTArray; } - nsCAutoString featureString; + nsAutoCString featureString; featureString.AppendPrintf("%s%c ", mFeature, mStatusChar); diff --git a/gfx/src/nsColor.cpp b/gfx/src/nsColor.cpp index 36729220159e..8246bfefdb7b 100644 --- a/gfx/src/nsColor.cpp +++ b/gfx/src/nsColor.cpp @@ -48,8 +48,8 @@ void nsColorNames::AddRefTable(void) { // let's verify the table... for (uint32_t index = 0; index < eColorName_COUNT; ++index) { - nsCAutoString temp1(kColorNames[index]); - nsCAutoString temp2(kColorNames[index]); + nsAutoCString temp1(kColorNames[index]); + nsAutoCString temp2(kColorNames[index]); ToLowerCase(temp1); NS_ASSERTION(temp1.Equals(temp2), "upper case char in table"); } diff --git a/gfx/src/nsThebesFontEnumerator.cpp b/gfx/src/nsThebesFontEnumerator.cpp index ba51f7760262..f81e1e2e711d 100644 --- a/gfx/src/nsThebesFontEnumerator.cpp +++ b/gfx/src/nsThebesFontEnumerator.cpp @@ -35,7 +35,7 @@ nsThebesFontEnumerator::EnumerateFonts(const char *aLangGroup, nsTArray fontList; - nsCAutoString generic; + nsAutoCString generic; if (aGeneric) generic.Assign(aGeneric); else @@ -43,7 +43,7 @@ nsThebesFontEnumerator::EnumerateFonts(const char *aLangGroup, nsCOMPtr langGroupAtom; if (aLangGroup) { - nsCAutoString lowered; + nsAutoCString lowered; lowered.Assign(aLangGroup); ToLowerCase(lowered); langGroupAtom = do_GetAtom(lowered); diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index 53fd2f3358d6..75de1cda9888 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -475,7 +475,7 @@ public: return; } - nsCAutoString buf; + nsAutoCString buf; PL_DHashTableEnumerate(&mMap, WriteOutMap, &buf); PL_DHashTableFinish(&mMap); mCache->PutBuffer(CACHE_KEY, buf.get(), buf.Length() + 1); @@ -596,7 +596,7 @@ private: return PL_DHASH_NEXT; } - nsCAutoString* buf = reinterpret_cast(aData); + nsAutoCString* buf = reinterpret_cast(aData); buf->Append(entry->mFilename); buf->Append(';'); buf->Append(entry->mFaces); diff --git a/gfx/thebes/gfxFT2Fonts.cpp b/gfx/thebes/gfxFT2Fonts.cpp index 2c68e5d5edb0..da5d3c866067 100644 --- a/gfx/thebes/gfxFT2Fonts.cpp +++ b/gfx/thebes/gfxFT2Fonts.cpp @@ -202,7 +202,7 @@ void gfxFT2FontGroup::GetPrefFonts(nsIAtom *aLangGroup, nsTArray, 5> fonts; - nsCAutoString key; + nsAutoCString key; aLangGroup->ToUTF8String(key); key.Append("-"); key.AppendInt(GetStyle()->style); @@ -234,7 +234,7 @@ static int32_t GetCJKLangGroupIndex(const char *aLangGroup) { void gfxFT2FontGroup::GetCJKPrefFonts(nsTArray >& aFontEntryList) { gfxToolkitPlatform *platform = gfxToolkitPlatform::GetPlatform(); - nsCAutoString key("x-internal-cjk-"); + nsAutoCString key("x-internal-cjk-"); key.AppendInt(mStyle.style); key.Append("-"); key.AppendInt(mStyle.weight); @@ -258,7 +258,7 @@ void gfxFT2FontGroup::GetCJKPrefFonts(nsTArray >& aFontEn const char *start = p; while (++p != p_end && *p != kComma) /* nothing */ ; - nsCAutoString lang(Substring(start, p)); + nsAutoCString lang(Substring(start, p)); lang.CompressWhitespace(false, true); int32_t index = GetCJKLangGroupIndex(lang.get()); if (index >= 0) { diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 5dac3e1b62ab..ed340cb910f0 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -3148,7 +3148,7 @@ gfxFontGroup::ForEachFontInternal(const nsAString& aFamilies, const PRUnichar kComma = PRUnichar(','); nsIAtom *groupAtom = nullptr; - nsCAutoString groupString; + nsAutoCString groupString; if (aLanguage) { if (!gLangService) { CallGetService(NS_LANGUAGEATOMSERVICE_CONTRACTID, &gLangService); @@ -3168,7 +3168,7 @@ gfxFontGroup::ForEachFontInternal(const nsAString& aFamilies, families.BeginReading(p); families.EndReading(p_end); nsAutoString family; - nsCAutoString lcFamily; + nsAutoCString lcFamily; nsAutoString genericFamily; while (p < p_end) { @@ -3216,7 +3216,7 @@ gfxFontGroup::ForEachFontInternal(const nsAString& aFamilies, ToLowerCase(NS_LossyConvertUTF16toASCII(family), lcFamily); - nsCAutoString prefName("font.name."); + nsAutoCString prefName("font.name."); prefName.Append(lcFamily); prefName.AppendLiteral("."); prefName.Append(groupString); @@ -3270,7 +3270,7 @@ gfxFontGroup::ForEachFontInternal(const nsAString& aFamilies, } if (generic && aResolveGeneric) { - nsCAutoString prefName("font.name-list."); + nsAutoCString prefName("font.name-list."); prefName.Append(lcFamily); prefName.AppendLiteral("."); prefName.Append(groupString); @@ -3476,7 +3476,7 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, #ifdef PR_LOGGING if (NS_UNLIKELY(log)) { - nsCAutoString lang; + nsAutoCString lang; mStyle.language->ToUTF8String(lang); uint32_t runLen = runLimit - runStart; PR_LOG(log, PR_LOG_WARNING,\ @@ -5634,7 +5634,7 @@ gfxTextRun::Dump(FILE* aOutput) { gfxFont* font = mGlyphRuns[i].mFont; const gfxFontStyle* style = font->GetStyle(); NS_ConvertUTF16toUTF8 fontName(font->GetName()); - nsCAutoString lang; + nsAutoCString lang; style->language->ToUTF8String(lang); fprintf(aOutput, "%d: %s %f/%d/%d/%s", mGlyphRuns[i].mCharacterOffset, fontName.get(), style->size, diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 754fdc48c1f2..6236ad5559bb 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -1778,7 +1778,7 @@ public: // then we convert the text to an 8-bit version and call the 8-bit // Create function instead. if (aFlags & gfxTextRunFactory::TEXT_IS_8BIT) { - nsCAutoString narrowText; + nsAutoCString narrowText; LossyAppendUTF16toASCII(nsDependentSubstring(aText, aLength), narrowText); return Create((const uint8_t*)(narrowText.BeginReading()), diff --git a/gfx/thebes/gfxFontconfigUtils.cpp b/gfx/thebes/gfxFontconfigUtils.cpp index 5d7c4d23ee4a..7888308e339f 100644 --- a/gfx/thebes/gfxFontconfigUtils.cpp +++ b/gfx/thebes/gfxFontconfigUtils.cpp @@ -249,7 +249,7 @@ static void AddLangGroup(FcPattern *aPattern, nsIAtom *aLangGroup) { // Translate from mozilla's internal mapping into fontconfig's - nsCAutoString lang; + nsAutoCString lang; gfxFontconfigUtils::GetSampleLangForGroup(aLangGroup, &lang); if (!lang.IsEmpty()) { @@ -528,7 +528,7 @@ gfxFontconfigUtils::GetFontListInternal(nsTArray& aListOfFonts, } // Remove duplicates... - nsCAutoString strFamily(family); + nsAutoCString strFamily(family); if (aListOfFonts.Contains(strFamily)) continue; @@ -635,7 +635,7 @@ gfxFontconfigUtils::UpdateFontListInternal(bool aForce) const char *start = p; while (++p != p_end && *p != kComma) /* nothing */ ; - nsCAutoString name(Substring(start, p)); + nsAutoCString name(Substring(start, p)); name.CompressWhitespace(false, true); mAliasForMultiFonts.AppendElement(name); p++; @@ -835,7 +835,7 @@ gfxFontconfigUtils::FontsByFullnameEntry::KeyEquals(KeyTypePointer aKey) const { const FcChar8 *key = mKey; // If mKey is NULL, key comes from the style and family of the first font. - nsCAutoString fullname; + nsAutoCString fullname; if (!key) { NS_ASSERTION(mFonts.Length(), "No font in FontsByFullnameEntry!"); GetFullnameFromFamilyAndStyle(mFonts[0], &fullname); @@ -881,7 +881,7 @@ gfxFontconfigUtils::AddFullnameEntries() // Fontconfig does not provide a fullname property for all fonts. if (v == 0) { - nsCAutoString name; + nsAutoCString name; if (!GetFullnameFromFamilyAndStyle(font, &name)) continue; diff --git a/gfx/thebes/gfxGraphiteShaper.cpp b/gfx/thebes/gfxGraphiteShaper.cpp index 937eda29aea4..a0f5d3057a06 100644 --- a/gfx/thebes/gfxGraphiteShaper.cpp +++ b/gfx/thebes/gfxGraphiteShaper.cpp @@ -176,7 +176,7 @@ gfxGraphiteShaper::ShapeWord(gfxContext *aContext, } else if (entry->mLanguageOverride) { grLang = MakeGraphiteLangTag(entry->mLanguageOverride); } else { - nsCAutoString langString; + nsAutoCString langString; style->language->ToUTF8String(langString); grLang = GetGraphiteTagForLang(langString); } diff --git a/gfx/thebes/gfxOS2Fonts.cpp b/gfx/thebes/gfxOS2Fonts.cpp index 7f5c4421ea4b..566ee46a65cb 100644 --- a/gfx/thebes/gfxOS2Fonts.cpp +++ b/gfx/thebes/gfxOS2Fonts.cpp @@ -565,7 +565,7 @@ gfxTextRun *gfxOS2FontGroup::MakeTextRun(const PRUnichar* aString, uint32_t aLen mEnableKerning = !(aFlags & gfxTextRunFactory::TEXT_OPTIMIZE_SPEED); - nsCAutoString utf8; + nsAutoCString utf8; int32_t headerLen = AppendDirectionalIndicatorUTF8(textRun->IsRightToLeft(), utf8); AppendUTF16toUTF8(Substring(aString, aString + aLength), utf8); @@ -610,7 +610,7 @@ gfxTextRun *gfxOS2FontGroup::MakeTextRun(const uint8_t* aString, uint32_t aLengt // bytes of any UCS-2 characters < 256), NS_ConvertASCIItoUTF16 seems // to DTRT. NS_ConvertASCIItoUTF16 unicodeString(chars, aLength); - nsCAutoString utf8; + nsAutoCString utf8; int32_t headerLen = AppendDirectionalIndicatorUTF8(isRTL, utf8); AppendUTF16toUTF8(unicodeString, utf8); InitTextRun(textRun, (uint8_t *)utf8.get(), utf8.Length(), headerLen); diff --git a/gfx/thebes/gfxOS2Platform.cpp b/gfx/thebes/gfxOS2Platform.cpp index c544099f5f86..f8eee640ae28 100644 --- a/gfx/thebes/gfxOS2Platform.cpp +++ b/gfx/thebes/gfxOS2Platform.cpp @@ -153,7 +153,7 @@ gfxOS2Platform::FindFontForChar(uint32_t aCh, gfxOS2Font *aFont) // just continue to append all fonts known to the system nsTArray fontList; - nsCAutoString generic; + nsAutoCString generic; nsresult rv = GetFontList(aFont->GetStyle()->language, generic, fontList); if (NS_SUCCEEDED(rv)) { // start at 3 to skip over the generic entries diff --git a/gfx/thebes/gfxPangoFonts.cpp b/gfx/thebes/gfxPangoFonts.cpp index c94a29933a12..2b023ed3a0cb 100644 --- a/gfx/thebes/gfxPangoFonts.cpp +++ b/gfx/thebes/gfxPangoFonts.cpp @@ -451,7 +451,7 @@ gfxUserFcFontEntry::AdjustPatternToCSS(FcPattern *aPattern) FcChar8 *unused; if (FcPatternGetString(aPattern, FC_FULLNAME, 0, &unused) == FcResultNoMatch) { - nsCAutoString fullname; + nsAutoCString fullname; if (gfxFontconfigUtils::GetFullnameFromFamilyAndStyle(aPattern, &fullname)) { FcPatternAddString(aPattern, FC_FULLNAME, @@ -459,7 +459,7 @@ gfxUserFcFontEntry::AdjustPatternToCSS(FcPattern *aPattern) } } - nsCAutoString family; + nsAutoCString family; family.Append(FONT_FACE_FAMILY_PREFIX); AppendUTF16toUTF8(Name(), family); @@ -3137,7 +3137,7 @@ GuessPangoLanguage(nsIAtom *aLanguage) // Pango and fontconfig won't understand mozilla's internal langGroups, so // find a real language. - nsCAutoString lang; + nsAutoCString lang; gfxFontconfigUtils::GetSampleLangForGroup(aLanguage, &lang); if (lang.IsEmpty()) return NULL; diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 7e7e4bf13296..582dd3ca4887 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -842,11 +842,11 @@ AppendGenericFontFromPref(nsString& aFonts, nsIAtom *aLangGroup, const char *aGe { NS_ENSURE_TRUE(Preferences::GetRootBranch(), ); - nsCAutoString prefName, langGroupString; + nsAutoCString prefName, langGroupString; aLangGroup->ToUTF8String(langGroupString); - nsCAutoString genericDotLang; + nsAutoCString genericDotLang; if (aGenericName) { genericDotLang.Assign(aGenericName); } else { @@ -899,7 +899,7 @@ bool gfxPlatform::ForEachPrefFont(eFontPrefLang aLangArray[], uint32_t aLangArra eFontPrefLang prefLang = aLangArray[i]; const char *langGroup = GetPrefLangName(prefLang); - nsCAutoString prefName; + nsAutoCString prefName; prefName.AssignLiteral("font.default."); prefName.Append(langGroup); @@ -924,7 +924,7 @@ bool gfxPlatform::ForEachPrefFont(eFontPrefLang aLangArray[], uint32_t aLangArra if (nameListValue && !nameListValue.Equals(nameValue)) { const char kComma = ','; const char *p, *p_end; - nsCAutoString list(nameListValue); + nsAutoCString list(nameListValue); list.BeginReading(p); list.EndReading(p_end); while (p < p_end) { @@ -937,7 +937,7 @@ bool gfxPlatform::ForEachPrefFont(eFontPrefLang aLangArray[], uint32_t aLangArra const char *start = p; while (++p != p_end && *p != kComma) /* nothing */ ; - nsCAutoString fontName(Substring(start, p)); + nsAutoCString fontName(Substring(start, p)); fontName.CompressWhitespace(false, true); if (!aCallback(prefLang, NS_ConvertUTF8toUTF16(fontName), aClosure)) return false; @@ -966,7 +966,7 @@ gfxPlatform::GetFontPrefLangFor(nsIAtom *aLang) { if (!aLang) return eFontPrefLang_Others; - nsCAutoString lang; + nsAutoCString lang; aLang->ToUTF8String(lang); return GetFontPrefLangFor(lang.get()); } @@ -1076,7 +1076,7 @@ gfxPlatform::AppendCJKPrefLangs(eFontPrefLang aPrefLangs[], uint32_t &aLen, eFon const char *start = p; while (++p != p_end && *p != kComma) /* nothing */ ; - nsCAutoString lang(Substring(start, p)); + nsAutoCString lang(Substring(start, p)); lang.CompressWhitespace(false, true); eFontPrefLang fpl = gfxPlatform::GetFontPrefLangFor(lang.get()); switch (fpl) { diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index d930ac934ec3..7da29d8c3e9b 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -371,7 +371,7 @@ gfxPlatformGtk::ResolveFontName(const nsAString& aFontName, return NS_OK; } - nsCAutoString utf8Name = NS_ConvertUTF16toUTF8(aFontName); + nsAutoCString utf8Name = NS_ConvertUTF16toUTF8(aFontName); FcPattern *npat = FcPatternCreate(); FcPatternAddString(npat, FC_FAMILY, (FcChar8*)utf8Name.get()); diff --git a/gfx/thebes/gfxQtPlatform.cpp b/gfx/thebes/gfxQtPlatform.cpp index 758b3b2ac9e8..1331caf59eca 100644 --- a/gfx/thebes/gfxQtPlatform.cpp +++ b/gfx/thebes/gfxQtPlatform.cpp @@ -378,7 +378,7 @@ gfxQtPlatform::ResolveFontName(const nsAString& aFontName, return NS_OK; } - nsCAutoString utf8Name = NS_ConvertUTF16toUTF8(aFontName); + nsAutoCString utf8Name = NS_ConvertUTF16toUTF8(aFontName); FcPattern *npat = FcPatternCreate(); FcPatternAddString(npat, FC_FAMILY, (FcChar8*)utf8Name.get()); diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 020c35a41254..0059d7c86b53 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -582,7 +582,7 @@ gfxUserFontSet::LoadNext(gfxProxyFontEntry *aProxyEntry) if (loadOK) { #ifdef PR_LOGGING if (LOG_ENABLED()) { - nsCAutoString fontURI; + nsAutoCString fontURI; currSrc.mURI->GetSpec(fontURI); LOG(("userfonts (%p) [src %d] loading uri: (%s) for (%s)\n", this, aProxyEntry->mSrcIndex, fontURI.get(), @@ -737,7 +737,7 @@ gfxUserFontSet::LoadFont(gfxProxyFontEntry *aProxy, // must do this before ReplaceFontEntry() because that will // clear the proxy's mFamily pointer! if (LOG_ENABLED()) { - nsCAutoString fontURI; + nsAutoCString fontURI; aProxy->mSrcList[aProxy->mSrcIndex].mURI->GetSpec(fontURI); LOG(("userfonts (%p) [src %d] loaded uri: (%s) for (%s) gen: %8.8x\n", this, aProxy->mSrcIndex, fontURI.get(), @@ -749,7 +749,7 @@ gfxUserFontSet::LoadFont(gfxProxyFontEntry *aProxy, } else { #ifdef PR_LOGGING if (LOG_ENABLED()) { - nsCAutoString fontURI; + nsAutoCString fontURI; aProxy->mSrcList[aProxy->mSrcIndex].mURI->GetSpec(fontURI); LOG(("userfonts (%p) [src %d] failed uri: (%s) for (%s)" " error making platform font\n", diff --git a/image/decoders/icon/android/nsIconChannel.cpp b/image/decoders/icon/android/nsIconChannel.cpp index 45ae987b9e4d..e269d379c301 100644 --- a/image/decoders/icon/android/nsIconChannel.cpp +++ b/image/decoders/icon/android/nsIconChannel.cpp @@ -111,13 +111,13 @@ nsIconChannel::Init(nsIURI* aURI) nsCOMPtr iconURI = do_QueryInterface(aURI); NS_ASSERTION(iconURI, "URI is not an nsIMozIconURI"); - nsCAutoString stockIcon; + nsAutoCString stockIcon; iconURI->GetStockIcon(stockIcon); uint32_t desiredImageSize; iconURI->GetImageSize(&desiredImageSize); - nsCAutoString iconFileExt; + nsAutoCString iconFileExt; iconURI->GetFileExtension(iconFileExt); return moz_icon_to_channel(iconURI, iconFileExt, desiredImageSize, getter_AddRefs(mRealChannel)); diff --git a/image/decoders/icon/gtk/nsIconChannel.cpp b/image/decoders/icon/gtk/nsIconChannel.cpp index a05568c8f9bb..e0fea87bd4d6 100644 --- a/image/decoders/icon/gtk/nsIconChannel.cpp +++ b/image/decoders/icon/gtk/nsIconChannel.cpp @@ -254,7 +254,7 @@ moz_gtk_icon_size(const char *name) static int32_t GetIconSize(nsIMozIconURI *aIconURI) { - nsCAutoString iconSizeString; + nsAutoCString iconSizeString; aIconURI->GetIconSize(iconSizeString); if (iconSizeString.IsEmpty()) { @@ -330,13 +330,13 @@ nsIconChannel::InitWithGnome(nsIMozIconURI *aIconURI) } uint32_t iconSize = GetIconSize(aIconURI); - nsCAutoString type; + nsAutoCString type; aIconURI->GetContentType(type); GnomeVFSFileInfo fileInfo = {0}; fileInfo.refcount = 1; // In case some GnomeVFS function addrefs and releases it - nsCAutoString spec; + nsAutoCString spec; nsCOMPtr url; rv = aIconURI->GetIconURL(getter_AddRefs(url)); if (url) { @@ -353,7 +353,7 @@ nsIconChannel::InitWithGnome(nsIMozIconURI *aIconURI) // "Whenever we can detect the charset used for the URI type we try to // convert it to/from utf8 automatically inside gnome-vfs." // I'll interpret that as "otherwise, this field is random junk". - nsCAutoString name; + nsAutoCString name; url->GetFileName(name); fileInfo.name = g_strdup(name.get()); @@ -367,7 +367,7 @@ nsIconChannel::InitWithGnome(nsIMozIconURI *aIconURI) if (type.IsEmpty()) { nsCOMPtr ms(do_GetService("@mozilla.org/mime;1")); if (ms) { - nsCAutoString fileExt; + nsAutoCString fileExt; aIconURI->GetFileExtension(fileExt); if (!fileExt.IsEmpty()) { ms->GetTypeFromExtension(fileExt, type); @@ -435,7 +435,7 @@ nsIconChannel::InitWithGIO(nsIMozIconURI *aIconURI) // Get icon for file specified by URI if (fileURI) { bool isFile; - nsCAutoString spec; + nsAutoCString spec; fileURI->GetAsciiSpec(spec); if (NS_SUCCEEDED(fileURI->SchemeIs("file", &isFile)) && isFile) { GFile *file = g_file_new_for_uri(spec.get()); @@ -455,13 +455,13 @@ nsIconChannel::InitWithGIO(nsIMozIconURI *aIconURI) // Try to get icon by using MIME type if (!icon) { - nsCAutoString type; + nsAutoCString type; aIconURI->GetContentType(type); // Try to get MIME type from file extension by using nsIMIMEService if (type.IsEmpty()) { nsCOMPtr ms(do_GetService("@mozilla.org/mime;1")); if (ms) { - nsCAutoString fileExt; + nsAutoCString fileExt; aIconURI->GetFileExtension(fileExt); ms->GetTypeFromExtension(fileExt, type); } @@ -525,7 +525,7 @@ nsIconChannel::Init(nsIURI* aURI) nsCOMPtr iconURI = do_QueryInterface(aURI); NS_ASSERTION(iconURI, "URI is not an nsIMozIconURI"); - nsCAutoString stockIcon; + nsAutoCString stockIcon; iconURI->GetStockIcon(stockIcon); if (stockIcon.IsEmpty()) { #ifdef MOZ_ENABLE_GNOMEUI @@ -540,10 +540,10 @@ nsIconChannel::Init(nsIURI* aURI) } // Search for stockIcon - nsCAutoString iconSizeString; + nsAutoCString iconSizeString; iconURI->GetIconSize(iconSizeString); - nsCAutoString iconStateString; + nsAutoCString iconStateString; iconURI->GetIconState(iconStateString); GtkIconSize icon_size = moz_gtk_icon_size(iconSizeString.get()); @@ -559,7 +559,7 @@ nsIconChannel::Init(nsIURI* aURI) } bool forceDirection = direction != GTK_TEXT_DIR_NONE; - nsCAutoString stockID; + nsAutoCString stockID; bool useIconName = false; if (!forceDirection) { direction = gtk_widget_get_default_direction(); diff --git a/image/decoders/icon/mac/nsIconChannelCocoa.mm b/image/decoders/icon/mac/nsIconChannelCocoa.mm index 7d5188561796..e54b2001c7ff 100644 --- a/image/decoders/icon/mac/nsIconChannelCocoa.mm +++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm @@ -204,7 +204,7 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool nonBlocki NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; nsXPIDLCString contentType; - nsCAutoString fileExt; + nsAutoCString fileExt; nsCOMPtr fileloc; // file we want an icon for uint32_t desiredImageSize; nsresult rv = ExtractIconInfoFromUrl(getter_AddRefs(fileloc), &desiredImageSize, contentType, fileExt); diff --git a/image/decoders/icon/nsIconURI.cpp b/image/decoders/icon/nsIconURI.cpp index a79cfe85d2b7..a229ae3441c9 100644 --- a/image/decoders/icon/nsIconURI.cpp +++ b/image/decoders/icon/nsIconURI.cpp @@ -74,7 +74,7 @@ nsMozIconURI::GetSpec(nsACString &aSpec) if (mIconURL) { - nsCAutoString fileIconSpec; + nsAutoCString fileIconSpec; nsresult rv = mIconURL->GetSpec(fileIconSpec); NS_ENSURE_SUCCESS(rv, rv); aSpec += fileIconSpec; @@ -172,7 +172,7 @@ nsMozIconURI::SetSpec(const nsACString &aSpec) mIconSize = -1; mIconState = -1; - nsCAutoString iconSpec(aSpec); + nsAutoCString iconSpec(aSpec); if (!Substring(iconSpec, 0, MOZICON_SCHEME_LEN).EqualsLiteral(MOZICON_SCHEME)) return NS_ERROR_MALFORMED_URI; @@ -181,7 +181,7 @@ nsMozIconURI::SetSpec(const nsACString &aSpec) { extractAttributeValue(iconSpec.get(), "contentType=", mContentType); - nsCAutoString sizeString; + nsAutoCString sizeString; extractAttributeValue(iconSpec.get(), "size=", sizeString); if (!sizeString.IsEmpty()) { @@ -200,7 +200,7 @@ nsMozIconURI::SetSpec(const nsACString &aSpec) mSize = sizeValue; } - nsCAutoString stateString; + nsAutoCString stateString; extractAttributeValue(iconSpec.get(), "state=", stateString); if (!stateString.IsEmpty()) { @@ -222,7 +222,7 @@ nsMozIconURI::SetSpec(const nsACString &aSpec) if (pathLength < 3) return NS_ERROR_MALFORMED_URI; - nsCAutoString iconPath(Substring(iconSpec, MOZICON_SCHEME_LEN, pathLength)); + nsAutoCString iconPath(Substring(iconSpec, MOZICON_SCHEME_LEN, pathLength)); // Icon URI path can have three forms: // (1) //stock/ @@ -387,8 +387,8 @@ nsMozIconURI::Equals(nsIURI *other, bool *result) NS_ENSURE_ARG_POINTER(other); NS_PRECONDITION(result, "null pointer"); - nsCAutoString spec1; - nsCAutoString spec2; + nsAutoCString spec1; + nsAutoCString spec2; other->GetSpec(spec2); GetSpec(spec1); @@ -530,7 +530,7 @@ nsMozIconURI::GetFileExtension(nsACString &aFileExtension) // First, try to get the extension from mIconURL if we have one if (mIconURL) { - nsCAutoString fileExt; + nsAutoCString fileExt; if (NS_SUCCEEDED(mIconURL->GetFileExtension(fileExt))) { if (!fileExt.IsEmpty()) diff --git a/image/decoders/icon/os2/nsIconChannel.cpp b/image/decoders/icon/os2/nsIconChannel.cpp index 6bc69675fd6c..6d4afcb3160c 100644 --- a/image/decoders/icon/os2/nsIconChannel.cpp +++ b/image/decoders/icon/os2/nsIconChannel.cpp @@ -222,7 +222,7 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream **_retval, nsCOMPtr localFile; uint32_t desiredImageSize; nsXPIDLCString contentType; - nsCAutoString filePath; + nsAutoCString filePath; nsresult rv = ExtractIconInfoFromUrl(getter_AddRefs(localFile), &desiredImageSize, contentType, filePath); @@ -456,7 +456,7 @@ static HPOINTER GetIcon(nsCString& file, bool fExists, NS_FAILED(tempPath->AppendNative(file))) return 0; - nsCAutoString pathStr; + nsAutoCString pathStr; tempPath->GetNativePath(pathStr); FILE* fp = fopen(pathStr.get(), "wb+"); if (fp) { diff --git a/image/decoders/icon/qt/nsIconChannel.cpp b/image/decoders/icon/qt/nsIconChannel.cpp index 323caa2b616a..d8233bd3fcb9 100644 --- a/image/decoders/icon/qt/nsIconChannel.cpp +++ b/image/decoders/icon/qt/nsIconChannel.cpp @@ -94,16 +94,16 @@ nsIconChannel::Init(nsIURI* aURI) nsCOMPtr iconURI = do_QueryInterface(aURI); NS_ASSERTION(iconURI, "URI is not an nsIMozIconURI"); - nsCAutoString stockIcon; + nsAutoCString stockIcon; iconURI->GetStockIcon(stockIcon); - nsCAutoString iconSizeString; + nsAutoCString iconSizeString; iconURI->GetIconSize(iconSizeString); uint32_t desiredImageSize; iconURI->GetImageSize(&desiredImageSize); - nsCAutoString iconStateString; + nsAutoCString iconStateString; iconURI->GetIconState(iconStateString); bool disabled = iconStateString.EqualsLiteral("disabled"); diff --git a/image/decoders/icon/win/nsIconChannel.cpp b/image/decoders/icon/win/nsIconChannel.cpp index b1bf1e4f1532..ceecf06aa544 100644 --- a/image/decoders/icon/win/nsIconChannel.cpp +++ b/image/decoders/icon/win/nsIconChannel.cpp @@ -310,7 +310,7 @@ nsresult nsIconChannel::GetHIconFromFile(HICON *hIcon) nsCOMPtr mimeService (do_GetService(NS_MIMESERVICE_CONTRACTID, &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString defFileExt; + nsAutoCString defFileExt; mimeService->GetPrimaryExtension(contentType, fileExt, defFileExt); // If the mime service does not know about this mime type, we show // the generic icon. @@ -356,7 +356,7 @@ nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon) { uint32_t desiredImageSize; aIconURI->GetImageSize(&desiredImageSize); - nsCAutoString stockIcon; + nsAutoCString stockIcon; aIconURI->GetStockIcon(stockIcon); SHSTOCKICONID stockIconID = GetStockIconIDForName(stockIcon); @@ -461,7 +461,7 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool nonBlocki nsCOMPtr iconURI(do_QueryInterface(mUrl, &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString stockIcon; + nsAutoCString stockIcon; iconURI->GetStockIcon(stockIcon); if (!stockIcon.IsEmpty()) rv = GetStockHIcon(iconURI, &hIcon); diff --git a/image/encoders/png/nsPNGEncoder.cpp b/image/encoders/png/nsPNGEncoder.cpp index 4423ecb49fcf..e90f07fb9c22 100644 --- a/image/encoders/png/nsPNGEncoder.cpp +++ b/image/encoders/png/nsPNGEncoder.cpp @@ -346,7 +346,7 @@ nsPNGEncoder::ParseOptions(const nsAString& aOptions, { #ifdef PNG_APNG_SUPPORTED // Make a copy of aOptions, because strtok() will modify it. - nsCAutoString optionsCopy; + nsAutoCString optionsCopy; optionsCopy.Assign(NS_ConvertUTF16toUTF8(aOptions)); char* options = optionsCopy.BeginWriting(); diff --git a/image/public/ImageLogging.h b/image/public/ImageLogging.h index 1211ea849357..ef13cafba55c 100644 --- a/image/public/ImageLogging.h +++ b/image/public/ImageLogging.h @@ -95,7 +95,7 @@ public: private: PRLogModuleInfo *mLog; void *mFrom; - nsCAutoString mFunc; + nsAutoCString mFunc; }; diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index d14a40daf5f9..e1cd53277b92 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -575,7 +575,7 @@ void imgCacheEntry::SetHasNoProxies(bool hasNoProxies) #if defined(PR_LOGGING) nsCOMPtr uri; mRequest->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; if (uri) uri->GetSpec(spec); if (hasNoProxies) @@ -765,7 +765,7 @@ void imgCacheExpirationTracker::NotifyExpired(imgCacheEntry *entry) if (req) { nsCOMPtr uri; req->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); LOG_FUNC_WITH_PARAM(gImgLog, "imgCacheExpirationTracker::NotifyExpired", "entry", spec.get()); } @@ -971,7 +971,7 @@ NS_IMETHODIMP imgLoader::RemoveEntry(nsIURI *uri) NS_IMETHODIMP imgLoader::FindEntryProperties(nsIURI *uri, nsIProperties **_retval) { nsRefPtr entry; - nsCAutoString spec; + nsAutoCString spec; imgCacheTable &cache = GetCache(uri); uri->GetSpec(spec); @@ -1016,7 +1016,7 @@ bool imgLoader::PutIntoCache(nsIURI *key, imgCacheEntry *entry) { imgCacheTable &cache = GetCache(key); - nsCAutoString spec; + nsAutoCString spec; key->GetSpec(spec); LOG_STATIC_FUNC_WITH_PARAM(gImgLog, "imgLoader::PutIntoCache", "uri", spec.get()); @@ -1070,7 +1070,7 @@ bool imgLoader::PutIntoCache(nsIURI *key, imgCacheEntry *entry) bool imgLoader::SetHasNoProxies(nsIURI *key, imgCacheEntry *entry) { #if defined(PR_LOGGING) - nsCAutoString spec; + nsAutoCString spec; key->GetSpec(spec); LOG_STATIC_FUNC_WITH_PARAM(gImgLog, "imgLoader::SetHasNoProxies", "uri", spec.get()); @@ -1103,7 +1103,7 @@ bool imgLoader::SetHasProxies(nsIURI *key) imgCacheTable &cache = GetCache(key); - nsCAutoString spec; + nsAutoCString spec; key->GetSpec(spec); LOG_STATIC_FUNC_WITH_PARAM(gImgLog, "imgLoader::SetHasProxies", "uri", spec.get()); @@ -1149,7 +1149,7 @@ void imgLoader::CheckCacheLimits(imgCacheTable &cache, imgCacheQueue &queue) if (req) { nsCOMPtr uri; req->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); LOG_STATIC_FUNC_WITH_PARAM(gImgLog, "imgLoader::CheckCacheLimits", "entry", spec.get()); } @@ -1359,7 +1359,7 @@ bool imgLoader::ValidateEntry(imgCacheEntry *aEntry, } #if defined(PR_LOGGING) else if (!key) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); PR_LOG(gImgLog, PR_LOG_DEBUG, @@ -1407,7 +1407,7 @@ bool imgLoader::RemoveFromCache(nsIURI *aKey) imgCacheTable &cache = GetCache(aKey); imgCacheQueue &queue = GetCacheQueue(aKey); - nsCAutoString spec; + nsAutoCString spec; aKey->GetSpec(spec); LOG_STATIC_FUNC_WITH_PARAM(gImgLog, "imgLoader::RemoveFromCache", "uri", spec.get()); @@ -1446,7 +1446,7 @@ bool imgLoader::RemoveFromCache(imgCacheEntry *entry) if (NS_SUCCEEDED(request->GetURI(getter_AddRefs(key))) && key) { imgCacheTable &cache = GetCache(key); imgCacheQueue &queue = GetCacheQueue(key); - nsCAutoString spec; + nsAutoCString spec; key->GetSpec(spec); LOG_STATIC_FUNC_WITH_PARAM(gImgLog, "imgLoader::RemoveFromCache", "entry's uri", spec.get()); @@ -1545,7 +1545,7 @@ NS_IMETHODIMP imgLoader::LoadImage(nsIURI *aURI, if (!aURI) return NS_ERROR_NULL_POINTER; - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); LOG_SCOPE_WITH_PARAM(gImgLog, "imgLoader::LoadImage", "aURI", spec.get()); @@ -1821,7 +1821,7 @@ NS_IMETHODIMP imgLoader::LoadImageWithChannel(nsIChannel *channel, imgIDecoderOb // for correctly dealing with image load requests that are a result // of post data. imgCacheTable &cache = GetCache(uri); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); @@ -1926,7 +1926,7 @@ NS_IMETHODIMP imgLoader::LoadImageWithChannel(nsIChannel *channel, imgIDecoderOb NS_IMETHODIMP imgLoader::SupportImageWithMimeType(const char* aMimeType, bool *_retval) { *_retval = false; - nsCAutoString mimeType(aMimeType); + nsAutoCString mimeType(aMimeType); ToLowerCase(mimeType); *_retval = (Image::GetDecoderType(mimeType.get()) == Image::eDecoderType_unknown) ? false : true; @@ -2042,7 +2042,7 @@ NS_IMETHODIMP ProxyListener::OnStartRequest(nsIRequest *aRequest, nsISupports *c nsCOMPtr channel(do_QueryInterface(aRequest)); if (channel) { - nsCAutoString contentType; + nsAutoCString contentType; nsresult rv = channel->GetContentType(contentType); if (!contentType.IsEmpty()) { @@ -2186,7 +2186,7 @@ NS_IMETHODIMP imgCacheValidator::OnStartRequest(nsIRequest *aRequest, nsISupport mRequest->GetURI(getter_AddRefs(uri)); #if defined(PR_LOGGING) - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); LOG_MSG_WITH_PARAM(gImgLog, "imgCacheValidator::OnStartRequest creating new request", "uri", spec.get()); #endif diff --git a/image/src/imgRequest.cpp b/image/src/imgRequest.cpp index 2fc58a8e8702..87c6ca2a3eeb 100644 --- a/image/src/imgRequest.cpp +++ b/image/src/imgRequest.cpp @@ -94,7 +94,7 @@ imgRequest::imgRequest(imgLoader* aLoader) : imgRequest::~imgRequest() { if (mURI) { - nsCAutoString spec; + nsAutoCString spec; mURI->GetSpec(spec); LOG_FUNC_WITH_PARAM(gImgLog, "imgRequest::~imgRequest()", "keyuri", spec.get()); } else @@ -227,7 +227,7 @@ nsresult imgRequest::RemoveProxy(imgRequestProxy *proxy, nsresult aStatus, bool } #if defined(PR_LOGGING) else { - nsCAutoString spec; + nsAutoCString spec; mURI->GetSpec(spec); LOG_MSG_WITH_PARAM(gImgLog, "imgRequest::RemoveProxy no cache entry", "uri", spec.get()); } @@ -392,7 +392,7 @@ void imgRequest::UpdateCacheEntrySize() mCacheEntry->SetDataSize(mImage->SizeOfData()); #ifdef DEBUG_joe - nsCAutoString url; + nsAutoCString url; mURI->GetSpec(url); printf("CACHEPUT: %d %s %d\n", time(NULL), url.get(), imageSize); #endif @@ -435,7 +435,7 @@ void imgRequest::SetCacheValidation(imgCacheEntry* aCacheEntry, nsIRequest* aReq } if (!bMustRevalidate) { - nsCAutoString cacheHeader; + nsAutoCString cacheHeader; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Cache-Control"), cacheHeader); @@ -1013,7 +1013,7 @@ NS_IMETHODIMP imgRequest::OnDataAvailable(nsIRequest *aRequest, nsISupports *ctx } /* set our content disposition as a property */ - nsCAutoString disposition; + nsAutoCString disposition; if (chan) { chan->GetContentDispositionHeader(disposition); } @@ -1064,7 +1064,7 @@ NS_IMETHODIMP imgRequest::OnDataAvailable(nsIRequest *aRequest, nsISupports *ctx imageFlags |= Image::INIT_FLAG_MULTIPART; // Get our URI string - nsCAutoString uriString; + nsAutoCString uriString; rv = mURI->GetSpec(uriString); if (NS_FAILED(rv)) uriString.Assign(""); @@ -1083,7 +1083,7 @@ NS_IMETHODIMP imgRequest::OnDataAvailable(nsIRequest *aRequest, nsISupports *ctx /* Use content-length as a size hint for http channels. */ nsCOMPtr httpChannel(do_QueryInterface(aRequest)); if (httpChannel) { - nsCAutoString contentLength; + nsAutoCString contentLength; rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("content-length"), contentLength); if (NS_SUCCEEDED(rv)) { @@ -1253,7 +1253,7 @@ imgRequest::OnRedirectVerifyCallback(nsresult result) mNewRedirectChannel = nullptr; #if defined(PR_LOGGING) - nsCAutoString oldspec; + nsAutoCString oldspec; if (mCurrentURI) mCurrentURI->GetSpec(oldspec); LOG_MSG_WITH_PARAM(gImgLog, "imgRequest::OnChannelRedirect", "old", oldspec.get()); diff --git a/image/src/imgRequestProxy.cpp b/image/src/imgRequestProxy.cpp index 44d8f96bc7a7..be1c89585fbc 100644 --- a/image/src/imgRequestProxy.cpp +++ b/image/src/imgRequestProxy.cpp @@ -715,7 +715,7 @@ void imgRequestProxy::OnImageIsAnimated() void imgRequestProxy::OnStartRequest() { #ifdef PR_LOGGING - nsCAutoString name; + nsAutoCString name; GetName(name); LOG_FUNC_WITH_PARAM(gImgLog, "imgRequestProxy::OnStartRequest", "name", name.get()); #endif @@ -732,7 +732,7 @@ void imgRequestProxy::OnStartRequest() void imgRequestProxy::OnStopRequest(bool lastPart) { #ifdef PR_LOGGING - nsCAutoString name; + nsAutoCString name; GetName(name); LOG_FUNC_WITH_PARAM(gImgLog, "imgRequestProxy::OnStopRequest", "name", name.get()); #endif @@ -775,7 +775,7 @@ void imgRequestProxy::OnStopRequest(bool lastPart) void imgRequestProxy::BlockOnload() { #ifdef PR_LOGGING - nsCAutoString name; + nsAutoCString name; GetName(name); LOG_FUNC_WITH_PARAM(gImgLog, "imgRequestProxy::BlockOnload", "name", name.get()); #endif @@ -789,7 +789,7 @@ void imgRequestProxy::BlockOnload() void imgRequestProxy::UnblockOnload() { #ifdef PR_LOGGING - nsCAutoString name; + nsAutoCString name; GetName(name); LOG_FUNC_WITH_PARAM(gImgLog, "imgRequestProxy::UnblockOnload", "name", name.get()); #endif diff --git a/image/src/imgStatusTracker.cpp b/image/src/imgStatusTracker.cpp index 5baff0c1223b..5f31926d4191 100644 --- a/image/src/imgStatusTracker.cpp +++ b/image/src/imgStatusTracker.cpp @@ -106,7 +106,7 @@ imgStatusTracker::Notify(imgRequest* request, imgRequestProxy* proxy) #ifdef PR_LOGGING nsCOMPtr uri; request->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); LOG_FUNC_WITH_PARAM(gImgLog, "imgStatusTracker::Notify async", "uri", spec.get()); #endif @@ -160,7 +160,7 @@ imgStatusTracker::NotifyCurrentState(imgRequestProxy* proxy) #ifdef PR_LOGGING nsCOMPtr uri; proxy->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); LOG_FUNC_WITH_PARAM(gImgLog, "imgStatusTracker::NotifyCurrentState", "uri", spec.get()); #endif @@ -181,7 +181,7 @@ imgStatusTracker::SyncNotify(imgRequestProxy* proxy) #ifdef PR_LOGGING nsCOMPtr uri; proxy->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); LOG_SCOPE_WITH_PARAM(gImgLog, "imgStatusTracker::SyncNotify", "uri", spec.get()); #endif diff --git a/image/src/imgTools.cpp b/image/src/imgTools.cpp index eca1d366848e..748cf419c2ba 100644 --- a/image/src/imgTools.cpp +++ b/image/src/imgTools.cpp @@ -232,7 +232,7 @@ NS_IMETHODIMP imgTools::EncodeImageData(gfxImageSurface *aSurface, uint32_t bitmapDataLength, strideSize; // Get an image encoder for the media type - nsCAutoString encoderCID( + nsAutoCString encoderCID( NS_LITERAL_CSTRING("@mozilla.org/image/encoder;2?type=") + aMimeType); nsCOMPtr encoder = do_CreateInstance(encoderCID.get()); diff --git a/intl/hyphenation/src/nsHyphenationManager.cpp b/intl/hyphenation/src/nsHyphenationManager.cpp index 4ca16974d1d2..c8fbd6f26cf8 100644 --- a/intl/hyphenation/src/nsHyphenationManager.cpp +++ b/intl/hyphenation/src/nsHyphenationManager.cpp @@ -302,7 +302,7 @@ nsHyphenationManager::LoadAliases() for (uint32_t i = 0; i < prefCount; ++i) { nsAdoptingCString value = Preferences::GetCString(prefNames[i]); if (value) { - nsCAutoString alias(prefNames[i]); + nsAutoCString alias(prefNames[i]); alias.Cut(0, strlen(INTL_HYPHENATIONALIAS_PREFIX)); ToLowerCase(alias); ToLowerCase(value); diff --git a/intl/locale/src/nsCharsetAlias.cpp b/intl/locale/src/nsCharsetAlias.cpp index 2efb4e21ff64..93101d9f43c2 100644 --- a/intl/locale/src/nsCharsetAlias.cpp +++ b/intl/locale/src/nsCharsetAlias.cpp @@ -32,7 +32,7 @@ nsresult nsCharsetAlias::GetPreferredInternal(const nsACString& aAlias, nsACString& oResult) { - nsCAutoString key(aAlias); + nsAutoCString key(aAlias); ToLowerCase(key); return nsUConvPropertySearch::SearchPropertyValue(kAliases, @@ -76,12 +76,12 @@ nsCharsetAlias::Equals(const nsACString& aCharset1, } *oResult = false; - nsCAutoString name1; + nsAutoCString name1; res = GetPreferredInternal(aCharset1, name1); if (NS_FAILED(res)) return res; - nsCAutoString name2; + nsAutoCString name2; res = GetPreferredInternal(aCharset2, name2); if (NS_FAILED(res)) return res; diff --git a/intl/locale/src/nsLanguageAtomService.cpp b/intl/locale/src/nsLanguageAtomService.cpp index 0da6b7a42223..e47389e51f4e 100644 --- a/intl/locale/src/nsLanguageAtomService.cpp +++ b/intl/locale/src/nsLanguageAtomService.cpp @@ -39,7 +39,7 @@ nsIAtom* nsLanguageAtomService::LookupLanguage(const nsACString &aLanguage, nsresult *aError) { - nsCAutoString lowered(aLanguage); + nsAutoCString lowered(aLanguage); ToLowerCase(lowered); nsCOMPtr lang = do_GetAtom(lowered); diff --git a/intl/locale/src/os2/nsOS2Charset.cpp b/intl/locale/src/os2/nsOS2Charset.cpp index cd51c22489cf..48c02fa7652d 100644 --- a/intl/locale/src/os2/nsOS2Charset.cpp +++ b/intl/locale/src/os2/nsOS2Charset.cpp @@ -42,7 +42,7 @@ nsPlatformCharset::~nsPlatformCharset() nsresult nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharset) { - nsCAutoString key; + nsAutoCString key; LossyCopyUTF16toASCII(inANSICodePage, key); nsresult rv = nsUConvPropertySearch::SearchPropertyValue(kOS2Charsets, diff --git a/intl/locale/src/unix/nsCollationUnix.cpp b/intl/locale/src/unix/nsCollationUnix.cpp index 53bc8f4e1928..99f5fd1d2c14 100644 --- a/intl/locale/src/unix/nsCollationUnix.cpp +++ b/intl/locale/src/unix/nsCollationUnix.cpp @@ -88,7 +88,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale) nsCOMPtr platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &res); if (NS_SUCCEEDED(res)) { - nsCAutoString mappedCharset; + nsAutoCString mappedCharset; res = platformCharset->GetDefaultCharsetForLocale(localeStr, mappedCharset); if (NS_SUCCEEDED(res)) { mCollation->SetCharset(mappedCharset.get()); diff --git a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp index 5ea2af1c0b49..bc2f411dbb09 100644 --- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp +++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp @@ -73,7 +73,7 @@ nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale) nsCOMPtr platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &res); if (NS_SUCCEEDED(res)) { - nsCAutoString mappedCharset; + nsAutoCString mappedCharset; res = platformCharset->GetDefaultCharsetForLocale(mLocale, mappedCharset); if (NS_SUCCEEDED(res)) { mCharset = mappedCharset; diff --git a/intl/locale/src/unix/nsUNIXCharset.cpp b/intl/locale/src/unix/nsUNIXCharset.cpp index b171094e2da9..aeed422dfc96 100644 --- a/intl/locale/src/unix/nsUNIXCharset.cpp +++ b/intl/locale/src/unix/nsUNIXCharset.cpp @@ -48,7 +48,7 @@ ConvertLocaleToCharsetUsingDeprecatedConfig(const nsACString& locale, nsACString& oResult) { if (!(locale.IsEmpty())) { - nsCAutoString localeKey; + nsAutoCString localeKey; localeKey.AssignLiteral("locale.all."); localeKey.Append(locale); if (NS_SUCCEEDED(nsUConvPropertySearch::SearchPropertyValue(kUnixCharsets, @@ -150,7 +150,7 @@ nsPlatformCharset::InitGetCharset(nsACString &oString) // try falling back on a deprecated (locale based) name // char* locale = setlocale(LC_CTYPE, nullptr); - nsCAutoString localeStr; + nsAutoCString localeStr; localeStr.Assign(locale); return ConvertLocaleToCharsetUsingDeprecatedConfig(localeStr, oString); } @@ -215,7 +215,7 @@ nsPlatformCharset::VerifyCharset(nsCString &aCharset) // check if we recognize the charset string // - nsCAutoString result; + nsAutoCString result; res = charsetConverterManager->GetCharsetAlias(aCharset.get(), result); if (NS_FAILED(res)) { return res; diff --git a/intl/locale/src/windows/nsCollationWin.cpp b/intl/locale/src/windows/nsCollationWin.cpp index ff3f7b55a12e..8114a0bf43a7 100644 --- a/intl/locale/src/windows/nsCollationWin.cpp +++ b/intl/locale/src/windows/nsCollationWin.cpp @@ -72,7 +72,7 @@ nsresult nsCollationWin::Initialize(nsILocale* locale) nsCOMPtr platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID); if (platformCharset) { - nsCAutoString mappedCharset; + nsAutoCString mappedCharset; res = platformCharset->GetDefaultCharsetForLocale(localeStr, mappedCharset); if (NS_SUCCEEDED(res)) { mCollation->SetCharset(mappedCharset.get()); diff --git a/intl/locale/src/windows/nsWinCharset.cpp b/intl/locale/src/windows/nsWinCharset.cpp index c7db6dee5228..d2e4e773ef1e 100644 --- a/intl/locale/src/windows/nsWinCharset.cpp +++ b/intl/locale/src/windows/nsWinCharset.cpp @@ -39,7 +39,7 @@ nsPlatformCharset::~nsPlatformCharset() nsresult nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharset) { - nsCAutoString key; + nsAutoCString key; LossyCopyUTF16toASCII(inANSICodePage, key); nsresult rv = nsUConvPropertySearch::SearchPropertyValue(kWinCharsets, diff --git a/intl/strres/src/nsStringBundle.cpp b/intl/strres/src/nsStringBundle.cpp index ce0e17fd19f5..ad83961dab87 100644 --- a/intl/strres/src/nsStringBundle.cpp +++ b/intl/strres/src/nsStringBundle.cpp @@ -114,7 +114,7 @@ nsresult nsStringBundle::GetStringFromID(int32_t aID, nsAString& aResult) { ReentrantMonitorAutoEnter automon(mReentrantMonitor); - nsCAutoString name; + nsAutoCString name; name.AppendInt(aID, 10); nsresult rv; @@ -301,7 +301,7 @@ nsStringBundle::GetCombinedEnumeration(nsIStringBundleOverride* aOverrideStrings (propElement = do_QueryInterface(supports, &rv))) { // now check if its in the override bundle - nsCAutoString key; + nsAutoCString key; propElement->GetKey(key); nsAutoString value; @@ -411,7 +411,7 @@ nsExtensibleStringBundle::Init(const char * aCategory, if (NS_FAILED(rv)) continue; - nsCAutoString name; + nsAutoCString name; rv = supStr->GetData(name); if (NS_FAILED(rv)) continue; diff --git a/intl/strres/src/nsStringBundleTextOverride.cpp b/intl/strres/src/nsStringBundleTextOverride.cpp index fd300b2ea6c1..e31efa017638 100644 --- a/intl/strres/src/nsStringBundleTextOverride.cpp +++ b/intl/strres/src/nsStringBundleTextOverride.cpp @@ -141,7 +141,7 @@ nsStringBundleTextOverride::Init() // read in the custom bundle. Keys are in the form // chrome://package/locale/foo.properties:keyname - nsCAutoString customStringsURLSpec; + nsAutoCString customStringsURLSpec; rv = NS_GetURLSpecFromFile(customStringsFile, customStringsURLSpec); if (NS_FAILED(rv)) return rv; @@ -175,7 +175,7 @@ nsStringBundleTextOverride::Init() nsCOMPtr prop = do_QueryInterface(sup); - nsCAutoString key; + nsAutoCString key; nsAutoString value; prop->GetKey(key); prop->GetValue(value); @@ -195,7 +195,7 @@ nsStringBundleTextOverride::GetStringFromName(const nsACString& aURL, nsAString& aResult) { // concatenate url#key to get the key to read - nsCAutoString combinedURL(aURL + NS_LITERAL_CSTRING("#") + key); + nsAutoCString combinedURL(aURL + NS_LITERAL_CSTRING("#") + key); // persistent properties uses ":" as a delimiter, so escape that character combinedURL.ReplaceSubstring(":", "%3A"); @@ -258,7 +258,7 @@ nsPropertyEnumeratorByURL::HasMoreElements(bool * aResult) mCurrent = do_QueryInterface(supports); if (mCurrent) { - nsCAutoString curKey; + nsAutoCString curKey; mCurrent->GetKey(curKey); if (StringBeginsWith(curKey, mURL)) diff --git a/intl/uconv/src/nsCharsetConverterManager.cpp b/intl/uconv/src/nsCharsetConverterManager.cpp index 8e81ba6d73d1..208f7769a5cf 100644 --- a/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/intl/uconv/src/nsCharsetConverterManager.cpp @@ -132,7 +132,7 @@ nsCharsetConverterManager::GetUnicodeEncoder(const char * aDest, nsIUnicodeEncoder ** aResult) { // resolve the charset first - nsCAutoString charset; + nsAutoCString charset; // fully qualify to possibly avoid vtable call nsCharsetConverterManager::GetCharsetAlias(aDest, charset); @@ -151,7 +151,7 @@ nsCharsetConverterManager::GetUnicodeEncoderRaw(const char * aDest, nsresult rv = NS_OK; - nsCAutoString + nsAutoCString contractid(NS_LITERAL_CSTRING(NS_UNICODEENCODER_CONTRACTID_BASE) + nsDependentCString(aDest)); @@ -173,7 +173,7 @@ nsCharsetConverterManager::GetUnicodeDecoder(const char * aSrc, nsIUnicodeDecoder ** aResult) { // resolve the charset first - nsCAutoString charset; + nsAutoCString charset; // fully qualify to possibly avoid vtable call if (NS_FAILED(nsCharsetConverterManager::GetCharsetAlias(aSrc, charset))) @@ -188,7 +188,7 @@ nsCharsetConverterManager::GetUnicodeDecoderInternal(const char * aSrc, nsIUnicodeDecoder ** aResult) { // resolve the charset first - nsCAutoString charset; + nsAutoCString charset; nsresult rv = nsCharsetAlias::GetPreferredInternal(nsDependentCString(aSrc), charset); @@ -250,11 +250,11 @@ nsresult GetList(const nsACString& aCategory, if (!supStr) continue; - nsCAutoString name; + nsAutoCString name; if (NS_FAILED(supStr->GetData(name))) continue; - nsCAutoString fullName(aPrefix); + nsAutoCString fullName(aPrefix); fullName.Append(name); NS_ENSURE_TRUE(array->AppendElement(fullName), NS_ERROR_OUT_OF_MEMORY); } @@ -332,7 +332,7 @@ nsCharsetConverterManager::GetCharsetLangGroup(const char * aCharset, nsIAtom** aResult) { // resolve the charset first - nsCAutoString charset; + nsAutoCString charset; nsresult rv = GetCharsetAlias(aCharset, charset); NS_ENSURE_SUCCESS(rv, rv); diff --git a/intl/uconv/src/nsConverterOutputStream.cpp b/intl/uconv/src/nsConverterOutputStream.cpp index 152e4abaf77c..d3ab9b1b141d 100644 --- a/intl/uconv/src/nsConverterOutputStream.cpp +++ b/intl/uconv/src/nsConverterOutputStream.cpp @@ -67,7 +67,7 @@ nsConverterOutputStream::Write(uint32_t aCount, const PRUnichar* aChars, nsresult rv = mConverter->GetMaxLength(aChars, inLen, &maxLen); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString buf; + nsAutoCString buf; buf.SetLength(maxLen); if (buf.Length() != (uint32_t) maxLen) return NS_ERROR_OUT_OF_MEMORY; diff --git a/intl/uconv/src/nsTextToSubURI.cpp b/intl/uconv/src/nsTextToSubURI.cpp index afe48c15ab26..478fe6036478 100644 --- a/intl/uconv/src/nsTextToSubURI.cpp +++ b/intl/uconv/src/nsTextToSubURI.cpp @@ -198,7 +198,7 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeURIForUI(const nsACString & aCharset, const nsACString &aURIFragment, nsAString &_retval) { - nsCAutoString unescapedSpec; + nsAutoCString unescapedSpec; // skip control octets (0x00 - 0x1f and 0x7f) when unescaping NS_UnescapeURL(PromiseFlatCString(aURIFragment), esc_SkipControl | esc_AlwaysCopy, unescapedSpec); @@ -218,7 +218,7 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeNonAsciiURI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString &_retval) { - nsCAutoString unescapedSpec; + nsAutoCString unescapedSpec; NS_UnescapeURL(PromiseFlatCString(aURIFragment), esc_AlwaysCopy | esc_OnlyNonASCII, unescapedSpec); // leave the URI as it is if it's not UTF-8 and aCharset is not a ASCII diff --git a/intl/uconv/src/nsUTF8ConverterService.cpp b/intl/uconv/src/nsUTF8ConverterService.cpp index 5bebf141985d..2ba81996762c 100644 --- a/intl/uconv/src/nsUTF8ConverterService.cpp +++ b/intl/uconv/src/nsUTF8ConverterService.cpp @@ -103,7 +103,7 @@ nsUTF8ConverterService::ConvertURISpecToUTF8(const nsACString &aSpec, aUTF8Spec.Truncate(); - nsCAutoString unescapedSpec; + nsAutoCString unescapedSpec; // NS_UnescapeURL does not fill up unescapedSpec unless there's at least // one character to unescape. bool written = NS_UnescapeURL(PromiseFlatCString(aSpec).get(), aSpec.Length(), diff --git a/intl/uconv/tests/TestUConv.cpp b/intl/uconv/tests/TestUConv.cpp index 8d454a3f63c1..76d932c0b864 100644 --- a/intl/uconv/tests/TestUConv.cpp +++ b/intl/uconv/tests/TestUConv.cpp @@ -40,7 +40,7 @@ private: static const char * kTraceDelimiter; - nsCAutoString mTrace; + nsAutoCString mTrace; public: @@ -189,7 +189,7 @@ nsresult nsTestUConv::TestEncoders() bool hasMore; encoders->HasMore(&hasMore); - nsCAutoString charset; + nsAutoCString charset; while (hasMore) { encoders->GetNext(charset); @@ -258,7 +258,7 @@ nsresult nsTestUConv::DisplayDetectors() bool hasMore; detectors->HasMore(&hasMore); while (hasMore) { - nsCAutoString detectorName; + nsAutoCString detectorName; res = detectors->GetNext(detectorName); if (NS_FAILED(res)) { mLog.PrintError("GetNext()", res); @@ -316,7 +316,7 @@ nsresult nsTestUConv::DisplayCharsets() nsTArray allCharsets; - nsCAutoString charset; + nsAutoCString charset; bool hasMore; encoders->HasMore(&hasMore); while (hasMore) { diff --git a/intl/uconv/tests/nsconv.cpp b/intl/uconv/tests/nsconv.cpp index a90bdf0a1d69..4f28cdb7353d 100644 --- a/intl/uconv/tests/nsconv.cpp +++ b/intl/uconv/tests/nsconv.cpp @@ -63,7 +63,7 @@ int main(int argc, const char** argv) if(strcmp(argv[i], "-f") == 0) { // User has specified the charset to convert from - nsCAutoString str; + nsAutoCString str; // First check if a charset alias was given, // and convert to the canonical name @@ -88,7 +88,7 @@ int main(int argc, const char** argv) if(strcmp(argv[i], "-t") == 0) { // User has specified which charset to convert to - nsCAutoString str; + nsAutoCString str; // First check if a charset alias was given, // and convert to the canonical name diff --git a/intl/uconv/tests/plattest.cpp b/intl/uconv/tests/plattest.cpp index 814f39d5fecf..69ada9a72e88 100644 --- a/intl/uconv/tests/plattest.cpp +++ b/intl/uconv/tests/plattest.cpp @@ -23,7 +23,7 @@ main(int argc, const char** argv) if (!locale_service) return -1; nsCOMPtr locale; - nsCAutoString charset; + nsAutoCString charset; nsAutoString category; nsresult rv = locale_service->GetSystemLocale(getter_AddRefs(locale)); diff --git a/intl/unicharutil/src/nsEntityConverter.cpp b/intl/unicharutil/src/nsEntityConverter.cpp index 3cc5917d445d..501b62dcfd44 100644 --- a/intl/unicharutil/src/nsEntityConverter.cpp +++ b/intl/unicharutil/src/nsEntityConverter.cpp @@ -78,7 +78,7 @@ nsEntityConverter::LoadVersionPropertyFile() already_AddRefed nsEntityConverter::LoadEntityBundle(uint32_t version) { - nsCAutoString url(NS_LITERAL_CSTRING("resource://gre/res/entityTables/")); + nsAutoCString url(NS_LITERAL_CSTRING("resource://gre/res/entityTables/")); nsresult rv; nsCOMPtr bundleService = diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index cf2fdcf90227..46bf9527527c 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -384,7 +384,7 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector aExtraOpts, b // different than parent. So temporarily change NSPR_LOG_FILE so child // inherits value we want it to have. (NSPR only looks at NSPR_LOG_FILE at // startup, so it's 'safe' to play with the parent's environment this way.) - nsCAutoString setChildLogName("NSPR_LOG_FILE="); + nsAutoCString setChildLogName("NSPR_LOG_FILE="); setChildLogName.Append(origLogName); // remember original value so we can restore it. @@ -562,7 +562,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt if (Omnijar::IsInitialized()) { // Make sure that child processes can find the omnijar // See XRE_InitCommandLine in nsAppRunner.cpp - nsCAutoString path; + nsAutoCString path; nsCOMPtr file = Omnijar::GetPath(Omnijar::GRE); if (file && NS_SUCCEEDED(file->GetNativePath(path))) { childArgv.push_back("-greomni"); diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h index bfeb77ab4696..0f91eb83500e 100644 --- a/ipc/glue/IPCMessageUtils.h +++ b/ipc/glue/IPCMessageUtils.h @@ -323,9 +323,9 @@ struct ParamTraits : ParamTraits #ifdef MOZILLA_INTERNAL_API template<> -struct ParamTraits : ParamTraits +struct ParamTraits : ParamTraits { - typedef nsCAutoString paramType; + typedef nsAutoCString paramType; }; #endif // MOZILLA_INTERNAL_API diff --git a/ipc/glue/WindowsMessageLoop.cpp b/ipc/glue/WindowsMessageLoop.cpp index 0053be2867a8..5fea78fc0cb4 100644 --- a/ipc/glue/WindowsMessageLoop.cpp +++ b/ipc/glue/WindowsMessageLoop.cpp @@ -279,7 +279,7 @@ ProcessOrDeferMessage(HWND hwnd, } else { // Unknown messages only #ifdef DEBUG - nsCAutoString log("Received \"nonqueued\" message "); + nsAutoCString log("Received \"nonqueued\" message "); log.AppendInt(uMsg); log.AppendLiteral(" during a synchronous IPC message for window "); log.AppendInt((int64_t)hwnd); @@ -390,7 +390,7 @@ WindowIsDeferredWindow(HWND hWnd) nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); if (appInfo) { - nsCAutoString appName; + nsAutoCString appName; if (NS_SUCCEEDED(appInfo->GetName(appName))) { appName.Append("MessageWindow"); nsDependentString windowName(gAppMessageWindowName); diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index f560f76fa849..780890f973ff 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -250,7 +250,7 @@ jsds_SyncFilter (FilterRecord *rec, jsdIFilter *filter) if (NS_FAILED(rv)) return false; - nsCAutoString urlPattern; + nsAutoCString urlPattern; rv = filter->GetUrlPattern (urlPattern); if (NS_FAILED(rv)) return false; @@ -520,7 +520,7 @@ jsds_ErrorHookProc (JSDContext *jsdc, JSContext *cx, const char *message, val = getter_AddRefs(jsdValue::FromPtr(jsdc, jsdv)); } - nsCAutoString fileName; + nsAutoCString fileName; uint32_t line; uint32_t pos; uint32_t flags; diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index a248a4d8fee1..d2f38a2ec868 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -554,7 +554,7 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) } if (JS_TypeOfValue(cx, NSGetFactory_val) != JSTYPE_FUNCTION) { - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); JS_ReportError(cx, "%s has NSGetFactory property that is not a function", spec.get()); @@ -688,7 +688,7 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, return NS_ERROR_FAILURE; } - nsCAutoString nativePath; + nsAutoCString nativePath; rv = aURI->GetSpec(nativePath); NS_ENSURE_SUCCESS(rv, rv); @@ -709,7 +709,7 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, bool writeToCache = false; StartupCache* cache = StartupCache::GetSingleton(); - nsCAutoString cachePath(kJSCachePrefix); + nsAutoCString cachePath(kJSCachePrefix); rv = PathifyURI(aURI, cachePath); NS_ENSURE_SUCCESS(rv, rv); @@ -1120,7 +1120,7 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, sourceLocalFile = do_QueryInterface(sourceFile, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString key; + nsAutoCString key; rv = resolvedURI->GetSpec(key); NS_ENSURE_SUCCESS(rv, rv); @@ -1192,7 +1192,7 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, } #ifdef DEBUG - nsCAutoString logBuffer; + nsAutoCString logBuffer; #endif for (uint32_t i = 0; i < symbolCount; ++i) { @@ -1277,7 +1277,7 @@ mozJSComponentLoader::Unload(const nsACString & aLocation) rv = scriptChannel->GetURI(getter_AddRefs(resolvedURI)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString key; + nsAutoCString key; rv = resolvedURI->GetSpec(key); NS_ENSURE_SUCCESS(rv, rv); diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp index 91ef3a80d35d..0269a0bf8dd9 100644 --- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp +++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp @@ -222,8 +222,8 @@ mozJSSubScriptLoader::LoadSubScript(const nsAString& url, /* load up the url. From here on, failures are reflected as ``custom'' * js exceptions */ nsCOMPtr uri; - nsCAutoString uriStr; - nsCAutoString scheme; + nsAutoCString uriStr; + nsAutoCString scheme; JSScript* script = nullptr; @@ -269,7 +269,7 @@ mozJSSubScriptLoader::LoadSubScript(const nsAString& url, // For file URIs prepend the filename with the filename of the // calling script, and " -> ". See bug 418356. - nsCAutoString tmp(JS_GetScriptFilename(cx, script)); + nsAutoCString tmp(JS_GetScriptFilename(cx, script)); tmp.AppendLiteral(" -> "); tmp.Append(uriStr); @@ -278,7 +278,7 @@ mozJSSubScriptLoader::LoadSubScript(const nsAString& url, bool writeScript = false; JSVersion version = JS_GetVersion(cx); - nsCAutoString cachePath; + nsAutoCString cachePath; cachePath.AppendPrintf("jssubloader/%d", version); PathifyURI(uri, cachePath); diff --git a/js/xpconnect/shell/xpcshell.cpp b/js/xpconnect/shell/xpcshell.cpp index 1f67ae26f7f3..1bc2b2d56493 100644 --- a/js/xpconnect/shell/xpcshell.cpp +++ b/js/xpconnect/shell/xpcshell.cpp @@ -1632,7 +1632,7 @@ GetCurrentWorkingDirectory(nsAString& workingDirectory) workingDirectory.SetLength(requiredLength); workingDirectory.Replace(workingDirectory.Length() - 1, 1, L'\\'); #elif defined(XP_UNIX) - nsCAutoString cwd; + nsAutoCString cwd; // 1024 is just a guess at a sane starting value size_t bufsize = 1024; char* result = nullptr; diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index dffca52fac6d..3a6236be1710 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -77,7 +77,7 @@ char* xpc_CloneAllAccess() char * xpc_CheckAccessList(const PRUnichar* wideName, const char* list[]) { - nsCAutoString asciiName; + nsAutoCString asciiName; CopyUTF16toUTF8(nsDependentString(wideName), asciiName); for (const char** p = list; *p; p++) @@ -882,7 +882,7 @@ nsXPCComponents_Classes::NewEnumerate(nsIXPConnectWrappedNative *wrapper, NS_SUCCEEDED(e->GetNext(getter_AddRefs(isup))) && isup) { nsCOMPtr holder(do_QueryInterface(isup)); if (holder) { - nsCAutoString name; + nsAutoCString name; if (NS_SUCCEEDED(holder->GetData(name))) { JSString* idstr = JS_NewStringCopyN(cx, name.get(), name.Length()); if (idstr && @@ -3873,7 +3873,7 @@ xpc_EvalInSandbox(JSContext *cx, JSObject *sandbox, const nsAString& source, return NS_ERROR_FAILURE; } - nsCAutoString filenameBuf; + nsAutoCString filenameBuf; if (!filename) { // Default to the spec of the principal. nsJSPrincipals::get(prin)->GetScriptLocation(filenameBuf); diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 0157b204b5c8..9062939420eb 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -1110,7 +1110,7 @@ XPCConvert::ConstructException(nsresult rv, const char* message, const char * msg = message; char* sz = nullptr; nsXPIDLString xmsg; - nsCAutoString sxmsg; + nsAutoCString sxmsg; nsCOMPtr errorObject = do_QueryInterface(data); if (errorObject) { @@ -1362,7 +1362,7 @@ XPCConvert::JSErrorToXPCException(XPCCallContext& ccx, } if (data) { - nsCAutoString formattedMsg; + nsAutoCString formattedMsg; data->ToString(formattedMsg); rv = ConstructException(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS, diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 9da53e785976..898bd9a0b00c 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1849,7 +1849,7 @@ class XPCJSRuntimeStats : public JS::RuntimeStats virtual void initExtraCompartmentStats(JSCompartment *c, JS::CompartmentStats *cstats) MOZ_OVERRIDE { - nsCAutoString cJSPathPrefix, cDOMPathPrefix; + nsAutoCString cJSPathPrefix, cDOMPathPrefix; nsCString cName; GetCompartmentName(c, cName, true); diff --git a/js/xpconnect/src/XPCLocale.cpp b/js/xpconnect/src/XPCLocale.cpp index b7bb3a173d1d..897fd2cca141 100644 --- a/js/xpconnect/src/XPCLocale.cpp +++ b/js/xpconnect/src/XPCLocale.cpp @@ -164,7 +164,7 @@ struct XPCLocaleCallbacks : public JSLocaleCallbacks do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { - nsCAutoString charset; + nsAutoCString charset; rv = platformCharset->GetDefaultCharsetForLocale(localeStr, charset); if (NS_SUCCEEDED(rv)) { // get/create unicode decoder for charset diff --git a/js/xpconnect/src/XPCVariant.cpp b/js/xpconnect/src/XPCVariant.cpp index 90ad1c79c7c4..518a53e17757 100644 --- a/js/xpconnect/src/XPCVariant.cpp +++ b/js/xpconnect/src/XPCVariant.cpp @@ -422,7 +422,7 @@ XPCVariant::VariantDataToJS(XPCLazyCallContext& lccx, nsXPTCVariant xpctvar; nsID iid; nsAutoString astring; - nsCAutoString cString; + nsAutoCString cString; nsUTF8String utf8String; uint32_t size; xpctvar.flags = 0; diff --git a/js/xpconnect/src/nsScriptError.cpp b/js/xpconnect/src/nsScriptError.cpp index ff4d33ead28f..3fb7e0a85c49 100644 --- a/js/xpconnect/src/nsScriptError.cpp +++ b/js/xpconnect/src/nsScriptError.cpp @@ -35,7 +35,7 @@ NS_IMETHODIMP nsScriptError::GetMessageMoz(PRUnichar **result) { nsresult rv; - nsCAutoString message; + nsAutoCString message; rv = ToString(message); if (NS_FAILED(rv)) return rv; diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index bf75f6adb9c9..2eb0fc4bd93f 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -2533,7 +2533,7 @@ Base64Encode(JSContext *cx, JS::Value val, JS::Value *out) if (!encodedString.IsValid()) return false; - nsCAutoString result; + nsAutoCString result; if (NS_FAILED(mozilla::Base64Encode(encodedString, result))) { JS_ReportError(cx, "Failed to encode base64 data!"); return false; @@ -2559,7 +2559,7 @@ Base64Decode(JSContext *cx, JS::Value val, JS::Value *out) if (!encodedString.IsValid()) return false; - nsCAutoString result; + nsAutoCString result; if (NS_FAILED(mozilla::Base64Decode(encodedString, result))) { JS_ReportError(cx, "Failed to decode base64 string!"); return false; diff --git a/layout/base/nsFrameManager.cpp b/layout/base/nsFrameManager.cpp index 6fc61d38d384..d0f3758f78cf 100644 --- a/layout/base/nsFrameManager.cpp +++ b/layout/base/nsFrameManager.cpp @@ -1726,7 +1726,7 @@ nsFrameManager::CaptureFrameStateFor(nsIFrame* aFrame, // Generate the hash key to store the state under // Exit early if we get empty key - nsCAutoString stateKey; + nsAutoCString stateKey; nsIContent* content = aFrame->GetContent(); nsIDocument* doc = content ? content->GetCurrentDoc() : nullptr; rv = nsContentUtils::GenerateStateKey(content, doc, aID, stateKey); @@ -1795,7 +1795,7 @@ nsFrameManager::RestoreFrameStateFor(nsIFrame* aFrame, return; } - nsCAutoString stateKey; + nsAutoCString stateKey; nsIDocument* doc = content->GetCurrentDoc(); nsresult rv = nsContentUtils::GenerateStateKey(content, doc, aID, stateKey); if (NS_FAILED(rv) || stateKey.IsEmpty()) { diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index b6c89640bc73..1e56f0916306 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -446,13 +446,13 @@ nsPresContext::GetFontPrefsForLang(nsIAtom *aLanguage) const font.minimum-size.[langGroup] = integer - settable by the user */ - nsCAutoString langGroup; + nsAutoCString langGroup; langGroupAtom->ToUTF8String(langGroup); prefs->mDefaultVariableFont.size = CSSPixelsToAppUnits(16); prefs->mDefaultFixedFont.size = CSSPixelsToAppUnits(13); - nsCAutoString pref; + nsAutoCString pref; // get the current applicable font-size unit enum {eUnit_unknown = -1, eUnit_px, eUnit_pt}; @@ -505,7 +505,7 @@ nsPresContext::GetFontPrefsForLang(nsIAtom *aLanguage) const // generic name that should be fed into the cascade. It is up to the GFX // code to look up the font prefs to convert generic names to specific // family names as necessary. - nsCAutoString generic_dot_langGroup; + nsAutoCString generic_dot_langGroup; for (uint32_t eType = 0; eType < ArrayLength(fontTypes); ++eType) { generic_dot_langGroup.Assign(kGenericFont[eType]); generic_dot_langGroup.Append(langGroup); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 0b57332f3260..c4ce7dc8db27 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -179,7 +179,7 @@ #ifdef NS_FUNCTION_TIMER #define NS_TIME_FUNCTION_DECLARE_DOCURL \ - nsCAutoString docURL__("N/A"); \ + nsAutoCString docURL__("N/A"); \ nsIURI *uri__ = mDocument->GetDocumentURI(); \ if (uri__) uri__->GetSpec(docURL__); #define NS_TIME_FUNCTION_WITH_DOCURL \ @@ -1638,7 +1638,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) if (mDocument) { nsIURI *uri = mDocument->GetDocumentURI(); if (uri) { - nsCAutoString url; + nsAutoCString url; uri->GetSpec(url); printf("*** PresShell::InitialReflow (this=%p, url='%s')\n", (void*)this, url.get()); } @@ -2476,7 +2476,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty, { #ifdef NS_FUNCTION_TIMER NS_TIME_FUNCTION_DECLARE_DOCURL; - nsCAutoString frameType__("N/A"); + nsAutoCString frameType__("N/A"); nsIAtom *atomType__ = aFrame ? aFrame->GetType() : nullptr; if (atomType__) atomType__->ToUTF8String(frameType__); NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (document: %s, frame type: %s)", MOZ_FUNCTION_NAME, @@ -7356,7 +7356,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible) { NS_TIME_FUNCTION_WITH_DOCURL; - nsCAutoString docURL("N/A"); + nsAutoCString docURL("N/A"); nsIURI *uri = mDocument->GetDocumentURI(); if (uri) uri->GetSpec(docURL); @@ -8301,7 +8301,7 @@ void PresShell::DumpReflows() { if (mReflowCountMgr) { - nsCAutoString uriStr; + nsAutoCString uriStr; if (mDocument) { nsIURI *uri = mDocument->GetDocumentURI(); if (uri) { diff --git a/layout/base/nsStyleSheetService.cpp b/layout/base/nsStyleSheetService.cpp index 47d65dc5048c..b8f71ce6e60d 100644 --- a/layout/base/nsStyleSheetService.cpp +++ b/layout/base/nsStyleSheetService.cpp @@ -57,7 +57,7 @@ nsStyleSheetService::RegisterFromEnumerator(nsICategoryManager *aManager, NS_ASSERTION(icStr, "category manager entries must be nsISupportsCStrings"); - nsCAutoString name; + nsAutoCString name; icStr->GetData(name); nsXPIDLCString spec; diff --git a/layout/build/nsContentDLF.cpp b/layout/build/nsContentDLF.cpp index 84dd80f6fa36..ce67e86b71ad 100644 --- a/layout/build/nsContentDLF.cpp +++ b/layout/build/nsContentDLF.cpp @@ -146,7 +146,7 @@ nsContentDLF::CreateInstance(const char* aCommand, nsIContentViewer** aDocViewer) { #ifdef NS_FUNCTION_TIMER - nsCAutoString channelURL__("N/A"); + nsAutoCString channelURL__("N/A"); nsCOMPtr url__; if (aChannel && NS_SUCCEEDED(aChannel->GetURI(getter_AddRefs(url__)))) { url__->GetSpec(channelURL__); @@ -158,7 +158,7 @@ nsContentDLF::CreateInstance(const char* aCommand, // Declare "type" here. This is because although the variable itself only // needs limited scope, we need to use the raw string memory -- as returned // by "type.get()" farther down in the function. - nsCAutoString type; + nsAutoCString type; // Are we viewing source? nsCOMPtr viewSourceChannel = do_QueryInterface(aChannel); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index ae3bf50b6c2b..1fef06819ce4 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1448,14 +1448,14 @@ nsGfxScrollFrameInner::AsyncScroll::InitDuration(nsIAtom *aOrigin) { static const int32_t kDefaultMinMS = 150, kDefaultMaxMS = 150; static const bool kDefaultIsSmoothEnabled = true; - nsCAutoString originName; + nsAutoCString originName; aOrigin->ToUTF8String(originName); - nsCAutoString prefBase = NS_LITERAL_CSTRING("general.smoothScroll.") + originName; + nsAutoCString prefBase = NS_LITERAL_CSTRING("general.smoothScroll.") + originName; isOriginSmoothnessEnabled = Preferences::GetBool(prefBase.get(), kDefaultIsSmoothEnabled); if (isOriginSmoothnessEnabled) { - nsCAutoString prefMin = prefBase + NS_LITERAL_CSTRING(".durationMinMS"); - nsCAutoString prefMax = prefBase + NS_LITERAL_CSTRING(".durationMaxMS"); + nsAutoCString prefMin = prefBase + NS_LITERAL_CSTRING(".durationMinMS"); + nsAutoCString prefMax = prefBase + NS_LITERAL_CSTRING(".durationMaxMS"); mOriginMinMS = Preferences::GetInt(prefMin.get(), kDefaultMinMS); mOriginMaxMS = Preferences::GetInt(prefMax.get(), kDefaultMaxMS); diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 6dfde2a2a9ee..e828cde65d60 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1623,7 +1623,7 @@ nsImageFrame::HandleEvent(nsPresContext* aPresContext, // mouse is over the border. if (p.x < 0) p.x = 0; if (p.y < 0) p.y = 0; - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); spec += nsPrintfCString("?%d,%d", p.x, p.y); uri->SetSpec(spec); @@ -1734,7 +1734,7 @@ nsImageFrame::List(FILE* out, int32_t aIndent) const if (currentRequest) { nsCOMPtr uri; currentRequest->GetURI(getter_AddRefs(uri)); - nsCAutoString uristr; + nsAutoCString uristr; uri->GetAsciiSpec(uristr); fprintf(out, " [src=%s]", uristr.get()); } @@ -1829,7 +1829,7 @@ nsImageFrame::SpecToURI(const nsAString& aSpec, nsIIOService *aIOService, if (mContent) { baseURI = mContent->GetBaseURI(); } - nsCAutoString charset; + nsAutoCString charset; GetDocumentCharacterSet(charset); NS_NewURI(aURI, aSpec, charset.IsEmpty() ? nullptr : charset.get(), diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 2729605a9b6d..b92350931e44 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -1083,7 +1083,7 @@ Selection::ToStringWithFormat(const char* aFormatType, uint32_t aFlags, int32_t aWrapCol, nsAString& aReturn) { nsresult rv = NS_OK; - nsCAutoString formatType( NS_DOC_ENCODER_CONTRACTID_BASE ); + nsAutoCString formatType( NS_DOC_ENCODER_CONTRACTID_BASE ); formatType.Append(aFormatType); nsCOMPtr encoder = do_CreateInstance(formatType.get(), &rv); diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 9420e292afa4..74131728c322 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -8343,7 +8343,7 @@ nsTextFrame::GetFrameName(nsAString& aResult) const { MakeFrameName(NS_LITERAL_STRING("Text"), aResult); int32_t totalContentLength; - nsCAutoString tmp; + nsAutoCString tmp; ToCString(tmp, &totalContentLength); tmp.SetLength(NS_MIN(tmp.Length(), 50u)); aResult += NS_LITERAL_STRING("\"") + NS_ConvertASCIItoUTF16(tmp) + NS_LITERAL_STRING("\""); diff --git a/layout/inspector/src/inCSSValueSearch.cpp b/layout/inspector/src/inCSSValueSearch.cpp index 4f7111e739b6..a0dff78adff2 100644 --- a/layout/inspector/src/inCSSValueSearch.cpp +++ b/layout/inspector/src/inCSSValueSearch.cpp @@ -363,7 +363,7 @@ inCSSValueSearch::SearchStyleValue(const nsAFlatString& aValue, nsIURI* aBaseURL nsCOMPtr uri; nsresult rv = NS_NewURI(getter_AddRefs(uri), url, nullptr, aBaseURL); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); nsAutoString *result = new NS_ConvertUTF8toUTF16(spec); if (mReturnRelativeURLs) diff --git a/layout/inspector/src/nsFontFace.cpp b/layout/inspector/src/nsFontFace.cpp index 50a7ce6cce9b..3256610b41ec 100644 --- a/layout/inspector/src/nsFontFace.cpp +++ b/layout/inspector/src/nsFontFace.cpp @@ -108,7 +108,7 @@ nsFontFace::GetURI(nsAString & aURI) if (mFontEntry->IsUserFont() && !mFontEntry->IsLocalUserFont()) { NS_ASSERTION(mFontEntry->mUserFontData, "missing userFontData"); if (mFontEntry->mUserFontData->mURI) { - nsCAutoString spec; + nsAutoCString spec; mFontEntry->mUserFontData->mURI->GetSpec(spec); AppendUTF8toUTF16(spec, aURI); } @@ -177,7 +177,7 @@ nsFontFace::GetMetadata(nsAString & aMetadata) NS_ASSERTION(mFontEntry->mUserFontData, "missing userFontData"); const gfxUserFontData* userFontData = mFontEntry->mUserFontData; if (userFontData->mMetadata.Length() && userFontData->mMetaOrigLen) { - nsCAutoString str; + nsAutoCString str; str.SetLength(userFontData->mMetaOrigLen); if (str.Length() == userFontData->mMetaOrigLen) { uLongf destLen = userFontData->mMetaOrigLen; diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index a3f0fc1c26ee..4b37db0bcdf7 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -219,7 +219,7 @@ nsGlyphTable::ElementAt(nsPresContext* aPresContext, nsMathMLChar* aChar, if (mState == NS_TABLE_STATE_EMPTY) { nsresult rv = LoadProperties(mFontName[0], mGlyphProperties); #ifdef DEBUG - nsCAutoString uriStr; + nsAutoCString uriStr; uriStr.AssignLiteral("resource://gre/res/fonts/mathfont"); LossyAppendUTF16toASCII(mFontName[0], uriStr); uriStr.StripWhitespace(); // that may come from mFontName @@ -235,7 +235,7 @@ nsGlyphTable::ElementAt(nsPresContext* aPresContext, nsMathMLChar* aChar, mState = NS_TABLE_STATE_READY; // see if there are external fonts needed for certain chars in this table - nsCAutoString key; + nsAutoCString key; nsAutoString value; for (int32_t i = 1; ; i++) { key.AssignLiteral("external."); @@ -514,7 +514,7 @@ GetFontExtensionPref(PRUnichar aChar, static const char* kMathFontPrefix = "font.mathfont-family."; - nsCAutoString extension; + nsAutoCString extension; switch (aExtension) { case eExtension_base: @@ -531,14 +531,14 @@ GetFontExtensionPref(PRUnichar aChar, } // .\\uNNNN key - nsCAutoString key; + nsAutoCString key; key.AssignASCII(kMathFontPrefix); char ustr[10]; PR_snprintf(ustr, sizeof(ustr), "\\u%04X", aChar); key.Append(ustr); key.Append(extension); // .\uNNNN key - nsCAutoString alternateKey; + nsAutoCString alternateKey; alternateKey.AssignASCII(kMathFontPrefix); NS_ConvertUTF16toUTF8 tmp(&aChar, 1); alternateKey.Append(tmp); @@ -583,7 +583,7 @@ InitGlobals(nsPresContext* aPresContext) It will be deleted at shutdown, even if a failure happens below. */ - nsCAutoString key; + nsAutoCString key; nsAutoString value; nsCOMPtr mathfontProp; diff --git a/layout/mathml/nsMathMLOperators.cpp b/layout/mathml/nsMathMLOperators.cpp index b71373c2723e..98d8d9903495 100644 --- a/layout/mathml/nsMathMLOperators.cpp +++ b/layout/mathml/nsMathMLOperators.cpp @@ -247,7 +247,7 @@ InitOperators(void) // Get the list of invariant chars for (int32_t i = 0; i < eMATHVARIANT_COUNT; ++i) { - nsCAutoString key(NS_LITERAL_CSTRING("mathvariant.")); + nsAutoCString key(NS_LITERAL_CSTRING("mathvariant.")); key.Append(kMathVariant_name[i]); nsAutoString value; mathfontProp->GetStringProperty(key, value); @@ -264,7 +264,7 @@ InitOperators(void) if (NS_SUCCEEDED(mathfontProp->Enumerate(getter_AddRefs(iterator)))) { bool more; uint32_t index = 0; - nsCAutoString name; + nsAutoCString name; nsAutoString attributes; while ((NS_SUCCEEDED(iterator->HasMoreElements(&more))) && more) { nsCOMPtr element; diff --git a/layout/printing/nsPrintEngine.cpp b/layout/printing/nsPrintEngine.cpp index cacbf821f4c8..9b3203282228 100644 --- a/layout/printing/nsPrintEngine.cpp +++ b/layout/printing/nsPrintEngine.cpp @@ -1161,7 +1161,7 @@ nsPrintEngine::GetDocumentTitleAndURL(nsIDocument* aDoc, if (!exposableURI) return; - nsCAutoString urlCStr; + nsAutoCString urlCStr; exposableURI->GetSpec(urlCStr); nsresult rv; @@ -1507,7 +1507,7 @@ nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError, bool aIsPrinting) PR_PL(("nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError=%lx, bool aIsPrinting=%d)\n", (long)aPrintError, (int)aIsPrinting)); - nsCAutoString stringName; + nsAutoCString stringName; switch(aPrintError) { diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 3228b73ddd94..dc76ccb54c9c 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -271,7 +271,7 @@ static PRLogModuleInfo *gLoaderLog = PR_NewLogModule("nsCSSLoader"); PR_BEGIN_MACRO \ NS_ASSERTION(uri, "Logging null uri"); \ if (LOG_ENABLED()) { \ - nsCAutoString _logURISpec; \ + nsAutoCString _logURISpec; \ uri->GetSpec(_logURISpec); \ LOG((format, _logURISpec.get())); \ } \ @@ -670,7 +670,7 @@ static nsresult GetCharsetFromData(const unsigned char* aStyleSheetData, pos += step; } - nsCAutoString charset; + nsAutoCString charset; while (pos < aDataLength) { if (aStyleSheetData[pos] == '"') { break; @@ -894,7 +894,7 @@ SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader* aLoader, } } - nsCAutoString contentType; + nsAutoCString contentType; if (channel) { channel->GetContentType(contentType); } @@ -929,7 +929,7 @@ SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader* aLoader, errorFlag = nsIScriptError::errorFlag; } - nsCAutoString spec; + nsAutoCString spec; channelURI->GetSpec(spec); const nsAFlatString& specUTF16 = NS_ConvertUTF8toUTF16(spec); @@ -1388,7 +1388,7 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState) NS_ASSERTION(mLoadingDatas.IsInitialized(), "mLoadingDatas should be initialized by now."); #ifdef NS_FUNCTION_TIMER - nsCAutoString spec__("N/A"); + nsAutoCString spec__("N/A"); if (aLoadData->mURI) aLoadData->mURI->GetSpec(spec__); NS_TIME_FUNCTION_FMT("Loading stylesheet (url: %s, %ssync)", spec__.get(), aLoadData->mSyncLoad ? "" : "a"); @@ -1622,7 +1622,7 @@ Loader::ParseSheet(const nsAString& aInput, NS_PRECONDITION(aLoadData->mSheet, "Must have sheet to parse into"); #ifdef NS_FUNCTION_TIMER - nsCAutoString spec__("N/A"); + nsAutoCString spec__("N/A"); if (aLoadData->mURI) aLoadData->mURI->GetSpec(spec__); NS_TIME_FUNCTION_FMT("Parsing stylesheet (url: %s)", spec__.get()); #endif diff --git a/layout/style/nsCSSKeywords.cpp b/layout/style/nsCSSKeywords.cpp index 6d51df563ce4..a387ab2ea6a1 100644 --- a/layout/style/nsCSSKeywords.cpp +++ b/layout/style/nsCSSKeywords.cpp @@ -36,8 +36,8 @@ nsCSSKeywords::AddRefTable(void) // let's verify the table... int32_t index = 0; for (; index < eCSSKeyword_COUNT && kCSSRawKeywords[index]; ++index) { - nsCAutoString temp1(kCSSRawKeywords[index]); - nsCAutoString temp2(kCSSRawKeywords[index]); + nsAutoCString temp1(kCSSRawKeywords[index]); + nsAutoCString temp2(kCSSRawKeywords[index]); ToLowerCase(temp1); NS_ASSERTION(temp1.Equals(temp2), "upper case char in table"); NS_ASSERTION(-1 == temp1.FindChar('_'), "underscore char in table"); diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 36238be81d00..0c0e149a85c1 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -131,8 +131,8 @@ nsCSSProps::AddRefTable(void) { // let's verify the table... for (int32_t index = 0; index < eCSSProperty_COUNT; ++index) { - nsCAutoString temp1(kCSSRawProperties[index]); - nsCAutoString temp2(kCSSRawProperties[index]); + nsAutoCString temp1(kCSSRawProperties[index]); + nsAutoCString temp2(kCSSRawProperties[index]); ToLowerCase(temp1); NS_ABORT_IF_FALSE(temp1.Equals(temp2), "upper case char in prop table"); NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'), @@ -149,8 +149,8 @@ nsCSSProps::AddRefTable(void) { // let's verify the table... for (int32_t index = 0; index < eCSSFontDesc_COUNT; ++index) { - nsCAutoString temp1(kCSSRawFontDescs[index]); - nsCAutoString temp2(kCSSRawFontDescs[index]); + nsAutoCString temp1(kCSSRawFontDescs[index]); + nsAutoCString temp2(kCSSRawFontDescs[index]); ToLowerCase(temp1); NS_ABORT_IF_FALSE(temp1.Equals(temp2), "upper case char in desc table"); NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'), diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index 70bbdfcfeb79..3a3244e30c43 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -932,7 +932,7 @@ DocumentRule::List(FILE* out, int32_t aIndent) const { for (int32_t indent = aIndent; --indent >= 0; ) fputs(" ", out); - nsCAutoString str; + nsAutoCString str; str.AssignLiteral("@-moz-document "); for (URL *url = mURLs; url; url = url->next) { switch (url->func) { @@ -949,7 +949,7 @@ DocumentRule::List(FILE* out, int32_t aIndent) const str.AppendLiteral("regexp(\""); break; } - nsCAutoString escapedURL(url->url); + nsAutoCString escapedURL(url->url); escapedURL.ReplaceSubstring("\"", "\\\""); // escape quotes str.Append(escapedURL); str.AppendLiteral("\"), "); @@ -1054,7 +1054,7 @@ DocumentRule::UseForPresentation(nsPresContext* aPresContext, { nsIDocument *doc = aPresContext->Document(); nsIURI *docURI = doc->GetDocumentURI(); - nsCAutoString docURISpec; + nsAutoCString docURISpec; if (docURI) docURI->GetSpec(docURISpec); @@ -1069,7 +1069,7 @@ DocumentRule::UseForPresentation(nsPresContext* aPresContext, return true; } break; case eDomain: { - nsCAutoString host; + nsAutoCString host; if (docURI) docURI->GetHost(host); int32_t lenDiff = host.Length() - url->url.Length(); @@ -1334,7 +1334,7 @@ AppendSerializedUnicodeRange(nsCSSValue const & aValue, return; nsCSSValue::Array const & sources = *aValue.GetArrayValue(); - nsCAutoString buf; + nsAutoCString buf; NS_ABORT_IF_FALSE(sources.Count() % 2 == 0, "odd number of entries in a unicode-range: array"); diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp index e1ff31a4ba5d..5c76ff4c209b 100644 --- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -1525,7 +1525,7 @@ nsCSSStyleSheet::List(FILE* out, int32_t aIndent) const for (index = aIndent; --index >= 0; ) fputs(" ", out); fputs("CSS Style Sheet: ", out); - nsCAutoString urlSpec; + nsAutoCString urlSpec; nsresult rv = mInner->mSheetURI->GetSpec(urlSpec); if (NS_SUCCEEDED(rv) && !urlSpec.IsEmpty()) { fputs(urlSpec.get(), out); @@ -1695,7 +1695,7 @@ NS_IMETHODIMP nsCSSStyleSheet::GetHref(nsAString& aHref) { if (mInner->mOriginalSheetURI) { - nsCAutoString str; + nsAutoCString str; mInner->mOriginalSheetURI->GetSpec(str); CopyUTF8toUTF16(str, aHref); } else { diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index 505bd1bd96ac..ed771c70395b 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -837,7 +837,7 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const else if (eCSSUnit_EnumColor == unit) { // we can lookup the property in the ColorTable and then // get a string mapping the name - nsCAutoString str; + nsAutoCString str; if (nsCSSProps::GetColorName(GetIntValue(), str)){ AppendASCIItoUTF16(str, aResult); } else { diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index 26c8a8d0ceef..2c399b432e56 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -159,7 +159,7 @@ nsFontFaceLoader::OnStreamComplete(nsIStreamLoader* aLoader, #ifdef PR_LOGGING if (LOG_ENABLED()) { - nsCAutoString fontURI; + nsAutoCString fontURI; mFontURI->GetSpec(fontURI); if (NS_SUCCEEDED(aStatus)) { LOG(("fontdownloader (%p) download completed - font uri: (%s)\n", @@ -349,7 +349,7 @@ nsUserFontSet::StartLoad(gfxProxyFontEntry *aProxy, #ifdef PR_LOGGING if (LOG_ENABLED()) { - nsCAutoString fontURI, referrerURI; + nsAutoCString fontURI, referrerURI; aFontFaceSrc->mURI->GetSpec(fontURI); if (aFontFaceSrc->mReferrer) aFontFaceSrc->mReferrer->GetSpec(referrerURI); @@ -700,7 +700,7 @@ nsUserFontSet::LogMessage(gfxProxyFontEntry *aProxy, } NS_ConvertUTF16toUTF8 familyName(aProxy->FamilyName()); - nsCAutoString fontURI; + nsAutoCString fontURI; if (aProxy->mSrcIndex == aProxy->mSrcList.Length()) { fontURI.AppendLiteral("(end of source list)"); } else { @@ -904,7 +904,7 @@ nsUserFontSet::SyncLoadFontData(gfxProxyFontEntry *aFontToLoad, // make sure there's a mime type if (NS_SUCCEEDED(rv)) { - nsCAutoString mimeType; + nsAutoCString mimeType; rv = channel->GetContentType(mimeType); aBufferLength = totalRead; } diff --git a/layout/style/nsHTMLCSSStyleSheet.cpp b/layout/style/nsHTMLCSSStyleSheet.cpp index cccb62f1e20d..2fdde7744e16 100644 --- a/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/layout/style/nsHTMLCSSStyleSheet.cpp @@ -227,7 +227,7 @@ nsHTMLCSSStyleSheet::List(FILE* out, int32_t aIndent) const for (int32_t index = aIndent; --index >= 0; ) fputs(" ", out); fputs("HTML CSS Style Sheet: ", out); - nsCAutoString urlSpec; + nsAutoCString urlSpec; mURL->GetSpec(urlSpec); if (!urlSpec.IsEmpty()) { fputs(urlSpec.get(), out); diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index e62ec505a7a8..4f9b872bb6b3 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -480,7 +480,7 @@ nsHTMLStyleSheet::List(FILE* out, int32_t aIndent) const for (int32_t index = aIndent; --index >= 0; ) fputs(" ", out); fputs("HTML Style Sheet: ", out); - nsCAutoString urlSpec; + nsAutoCString urlSpec; mURL->GetSpec(urlSpec); if (!urlSpec.IsEmpty()) { fputs(urlSpec.get(), out); diff --git a/layout/style/nsROCSSPrimitiveValue.cpp b/layout/style/nsROCSSPrimitiveValue.cpp index 0c14c622c5d4..ee20e3dff889 100644 --- a/layout/style/nsROCSSPrimitiveValue.cpp +++ b/layout/style/nsROCSSPrimitiveValue.cpp @@ -75,7 +75,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAString& aCssText) case CSS_URI : { if (mValue.mURI) { - nsCAutoString specUTF8; + nsAutoCString specUTF8; mValue.mURI->GetSpec(specUTF8); tmpStr.AssignLiteral("url("); @@ -365,7 +365,7 @@ nsROCSSPrimitiveValue::GetStringValue(nsAString& aReturn) aReturn.Assign(mValue.mString); break; case CSS_URI: { - nsCAutoString spec; + nsAutoCString spec; if (mValue.mURI) mValue.mURI->GetSpec(spec); CopyUTF8toUTF16(spec, aReturn); diff --git a/layout/style/nsStyleAnimation.cpp b/layout/style/nsStyleAnimation.cpp index 116d5a319fdc..ea89f7c436f6 100644 --- a/layout/style/nsStyleAnimation.cpp +++ b/layout/style/nsStyleAnimation.cpp @@ -348,7 +348,7 @@ SetCalcValue(const nsStyleCoord::Calc* aCalc, nsCSSValue& aValue) static already_AddRefed GetURIAsUtf16StringBuffer(nsIURI* aUri) { - nsCAutoString utf8String; + nsAutoCString utf8String; nsresult rv = aUri->GetSpec(utf8String); NS_ENSURE_SUCCESS(rv, nullptr); diff --git a/layout/style/test/TestCSSPropertyLookup.cpp b/layout/style/test/TestCSSPropertyLookup.cpp index 81a5b9b0d66c..e097787ade57 100644 --- a/layout/style/test/TestCSSPropertyLookup.cpp +++ b/layout/style/test/TestCSSPropertyLookup.cpp @@ -70,7 +70,7 @@ TestProps() // Now make sure we don't find some garbage for (int i = 0; i < (int) (sizeof(kJunkNames) / sizeof(const char*)); i++) { const char* const tag = kJunkNames[i]; - id = nsCSSProps::LookupProperty(nsCAutoString(tag), nsCSSProps::eAny); + id = nsCSSProps::LookupProperty(nsAutoCString(tag), nsCSSProps::eAny); if (id >= 0) { printf("bug: found '%s'\n", tag ? tag : "(null)"); success = false; @@ -140,7 +140,7 @@ TestKeywords() // Now make sure we don't find some garbage for (int i = 0; i < (int) (sizeof(kJunkNames) / sizeof(const char*)); i++) { const char* const tag = kJunkNames[i]; - id = nsCSSKeywords::LookupKeyword(nsCAutoString(tag)); + id = nsCSSKeywords::LookupKeyword(nsAutoCString(tag)); if (eCSSKeyword_UNKNOWN < id) { printf("bug: found '%s'\n", tag ? tag : "(null)"); success = false; diff --git a/layout/xul/base/src/nsXULTooltipListener.cpp b/layout/xul/base/src/nsXULTooltipListener.cpp index 23a70f9ee58c..4a13276e999b 100644 --- a/layout/xul/base/src/nsXULTooltipListener.cpp +++ b/layout/xul/base/src/nsXULTooltipListener.cpp @@ -349,7 +349,7 @@ nsXULTooltipListener::CheckTreeBodyMove(nsIDOMMouseEvent* aMouseEvent) int32_t row; nsCOMPtr col; - nsCAutoString obj; + nsAutoCString obj; // subtract off the documentElement's boxObject int32_t boxX, boxY; diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 256d52f01015..74156a6bd3a4 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -2096,7 +2096,7 @@ nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContex return NS_OK; nsCOMPtr uri; styleRequest->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); CopyUTF8toUTF16(spec, imageSrc); } diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp index 8ba5afd1e926..803fa6c3b10f 100644 --- a/modules/libjar/nsJAR.cpp +++ b/modules/libjar/nsJAR.cpp @@ -247,7 +247,7 @@ nsJAR::Extract(const nsACString &aEntryName, nsIFile* outFile) if (NS_FAILED(rv)) return rv; // ExtractFile also closes the fd handle and resolves the symlink if needed - nsCAutoString path; + nsAutoCString path; rv = outFile->GetNativePath(path); if (NS_FAILED(rv)) return rv; @@ -504,7 +504,7 @@ nsJAR::ParseManifest() return NS_OK; } - nsCAutoString manifestFilename; + nsAutoCString manifestFilename; rv = files->GetNext(manifestFilename); NS_ENSURE_SUCCESS(rv, rv); @@ -547,19 +547,19 @@ nsJAR::ParseManifest() if (NS_FAILED(rv)) return rv; //-- Get its corresponding signature file - nsCAutoString sigFilename(manifestFilename); + nsAutoCString sigFilename(manifestFilename); int32_t extension = sigFilename.RFindChar('.') + 1; NS_ASSERTION(extension != 0, "Manifest Parser: Missing file extension."); (void)sigFilename.Cut(extension, 2); nsXPIDLCString sigBuffer; uint32_t sigLen; { - nsCAutoString tempFilename(sigFilename); tempFilename.Append("rsa", 3); + nsAutoCString tempFilename(sigFilename); tempFilename.Append("rsa", 3); rv = LoadEntry(tempFilename, getter_Copies(sigBuffer), &sigLen); } if (NS_FAILED(rv)) { - nsCAutoString tempFilename(sigFilename); tempFilename.Append("RSA", 3); + nsAutoCString tempFilename(sigFilename); tempFilename.Append("RSA", 3); rv = LoadEntry(tempFilename, getter_Copies(sigBuffer), &sigLen); } if (NS_FAILED(rv)) @@ -606,7 +606,7 @@ nsJAR::ParseOneFile(const char* filebuf, int16_t aFileType) { //-- Check file header const char* nextLineStart = filebuf; - nsCAutoString curLine; + nsAutoCString curLine; int32_t linelen; linelen = ReadLine(&nextLineStart); curLine.Assign(filebuf, linelen); @@ -630,8 +630,8 @@ nsJAR::ParseOneFile(const char* filebuf, int16_t aFileType) if (!(curItemMF = new nsJARManifestItem())) return NS_ERROR_OUT_OF_MEMORY; - nsCAutoString curItemName; - nsCAutoString storedSectionDigest; + nsAutoCString curItemName; + nsAutoCString storedSectionDigest; for(;;) { @@ -727,7 +727,7 @@ nsJAR::ParseOneFile(const char* filebuf, int16_t aFileType) { curPos = nextLineStart; int32_t continuationLen = ReadLine(&nextLineStart) - 1; - nsCAutoString continuation(curPos+1, continuationLen); + nsAutoCString continuation(curPos+1, continuationLen); curLine += continuation; linelen += continuationLen; } @@ -737,9 +737,9 @@ nsJAR::ParseOneFile(const char* filebuf, int16_t aFileType) if (colonPos == -1) // No colon on line, ignore line continue; //-- Break down the line - nsCAutoString lineName; + nsAutoCString lineName; curLine.Left(lineName, colonPos); - nsCAutoString lineData; + nsAutoCString lineData; curLine.Mid(lineData, colonPos+2, linelen - (colonPos+2)); //-- Lines to look for: @@ -1074,7 +1074,7 @@ nsZipReaderCache::GetZip(nsIFile* zipFile, nsIZipReader* *result) mZipCacheLookups++; #endif - nsCAutoString uri; + nsAutoCString uri; rv = zipFile->GetNativePath(uri); if (NS_FAILED(rv)) return rv; @@ -1125,7 +1125,7 @@ nsZipReaderCache::GetInnerZip(nsIFile* zipFile, const nsACString &entry, mZipCacheLookups++; #endif - nsCAutoString uri; + nsAutoCString uri; rv = zipFile->GetNativePath(uri); if (NS_FAILED(rv)) return rv; @@ -1239,7 +1239,7 @@ nsZipReaderCache::ReleaseZip(nsJAR* zip) #endif // remove from hashtable - nsCAutoString uri; + nsAutoCString uri; rv = oldest->GetJarPath(uri); if (NS_FAILED(rv)) return rv; @@ -1310,7 +1310,7 @@ nsZipReaderCache::Observe(nsISupports *aSubject, if (!file) return NS_OK; - nsCAutoString uri; + nsAutoCString uri; if (NS_FAILED(file->GetNativePath(uri))) return NS_OK; diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 91878dffa926..133298a74057 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -732,7 +732,7 @@ NS_IMETHODIMP nsJARChannel::SetAppURI(nsIURI *aURI) { NS_ENSURE_ARG_POINTER(aURI); - nsCAutoString scheme; + nsAutoCString scheme; aURI->GetScheme(scheme); if (!scheme.EqualsLiteral("app")) { return NS_ERROR_INVALID_ARG; @@ -791,13 +791,13 @@ nsJARChannel::OnDownloadComplete(nsIDownloader *downloader, // We only want to run scripts if the server really intended to // send us a JAR file. Check the server-supplied content type for // a JAR type. - nsCAutoString header; + nsAutoCString header; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Type"), header); - nsCAutoString contentType; - nsCAutoString charset; + nsAutoCString contentType; + nsAutoCString charset; NS_ParseContentType(header, contentType, charset); - nsCAutoString channelContentType; + nsAutoCString channelContentType; channel->GetContentType(channelContentType); mIsUnsafe = !(contentType.Equals(channelContentType) && (contentType.EqualsLiteral("application/java-archive") || diff --git a/modules/libjar/nsJARInputStream.cpp b/modules/libjar/nsJARInputStream.cpp index f7a7b2aa4525..bf954160b24c 100644 --- a/modules/libjar/nsJARInputStream.cpp +++ b/modules/libjar/nsJARInputStream.cpp @@ -92,7 +92,7 @@ nsJARInputStream::InitDirectory(nsJAR* aJar, // iterate through dirName and copy it to escDirName, escaping chars // which are special at the "top" level of the regexp so FindEntries // works correctly - nsCAutoString escDirName; + nsAutoCString escDirName; const char* curr = dirName.BeginReading(); const char* end = dirName.EndReading(); while (curr != end) { @@ -114,7 +114,7 @@ nsJARInputStream::InitDirectory(nsJAR* aJar, } ++curr; } - nsCAutoString pattern = escDirName + NS_LITERAL_CSTRING("?*~") + + nsAutoCString pattern = escDirName + NS_LITERAL_CSTRING("?*~") + escDirName + NS_LITERAL_CSTRING("?*/?*"); rv = mJar->mZip->FindInit(pattern.get(), &find); if (NS_FAILED(rv)) return rv; diff --git a/modules/libjar/nsJARURI.cpp b/modules/libjar/nsJARURI.cpp index 92b2a0ccb422..b44b3e04eec1 100644 --- a/modules/libjar/nsJARURI.cpp +++ b/modules/libjar/nsJARURI.cpp @@ -75,7 +75,7 @@ nsJARURI::FormatSpec(const nsACString &entrySpec, nsACString &result, NS_ASSERTION(StringBeginsWith(entrySpec, NS_BOGUS_ENTRY_SCHEME), "bogus entry spec"); - nsCAutoString fileSpec; + nsAutoCString fileSpec; nsresult rv = mJARFile->GetSpec(fileSpec); if (NS_FAILED(rv)) return rv; @@ -102,7 +102,7 @@ nsJARURI::CreateEntryURL(const nsACString& entryFilename, } // Flatten the concatenation, just in case. See bug 128288 - nsCAutoString spec(NS_BOGUS_ENTRY_SCHEME + entryFilename); + nsAutoCString spec(NS_BOGUS_ENTRY_SCHEME + entryFilename); nsresult rv = stdURL->Init(nsIStandardURL::URLTYPE_NO_AUTHORITY, -1, spec, charset, nullptr); if (NS_FAILED(rv)) { @@ -216,7 +216,7 @@ nsJARURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) NS_IMETHODIMP nsJARURI::GetSpec(nsACString &aSpec) { - nsCAutoString entrySpec; + nsAutoCString entrySpec; mJAREntry->GetSpec(entrySpec); return FormatSpec(entrySpec, aSpec); } @@ -224,7 +224,7 @@ nsJARURI::GetSpec(nsACString &aSpec) NS_IMETHODIMP nsJARURI::GetSpecIgnoringRef(nsACString &aSpec) { - nsCAutoString entrySpec; + nsAutoCString entrySpec; mJAREntry->GetSpecIgnoringRef(entrySpec); return FormatSpec(entrySpec, aSpec); } @@ -249,7 +249,7 @@ nsJARURI::SetSpecWithBase(const nsACString &aSpec, nsIURI* aBaseURL) nsCOMPtr ioServ(do_GetIOService(&rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString scheme; + nsAutoCString scheme; rv = ioServ->ExtractScheme(aSpec, scheme); if (NS_FAILED(rv)) { // not an absolute URI @@ -412,7 +412,7 @@ nsJARURI::SetPort(int32_t aPort) NS_IMETHODIMP nsJARURI::GetPath(nsACString &aPath) { - nsCAutoString entrySpec; + nsAutoCString entrySpec; mJAREntry->GetSpec(entrySpec); return FormatSpec(entrySpec, aPath, false); } @@ -529,7 +529,7 @@ nsJARURI::Resolve(const nsACString &relativePath, nsACString &result) if (NS_FAILED(rv)) return rv; - nsCAutoString scheme; + nsAutoCString scheme; rv = ioServ->ExtractScheme(relativePath, scheme); if (NS_SUCCEEDED(rv)) { // then aSpec is absolute @@ -537,7 +537,7 @@ nsJARURI::Resolve(const nsACString &relativePath, nsACString &result) return NS_OK; } - nsCAutoString resolvedPath; + nsAutoCString resolvedPath; mJAREntry->Resolve(relativePath, resolvedPath); return FormatSpec(resolvedPath, result); @@ -659,7 +659,7 @@ nsJARURI::GetCommonBaseSpec(nsIURI* uriToCompare, nsACString& commonSpec) // Not a URL, so nothing in common return NS_OK; } - nsCAutoString common; + nsAutoCString common; rv = ourJARFileURL->GetCommonBaseSpec(otherJARFile, common); if (NS_FAILED(rv)) return rv; @@ -669,11 +669,11 @@ nsJARURI::GetCommonBaseSpec(nsIURI* uriToCompare, nsACString& commonSpec) } // At this point we have the same JAR file. Compare the JAREntrys - nsCAutoString otherEntry; + nsAutoCString otherEntry; rv = otherJARURI->GetJAREntry(otherEntry); if (NS_FAILED(rv)) return rv; - nsCAutoString otherCharset; + nsAutoCString otherCharset; rv = uriToCompare->GetOriginCharset(otherCharset); if (NS_FAILED(rv)) return rv; @@ -681,7 +681,7 @@ nsJARURI::GetCommonBaseSpec(nsIURI* uriToCompare, nsACString& commonSpec) rv = CreateEntryURL(otherEntry, otherCharset.get(), getter_AddRefs(url)); if (NS_FAILED(rv)) return rv; - nsCAutoString common; + nsAutoCString common; rv = mJAREntry->GetCommonBaseSpec(url, common); if (NS_FAILED(rv)) return rv; @@ -716,11 +716,11 @@ nsJARURI::GetRelativeSpec(nsIURI* uriToCompare, nsACString& relativeSpec) } // Same JAR file. Compare the JAREntrys - nsCAutoString otherEntry; + nsAutoCString otherEntry; rv = otherJARURI->GetJAREntry(otherEntry); if (NS_FAILED(rv)) return rv; - nsCAutoString otherCharset; + nsAutoCString otherCharset; rv = uriToCompare->GetOriginCharset(otherCharset); if (NS_FAILED(rv)) return rv; @@ -728,7 +728,7 @@ nsJARURI::GetRelativeSpec(nsIURI* uriToCompare, nsACString& relativeSpec) rv = CreateEntryURL(otherEntry, otherCharset.get(), getter_AddRefs(url)); if (NS_FAILED(rv)) return rv; - nsCAutoString relativeEntrySpec; + nsAutoCString relativeEntrySpec; rv = mJAREntry->GetRelativeSpec(url, relativeEntrySpec); if (NS_FAILED(rv)) return rv; @@ -751,7 +751,7 @@ nsJARURI::GetJARFile(nsIURI* *jarFile) NS_IMETHODIMP nsJARURI::GetJAREntry(nsACString &entryPath) { - nsCAutoString filePath; + nsAutoCString filePath; mJAREntry->GetFilePath(filePath); NS_ASSERTION(filePath.Length() > 0, "path should never be empty!"); // Trim off the leading '/' diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferences.cpp index e401e42ddf78..875edfdc4603 100644 --- a/modules/libpref/src/Preferences.cpp +++ b/modules/libpref/src/Preferences.cpp @@ -440,7 +440,7 @@ ReadExtensionPrefs(nsIFile *aFile) bool more; while (NS_SUCCEEDED(rv = files->HasMore(&more)) && more) { - nsCAutoString entry; + nsAutoCString entry; rv = files->GetNext(entry); NS_ENSURE_SUCCESS(rv, rv); @@ -788,7 +788,7 @@ static nsresult openPrefFile(nsIFile* aFile) static int pref_CompareFileNames(nsIFile* aFile1, nsIFile* aFile2, void* /*unused*/) { - nsCAutoString filename1, filename2; + nsAutoCString filename1, filename2; aFile1->GetNativeLeafName(filename1); aFile2->GetNativeLeafName(filename2); @@ -826,7 +826,7 @@ pref_LoadPrefsInDir(nsIFile* aDir, char const *const *aSpecialFiles, uint32_t aS nsCOMPtr prefFile; while (hasMoreElements && NS_SUCCEEDED(rv)) { - nsCAutoString leafName; + nsAutoCString leafName; rv = dirIterator->GetNext(getter_AddRefs(prefFile)); if (NS_FAILED(rv)) { @@ -919,7 +919,7 @@ static nsresult pref_LoadPrefsInDirList(const char *listId) if (!path) continue; - nsCAutoString leaf; + nsAutoCString leaf; path->GetNativeLeafName(leaf); // Do we care if a file provided by this process fails to load? @@ -1134,7 +1134,7 @@ Preferences::GetCString(const char* aPref, nsACString* aResult) { NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - nsCAutoString result; + nsAutoCString result; nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), false); if (NS_SUCCEEDED(rv)) { *aResult = result; @@ -1148,7 +1148,7 @@ Preferences::GetString(const char* aPref, nsAString* aResult) { NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - nsCAutoString result; + nsAutoCString result; nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), false); if (NS_SUCCEEDED(rv)) { CopyUTF8toUTF16(result, *aResult); @@ -1516,7 +1516,7 @@ Preferences::GetDefaultCString(const char* aPref, nsACString* aResult) { NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - nsCAutoString result; + nsAutoCString result; nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), true); if (NS_SUCCEEDED(rv)) { *aResult = result; @@ -1530,7 +1530,7 @@ Preferences::GetDefaultString(const char* aPref, nsAString* aResult) { NS_PRECONDITION(aResult, "aResult must not be NULL"); NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); - nsCAutoString result; + nsAutoCString result; nsresult rv = PREF_CopyCharPref(aPref, getter_Copies(result), true); if (NS_SUCCEEDED(rv)) { CopyUTF8toUTF16(result, *aResult); diff --git a/modules/libpref/src/nsPrefBranch.cpp b/modules/libpref/src/nsPrefBranch.cpp index 4d8d4d04bf2c..7a0cd970e1c1 100644 --- a/modules/libpref/src/nsPrefBranch.cpp +++ b/modules/libpref/src/nsPrefBranch.cpp @@ -267,7 +267,7 @@ NS_IMETHODIMP nsPrefBranch::GetComplexValue(const char *aPrefName, const nsIID & nsACString::const_iterator keyEnd(keyBegin); if (!FindCharInReadable(']', keyEnd, strEnd)) return NS_ERROR_FAILURE; - nsCAutoString key(Substring(keyBegin, keyEnd)); + nsAutoCString key(Substring(keyBegin, keyEnd)); nsCOMPtr fromFile; nsCOMPtr directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); @@ -323,7 +323,7 @@ NS_IMETHODIMP nsPrefBranch::SetComplexValue(const char *aPrefName, const nsIID & nsCOMPtr file = do_QueryInterface(aValue); if (!file) return NS_NOINTERFACE; - nsCAutoString descriptorString; + nsAutoCString descriptorString; rv = file->GetPersistentDescriptor(descriptorString); if (NS_SUCCEEDED(rv)) { @@ -341,7 +341,7 @@ NS_IMETHODIMP nsPrefBranch::SetComplexValue(const char *aPrefName, const nsIID & relFilePref->GetFile(getter_AddRefs(file)); if (!file) return NS_NOINTERFACE; - nsCAutoString relativeToKey; + nsAutoCString relativeToKey; (void) relFilePref->GetRelativeToKey(relativeToKey); nsCOMPtr relativeToFile; @@ -352,12 +352,12 @@ NS_IMETHODIMP nsPrefBranch::SetComplexValue(const char *aPrefName, const nsIID & if (NS_FAILED(rv)) return rv; - nsCAutoString relDescriptor; + nsAutoCString relDescriptor; rv = file->GetRelativeDescriptor(relativeToFile, relDescriptor); if (NS_FAILED(rv)) return rv; - nsCAutoString descriptorString; + nsAutoCString descriptorString; descriptorString.Append('['); descriptorString.Append(relativeToKey); descriptorString.Append(']'); @@ -624,7 +624,7 @@ nsresult nsPrefBranch::NotifyObserver(const char *newpref, void *data) // remove any root this string may contain so as to not confuse the observer // by passing them something other than what they passed us as a topic uint32_t len = pCallback->GetPrefBranch()->GetRootLength(); - nsCAutoString suffix(newpref + len); + nsAutoCString suffix(newpref + len); observer->Observe(static_cast(pCallback->GetPrefBranch()), NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, diff --git a/modules/libpref/src/prefapi.cpp b/modules/libpref/src/prefapi.cpp index 18354b93679d..483e672a9fd8 100644 --- a/modules/libpref/src/prefapi.cpp +++ b/modules/libpref/src/prefapi.cpp @@ -335,8 +335,8 @@ pref_savePref(PLDHashTable *table, PLDHashEntryHdr *heh, uint32_t i, void *arg) if (!pref) return PL_DHASH_NEXT; - nsCAutoString prefValue; - nsCAutoString prefPrefix; + nsAutoCString prefValue; + nsAutoCString prefPrefix; prefPrefix.Assign(NS_LITERAL_CSTRING("user_pref(\"")); // where we're getting our pref from @@ -371,7 +371,7 @@ pref_savePref(PLDHashTable *table, PLDHashEntryHdr *heh, uint32_t i, void *arg) else if (pref->flags & PREF_BOOL) prefValue = (sourcePref->boolVal) ? "true" : "false"; - nsCAutoString prefName; + nsAutoCString prefName; str_escape(pref->key, prefName); argData->prefArray[i] = ToNewCString(prefPrefix + @@ -591,7 +591,7 @@ PREF_DeleteBranch(const char *branch_name) * does not. When nsIPref goes away this function should be fixed to * never add the period at all. */ - nsCAutoString branch_dot(branch_name); + nsAutoCString branch_dot(branch_name); if ((len > 1) && branch_name[len - 1] != '.') branch_dot += '.'; diff --git a/netwerk/base/public/nsNetUtil.h b/netwerk/base/public/nsNetUtil.h index 778043411beb..cc1599aa5080 100644 --- a/netwerk/base/public/nsNetUtil.h +++ b/netwerk/base/public/nsNetUtil.h @@ -300,7 +300,7 @@ NS_MakeAbsoluteURI(char **result, nsIIOService *unused = nullptr) { nsresult rv; - nsCAutoString resultBuf; + nsAutoCString resultBuf; rv = NS_MakeAbsoluteURI(resultBuf, nsDependentCString(spec), baseURI); if (NS_SUCCEEDED(rv)) { *result = ToNewCString(resultBuf); @@ -323,7 +323,7 @@ NS_MakeAbsoluteURI(nsAString &result, rv = NS_OK; } else { - nsCAutoString resultBuf; + nsAutoCString resultBuf; if (spec.IsEmpty()) rv = baseURI->GetSpec(resultBuf); else @@ -394,7 +394,7 @@ NS_GetRealPort(nsIURI* aURI, // Otherwise, we have to get the default port from the protocol handler // Need the scheme first - nsCAutoString scheme; + nsAutoCString scheme; rv = aURI->GetScheme(scheme); if (NS_FAILED(rv)) return -1; @@ -709,7 +709,7 @@ NS_CheckPortSafety(nsIURI *uri) { nsresult rv = uri->GetPort(&port); if (NS_FAILED(rv) || port == -1) // port undefined or default-valued return NS_OK; - nsCAutoString scheme; + nsAutoCString scheme; uri->GetScheme(scheme); return NS_CheckPortSafety(port, scheme.get()); } @@ -862,7 +862,7 @@ NS_ExamineForProxy(const char *scheme, nsCOMPtr pps = do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { - nsCAutoString spec(scheme); + nsAutoCString spec(scheme); spec.Append("://"); spec.Append(host); spec.Append(':'); @@ -1664,7 +1664,7 @@ NS_SecurityHashURI(nsIURI* aURI) { nsCOMPtr baseURI = NS_GetInnermostURI(aURI); - nsCAutoString scheme; + nsAutoCString scheme; uint32_t schemeHash = 0; if (NS_SUCCEEDED(baseURI->GetScheme(scheme))) schemeHash = mozilla::HashString(scheme); @@ -1677,14 +1677,14 @@ NS_SecurityHashURI(nsIURI* aURI) scheme.EqualsLiteral("mailbox") || scheme.EqualsLiteral("news")) { - nsCAutoString spec; + nsAutoCString spec; uint32_t specHash = baseURI->GetSpec(spec); if (NS_SUCCEEDED(specHash)) specHash = mozilla::HashString(spec); return specHash; } - nsCAutoString host; + nsAutoCString host; uint32_t hostHash = 0; if (NS_SUCCEEDED(baseURI->GetAsciiHost(host))) hostHash = mozilla::HashString(host); @@ -1731,7 +1731,7 @@ NS_SecurityCompareURIs(nsIURI* aSourceURI, return false; // Compare schemes - nsCAutoString targetScheme; + nsAutoCString targetScheme; bool sameScheme = false; if (NS_FAILED( targetBaseURI->GetScheme(targetScheme) ) || NS_FAILED( sourceBaseURI->SchemeIs(targetScheme.get(), &sameScheme) ) || @@ -1775,16 +1775,16 @@ NS_SecurityCompareURIs(nsIURI* aSourceURI, { // Each message is a distinct trust domain; use the // whole spec for comparison - nsCAutoString targetSpec; - nsCAutoString sourceSpec; + nsAutoCString targetSpec; + nsAutoCString sourceSpec; return ( NS_SUCCEEDED( targetBaseURI->GetSpec(targetSpec) ) && NS_SUCCEEDED( sourceBaseURI->GetSpec(sourceSpec) ) && targetSpec.Equals(sourceSpec) ); } // Compare hosts - nsCAutoString targetHost; - nsCAutoString sourceHost; + nsAutoCString targetHost; + nsAutoCString sourceHost; if (NS_FAILED( targetBaseURI->GetAsciiHost(targetHost) ) || NS_FAILED( sourceBaseURI->GetAsciiHost(sourceHost) )) { @@ -1980,7 +1980,7 @@ NS_GetContentDispositionFromHeader(const nsACString& aHeader, nsIChannel *aChan if (NS_FAILED(rv)) return nsIChannel::DISPOSITION_ATTACHMENT; - nsCAutoString fallbackCharset; + nsAutoCString fallbackCharset; if (aChan) { nsCOMPtr uri; aChan->GetURI(getter_AddRefs(uri)); @@ -2023,7 +2023,7 @@ NS_GetFilenameFromDisposition(nsAString& aFilename, nsCOMPtr url = do_QueryInterface(aURI); - nsCAutoString fallbackCharset; + nsAutoCString fallbackCharset; if (url) url->GetOriginCharset(fallbackCharset); // Get the value of 'filename' parameter @@ -2073,7 +2073,7 @@ NS_IsAboutBlank(nsIURI *uri) return false; } - nsCAutoString str; + nsAutoCString str; uri->GetSpec(str); return str.EqualsLiteral("about:blank"); } diff --git a/netwerk/base/public/nsURIHashKey.h b/netwerk/base/public/nsURIHashKey.h index c1f8b658839c..7f391c34b8c6 100644 --- a/netwerk/base/public/nsURIHashKey.h +++ b/netwerk/base/public/nsURIHashKey.h @@ -37,7 +37,7 @@ public: static const nsIURI* KeyToPointer(nsIURI* aKey) { return aKey; } static PLDHashNumber HashKey(const nsIURI* aKey) { - nsCAutoString spec; + nsAutoCString spec; const_cast(aKey)->GetSpec(spec); return mozilla::HashString(spec); } diff --git a/netwerk/base/src/nsBaseChannel.cpp b/netwerk/base/src/nsBaseChannel.cpp index 4b5e8eb6d7d4..0f6aa8ca4a73 100644 --- a/netwerk/base/src/nsBaseChannel.cpp +++ b/netwerk/base/src/nsBaseChannel.cpp @@ -653,7 +653,7 @@ CallTypeSniffers(void *aClosure, const uint8_t *aData, uint32_t aCount) gIOService->GetContentSniffers(); uint32_t length = sniffers.Count(); for (uint32_t i = 0; i < length; ++i) { - nsCAutoString newType; + nsAutoCString newType; nsresult rv = sniffers[i]->GetMIMETypeFromContent(chan, aData, aCount, newType); if (NS_SUCCEEDED(rv) && !newType.IsEmpty()) { @@ -673,7 +673,7 @@ CallUnknownTypeSniffer(void *aClosure, const uint8_t *aData, uint32_t aCount) if (!sniffer) return; - nsCAutoString detected; + nsAutoCString detected; nsresult rv = sniffer->GetMIMETypeFromContent(chan, aData, aCount, detected); if (NS_SUCCEEDED(rv)) chan->SetContentType(detected); diff --git a/netwerk/base/src/nsDirectoryIndexStream.cpp b/netwerk/base/src/nsDirectoryIndexStream.cpp index 53e690afaa78..6863f181e086 100644 --- a/netwerk/base/src/nsDirectoryIndexStream.cpp +++ b/netwerk/base/src/nsDirectoryIndexStream.cpp @@ -81,7 +81,7 @@ static int compare(nsIFile* aElement1, nsIFile* aElement2, void* aData) return Compare(name1, name2); } - nsCAutoString name1, name2; + nsAutoCString name1, name2; aElement1->GetNativeLeafName(name1); aElement2->GetNativeLeafName(name2); @@ -101,7 +101,7 @@ nsDirectoryIndexStream::Init(nsIFile* aDir) #ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) { - nsCAutoString path; + nsAutoCString path; aDir->GetNativePath(path); PR_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: initialized on %s", @@ -153,7 +153,7 @@ nsDirectoryIndexStream::Init(nsIFile* aDir) #endif mBuf.AppendLiteral("300: "); - nsCAutoString url; + nsAutoCString url; rv = net_GetURLSpecFromFile(aDir, url); if (NS_FAILED(rv)) return rv; mBuf.Append(url); @@ -253,7 +253,7 @@ nsDirectoryIndexStream::Read(char* aBuf, uint32_t aCount, uint32_t* aReadCount) #ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) { - nsCAutoString path; + nsAutoCString path; current->GetNativePath(path); PR_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: iterated %s", @@ -293,7 +293,7 @@ nsDirectoryIndexStream::Read(char* aBuf, uint32_t aCount, uint32_t* aReadCount) if (!leafname.IsEmpty()) escaped = nsEscape(NS_ConvertUTF16toUTF8(leafname).get(), url_Path); } else { - nsCAutoString leafname; + nsAutoCString leafname; rv = current->GetNativeLeafName(leafname); if (NS_FAILED(rv)) return rv; if (!leafname.IsEmpty()) diff --git a/netwerk/base/src/nsIOService.cpp b/netwerk/base/src/nsIOService.cpp index e0b76e22ef8d..1c225d81d641 100644 --- a/netwerk/base/src/nsIOService.cpp +++ b/netwerk/base/src/nsIOService.cpp @@ -411,7 +411,7 @@ nsIOService::GetProtocolHandler(const char* scheme, nsIProtocolHandler* *result) nsCOMPtr prefBranch; GetPrefBranch(getter_AddRefs(prefBranch)); if (prefBranch) { - nsCAutoString externalProtocolPref("network.protocol-handler.external."); + nsAutoCString externalProtocolPref("network.protocol-handler.external."); externalProtocolPref += scheme; rv = prefBranch->GetBoolPref(externalProtocolPref.get(), &externalProtocol); if (NS_FAILED(rv)) { @@ -420,7 +420,7 @@ nsIOService::GetProtocolHandler(const char* scheme, nsIProtocolHandler* *result) } if (!externalProtocol) { - nsCAutoString contractID(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX); + nsAutoCString contractID(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX); contractID += scheme; ToLowerCase(contractID); @@ -439,7 +439,7 @@ nsIOService::GetProtocolHandler(const char* scheme, nsIProtocolHandler* *result) rv = CallGetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"moz-gio", result); if (NS_SUCCEEDED(rv)) { - nsCAutoString spec(scheme); + nsAutoCString spec(scheme); spec.Append(':'); nsIURI *uri; @@ -463,7 +463,7 @@ nsIOService::GetProtocolHandler(const char* scheme, nsIProtocolHandler* *result) rv = CallGetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"moz-gnomevfs", result); if (NS_SUCCEEDED(rv)) { - nsCAutoString spec(scheme); + nsAutoCString spec(scheme); spec.Append(':'); nsIURI *uri; @@ -533,7 +533,7 @@ nsIOService::NewURI(const nsACString &aSpec, const char *aCharset, nsIURI *aBase return NS_ERROR_MALFORMED_URI; AutoIncrement inc(&recursionCount); - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = ExtractScheme(aSpec, scheme); if (NS_FAILED(rv)) { // then aSpec is relative @@ -610,7 +610,7 @@ nsIOService::NewChannelFromURIWithProxyFlags(nsIURI *aURI, nsresult rv; NS_ENSURE_ARG_POINTER(aURI); - nsCAutoString scheme; + nsAutoCString scheme; rv = aURI->GetScheme(scheme); if (NS_FAILED(rv)) return rv; @@ -631,7 +631,7 @@ nsIOService::NewChannelFromURIWithProxyFlags(nsIURI *aURI, nsCOMPtr pi; LookupProxyInfo(aURI, aProxyURI, aProxyFlags, &scheme, getter_AddRefs(pi)); if (pi) { - nsCAutoString type; + nsAutoCString type; if (NS_SUCCEEDED(pi->GetType(type)) && type.EqualsLiteral("http")) { // we are going to proxy this channel using an http proxy rv = GetProtocolHandler("http", getter_AddRefs(handler)); @@ -1015,7 +1015,7 @@ nsIOService::ProtocolHasFlags(nsIURI *uri, NS_ENSURE_ARG(uri); *result = false; - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = uri->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); @@ -1164,7 +1164,7 @@ nsIOService::EscapeString(const nsACString& aString, { NS_ENSURE_ARG_MAX(aEscapeType, 4); - nsCAutoString stringCopy(aString); + nsAutoCString stringCopy(aString); nsCString result; if (!NS_Escape(stringCopy, result, (nsEscapeMask) aEscapeType)) @@ -1202,7 +1202,7 @@ nsIOService::ExtractCharsetFromContentType(const nsACString &aTypeHeader, int32_t *aCharsetEnd, bool *aHadCharset) { - nsCAutoString ignored; + nsAutoCString ignored; net_ParseContentType(aTypeHeader, ignored, aCharset, aHadCharset, aCharsetStart, aCharsetEnd); if (*aHadCharset && *aCharsetStart == *aCharsetEnd) { @@ -1217,7 +1217,7 @@ nsIOService::SpeculativeConnect(nsIURI *aURI, nsIInterfaceRequestor *aCallbacks, nsIEventTarget *aTarget) { - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = aURI->GetScheme(scheme); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/base/src/nsIncrementalDownload.cpp b/netwerk/base/src/nsIncrementalDownload.cpp index 6401739b11e1..3fba27bae597 100644 --- a/netwerk/base/src/nsIncrementalDownload.cpp +++ b/netwerk/base/src/nsIncrementalDownload.cpp @@ -255,7 +255,7 @@ nsIncrementalDownload::ProcessTimeout() // Don't bother making a range request if we are just going to fetch the // entire document. if (mInterval || mCurrentSize != int64_t(0)) { - nsCAutoString range; + nsAutoCString range; MakeRangeSpec(mCurrentSize, mTotalSize, mChunkSize, mInterval == 0, range); rv = http->SetRequestHeader(NS_LITERAL_CSTRING("Range"), range, false); @@ -556,7 +556,7 @@ nsIncrementalDownload::OnStartRequest(nsIRequest *request, if (code == 206) { // OK, read the Content-Range header to determine the total size of this // download file. - nsCAutoString buf; + nsAutoCString buf; rv = http->GetResponseHeader(NS_LITERAL_CSTRING("Content-Range"), buf); if (NS_FAILED(rv)) return rv; @@ -754,7 +754,7 @@ nsIncrementalDownload::AsyncOnChannelRedirect(nsIChannel *oldChannel, return rv; // If we didn't have a Range header, then we must be doing a full download. - nsCAutoString rangeVal; + nsAutoCString rangeVal; http->GetRequestHeader(rangeHdr, rangeVal); if (!rangeVal.IsEmpty()) { rv = newHttpChannel->SetRequestHeader(rangeHdr, rangeVal, false); diff --git a/netwerk/base/src/nsLoadGroup.cpp b/netwerk/base/src/nsLoadGroup.cpp index 3c0adafc3d4b..33b82e351fa8 100644 --- a/netwerk/base/src/nsLoadGroup.cpp +++ b/netwerk/base/src/nsLoadGroup.cpp @@ -289,7 +289,7 @@ nsLoadGroup::Cancel(nsresult status) } #if defined(PR_LOGGING) - nsCAutoString nameStr; + nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Canceling request %x %s.\n", this, request, nameStr.get())); @@ -357,7 +357,7 @@ nsLoadGroup::Suspend() continue; #if defined(PR_LOGGING) - nsCAutoString nameStr; + nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Suspending request %x %s.\n", this, request, nameStr.get())); @@ -409,7 +409,7 @@ nsLoadGroup::Resume() continue; #if defined(PR_LOGGING) - nsCAutoString nameStr; + nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Resuming request %x %s.\n", this, request, nameStr.get())); @@ -499,7 +499,7 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt) #if defined(PR_LOGGING) { - nsCAutoString nameStr; + nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Adding request %x %s (count=%d).\n", this, request, nameStr.get(), mRequests.entryCount)); @@ -612,7 +612,7 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt, #if defined(PR_LOGGING) { - nsCAutoString nameStr; + nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Removing request %x %s status %x (count=%d).\n", this, request, nameStr.get(), aStatus, mRequests.entryCount-1)); diff --git a/netwerk/base/src/nsPACMan.cpp b/netwerk/base/src/nsPACMan.cpp index 336be48c7732..9191709a382a 100644 --- a/netwerk/base/src/nsPACMan.cpp +++ b/netwerk/base/src/nsPACMan.cpp @@ -84,7 +84,7 @@ PendingPACQuery::Start(uint32_t flags) return rv; } - nsCAutoString host; + nsAutoCString host; rv = mURI->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; @@ -130,7 +130,7 @@ PendingPACQuery::OnLookupComplete(nsICancelable *request, // We're no longer pending, so we can remove ourselves. PR_REMOVE_LINK(this); - nsCAutoString pacString; + nsAutoCString pacString; status = mPACMan->GetProxyForURI(mURI, pacString); Complete(status, pacString); @@ -183,7 +183,7 @@ nsPACMan::GetProxyForURI(nsIURI *uri, nsACString &result) if (!mPAC) return NS_ERROR_NOT_AVAILABLE; - nsCAutoString spec, host; + nsAutoCString spec, host; uri->GetAsciiSpec(spec); uri->GetAsciiHost(host); @@ -391,7 +391,7 @@ nsPACMan::OnStreamComplete(nsIStreamLoader *loader, if (NS_SUCCEEDED(status) && HttpRequestSucceeded(loader)) { // Get the URI spec used to load this PAC script. - nsCAutoString pacURI; + nsAutoCString pacURI; { nsCOMPtr request; loader->GetRequest(getter_AddRefs(request)); diff --git a/netwerk/base/src/nsProtocolProxyService.cpp b/netwerk/base/src/nsProtocolProxyService.cpp index a380efc9fe51..ea2d6e1ff205 100644 --- a/netwerk/base/src/nsProtocolProxyService.cpp +++ b/netwerk/base/src/nsProtocolProxyService.cpp @@ -51,7 +51,7 @@ static PRLogModuleInfo *sLog = PR_NewLogModule("proxy"); // This structure is intended to be allocated on the stack struct nsProtocolInfo { - nsCAutoString scheme; + nsAutoCString scheme; uint32_t flags; int32_t defaultPort; }; @@ -482,7 +482,7 @@ nsProtocolProxyService::CanUseProxy(nsIURI *aURI, int32_t defaultPort) return true; int32_t port; - nsCAutoString host; + nsAutoCString host; nsresult rv = aURI->GetAsciiHost(host); if (NS_FAILED(rv) || host.IsEmpty()) @@ -686,7 +686,7 @@ nsProtocolProxyService::SecondsSinceSessionStart() void nsProtocolProxyService::EnableProxy(nsProxyInfo *pi) { - nsCAutoString key; + nsAutoCString key; GetProxyKey(pi, key); mFailedProxies.Remove(key); } @@ -694,7 +694,7 @@ nsProtocolProxyService::EnableProxy(nsProxyInfo *pi) void nsProtocolProxyService::DisableProxy(nsProxyInfo *pi) { - nsCAutoString key; + nsAutoCString key; GetProxyKey(pi, key); uint32_t dsec = SecondsSinceSessionStart(); @@ -721,7 +721,7 @@ nsProtocolProxyService::DisableProxy(nsProxyInfo *pi) bool nsProtocolProxyService::IsProxyDisabled(nsProxyInfo *pi) { - nsCAutoString key; + nsAutoCString key; GetProxyKey(pi, key); uint32_t val; @@ -1077,7 +1077,7 @@ nsProtocolProxyService::LoadHostFilters(const char *filters) portLocation ? portLocation : endhost; - nsCAutoString str(starthost, end - starthost); + nsAutoCString str(starthost, end - starthost); // If the current host filter is "", then all local (i.e. // no dots in the hostname) hosts should bypass the proxy @@ -1245,10 +1245,10 @@ nsProtocolProxyService::Resolve_Internal(nsIURI *uri, return NS_OK; // Can't proxy this (filters may not override) if (mSystemProxySettings) { - nsCAutoString PACURI; + nsAutoCString PACURI; if (NS_FAILED(mSystemProxySettings->GetPACURI(PACURI)) || PACURI.IsEmpty()) { - nsCAutoString proxy; + nsAutoCString proxy; nsresult rv = mSystemProxySettings->GetProxyForURI(uri, proxy); if (NS_SUCCEEDED(rv)) { ProcessPACString(proxy, flags, result); diff --git a/netwerk/base/src/nsSimpleURI.cpp b/netwerk/base/src/nsSimpleURI.cpp index cb7f12301132..5665103abe1f 100644 --- a/netwerk/base/src/nsSimpleURI.cpp +++ b/netwerk/base/src/nsSimpleURI.cpp @@ -206,7 +206,7 @@ nsSimpleURI::SetSpec(const nsACString &aSpec) const char* specPtr = flat.get(); // filter out unexpected chars "\r\n\t" if necessary - nsCAutoString filteredSpec; + nsAutoCString filteredSpec; int32_t specLen; if (net_FilterURIString(specPtr, filteredSpec)) { specPtr = filteredSpec.get(); @@ -215,7 +215,7 @@ nsSimpleURI::SetSpec(const nsACString &aSpec) specLen = flat.Length(); // nsSimpleURI currently restricts the charset to US-ASCII - nsCAutoString spec; + nsAutoCString spec; NS_EscapeURL(specPtr, specLen, esc_OnlyNonASCII|esc_AlwaysCopy, spec); int32_t colonPos = spec.FindChar(':'); @@ -531,7 +531,7 @@ nsSimpleURI::Resolve(const nsACString &relativePath, nsACString &result) NS_IMETHODIMP nsSimpleURI::GetAsciiSpec(nsACString &result) { - nsCAutoString buf; + nsAutoCString buf; nsresult rv = GetSpec(buf); if (NS_FAILED(rv)) return rv; NS_EscapeURL(buf, esc_OnlyNonASCII|esc_AlwaysCopy, result); diff --git a/netwerk/base/src/nsSocketTransport2.cpp b/netwerk/base/src/nsSocketTransport2.cpp index 6c8879c0e091..85ce7e390bcb 100644 --- a/netwerk/base/src/nsSocketTransport2.cpp +++ b/netwerk/base/src/nsSocketTransport2.cpp @@ -2133,7 +2133,7 @@ nsSocketTransport::TraceInBuf(const char *buf, int32_t n) if (!val || !*val) return; - nsCAutoString header; + nsAutoCString header; header.Assign(NS_LITERAL_CSTRING("Reading from: ") + mHost); header.Append(':'); header.AppendInt(mPort); @@ -2148,7 +2148,7 @@ nsSocketTransport::TraceOutBuf(const char *buf, int32_t n) if (!val || !*val) return; - nsCAutoString header; + nsAutoCString header; header.Assign(NS_LITERAL_CSTRING("Writing to: ") + mHost); header.Append(':'); header.AppendInt(mPort); diff --git a/netwerk/base/src/nsStandardURL.cpp b/netwerk/base/src/nsStandardURL.cpp index 8c572894fade..081203d16bf3 100644 --- a/netwerk/base/src/nsStandardURL.cpp +++ b/netwerk/base/src/nsStandardURL.cpp @@ -161,7 +161,7 @@ nsSegmentEncoder::EncodeSegmentCount(const char *str, // only do this if the segment is non-ASCII. Further, if mCharset is // null or the empty string then the origin charset is UTF-8 and there // is nothing to do. - nsCAutoString encBuf; + nsAutoCString encBuf; if (mCharset && *mCharset && !nsCRT::IsAscii(str + pos, len)) { // we have to encode this segment if (mEncoder || InitUnicodeEncoder()) { @@ -473,11 +473,11 @@ nsStandardURL::BuildNormalizedSpec(const char *spec) // buffers for holding escaped url segments (these will remain empty unless // escaping is required). - nsCAutoString encUsername, encPassword, encHost, encDirectory, + nsAutoCString encUsername, encPassword, encHost, encDirectory, encBasename, encExtension, encQuery, encRef; bool useEncUsername, useEncPassword, useEncHost = false, useEncDirectory, useEncBasename, useEncExtension, useEncQuery, useEncRef; - nsCAutoString portbuf; + nsAutoCString portbuf; // // escape each URL segment, if necessary, and calculate approximate normalized @@ -1056,7 +1056,7 @@ nsStandardURL::GetAsciiSpec(nsACString &result) NS_EscapeURL(Userpass(true), esc_OnlyNonASCII | esc_AlwaysCopy, result); // get escaped host - nsCAutoString escHostport; + nsAutoCString escHostport; if (mHost.mLen > 0) { // this doesn't fail (void) GetAsciiHost(escHostport); @@ -1129,7 +1129,7 @@ nsStandardURL::SetSpec(const nsACString &input) return NS_OK; // filter out unexpected chars "\r\n\t" if necessary - nsCAutoString buf1; + nsAutoCString buf1; if (net_FilterURIString(spec, buf1)) { spec = buf1.get(); specLength = buf1.Length(); @@ -1253,7 +1253,7 @@ nsStandardURL::SetUserPass(const nsACString &input) if (NS_FAILED(rv)) return rv; // build new user:pass in |buf| - nsCAutoString buf; + nsAutoCString buf; if (usernameLen > 0) { GET_SEGMENT_ENCODER(encoder); bool ignoredOut; @@ -1327,7 +1327,7 @@ nsStandardURL::SetUsername(const nsACString &input) InvalidateCache(); // escape username if necessary - nsCAutoString buf; + nsAutoCString buf; GET_SEGMENT_ENCODER(encoder); const nsACString &escUsername = encoder.EncodeSegment(username, esc_Username, buf); @@ -1384,7 +1384,7 @@ nsStandardURL::SetPassword(const nsACString &input) } // escape password if necessary - nsCAutoString buf; + nsAutoCString buf; GET_SEGMENT_ENCODER(encoder); const nsACString &escPassword = encoder.EncodeSegment(password, esc_Password, buf); @@ -1462,7 +1462,7 @@ nsStandardURL::SetHost(const nsACString &input) // handle IPv6 unescaped address literal int32_t len; - nsCAutoString hostBuf; + nsAutoCString hostBuf; if (EscapeIPv6(host, hostBuf)) { host = hostBuf.get(); len = hostBuf.Length(); @@ -1516,7 +1516,7 @@ nsStandardURL::SetPort(int32_t port) if (mPort == -1) { // need to insert the port number in the URL spec - nsCAutoString buf; + nsAutoCString buf; buf.Assign(':'); buf.AppendInt(port); mSpec.Insert(buf, mHost.mPos + mHost.mLen); @@ -1536,7 +1536,7 @@ nsStandardURL::SetPort(int32_t port) } else { // need to replace the existing port - nsCAutoString buf; + nsAutoCString buf; buf.AppendInt(port); uint32_t start = mHost.mPos + mHost.mLen + 1; uint32_t length = mPath.mPos - start; @@ -1563,7 +1563,7 @@ nsStandardURL::SetPath(const nsACString &input) InvalidateCache(); if (!path.IsEmpty()) { - nsCAutoString spec; + nsAutoCString spec; spec.Assign(mSpec.get(), mPath.mPos); if (path.First() != '/') @@ -1768,7 +1768,7 @@ nsStandardURL::Resolve(const nsACString &in, nsACString &out) const char *relpath = flat.get(); // filter out unexpected chars "\r\n\t" if necessary - nsCAutoString buf; + nsAutoCString buf; int32_t relpathLen; if (net_FilterURIString(relpath, buf)) { relpath = buf.get(); @@ -2151,7 +2151,7 @@ nsStandardURL::SetFilePath(const nsACString &input) return SetPath(flat); if (filepath && *filepath) { - nsCAutoString spec; + nsAutoCString spec; uint32_t dirPos, basePos, extPos; int32_t dirLen, baseLen, extLen; nsresult rv; @@ -2261,7 +2261,7 @@ nsStandardURL::SetQuery(const nsACString &input) } // encode query if necessary - nsCAutoString buf; + nsAutoCString buf; bool encoded; GET_QUERY_ENCODER(encoder); encoder.EncodeSegmentCount(query, URLSegment(0, queryLen), esc_Query, @@ -2322,7 +2322,7 @@ nsStandardURL::SetRef(const nsACString &input) } // encode ref if necessary - nsCAutoString buf; + nsAutoCString buf; bool encoded; GET_SEGMENT_ENCODER(encoder); encoder.EncodeSegmentCount(ref, URLSegment(0, refLen), esc_Ref, @@ -2394,7 +2394,7 @@ nsStandardURL::SetFileName(const nsACString &input) } } else { - nsCAutoString newFilename; + nsAutoCString newFilename; bool ignoredOut; GET_SEGMENT_ENCODER(encoder); basename.mLen = encoder.EncodeSegmentCount(filename, basename, @@ -2443,11 +2443,11 @@ nsStandardURL::SetFileName(const nsACString &input) NS_IMETHODIMP nsStandardURL::SetFileBaseName(const nsACString &input) { - nsCAutoString extension; + nsAutoCString extension; nsresult rv = GetFileExtension(extension); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString newFileName(input); + nsAutoCString newFileName(input); if (!extension.IsEmpty()) { newFileName.Append('.'); @@ -2460,7 +2460,7 @@ nsStandardURL::SetFileBaseName(const nsACString &input) NS_IMETHODIMP nsStandardURL::SetFileExtension(const nsACString &input) { - nsCAutoString newFileName; + nsAutoCString newFileName; nsresult rv = GetFileBaseName(newFileName); NS_ENSURE_SUCCESS(rv, rv); @@ -2511,7 +2511,7 @@ nsStandardURL::GetFile(nsIFile **result) #if defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString path; + nsAutoCString path; mFile->GetNativePath(path); LOG(("nsStandardURL::GetFile [this=%p spec=%s resulting_path=%s]\n", this, mSpec.get(), path.get())); @@ -2535,7 +2535,7 @@ nsStandardURL::SetFile(nsIFile *file) NS_ENSURE_ARG_POINTER(file); nsresult rv; - nsCAutoString url; + nsAutoCString url; rv = net_GetURLSpecFromFile(file, url); if (NS_FAILED(rv)) return rv; @@ -2636,7 +2636,7 @@ nsStandardURL::Init(uint32_t urlType, if (!baseURI) return SetSpec(spec); - nsCAutoString buf; + nsAutoCString buf; nsresult rv = baseURI->Resolve(spec, buf); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/base/src/nsURIChecker.cpp b/netwerk/base/src/nsURIChecker.cpp index 2ed3b0aadea4..19e967c4f896 100644 --- a/netwerk/base/src/nsURIChecker.cpp +++ b/netwerk/base/src/nsURIChecker.cpp @@ -16,7 +16,7 @@ static bool ServerIsNES3x(nsIHttpChannel *httpChannel) { - nsCAutoString server; + nsAutoCString server; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Server"), server); // case sensitive string comparison is OK here. the server string // is a well-known value, so we should not have to worry about it diff --git a/netwerk/base/src/nsURLHelper.cpp b/netwerk/base/src/nsURLHelper.cpp index abe15269d4df..f2c3bbe54698 100644 --- a/netwerk/base/src/nsURLHelper.cpp +++ b/netwerk/base/src/nsURLHelper.cpp @@ -107,7 +107,7 @@ net_GetStdURLParser() nsresult net_GetURLSpecFromDir(nsIFile *aFile, nsACString &result) { - nsCAutoString escPath; + nsAutoCString escPath; nsresult rv = net_GetURLSpecFromActualFile(aFile, escPath); if (NS_FAILED(rv)) return rv; @@ -123,7 +123,7 @@ net_GetURLSpecFromDir(nsIFile *aFile, nsACString &result) nsresult net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result) { - nsCAutoString escPath; + nsAutoCString escPath; nsresult rv = net_GetURLSpecFromActualFile(aFile, escPath); if (NS_FAILED(rv)) return rv; @@ -396,8 +396,8 @@ net_ResolveRelativePath(const nsACString &relativePath, const nsACString &basePath, nsACString &result) { - nsCAutoString name; - nsCAutoString path(basePath); + nsAutoCString name; + nsAutoCString path(basePath); bool needsDelim = false; if ( !path.IsEmpty() ) { @@ -1016,7 +1016,7 @@ net_IsValidHostName(const nsCSubstring &host) return true; // Might be a valid IPv6 link-local address containing a percent sign - nsCAutoString strhost(host); + nsAutoCString strhost(host); PRNetAddr addr; return PR_StringToNetAddr(strhost.get(), &addr) == PR_SUCCESS; } diff --git a/netwerk/base/src/nsURLHelperOS2.cpp b/netwerk/base/src/nsURLHelperOS2.cpp index 7b3a15053783..fb7f0b20f82f 100644 --- a/netwerk/base/src/nsURLHelperOS2.cpp +++ b/netwerk/base/src/nsURLHelperOS2.cpp @@ -25,7 +25,7 @@ net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) // Replace \ with / to convert to an url path.ReplaceChar(PRUnichar(0x5Cu), PRUnichar(0x2Fu)); - nsCAutoString escPath; + nsAutoCString escPath; NS_NAMED_LITERAL_CSTRING(prefix, "file:///"); // Escape the path with the directory mask @@ -58,18 +58,18 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) const nsACString *specPtr; - nsCAutoString buf; + nsAutoCString buf; if (net_NormalizeFileURL(aURL, buf)) specPtr = &buf; else specPtr = &aURL; - nsCAutoString directory, fileBaseName, fileExtension; + nsAutoCString directory, fileBaseName, fileExtension; rv = net_ParseFileURL(*specPtr, directory, fileBaseName, fileExtension); if (NS_FAILED(rv)) return rv; - nsCAutoString path; + nsAutoCString path; if (!directory.IsEmpty()) { NS_EscapeURL(directory, esc_Directory|esc_AlwaysCopy, path); diff --git a/netwerk/base/src/nsURLHelperOSX.cpp b/netwerk/base/src/nsURLHelperOSX.cpp index fb05eab92981..dea661fbaa2b 100644 --- a/netwerk/base/src/nsURLHelperOSX.cpp +++ b/netwerk/base/src/nsURLHelperOSX.cpp @@ -55,7 +55,7 @@ static bool pathBeginsWithVolName(const nsACString& path, nsACString& firstPathC nsACString::const_iterator component_end(start); FindCharInReadable('/', component_end, directory_end); - nsCAutoString flatComponent((Substring(start, component_end))); + nsAutoCString flatComponent((Substring(start, component_end))); NS_UnescapeURL(flatComponent); int32_t foundIndex = gVolumeList->IndexOf(flatComponent); firstPathComponent = flatComponent; @@ -115,14 +115,14 @@ net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) // NOTE: This is identical to the implementation in nsURLHelperUnix.cpp nsresult rv; - nsCAutoString ePath; + nsAutoCString ePath; // construct URL spec from native file path rv = aFile->GetNativePath(ePath); if (NS_FAILED(rv)) return rv; - nsCAutoString escPath; + nsAutoCString escPath; NS_NAMED_LITERAL_CSTRING(prefix, "file://"); // Escape the path with the directory mask @@ -153,7 +153,7 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) if (NS_FAILED(rv)) return rv; - nsCAutoString directory, fileBaseName, fileExtension, path; + nsAutoCString directory, fileBaseName, fileExtension, path; bool bHFSPath = false; rv = net_ParseFileURL(aURL, directory, fileBaseName, fileExtension); @@ -168,7 +168,7 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) // But, we still encounter file URLs that use HFS paths: // file:///volume-name/path-name // Determine that here and normalize HFS paths to POSIX. - nsCAutoString possibleVolName; + nsAutoCString possibleVolName; if (pathBeginsWithVolName(directory, possibleVolName)) { // Though we know it begins with a volume name, it could still // be a valid POSIX path if the boot drive is named "Mac HD" diff --git a/netwerk/base/src/nsURLHelperUnix.cpp b/netwerk/base/src/nsURLHelperUnix.cpp index 66d7ea75bae8..e9256474deec 100644 --- a/netwerk/base/src/nsURLHelperUnix.cpp +++ b/netwerk/base/src/nsURLHelperUnix.cpp @@ -14,7 +14,7 @@ nsresult net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) { nsresult rv; - nsCAutoString nativePath, ePath; + nsAutoCString nativePath, ePath; nsAutoString path; rv = aFile->GetNativePath(nativePath); @@ -30,7 +30,7 @@ net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) else ePath = nativePath; - nsCAutoString escPath; + nsAutoCString escPath; NS_NAMED_LITERAL_CSTRING(prefix, "file://"); // Escape the path with the directory mask @@ -60,7 +60,7 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) if (NS_FAILED(rv)) return rv; - nsCAutoString directory, fileBaseName, fileExtension, path; + nsAutoCString directory, fileBaseName, fileExtension, path; rv = net_ParseFileURL(aURL, directory, fileBaseName, fileExtension); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/base/src/nsURLHelperWin.cpp b/netwerk/base/src/nsURLHelperWin.cpp index a1cdcb23c93c..508de197b4a2 100644 --- a/netwerk/base/src/nsURLHelperWin.cpp +++ b/netwerk/base/src/nsURLHelperWin.cpp @@ -23,7 +23,7 @@ net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) // Replace \ with / to convert to an url path.ReplaceChar(PRUnichar(0x5Cu), PRUnichar(0x2Fu)); - nsCAutoString escPath; + nsAutoCString escPath; // Windows Desktop paths begin with a drive letter, so need an 'extra' // slash at the begining @@ -62,18 +62,18 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) const nsACString *specPtr; - nsCAutoString buf; + nsAutoCString buf; if (net_NormalizeFileURL(aURL, buf)) specPtr = &buf; else specPtr = &aURL; - nsCAutoString directory, fileBaseName, fileExtension; + nsAutoCString directory, fileBaseName, fileExtension; rv = net_ParseFileURL(*specPtr, directory, fileBaseName, fileExtension); if (NS_FAILED(rv)) return rv; - nsCAutoString path; + nsAutoCString path; if (!directory.IsEmpty()) { NS_EscapeURL(directory, esc_Directory|esc_AlwaysCopy, path); diff --git a/netwerk/base/src/nsURLParsers.cpp b/netwerk/base/src/nsURLParsers.cpp index c24b56e296c9..03cfd7428a21 100644 --- a/netwerk/base/src/nsURLParsers.cpp +++ b/netwerk/base/src/nsURLParsers.cpp @@ -574,7 +574,7 @@ nsAuthURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen, SET_RESULT(hostname, 0, colon - serverinfo); if (port) { // XXX unfortunately ToInteger is not defined for substrings - nsCAutoString buf(colon+1, serverinfoLen - (colon + 1 - serverinfo)); + nsAutoCString buf(colon+1, serverinfoLen - (colon + 1 - serverinfo)); if (buf.Length() == 0) { *port = -1; } diff --git a/netwerk/cache/nsCache.cpp b/netwerk/cache/nsCache.cpp index 2a004127e0b6..22493a8bc333 100644 --- a/netwerk/cache/nsCache.cpp +++ b/netwerk/cache/nsCache.cpp @@ -30,7 +30,7 @@ CacheLogInit() void CacheLogPrintPath(PRLogModuleLevel level, const char * format, nsIFile * item) { - nsCAutoString path; + nsAutoCString path; nsresult rv = item->GetNativePath(path); if (NS_SUCCEEDED(rv)) { PR_LOG(gCacheLog, level, (format, path.get())); diff --git a/netwerk/cache/nsCacheEntryDescriptor.cpp b/netwerk/cache/nsCacheEntryDescriptor.cpp index 17e2922d3e53..ac8cd62c74b0 100644 --- a/netwerk/cache/nsCacheEntryDescriptor.cpp +++ b/netwerk/cache/nsCacheEntryDescriptor.cpp @@ -930,7 +930,7 @@ nsCompressOutputStreamWrapper::Close() } if (mDescriptor->CacheEntry()) { - nsCAutoString uncompressedLenStr; + nsAutoCString uncompressedLenStr; rv = mDescriptor->GetMetaDataElement("uncompressed-len", getter_Copies(uncompressedLenStr)); if (NS_SUCCEEDED(rv)) { diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index cc3e3db8c8b2..915426b1b83c 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -1707,7 +1707,7 @@ nsCacheService::CreateCustomOfflineDevice(nsIFile *aProfileDir, NS_ENSURE_ARG(aProfileDir); #if defined(PR_LOGGING) - nsCAutoString profilePath; + nsAutoCString profilePath; aProfileDir->GetNativePath(profilePath); CACHE_LOG_ALWAYS(("Creating custom offline device, %s, %d", profilePath.BeginReading(), aQuota)); @@ -1789,7 +1789,7 @@ nsCacheService::CreateRequest(nsCacheSession * session, { NS_ASSERTION(request, "CreateRequest: request is null"); - nsCAutoString key(*session->ClientID()); + nsAutoCString key(*session->ClientID()); key.Append(':'); key.Append(clientKey); diff --git a/netwerk/cache/nsDeleteDir.cpp b/netwerk/cache/nsDeleteDir.cpp index 39a7a1912ff3..b4ef844e1f86 100644 --- a/netwerk/cache/nsDeleteDir.cpp +++ b/netwerk/cache/nsDeleteDir.cpp @@ -218,14 +218,14 @@ nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash, uint32_t delay) rv = GetTrashDir(dir, &trash); if (NS_FAILED(rv)) return rv; - nsCAutoString origLeaf; + nsAutoCString origLeaf; rv = trash->GetNativeLeafName(origLeaf); if (NS_FAILED(rv)) return rv; // Append random number to the trash directory and check if it exists. srand(PR_Now()); - nsCAutoString leaf; + nsAutoCString leaf; for (int32_t i = 0; i < 10; i++) { leaf = origLeaf; leaf.AppendInt(rand()); @@ -289,7 +289,7 @@ nsDeleteDir::GetTrashDir(nsIFile *target, nsCOMPtr *result) return rv; // Add a sub folder with the cache folder name - nsCAutoString leaf; + nsAutoCString leaf; rv = target->GetNativeLeafName(leaf); (*result)->AppendNative(leaf); } else @@ -300,7 +300,7 @@ nsDeleteDir::GetTrashDir(nsIFile *target, nsCOMPtr *result) if (NS_FAILED(rv)) return rv; - nsCAutoString leaf; + nsAutoCString leaf; rv = (*result)->GetNativeLeafName(leaf); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/cache/nsDiskCacheDeviceSQL.cpp b/netwerk/cache/nsDiskCacheDeviceSQL.cpp index 1fbb86de2391..f37f4ba4d9f2 100644 --- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp +++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp @@ -191,7 +191,7 @@ nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray *values, ns uint32_t valueLen; const char *clientID = values->AsSharedUTF8String(0, &valueLen); const char *key = values->AsSharedUTF8String(1, &valueLen); - nsCAutoString fullKey(clientID); + nsAutoCString fullKey(clientID); fullKey.AppendLiteral(":"); fullKey.Append(key); int generation = values->AsInt32(2); @@ -224,7 +224,7 @@ nsOfflineCacheEvictionFunction::Apply() for (int32_t i = 0; i < mItems.Count(); i++) { #if defined(PR_LOGGING) - nsCAutoString path; + nsAutoCString path; mItems[i]->GetNativePath(path); LOG((" removing %s\n", path.get())); #endif @@ -293,7 +293,7 @@ nsOfflineCacheDeviceInfo::GetDescription(char **aDescription) NS_IMETHODIMP nsOfflineCacheDeviceInfo::GetUsageReport(char ** usageReport) { - nsCAutoString buffer; + nsAutoCString buffer; buffer.AssignLiteral(" \n" " Cache Directory:\n" " "); @@ -374,7 +374,7 @@ nsOfflineCacheBinding::Create(nsIFile *cacheDir, if (!file) return nullptr; - nsCAutoString keyBuf; + nsAutoCString keyBuf; const char *cid, *key; if (!DecomposeCacheEntryKey(fullKey, &cid, &key, keyBuf)) return nullptr; @@ -900,7 +900,7 @@ nsresult nsOfflineCacheDevice::UpdateEntry(nsCacheEntry *entry) { // Decompose the key into "ClientID" and "Key" - nsCAutoString keyBuf; + nsAutoCString keyBuf; const char *cid, *key; if (!DecomposeCacheEntryKey(entry->Key(), &cid, &key, keyBuf)) @@ -968,7 +968,7 @@ nsresult nsOfflineCacheDevice::UpdateEntrySize(nsCacheEntry *entry, uint32_t newSize) { // Decompose the key into "ClientID" and "Key" - nsCAutoString keyBuf; + nsAutoCString keyBuf; const char *cid, *key; if (!DecomposeCacheEntryKey(entry->Key(), &cid, &key, keyBuf)) return NS_ERROR_UNEXPECTED; @@ -1005,7 +1005,7 @@ nsOfflineCacheDevice::DeleteEntry(nsCacheEntry *entry, bool deleteData) } // Decompose the key into "ClientID" and "Key" - nsCAutoString keyBuf; + nsAutoCString keyBuf; const char *cid, *key; if (!DecomposeCacheEntryKey(entry->Key(), &cid, &key, keyBuf)) return NS_ERROR_UNEXPECTED; @@ -1241,7 +1241,7 @@ nsOfflineCacheDevice::InitActiveCaches() while (hasRows) { - nsCAutoString group; + nsAutoCString group; statement->GetUTF8String(0, group); nsCString clientID; statement->GetUTF8String(1, clientID); @@ -1370,7 +1370,7 @@ nsOfflineCacheDevice::FindEntry(nsCString *fullKey, bool *collision) // SELECT * FROM moz_cache WHERE key = ? // Decompose the key into "ClientID" and "Key" - nsCAutoString keyBuf; + nsAutoCString keyBuf; const char *cid, *key; if (!DecomposeCacheEntryKey(fullKey, &cid, &key, keyBuf)) return nullptr; @@ -1488,7 +1488,7 @@ nsOfflineCacheDevice::BindEntry(nsCacheEntry *entry) // it from the table. so, we should always have to insert at this point. // Decompose the key into "ClientID" and "Key" - nsCAutoString keyBuf; + nsAutoCString keyBuf; const char *cid, *key; if (!DecomposeCacheEntryKey(entry->Key(), &cid, &key, keyBuf)) return NS_ERROR_UNEXPECTED; @@ -2280,7 +2280,7 @@ bool nsOfflineCacheDevice::CanUseCache(nsIURI *keyURI, const nsCString &clientID) { if (mActiveCaches.Contains(clientID)) { - nsCAutoString groupID; + nsAutoCString groupID; nsresult rv = GetGroupForCache(clientID, groupID); NS_ENSURE_SUCCESS(rv, false); @@ -2328,7 +2328,7 @@ nsOfflineCacheDevice::ChooseApplicationCache(const nsACString &key, NS_ENSURE_SUCCESS(rv, rv); if (!(itemType & nsIApplicationCache::ITEM_FOREIGN)) { - nsCAutoString clientID; + nsAutoCString clientID; rv = statement->GetUTF8String(0, clientID); NS_ENSURE_SUCCESS(rv, rv); @@ -2360,7 +2360,7 @@ nsOfflineCacheDevice::ChooseApplicationCache(const nsACString &key, // Don't associate with a cache based solely on a whitelist entry if (!(itemType & nsIApplicationCacheNamespace::NAMESPACE_BYPASS)) { - nsCAutoString clientID; + nsAutoCString clientID; rv = nsstatement->GetUTF8String(0, clientID); NS_ENSURE_SUCCESS(rv, rv); @@ -2384,7 +2384,7 @@ nsOfflineCacheDevice::CacheOpportunistically(nsIApplicationCache* cache, nsresult rv; - nsCAutoString clientID; + nsAutoCString clientID; rv = cache->GetClientID(clientID); NS_ENSURE_SUCCESS(rv, rv); @@ -2502,7 +2502,7 @@ nsOfflineCacheDevice::AutoShutdown(nsIApplicationCache * aAppCache) nsRefPtr cacheService = nsCacheService::GlobalInstance(); cacheService->RemoveCustomOfflineDevice(this); - nsCAutoString clientID; + nsAutoCString clientID; aAppCache->GetClientID(clientID); mCaches.Remove(clientID); diff --git a/netwerk/cookie/CookieServiceChild.cpp b/netwerk/cookie/CookieServiceChild.cpp index fd5ff89f92f4..5ae57c40cb55 100644 --- a/netwerk/cookie/CookieServiceChild.cpp +++ b/netwerk/cookie/CookieServiceChild.cpp @@ -116,7 +116,7 @@ CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI, SerializeURI(aHostURI, uriParams); // Synchronously call the parent. - nsCAutoString result; + nsAutoCString result; SendGetCookieString(uriParams, !!isForeign, aFromHttp, &result); if (!result.IsEmpty()) *aCookieString = ToNewCString(result); diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index cf05a4765807..2742384987a4 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -105,12 +105,12 @@ bindCookieParameters(mozIStorageBindingParamsArray *aParamsArray, // struct for temporarily storing cookie attributes during header parsing struct nsCookieAttributes { - nsCAutoString name; - nsCAutoString value; - nsCAutoString host; - nsCAutoString path; - nsCAutoString expires; - nsCAutoString maxage; + nsAutoCString name; + nsAutoCString value; + nsAutoCString host; + nsAutoCString path; + nsAutoCString expires; + nsAutoCString maxage; int64_t expiryTime; bool isSession; bool isSecure; @@ -191,7 +191,7 @@ LogFailure(bool aSetCookie, nsIURI *aHostURI, const char *aCookieString, const c if (!PR_LOG_TEST(sCookieLog, PR_LOG_WARNING)) return; - nsCAutoString spec; + nsAutoCString spec; if (aHostURI) aHostURI->GetAsciiSpec(spec); @@ -251,7 +251,7 @@ LogSuccess(bool aSetCookie, nsIURI *aHostURI, const char *aCookieString, nsCooki return; } - nsCAutoString spec; + nsAutoCString spec; if (aHostURI) aHostURI->GetAsciiSpec(spec); @@ -332,7 +332,7 @@ public: aError->GetResult(&result); #ifdef PR_LOGGING - nsCAutoString message; + nsAutoCString message; aError->GetMessage(message); COOKIE_LOGSTRING(PR_LOG_WARNING, ("DBListenerErrorHandler::HandleError(): Error %d occurred while " @@ -1420,7 +1420,7 @@ nsCookieService::GetCookieStringCommon(nsIURI *aHostURI, if (RequireThirdPartyCheck()) mThirdPartyUtil->IsThirdPartyChannel(aChannel, aHostURI, &isForeign); - nsCAutoString result; + nsAutoCString result; GetCookieStringInternal(aHostURI, isForeign, aHttpBound, result); *aCookie = result.IsEmpty() ? nullptr : ToNewCString(result); return NS_OK; @@ -1489,7 +1489,7 @@ nsCookieService::SetCookieStringInternal(nsIURI *aHostURI, // scheme must have a non-empty host. A trailing dot in the host // is acceptable. bool requireHostMatch; - nsCAutoString baseDomain; + nsAutoCString baseDomain; nsresult rv = GetBaseDomain(aHostURI, baseDomain, requireHostMatch); if (NS_FAILED(rv)) { COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, @@ -1693,13 +1693,13 @@ nsCookieService::Add(const nsACString &aHost, } // first, normalize the hostname, and fail if it contains illegal characters. - nsCAutoString host(aHost); + nsAutoCString host(aHost); nsresult rv = NormalizeHost(host); NS_ENSURE_SUCCESS(rv, rv); // get the base domain for the host URI. // e.g. for "www.bbc.co.uk", this would be "bbc.co.uk". - nsCAutoString baseDomain; + nsAutoCString baseDomain; rv = GetBaseDomainFromHost(host, baseDomain); NS_ENSURE_SUCCESS(rv, rv); @@ -1733,11 +1733,11 @@ nsCookieService::Remove(const nsACString &aHost, } // first, normalize the hostname, and fail if it contains illegal characters. - nsCAutoString host(aHost); + nsAutoCString host(aHost); nsresult rv = NormalizeHost(host); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString baseDomain; + nsAutoCString baseDomain; rv = GetBaseDomainFromHost(host, baseDomain); NS_ENSURE_SUCCESS(rv, rv); @@ -2131,7 +2131,7 @@ nsCookieService::ImportCookies(nsIFile *aCookieFile) static const char kTrue[] = "TRUE"; - nsCAutoString buffer, baseDomain; + nsAutoCString buffer, baseDomain; bool isMore = true; int32_t hostIndex, isDomainIndex, pathIndex, secureIndex, expiresIndex, nameIndex, cookieIndex; nsASingleFragmentCString::char_iterator iter; @@ -2325,7 +2325,7 @@ nsCookieService::GetCookieStringInternal(nsIURI *aHostURI, // scheme must have a non-empty host. A trailing dot in the host // is acceptable. bool requireHostMatch; - nsCAutoString baseDomain, hostFromURI, pathFromURI; + nsAutoCString baseDomain, hostFromURI, pathFromURI; nsresult rv = GetBaseDomain(aHostURI, baseDomain, requireHostMatch); if (NS_SUCCEEDED(rv)) rv = aHostURI->GetAsciiHost(hostFromURI); @@ -3032,7 +3032,7 @@ nsresult nsCookieService::NormalizeHost(nsCString &aHost) { if (!IsASCII(aHost)) { - nsCAutoString host; + nsAutoCString host; nsresult rv = mIDNService->ConvertUTF8toACE(aHost, host); if (NS_FAILED(rv)) return rv; @@ -3126,7 +3126,7 @@ nsCookieService::CheckDomain(nsCookieAttributes &aCookieAttributes, bool aRequireHostMatch) { // get host from aHostURI - nsCAutoString hostFromURI; + nsAutoCString hostFromURI; aHostURI->GetAsciiHost(hostFromURI); // if a domain is given, check the host has permission @@ -3202,7 +3202,7 @@ nsCookieService::CheckPath(nsCookieAttributes &aCookieAttributes, * been disabled, unless we can evangelize these sites. */ // get path from aHostURI - nsCAutoString pathFromURI; + nsAutoCString pathFromURI; if (NS_FAILED(aHostURI->GetPath(pathFromURI)) || !StringBeginsWith(pathFromURI, aCookieAttributes.path)) { return false; @@ -3496,7 +3496,7 @@ nsCookieService::CookieExists(nsICookie2 *aCookie, return NS_ERROR_NOT_AVAILABLE; } - nsCAutoString host, name, path; + nsAutoCString host, name, path; nsresult rv = aCookie->GetHost(host); NS_ENSURE_SUCCESS(rv, rv); rv = aCookie->GetName(name); @@ -3504,7 +3504,7 @@ nsCookieService::CookieExists(nsICookie2 *aCookie, rv = aCookie->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString baseDomain; + nsAutoCString baseDomain; rv = GetBaseDomainFromHost(host, baseDomain); NS_ENSURE_SUCCESS(rv, rv); @@ -3555,11 +3555,11 @@ nsCookieService::CountCookiesFromHost(const nsACString &aHost, } // first, normalize the hostname, and fail if it contains illegal characters. - nsCAutoString host(aHost); + nsAutoCString host(aHost); nsresult rv = NormalizeHost(host); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString baseDomain; + nsAutoCString baseDomain; rv = GetBaseDomainFromHost(host, baseDomain); NS_ENSURE_SUCCESS(rv, rv); @@ -3583,11 +3583,11 @@ nsCookieService::GetCookiesFromHost(const nsACString &aHost, } // first, normalize the hostname, and fail if it contains illegal characters. - nsCAutoString host(aHost); + nsAutoCString host(aHost); nsresult rv = NormalizeHost(host); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString baseDomain; + nsAutoCString baseDomain; rv = GetBaseDomainFromHost(host, baseDomain); NS_ENSURE_SUCCESS(rv, rv); diff --git a/netwerk/dns/nsDNSService2.cpp b/netwerk/dns/nsDNSService2.cpp index 114af2e10361..beba06e8cdc7 100644 --- a/netwerk/dns/nsDNSService2.cpp +++ b/netwerk/dns/nsDNSService2.cpp @@ -587,7 +587,7 @@ nsDNSService::AsyncResolve(const nsACString &hostname, } nsresult rv; - nsCAutoString hostACE; + nsAutoCString hostACE; if (idn && !IsASCII(*hostPtr)) { if (NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE))) hostPtr = &hostACE; @@ -639,7 +639,7 @@ nsDNSService::CancelAsyncResolve(const nsACString &aHostname, nsCString hostname(aHostname); - nsCAutoString hostACE; + nsAutoCString hostACE; if (idn && !IsASCII(aHostname)) { if (NS_SUCCEEDED(idn->ConvertUTF8toACE(aHostname, hostACE))) hostname = hostACE; @@ -676,7 +676,7 @@ nsDNSService::Resolve(const nsACString &hostname, } nsresult rv; - nsCAutoString hostACE; + nsAutoCString hostACE; if (idn && !IsASCII(*hostPtr)) { if (NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE))) hostPtr = &hostACE; diff --git a/netwerk/dns/nsEffectiveTLDService.cpp b/netwerk/dns/nsEffectiveTLDService.cpp index ca1471d81e44..f8194bd3d908 100644 --- a/netwerk/dns/nsEffectiveTLDService.cpp +++ b/netwerk/dns/nsEffectiveTLDService.cpp @@ -47,7 +47,7 @@ nsEffectiveTLDService::Init() for (uint32_t i = 0; i < ArrayLength(gEntries) - 1; i++) { #ifdef DEBUG nsDependentCString name(gEntries[i].domain); - nsCAutoString normalizedName(gEntries[i].domain); + nsAutoCString normalizedName(gEntries[i].domain); NS_ASSERTION(NS_SUCCEEDED(NormalizeHostname(normalizedName)), "normalization failure!"); NS_ASSERTION(name.Equals(normalizedName), "domain not normalized!"); @@ -71,7 +71,7 @@ nsEffectiveTLDService::GetPublicSuffix(nsIURI *aURI, nsCOMPtr innerURI = NS_GetInnermostURI(aURI); NS_ENSURE_ARG_POINTER(innerURI); - nsCAutoString host; + nsAutoCString host; nsresult rv = innerURI->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; @@ -91,7 +91,7 @@ nsEffectiveTLDService::GetBaseDomain(nsIURI *aURI, nsCOMPtr innerURI = NS_GetInnermostURI(aURI); NS_ENSURE_ARG_POINTER(innerURI); - nsCAutoString host; + nsAutoCString host; nsresult rv = innerURI->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; @@ -106,7 +106,7 @@ nsEffectiveTLDService::GetPublicSuffixFromHost(const nsACString &aHostname, { // Create a mutable copy of the hostname and normalize it to ACE. // This will fail if the hostname includes invalid characters. - nsCAutoString normHostname(aHostname); + nsAutoCString normHostname(aHostname); nsresult rv = NormalizeHostname(normHostname); if (NS_FAILED(rv)) return rv; @@ -123,7 +123,7 @@ nsEffectiveTLDService::GetBaseDomainFromHost(const nsACString &aHostname, { // Create a mutable copy of the hostname and normalize it to ACE. // This will fail if the hostname includes invalid characters. - nsCAutoString normHostname(aHostname); + nsAutoCString normHostname(aHostname); nsresult rv = NormalizeHostname(normHostname); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/dns/nsIDNService.cpp b/netwerk/dns/nsIDNService.cpp index e43551265423..b4747b40451a 100644 --- a/netwerk/dns/nsIDNService.cpp +++ b/netwerk/dns/nsIDNService.cpp @@ -145,7 +145,7 @@ nsresult nsIDNService::UTF8toACE(const nsACString & input, nsACString & ace, boo uint32_t len, offset; len = 0; offset = 0; - nsCAutoString encodedBuf; + nsAutoCString encodedBuf; nsAString::const_iterator start, end; ustr.BeginReading(start); @@ -201,7 +201,7 @@ nsresult nsIDNService::ACEtoUTF8(const nsACString & input, nsACString & _retval, } uint32_t len = 0, offset = 0; - nsCAutoString decodedBuf; + nsAutoCString decodedBuf; nsACString::const_iterator start, end; input.BeginReading(start); @@ -316,7 +316,7 @@ NS_IMETHODIMP nsIDNService::ConvertToDisplayIDN(const nsACString & input, bool * if (isACE && !mShowPunycode && isInWhitelist(_retval)) { // ACEtoUTF8() can't fail, but might return the original ACE string - nsCAutoString temp(_retval); + nsAutoCString temp(_retval); ACEtoUTF8(temp, _retval, false); *_isASCII = IsASCII(_retval); } else { @@ -641,7 +641,7 @@ nsresult nsIDNService::decodeACE(const nsACString& in, nsACString& out, CopyUTF16toUTF8(utf16, out); // Validation: encode back to ACE and compare the strings - nsCAutoString ace; + nsAutoCString ace; nsresult rv = UTF8toACE(out, ace, allowUnassigned); NS_ENSURE_SUCCESS(rv, rv); @@ -654,7 +654,7 @@ nsresult nsIDNService::decodeACE(const nsACString& in, nsACString& out, bool nsIDNService::isInWhitelist(const nsACString &host) { if (mIDNWhitelistPrefBranch) { - nsCAutoString tld(host); + nsAutoCString tld(host); // make sure the host is ACE for lookup and check that there are no // unassigned codepoints if (!IsASCII(tld) && NS_FAILED(UTF8toACE(tld, tld, false))) { diff --git a/netwerk/mime/nsMIMEHeaderParamImpl.cpp b/netwerk/mime/nsMIMEHeaderParamImpl.cpp index 1b27f9e89265..8cbcf5dd1be1 100644 --- a/netwerk/mime/nsMIMEHeaderParamImpl.cpp +++ b/netwerk/mime/nsMIMEHeaderParamImpl.cpp @@ -86,13 +86,13 @@ nsMIMEHeaderParamImpl::DoGetParameter(const nsACString& aHeaderVal, // convert to UTF-8 after charset conversion and RFC 2047 decoding // if necessary. - nsCAutoString str1; + nsAutoCString str1; rv = DecodeParameter(med, charset.get(), nullptr, false, str1); NS_ENSURE_SUCCESS(rv, rv); if (!aFallbackCharset.IsEmpty()) { - nsCAutoString str2; + nsAutoCString str2; nsCOMPtr cvtUTF8(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID)); if (cvtUTF8 && @@ -286,9 +286,9 @@ bool IsValidOctetSequenceForCharset(nsACString& aCharset, const char *aOctets) return false; } - nsCAutoString tmpRaw; + nsAutoCString tmpRaw; tmpRaw.Assign(aOctets); - nsCAutoString tmpDecoded; + nsAutoCString tmpDecoded; nsresult rv = cvtUTF8->ConvertStringToUTF8(tmpRaw, PromiseFlatCString(aCharset).get(), @@ -340,7 +340,7 @@ nsMIMEHeaderParamImpl::DoParameterInternal(const char *aHeaderValue, if (aCharset) *aCharset = nullptr; if (aLang) *aLang = nullptr; - nsCAutoString charset; + nsAutoCString charset; bool acceptContinuations = (aDecoding != RFC_5987_DECODING); @@ -480,7 +480,7 @@ nsMIMEHeaderParamImpl::DoParameterInternal(const char *aHeaderValue, // if the parameter spans across multiple lines we have to strip out the // line continuation -- jht 4/29/98 - nsCAutoString tempStr(valueStart, valueEnd - valueStart); + nsAutoCString tempStr(valueStart, valueEnd - valueStart); tempStr.StripChars("\r\n"); char *res = ToNewCString(tempStr); NS_ENSURE_TRUE(res, NS_ERROR_OUT_OF_MEMORY); @@ -720,7 +720,7 @@ nsMIMEHeaderParamImpl::DecodeRFC2047Header(const char* aHeaderVal, } if (aEatContinuations) { - nsCAutoString temp(aResult); + nsAutoCString temp(aResult); temp.ReplaceSubstring("\n\t", " "); temp.ReplaceSubstring("\r\t", " "); temp.StripChars("\r\n"); @@ -779,9 +779,9 @@ nsMIMEHeaderParamImpl::DecodeRFC5987Param(const nsACString& aParamVal, nsACString& aLang, nsAString& aResult) { - nsCAutoString charset; - nsCAutoString language; - nsCAutoString value; + nsAutoCString charset; + nsAutoCString language; + nsAutoCString value; uint32_t delimiters = 0; const char *encoded = PromiseFlatCString(aParamVal).get(); @@ -851,7 +851,7 @@ nsMIMEHeaderParamImpl::DecodeRFC5987Param(const nsACString& aParamVal, do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString utf8; + nsAutoCString utf8; rv = cvtUTF8->ConvertStringToUTF8(value, charset.get(), true, false, 1, utf8); NS_ENSURE_SUCCESS(rv, rv); @@ -878,7 +878,7 @@ nsMIMEHeaderParamImpl::DecodeParameter(const nsACString& aParamValue, } const nsAFlatCString& param = PromiseFlatCString(aParamValue); - nsCAutoString unQuoted; + nsAutoCString unQuoted; nsACString::const_iterator s, e; param.BeginReading(s); param.EndReading(e); @@ -899,7 +899,7 @@ nsMIMEHeaderParamImpl::DecodeParameter(const nsACString& aParamValue, aResult = unQuoted; - nsCAutoString decoded; + nsAutoCString decoded; // Try RFC 2047 encoding, instead. nsresult rv = DecodeRFC2047Header(unQuoted.get(), aDefaultCharset, @@ -1050,7 +1050,7 @@ void CopyRawHeader(const char *aInput, uint32_t aLen, // If not UTF-8, treat as default charset nsCOMPtr cvtUTF8(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID)); - nsCAutoString utf8Text; + nsAutoCString utf8Text; if (cvtUTF8 && NS_SUCCEEDED( cvtUTF8->ConvertStringToUTF8(Substring(aInput, aInput + aLen), @@ -1183,7 +1183,7 @@ nsresult DecodeRFC2047Str(const char *aHeader, const char *aDefaultCharset, { nsCOMPtr cvtUTF8(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID)); - nsCAutoString utf8Text; + nsAutoCString utf8Text; // skip ASCIIness/UTF8ness test if aCharset is 7bit non-ascii charset. if (cvtUTF8 && NS_SUCCEEDED( @@ -1211,7 +1211,7 @@ nsresult DecodeRFC2047Str(const char *aHeader, const char *aDefaultCharset, // put the tail back CopyRawHeader(begin, strlen(begin), aDefaultCharset, aResult); - nsCAutoString tempStr(aResult); + nsAutoCString tempStr(aResult); tempStr.ReplaceChar('\t', ' '); aResult = tempStr; diff --git a/netwerk/protocol/about/nsAboutBloat.cpp b/netwerk/protocol/about/nsAboutBloat.cpp index 87b6fecea6e9..e73ea06bb6e5 100644 --- a/netwerk/protocol/about/nsAboutBloat.cpp +++ b/netwerk/protocol/about/nsAboutBloat.cpp @@ -30,7 +30,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result) { NS_ENSURE_ARG_POINTER(aURI); nsresult rv; - nsCAutoString path; + nsAutoCString path; rv = aURI->GetPath(path); if (NS_FAILED(rv)) return rv; @@ -40,7 +40,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result) int32_t pos = path.Find("?"); if (pos > 0) { - nsCAutoString param; + nsAutoCString param; (void)path.Right(param, path.Length() - (pos+1)); if (param.EqualsLiteral("new")) statType = nsTraceRefcntImpl::NEW_STATS; @@ -87,7 +87,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result) if (NS_FAILED(rv)) return rv; } - nsCAutoString dumpFileName; + nsAutoCString dumpFileName; if (statType == nsTraceRefcntImpl::ALL_STATS) dumpFileName.AssignLiteral("all-"); else diff --git a/netwerk/protocol/about/nsAboutCache.cpp b/netwerk/protocol/about/nsAboutCache.cpp index 400d05afaff4..cf9a602507f9 100644 --- a/netwerk/protocol/about/nsAboutCache.cpp +++ b/netwerk/protocol/about/nsAboutCache.cpp @@ -234,7 +234,7 @@ nsAboutCache::VisitEntry(const char *deviceID, nsresult rv; uint32_t bytesWritten; - nsCAutoString key; + nsAutoCString key; nsXPIDLCString clientID; bool streamBased; @@ -248,7 +248,7 @@ nsAboutCache::VisitEntry(const char *deviceID, if (NS_FAILED(rv)) return rv; // Generate a about:cache-entry URL for this entry... - nsCAutoString url; + nsAutoCString url; url.AssignLiteral("about:cache-entry?client="); url += clientID; url.AppendLiteral("&sb="); @@ -327,7 +327,7 @@ nsAboutCache::ParseURI(nsIURI * uri, nsCString &deviceID) deviceID.Truncate(); - nsCAutoString path; + nsAutoCString path; rv = uri->GetPath(path); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/about/nsAboutCacheEntry.cpp b/netwerk/protocol/about/nsAboutCacheEntry.cpp index b92952ce318e..605e589e99a8 100644 --- a/netwerk/protocol/about/nsAboutCacheEntry.cpp +++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp @@ -160,7 +160,7 @@ nsresult nsAboutCacheEntry::OpenCacheEntry(nsIURI *uri, nsICacheEntryDescriptor **result) { nsresult rv; - nsCAutoString clientID, key; + nsAutoCString clientID, key; bool streamBased = true; rv = ParseURI(uri, clientID, streamBased, key); @@ -225,7 +225,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream, nsCString buffer; uint32_t n; - nsCAutoString str; + nsAutoCString str; rv = descriptor->GetKey(str); if (NS_FAILED(rv)) return rv; @@ -267,7 +267,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream, char timeBuf[255]; uint32_t u = 0; int32_t i = 0; - nsCAutoString s; + nsAutoCString s; // Fetch Count s.Truncate(); @@ -401,7 +401,7 @@ nsAboutCacheEntry::ParseURI(nsIURI *uri, nsCString &clientID, // nsresult rv; - nsCAutoString path; + nsAutoCString path; rv = uri->GetPath(path); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/about/nsAboutProtocolHandler.cpp b/netwerk/protocol/about/nsAboutProtocolHandler.cpp index adc14dc01c2b..f7156e29820c 100644 --- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp +++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp @@ -94,7 +94,7 @@ nsAboutProtocolHandler::NewURI(const nsACString &aSpec, // no one but the security manager will see. Make sure to preserve our // path, in case someone decides to hardcode checks for particular // about: URIs somewhere. - nsCAutoString spec; + nsAutoCString spec; rv = url->GetPath(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/netwerk/protocol/about/nsAboutProtocolUtils.h b/netwerk/protocol/about/nsAboutProtocolUtils.h index 0f2a09b2cc15..f8d0498cc5dd 100644 --- a/netwerk/protocol/about/nsAboutProtocolUtils.h +++ b/netwerk/protocol/about/nsAboutProtocolUtils.h @@ -37,7 +37,7 @@ NS_GetAboutModule(nsIURI *aAboutURI, nsIAboutModule** aModule) { NS_PRECONDITION(aAboutURI, "Must have URI"); - nsCAutoString contractID; + nsAutoCString contractID; nsresult rv = NS_GetAboutModuleName(aAboutURI, contractID); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/data/nsDataChannel.cpp b/netwerk/protocol/data/nsDataChannel.cpp index ed359d049f97..8e113b7551ab 100644 --- a/netwerk/protocol/data/nsDataChannel.cpp +++ b/netwerk/protocol/data/nsDataChannel.cpp @@ -26,7 +26,7 @@ nsDataChannel::OpenContentStream(bool async, nsIInputStream **result, nsresult rv; - nsCAutoString spec; + nsAutoCString spec; rv = URI()->GetAsciiSpec(spec); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/data/nsDataHandler.cpp b/netwerk/protocol/data/nsDataHandler.cpp index ac46964a2f16..24d9bcf5acf1 100644 --- a/netwerk/protocol/data/nsDataHandler.cpp +++ b/netwerk/protocol/data/nsDataHandler.cpp @@ -83,7 +83,7 @@ nsDataHandler::NewURI(const nsACString &aSpec, rv = uri->SetRef(spec); } else { // Otherwise, we'll assume |spec| is a fully-specified data URI - nsCAutoString contentType, contentCharset, dataBuffer, hashRef; + nsAutoCString contentType, contentCharset, dataBuffer, hashRef; bool base64; rv = ParseURI(spec, contentType, contentCharset, base64, dataBuffer, hashRef); if (NS_FAILED(rv)) diff --git a/netwerk/protocol/device/nsDeviceChannel.cpp b/netwerk/protocol/device/nsDeviceChannel.cpp index 34c2e87128a2..5a1a8c7cb9dc 100644 --- a/netwerk/protocol/device/nsDeviceChannel.cpp +++ b/netwerk/protocol/device/nsDeviceChannel.cpp @@ -85,10 +85,10 @@ nsDeviceChannel::OpenContentStream(bool aAsync, NS_NAMED_LITERAL_CSTRING(width, "width="); NS_NAMED_LITERAL_CSTRING(height, "height="); - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); - nsCAutoString type; + nsAutoCString type; nsRefPtr capture; nsCaptureParams captureParams; @@ -103,7 +103,7 @@ nsDeviceChannel::OpenContentStream(bool aAsync, captureParams.captureVideo = true; captureParams.timeLimit = 0; captureParams.frameLimit = 1; - nsCAutoString buffer; + nsAutoCString buffer; extractAttributeValue(spec.get(), "width=", buffer); nsresult err; captureParams.width = buffer.ToInteger(&err); @@ -130,7 +130,7 @@ nsDeviceChannel::OpenContentStream(bool aAsync, SetContentType(type); captureParams.captureAudio = false; captureParams.captureVideo = true; - nsCAutoString buffer; + nsAutoCString buffer; extractAttributeValue(spec.get(), "width=", buffer); nsresult err; captureParams.width = buffer.ToInteger(&err); diff --git a/netwerk/protocol/file/nsFileChannel.cpp b/netwerk/protocol/file/nsFileChannel.cpp index 58df36276bff..827011c76f77 100644 --- a/netwerk/protocol/file/nsFileChannel.cpp +++ b/netwerk/protocol/file/nsFileChannel.cpp @@ -247,7 +247,7 @@ nsFileChannel::nsFileChannel(nsIURI *uri) // can point to different resources right after the first resource is loaded. nsCOMPtr file; nsCOMPtr targetURI; - nsCAutoString fileTarget; + nsAutoCString fileTarget; nsCOMPtr resolvedFile; bool symLink; nsCOMPtr fileURL = do_QueryInterface(uri); @@ -363,7 +363,7 @@ nsFileChannel::OpenContentStream(bool async, nsIInputStream **result, if (!HasContentTypeHint()) SetContentType(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM)); } else { - nsCAutoString contentType; + nsAutoCString contentType; rv = MakeFileInputStream(file, stream, contentType); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/file/nsFileProtocolHandler.cpp b/netwerk/protocol/file/nsFileProtocolHandler.cpp index dfd37fc55527..eab73befe89f 100644 --- a/netwerk/protocol/file/nsFileProtocolHandler.cpp +++ b/netwerk/protocol/file/nsFileProtocolHandler.cpp @@ -154,7 +154,7 @@ nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI) { // We only support desktop files that end in ".desktop" like the spec says: // http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html - nsCAutoString leafName; + nsAutoCString leafName; nsresult rv = aFile->GetNativeLeafName(leafName); if (NS_FAILED(rv) || !StringEndsWith(leafName, NS_LITERAL_CSTRING(".desktop"))) @@ -165,12 +165,12 @@ nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI) if (NS_FAILED(rv)) return rv; - nsCAutoString type; + nsAutoCString type; parser.GetString(DESKTOP_ENTRY_SECTION, "Type", type); if (!type.EqualsLiteral("Link")) return NS_ERROR_NOT_AVAILABLE; - nsCAutoString url; + nsAutoCString url; rv = parser.GetString(DESKTOP_ENTRY_SECTION, "URL", url); if (NS_FAILED(rv) || url.IsEmpty()) return NS_ERROR_NOT_AVAILABLE; @@ -220,7 +220,7 @@ nsFileProtocolHandler::NewURI(const nsACString &spec, const nsACString *specPtr = &spec; #if defined(XP_WIN) || defined(XP_OS2) - nsCAutoString buf; + nsAutoCString buf; if (net_NormalizeFileURL(spec, buf)) specPtr = &buf; #endif diff --git a/netwerk/protocol/ftp/nsFTPChannel.cpp b/netwerk/protocol/ftp/nsFTPChannel.cpp index 2c8bc1802581..82bf787fdaa1 100644 --- a/netwerk/protocol/ftp/nsFTPChannel.cpp +++ b/netwerk/protocol/ftp/nsFTPChannel.cpp @@ -135,7 +135,7 @@ nsFtpChannel::OpenContentStream(bool async, nsIInputStream **result, bool nsFtpChannel::GetStatusArg(nsresult status, nsString &statusArg) { - nsCAutoString host; + nsAutoCString host; URI()->GetHost(host); CopyUTF8toUTF16(host, statusArg); return true; diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index 8a344b89d388..06a3c30f257b 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -150,7 +150,7 @@ nsFtpState::OnControlDataAvailable(const char *aData, uint32_t aDataLen) } // Append the current segment, including the LF - nsCAutoString line; + nsAutoCString line; int32_t crlfLength = 0; if ((currLineLength > eolLength) && @@ -282,7 +282,7 @@ nsFtpState::EstablishControlConnection() mState = FTP_READ_BUF; mNextState = FTP_S_USER; - nsCAutoString host; + nsAutoCString host; rv = mChannel->URI()->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; @@ -647,7 +647,7 @@ nsFtpState::S_user() { return NS_ERROR_FAILURE; nsresult rv; - nsCAutoString usernameStr("USER "); + nsAutoCString usernameStr("USER "); mResponseMsg = ""; @@ -716,7 +716,7 @@ nsFtpState::R_user() { nsresult nsFtpState::S_pass() { nsresult rv; - nsCAutoString passwordStr("PASS "); + nsAutoCString passwordStr("PASS "); mResponseMsg = ""; @@ -825,7 +825,7 @@ nsFtpState::R_pwd() { if (mResponseCode/100 != 2) return FTP_S_TYPE; - nsCAutoString respStr(mResponseMsg); + nsAutoCString respStr(mResponseMsg); int32_t pos = respStr.FindChar('"'); if (pos > -1) { respStr.Cut(0, pos+1); @@ -949,7 +949,7 @@ nsFtpState::S_cwd() { if (mPwd.IsEmpty()) mCacheConnection = false; - nsCAutoString cwdStr; + nsAutoCString cwdStr; if (mAction != PUT) cwdStr = mPath; if (cwdStr.IsEmpty() || cwdStr.First() != '/') @@ -976,7 +976,7 @@ nsFtpState::R_cwd() { nsresult nsFtpState::S_size() { - nsCAutoString sizeBuf(mPath); + nsAutoCString sizeBuf(mPath); if (sizeBuf.IsEmpty() || sizeBuf.First() != '/') sizeBuf.Insert(mPwd,0); if (mServerType == FTP_VMS_TYPE) @@ -1000,7 +1000,7 @@ nsFtpState::R_size() { nsresult nsFtpState::S_mdtm() { - nsCAutoString mdtmBuf(mPath); + nsAutoCString mdtmBuf(mPath); if (mdtmBuf.IsEmpty() || mdtmBuf.First() != '/') mdtmBuf.Insert(mPwd,0); if (mServerType == FTP_VMS_TYPE) @@ -1023,7 +1023,7 @@ nsFtpState::R_mdtm() { mModTime = mResponseMsg; // Save lastModified time for downloaded files. - nsCAutoString timeString; + nsAutoCString timeString; nsresult error; PRExplodedTime exTime; @@ -1083,7 +1083,7 @@ nsFtpState::SetContentType() if (!mPath.IsEmpty() && mPath.Last() != '/') { nsCOMPtr url = (do_QueryInterface(mChannel->URI())); - nsCAutoString filePath; + nsAutoCString filePath; if(NS_SUCCEEDED(url->GetFilePath(filePath))) { filePath.Append('/'); url->SetFilePath(filePath); @@ -1112,7 +1112,7 @@ nsFtpState::S_list() { if (mCacheEntry) { // save off the server type if we are caching. - nsCAutoString serverType; + nsAutoCString serverType; serverType.AppendInt(mServerType); mCacheEntry->SetMetaDataElement("servertype", serverType.get()); @@ -1158,7 +1158,7 @@ nsFtpState::R_list() { nsresult nsFtpState::S_retr() { - nsCAutoString retrStr(mPath); + nsAutoCString retrStr(mPath); if (retrStr.IsEmpty() || retrStr.First() != '/') retrStr.Insert(mPwd,0); if (mServerType == FTP_VMS_TYPE) @@ -1206,7 +1206,7 @@ nsFtpState::R_retr() { nsresult nsFtpState::S_rest() { - nsCAutoString restString("REST "); + nsAutoCString restString("REST "); // The int64_t cast is needed to avoid ambiguity restString.AppendInt(int64_t(mChannel->StartPos()), 10); restString.Append(CRLF); @@ -1238,7 +1238,7 @@ nsFtpState::S_stor() { nsCOMPtr url = do_QueryInterface(mChannel->URI()); NS_ASSERTION(url, "I thought you were a nsStandardURL"); - nsCAutoString storStr; + nsAutoCString storStr; url->GetFilePath(storStr); NS_ASSERTION(!storStr.IsEmpty(), "What does it mean to store a empty path"); @@ -1338,7 +1338,7 @@ nsFtpState::R_pasv() { nsresult rv; int32_t port; - nsCAutoString responseCopy(mResponseMsg); + nsAutoCString responseCopy(mResponseMsg); char *response = responseCopy.BeginWriting(); char *ptr = response; @@ -1438,7 +1438,7 @@ nsFtpState::R_pasv() { nsCOMPtr strans; - nsCAutoString host; + nsAutoCString host; if (!PR_IsNetAddrType(&mServerAddress, PR_IpAddrAny)) { char buf[64]; PR_NetAddrToString(&mServerAddress, buf, sizeof(buf)); @@ -1674,7 +1674,7 @@ nsFtpState::Init(nsFtpChannel *channel) mAction = PUT; nsresult rv; - nsCAutoString path; + nsAutoCString path; nsCOMPtr url = do_QueryInterface(mChannel->URI()); nsCString host; @@ -1711,7 +1711,7 @@ nsFtpState::Init(nsFtpChannel *channel) int32_t len = NS_UnescapeURL(fwdPtr); mPath.Assign(fwdPtr, len); if (IsUTF8(mPath)) { - nsCAutoString originCharset; + nsAutoCString originCharset; rv = mChannel->URI()->GetOriginCharset(originCharset); if (NS_SUCCEEDED(rv) && !originCharset.EqualsLiteral("UTF-8")) ConvertUTF8PathToCharset(originCharset); @@ -1724,7 +1724,7 @@ nsFtpState::Init(nsFtpChannel *channel) } // pull any username and/or password out of the uri - nsCAutoString uname; + nsAutoCString uname; rv = mChannel->URI()->GetUsername(uname); if (NS_FAILED(rv)) return rv; @@ -1738,7 +1738,7 @@ nsFtpState::Init(nsFtpChannel *channel) return NS_ERROR_MALFORMED_URI; } - nsCAutoString password; + nsAutoCString password; rv = mChannel->URI()->GetPassword(password); if (NS_FAILED(rv)) return rv; @@ -1872,7 +1872,7 @@ nsFtpState::SendFTPCommand(const nsCSubstring& command) NS_ASSERTION(mControlConnection, "null control connection"); // we don't want to log the password: - nsCAutoString logcmd(command); + nsAutoCString logcmd(command); if (StringBeginsWith(command, NS_LITERAL_CSTRING("PASS "))) logcmd = "PASS xxxxx"; @@ -1897,7 +1897,7 @@ nsFtpState::ConvertFilespecToVMS(nsCString& fileString) { int ntok=1; char *t, *nextToken; - nsCAutoString fileStringCopy; + nsAutoCString fileStringCopy; // Get a writeable copy we can strtok with. fileStringCopy = fileString; @@ -2187,7 +2187,7 @@ nsFtpState::ReadCacheEntry() nsXPIDLCString serverType; mCacheEntry->GetMetaDataElement("servertype", getter_Copies(serverType)); - nsCAutoString serverNum(serverType.get()); + nsAutoCString serverNum(serverType.get()); nsresult err; mServerType = serverNum.ToInteger(&err); @@ -2253,7 +2253,7 @@ nsFtpState::CheckCache() } // Generate cache key (remove trailing #ref if any): - nsCAutoString key; + nsAutoCString key; mChannel->URI()->GetAsciiSpec(key); int32_t pos = key.RFindChar('#'); if (pos != kNotFound) @@ -2284,7 +2284,7 @@ nsFtpState::ConvertUTF8PathToCharset(const nsACString &aCharset) nsresult rv; NS_ASSERTION(IsUTF8(mPath), "mPath isn't UTF8 string!"); NS_ConvertUTF8toUTF16 ucsPath(mPath); - nsCAutoString result; + nsAutoCString result; nsCOMPtr charsetMgr( do_GetService("@mozilla.org/charset-converter-manager;1", &rv)); diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp index c190441e12a1..5e0aeb4f410f 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp @@ -181,7 +181,7 @@ nsFtpProtocolHandler::NewURI(const nsACString &aSpec, nsIURI *aBaseURI, nsIURI **result) { - nsCAutoString spec(aSpec); + nsAutoCString spec(aSpec); spec.Trim(" \t\n\r"); // Match NS_IsAsciiWhitespace instead of HTML5 char *fwdPtr = spec.BeginWriting(); @@ -266,7 +266,7 @@ nsFtpProtocolHandler::RemoveConnection(nsIURI *aKey, nsFtpControlConnection* *_r *_retval = nullptr; - nsCAutoString spec; + nsAutoCString spec; aKey->GetPrePath(spec); LOG(("FTP:removing connection for %s\n", spec.get())); @@ -304,7 +304,7 @@ nsFtpProtocolHandler::InsertConnection(nsIURI *aKey, nsFtpControlConnection *aCo if (aConn->mSessionId != mSessionId) return NS_ERROR_FAILURE; - nsCAutoString spec; + nsAutoCString spec; aKey->GetPrePath(spec); LOG(("FTP:inserting connection for %s\n", spec.get())); diff --git a/netwerk/protocol/http/ConnectionDiagnostics.cpp b/netwerk/protocol/http/ConnectionDiagnostics.cpp index dff6f9f0662c..ca3f839b4485 100644 --- a/netwerk/protocol/http/ConnectionDiagnostics.cpp +++ b/netwerk/protocol/http/ConnectionDiagnostics.cpp @@ -237,7 +237,7 @@ nsHttpTransaction::PrintDiagnostics(nsCString &log) return; log.AppendPrintf(" ::: uri = %s\n", - nsCAutoString(mRequestHead->RequestURI()).get()); + nsAutoCString(mRequestHead->RequestURI()).get()); log.AppendPrintf(" caps = 0x%x\n", mCaps); log.AppendPrintf(" priority = %d\n", mPriority); log.AppendPrintf(" restart count = %u\n", mRestartCount); diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 21ece014d325..eedfb7f37230 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -89,7 +89,7 @@ HttpBaseChannel::Init(nsIURI *aURI, mCaps = aCaps; // Construct connection info object - nsCAutoString host; + nsAutoCString host; int32_t port = -1; bool usingSSL = false; @@ -121,7 +121,7 @@ HttpBaseChannel::Init(nsIURI *aURI, mRequestHead.SetMethod(nsHttp::Get); // Set request headers - nsCAutoString hostLine; + nsAutoCString hostLine; rv = nsHttpHandler::GenerateHostPort(host, port, hostLine); if (NS_FAILED(rv)) return rv; @@ -302,7 +302,7 @@ HttpBaseChannel::SetContentType(const nsACString& aContentType) if (!mResponseHead) return NS_ERROR_NOT_AVAILABLE; - nsCAutoString contentTypeBuf, charsetBuf; + nsAutoCString contentTypeBuf, charsetBuf; bool hadCharset; net_ParseContentType(aContentType, contentTypeBuf, charsetBuf, &hadCharset); @@ -445,7 +445,7 @@ HttpBaseChannel::SetUploadStream(nsIInputStream *stream, // contentLength are unspecified. if (stream) { - nsCAutoString method; + nsAutoCString method; bool hasHeaders; if (contentType.IsEmpty()) { @@ -494,7 +494,7 @@ HttpBaseChannel::ExplicitSetUploadStream(nsIInputStream *aStream, if (!aStreamHasHeaders) { // SetRequestHeader propagates headers to chrome if HttpChannelChild - nsCAutoString contentLengthStr; + nsAutoCString contentLengthStr; contentLengthStr.AppendInt(aContentLength); SetRequestHeader(NS_LITERAL_CSTRING("Content-Length"), contentLengthStr, false); @@ -548,7 +548,7 @@ HttpBaseChannel::ApplyContentConversions() return NS_OK; } - nsCAutoString contentEncoding; + nsAutoCString contentEncoding; char *cePtr, *val; nsresult rv; @@ -586,7 +586,7 @@ HttpBaseChannel::ApplyContentConversions() } nsCOMPtr converter; - nsCAutoString from(val); + nsAutoCString from(val); ToLowerCase(from); rv = serv->AsyncConvertData(from.get(), "uncompressed", @@ -838,7 +838,7 @@ HttpBaseChannel::SetReferrer(nsIURI *referrer) rv = referrer->SchemeIs("wyciwyg", &match); if (NS_FAILED(rv)) return rv; if (match) { - nsCAutoString path; + nsAutoCString path; rv = referrer->GetPath(path); if (NS_FAILED(rv)) return rv; @@ -852,7 +852,7 @@ HttpBaseChannel::SetReferrer(nsIURI *referrer) if (slashIndex == kNotFound) return NS_ERROR_FAILURE; // Get the charset of the original URI so we can pass it to our fixed up URI. - nsCAutoString charset; + nsAutoCString charset; referrer->GetOriginCharset(charset); // Replace |referrer| with a URI without wyciwyg://123/. @@ -898,8 +898,8 @@ HttpBaseChannel::SetReferrer(nsIURI *referrer) return NS_OK; if (!gHttpHandler->SendSecureXSiteReferrer()) { - nsCAutoString referrerHost; - nsCAutoString host; + nsAutoCString referrerHost; + nsAutoCString host; rv = referrer->GetAsciiHost(referrerHost); if (NS_FAILED(rv)) return rv; @@ -927,7 +927,7 @@ HttpBaseChannel::SetReferrer(nsIURI *referrer) rv = clone->SetUserPass(EmptyCString()); if (NS_FAILED(rv)) return rv; - nsCAutoString spec; + nsAutoCString spec; rv = clone->GetAsciiSpec(spec); if (NS_FAILED(rv)) return rv; @@ -1351,7 +1351,7 @@ HttpBaseChannel::GetEntityID(nsACString& aEntityID) } uint64_t size = LL_MAXUINT; - nsCAutoString etag, lastmod; + nsAutoCString etag, lastmod; if (mResponseHead) { // Don't return an entity if the server sent the following header: // Accept-Ranges: none diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 5d82f7e57081..675fa7bb41fe 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -372,7 +372,7 @@ HttpChannelChild::OnTransportAndData(const nsresult& status, status == NS_NET_STATUS_READING, "unexpected status code"); - nsCAutoString host; + nsAutoCString host; mURI->GetHost(host); mProgressSink->OnStatus(this, nullptr, status, NS_ConvertUTF8toUTF16(host).get()); @@ -568,7 +568,7 @@ HttpChannelChild::OnStatus(const nsresult& status) if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending && !(mLoadFlags & LOAD_BACKGROUND)) { - nsCAutoString host; + nsAutoCString host; mURI->GetHost(host); mProgressSink->OnStatus(this, nullptr, status, NS_ConvertUTF8toUTF16(host).get()); diff --git a/netwerk/protocol/http/NullHttpTransaction.cpp b/netwerk/protocol/http/NullHttpTransaction.cpp index 5c2eba9199d4..30cd1c0b135f 100644 --- a/netwerk/protocol/http/NullHttpTransaction.cpp +++ b/netwerk/protocol/http/NullHttpTransaction.cpp @@ -127,7 +127,7 @@ NullHttpTransaction::RequestHead() if (!mRequestHead) { mRequestHead = new nsHttpRequestHead(); - nsCAutoString hostHeader; + nsAutoCString hostHeader; nsCString host(mConnectionInfo->GetHost()); nsresult rv = nsHttpHandler::GenerateHostPort(host, mConnectionInfo->Port(), diff --git a/netwerk/protocol/http/PHttpChannelParams.h b/netwerk/protocol/http/PHttpChannelParams.h index 1245d8b1a427..efe60b8e01e2 100644 --- a/netwerk/protocol/http/PHttpChannelParams.h +++ b/netwerk/protocol/http/PHttpChannelParams.h @@ -66,13 +66,13 @@ struct ParamTraits { // aParam.get() cannot be null. NS_ASSERTION(aParam.get(), "null nsHTTPAtom value"); - nsCAutoString value(aParam.get()); + nsAutoCString value(aParam.get()); WriteParam(aMsg, value); } static bool Read(const Message* aMsg, void** aIter, paramType* aResult) { - nsCAutoString value; + nsAutoCString value; if (!ReadParam(aMsg, aIter, &value)) return false; diff --git a/netwerk/protocol/http/nsHttpAuthCache.cpp b/netwerk/protocol/http/nsHttpAuthCache.cpp index 054167a477bb..3d34506bcf84 100644 --- a/netwerk/protocol/http/nsHttpAuthCache.cpp +++ b/netwerk/protocol/http/nsHttpAuthCache.cpp @@ -76,7 +76,7 @@ nsHttpAuthCache::GetAuthEntryForPath(const char *scheme, LOG(("nsHttpAuthCache::GetAuthEntryForPath [key=%s://%s:%d path=%s]\n", scheme, host, port, path)); - nsCAutoString key; + nsAutoCString key; nsHttpAuthNode *node = LookupAuthNode(scheme, host, port, key); if (!node) return NS_ERROR_NOT_AVAILABLE; @@ -96,7 +96,7 @@ nsHttpAuthCache::GetAuthEntryForDomain(const char *scheme, LOG(("nsHttpAuthCache::GetAuthEntryForDomain [key=%s://%s:%d realm=%s]\n", scheme, host, port, realm)); - nsCAutoString key; + nsAutoCString key; nsHttpAuthNode *node = LookupAuthNode(scheme, host, port, key); if (!node) return NS_ERROR_NOT_AVAILABLE; @@ -126,7 +126,7 @@ nsHttpAuthCache::SetAuthEntry(const char *scheme, if (NS_FAILED(rv)) return rv; } - nsCAutoString key; + nsAutoCString key; nsHttpAuthNode *node = LookupAuthNode(scheme, host, port, key); if (!node) { @@ -154,7 +154,7 @@ nsHttpAuthCache::ClearAuthEntry(const char *scheme, if (!mDB) return; - nsCAutoString key; + nsAutoCString key; GetAuthKey(scheme, host, port, key); PL_HashTableRemove(mDB, key.get()); } diff --git a/netwerk/protocol/http/nsHttpBasicAuth.cpp b/netwerk/protocol/http/nsHttpBasicAuth.cpp index 8f531c8c21fb..59ca02b56e2f 100644 --- a/netwerk/protocol/http/nsHttpBasicAuth.cpp +++ b/netwerk/protocol/http/nsHttpBasicAuth.cpp @@ -71,7 +71,7 @@ nsHttpBasicAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, NS_ENSURE_TRUE(isBasicAuth, NS_ERROR_UNEXPECTED); // we work with ASCII around here - nsCAutoString userpass; + nsAutoCString userpass; LossyCopyUTF16toASCII(user, userpass); userpass.Append(':'); // always send a ':' (see bug 129565) if (password) diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 62db41d8ed48..05cbe032ed37 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -389,7 +389,7 @@ nsHttpChannel::Connect() // Check for a previous SPDY Alternate-Protocol directive if (gHttpHandler->IsSpdyEnabled() && mAllowSpdy) { - nsCAutoString hostPort; + nsAutoCString hostPort; if (NS_SUCCEEDED(mURI->GetHostPort(hostPort)) && gHttpHandler->ConnMgr()->GetSpdyAlternateProtocol(hostPort)) { @@ -724,7 +724,7 @@ nsHttpChannel::SetupTransaction() // Use the URI path if not proxying (transparent proxying such as proxy // CONNECT does not count here). Also figure out what HTTP version to use. - nsCAutoString buf, path; + nsAutoCString buf, path; nsCString* requestURI; if (mConnectionInfo->UsingConnect() || !mConnectionInfo->UsingHttpProxy()) { @@ -804,7 +804,7 @@ nsHttpChannel::SetupTransaction() mEntityID.BeginReading(slash); if (FindCharInReadable('/', slash, end)) { - nsCAutoString ifMatch; + nsAutoCString ifMatch; mRequestHead.SetHeader(nsHttp::If_Match, NS_UnescapeURL(Substring(start, slash), 0, ifMatch)); @@ -878,7 +878,7 @@ CallTypeSniffers(void *aClosure, const uint8_t *aData, uint32_t aCount) gIOService->GetContentSniffers(); uint32_t length = sniffers.Count(); for (uint32_t i = 0; i < length; ++i) { - nsCAutoString newType; + nsAutoCString newType; nsresult rv = sniffers[i]->GetMIMETypeFromContent(chan, aData, aCount, newType); if (NS_SUCCEEDED(rv) && !newType.IsEmpty()) { @@ -1097,7 +1097,7 @@ nsHttpChannel::ProcessSTSHeader() if (!isHttps) return NS_OK; - nsCAutoString asciiHost; + nsAutoCString asciiHost; rv = mURI->GetAsciiHost(asciiHost); NS_ENSURE_SUCCESS(rv, NS_OK); @@ -1147,7 +1147,7 @@ nsHttpChannel::ProcessSTSHeader() // If there's a STS header, process it (STS Spec 7.1). At this point in // processing, the channel is trusted, so the header should not be ignored. const nsHttpAtom atom = nsHttp::ResolveAtom("Strict-Transport-Security"); - nsCAutoString stsHeader; + nsAutoCString stsHeader; rv = mResponseHead->GetHeader(atom, stsHeader); if (rv == NS_ERROR_NOT_AVAILABLE) { LOG(("STS: No STS header, continuing load.\n")); @@ -1436,7 +1436,7 @@ nsHttpChannel::ContinueProcessNormal(nsresult rv) // Check that the server sent us what we were asking for if (mResuming) { // Create an entity id from the response - nsCAutoString id; + nsAutoCString id; rv = GetEntityID(id); if (NS_FAILED(rv)) { // If creating an entity id is not possible -> error @@ -1805,7 +1805,7 @@ HttpCacheQuery::ResponseWouldVary() const AssertOnCacheThread(); nsresult rv; - nsCAutoString buf, metaKey; + nsAutoCString buf, metaKey; mCachedResponseHead->GetHeader(nsHttp::Vary, buf); if (!buf.IsEmpty()) { NS_NAMED_LITERAL_CSTRING(prefix, "request-"); @@ -1855,7 +1855,7 @@ HttpCacheQuery::ResponseWouldVary() const // If this is a cookie-header, stored metadata is not // the value itself but the hash. So we also hash the // outgoing value here in order to compare the hashes - nsCAutoString hash; + nsAutoCString hash; if (atom == nsHttp::Cookie) { rv = Hash(newVal, hash); // If hash failed, be conservative (the cached hash @@ -2071,7 +2071,7 @@ nsHttpChannel::ProcessPartialContent() if (NS_FAILED(rv)) return rv; // update the cached response head - nsCAutoString head; + nsAutoCString head; mCachedResponseHead->Flatten(head, true); rv = mCacheEntry->SetMetaDataElement("response-head", head.get()); if (NS_FAILED(rv)) return rv; @@ -2163,8 +2163,8 @@ nsHttpChannel::ProcessNotModified() // that cache entry so there is a fighting chance of getting things on the // right track as well as disabling pipelining for that host. - nsCAutoString lastModifiedCached; - nsCAutoString lastModified304; + nsAutoCString lastModifiedCached; + nsAutoCString lastModified304; rv = mCachedResponseHead->GetHeader(nsHttp::Last_Modified, lastModifiedCached); @@ -2192,7 +2192,7 @@ nsHttpChannel::ProcessNotModified() if (NS_FAILED(rv)) return rv; // update the cached response head - nsCAutoString head; + nsAutoCString head; mCachedResponseHead->Flatten(head, true); rv = mCacheEntry->SetMetaDataElement("response-head", head.get()); if (NS_FAILED(rv)) return rv; @@ -2352,7 +2352,7 @@ IsSubRangeRequest(nsHttpRequestHead &aRequestHead) { if (!aRequestHead.PeekHeader(nsHttp::Range)) return false; - nsCAutoString byteRange; + nsAutoCString byteRange; aRequestHead.GetHeader(nsHttp::Range, byteRange); return !byteRange.EqualsLiteral("bytes=0-"); } @@ -2370,7 +2370,7 @@ nsHttpChannel::OpenCacheEntry(bool usingSSL) // make sure we're not abusing this function NS_PRECONDITION(!mCacheEntry, "cache entry already open"); - nsCAutoString cacheKey; + nsAutoCString cacheKey; if (mRequestHead.Method() == nsHttp::Post) { // If the post id is already set then this is an attempt to replay @@ -2432,7 +2432,7 @@ nsHttpChannel::OpenCacheEntry(bool usingSSL) // If we have an application cache, we check it first. if (mApplicationCache) { - nsCAutoString appCacheClientID; + nsAutoCString appCacheClientID; rv = mApplicationCache->GetClientID(appCacheClientID); if (NS_SUCCEEDED(rv)) { // We open with ACCESS_READ only, because we don't want to overwrite @@ -2496,7 +2496,7 @@ nsHttpChannel::OnOfflineCacheEntryAvailable(nsICacheEntryDescriptor *aEntry, return NS_OK; if (!mApplicationCacheForWrite && !mFallbackChannel) { - nsCAutoString cacheKey; + nsAutoCString cacheKey; GenerateCacheKey(mPostID, cacheKey); // Check for namespace match. @@ -2545,7 +2545,7 @@ nsHttpChannel::OpenNormalCacheEntry(bool usingSSL) nsDependentCString clientID( GetCacheSessionNameForStoragePolicy(storagePolicy, mPrivateBrowsing)); - nsCAutoString cacheKey; + nsAutoCString cacheKey; GenerateCacheKey(mPostID, cacheKey); nsCacheAccessMode accessRequested; @@ -2627,13 +2627,13 @@ nsHttpChannel::OpenOfflineCacheEntryForWriting() if (IsSubRangeRequest(mRequestHead)) return NS_OK; - nsCAutoString cacheKey; + nsAutoCString cacheKey; GenerateCacheKey(mPostID, cacheKey); NS_ENSURE_TRUE(mApplicationCacheForWrite, NS_ERROR_NOT_AVAILABLE); - nsCAutoString offlineCacheClientID; + nsAutoCString offlineCacheClientID; rv = mApplicationCacheForWrite->GetClientID(offlineCacheClientID); NS_ENSURE_SUCCESS(rv, rv); @@ -3264,7 +3264,7 @@ HttpCacheQuery::HasQueryString(nsHttpAtom method, nsIURI * uri) if (method != nsHttp::Get && method != nsHttp::Head) return false; - nsCAutoString query; + nsAutoCString query; nsCOMPtr url = do_QueryInterface(uri); nsresult rv = url->GetQuery(query); return NS_SUCCEEDED(rv) && !query.IsEmpty(); @@ -3715,7 +3715,7 @@ nsHttpChannel::AddCacheEntryHeaders(nsICacheEntryDescriptor *entry) // header in this case, but it doesn't seem worth the extra code to perform // the check. { - nsCAutoString buf, metaKey; + nsAutoCString buf, metaKey; mResponseHead->GetHeader(nsHttp::Vary, buf); if (!buf.IsEmpty()) { NS_NAMED_LITERAL_CSTRING(prefix, "request-"); @@ -3728,7 +3728,7 @@ nsHttpChannel::AddCacheEntryHeaders(nsICacheEntryDescriptor *entry) if (*token != '*') { nsHttpAtom atom = nsHttp::ResolveAtom(token); const char *val = mRequestHead.PeekHeader(atom); - nsCAutoString hash; + nsAutoCString hash; if (val) { // If cookie-header, store a hash of the value if (atom == nsHttp::Cookie) { @@ -3763,7 +3763,7 @@ nsHttpChannel::AddCacheEntryHeaders(nsICacheEntryDescriptor *entry) // Store the received HTTP head with the cache entry as an element of // the meta data. - nsCAutoString head; + nsAutoCString head; mResponseHead->Flatten(head, true); rv = entry->SetMetaDataElement("response-head", head.get()); @@ -3791,7 +3791,7 @@ nsHttpChannel::StoreAuthorizationMetaData(nsICacheEntryDescriptor *entry) return NS_OK; // eg. [Basic realm="wally world"] - nsCAutoString buf; + nsAutoCString buf; GetAuthType(val, buf); return entry->SetMetaDataElement("auth", buf.get()); } @@ -3992,7 +3992,7 @@ nsHttpChannel::AsyncProcessRedirection(uint32_t redirectType) return NS_ERROR_FAILURE; // make sure non-ASCII characters in the location header are escaped. - nsCAutoString locationBuf; + nsAutoCString locationBuf; if (NS_EscapeURL(location, -1, esc_OnlyNonASCII, locationBuf)) location = locationBuf.get(); @@ -4039,7 +4039,7 @@ nsHttpChannel::CreateNewURI(const char *loc, nsIURI **newURI) if (NS_FAILED(rv)) return rv; // the new uri should inherit the origin charset of the current uri - nsCAutoString originCharset; + nsAutoCString originCharset; rv = mURI->GetOriginCharset(originCharset); if (NS_FAILED(rv)) originCharset.Truncate(); @@ -4069,7 +4069,7 @@ nsHttpChannel::ContinueProcessRedirectionAfterFallback(nsresult rv) // move the reference of the old location to the new one if the new // one has none. - nsCAutoString ref; + nsAutoCString ref; rv = mRedirectURI->GetRef(ref); if (NS_SUCCEEDED(rv) && ref.IsEmpty()) { mURI->GetRef(ref); @@ -4773,7 +4773,7 @@ nsHttpChannel::OnStartRequest(nsIRequest *request, nsISupports *ctxt) // For sanity's sake we may want to cancel an alternate protocol // redirection involving the original host name - nsCAutoString hostPort; + nsAutoCString hostPort; if (NS_SUCCEEDED(mOriginalURI->GetHostPort(hostPort))) gHttpHandler->ConnMgr()->RemoveSpdyAlternateProtocol(hostPort); } @@ -5113,7 +5113,7 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status, LOG(("sending status notification [this=%p status=%x progress=%llu/%llu]\n", this, status, progress, progressMax)); - nsCAutoString host; + nsAutoCString host; mURI->GetHost(host); mProgressSink->OnStatus(this, nullptr, status, NS_ConvertUTF8toUTF16(host).get()); @@ -5310,7 +5310,7 @@ nsHttpChannel::GetCacheKey(nsISupports **key) if (!container) return NS_ERROR_OUT_OF_MEMORY; - nsCAutoString cacheKey; + nsAutoCString cacheKey; rv = GenerateCacheKey(mPostID, cacheKey); if (NS_FAILED(rv)) return rv; @@ -5645,7 +5645,7 @@ nsHttpChannel::GetOfflineCacheEntryAsForeignMarker() nsresult rv; - nsCAutoString cacheKey; + nsAutoCString cacheKey; rv = GenerateCacheKey(mPostID, cacheKey); NS_ENSURE_SUCCESS(rv, nullptr); @@ -5799,7 +5799,7 @@ nsHttpChannel::MaybeInvalidateCacheEntryForSubsequentGet() // Invalidate the request-uri. // Pass 0 in first param to get the cache-key for a GET-request. - nsCAutoString tmpCacheKey; + nsAutoCString tmpCacheKey; GenerateCacheKey(0, tmpCacheKey); LOG(("MaybeInvalidateCacheEntryForSubsequentGet [this=%p uri=%s]\n", this, tmpCacheKey.get())); @@ -5823,7 +5823,7 @@ nsHttpChannel::MaybeInvalidateCacheEntryForSubsequentGet() void nsHttpChannel::InvalidateCacheEntryForLocation(const char *location) { - nsCAutoString tmpCacheKey, tmpSpec; + nsAutoCString tmpCacheKey, tmpSpec; nsCOMPtr resultingURI; nsresult rv = CreateNewURI(location, getter_AddRefs(resultingURI)); if (NS_SUCCEEDED(rv) && HostPartIsTheSame(resultingURI)) { diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h index 703f927ef4c8..117a5437e1b9 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h @@ -121,7 +121,7 @@ public: /* internal necko use only */ { mUploadStreamHasHeaders = hasHeaders; } nsresult SetReferrerInternal(nsIURI *referrer) { - nsCAutoString spec; + nsAutoCString spec; nsresult rv = referrer->GetAsciiSpec(spec); if (NS_FAILED(rv)) return rv; mReferrer = referrer; @@ -256,7 +256,7 @@ private: // Ref RFC2616 13.10: "invalidation... MUST only be performed if // the host part is the same as in the Request-URI" inline bool HostPartIsTheSame(nsIURI *uri) { - nsCAutoString tmpHost1, tmpHost2; + nsAutoCString tmpHost1, tmpHost2; return (NS_SUCCEEDED(mURI->GetAsciiHost(tmpHost1)) && NS_SUCCEEDED(uri->GetAsciiHost(tmpHost2)) && (tmpHost1 == tmpHost2)); diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp index 607c2f0c1e97..deeaa6dfb98b 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ -96,7 +96,7 @@ nsHttpChannelAuthProvider::ProcessAuthentication(uint32_t httpStatus, rv = mAuthChannel->GetLoadFlags(&loadFlags); if (NS_FAILED(rv)) return rv; - nsCAutoString challenges; + nsAutoCString challenges; mProxyAuth = (httpStatus == 407); // Do proxy auth even if we're LOAD_ANONYMOUS @@ -134,7 +134,7 @@ nsHttpChannelAuthProvider::ProcessAuthentication(uint32_t httpStatus, rv = mAuthChannel->GetWWWChallenges(challenges); if (NS_FAILED(rv)) return rv; - nsCAutoString creds; + nsAutoCString creds; rv = GetCredentials(challenges.get(), mProxyAuth, creds); if (rv == NS_ERROR_IN_PROGRESS) return rv; @@ -187,7 +187,7 @@ nsHttpChannelAuthProvider::AddAuthorizationHeaders() } // check if server credentials should be sent - nsCAutoString path, scheme; + nsAutoCString path, scheme; if (NS_SUCCEEDED(GetCurrentPath(path)) && NS_SUCCEEDED(mURI->GetScheme(scheme))) { SetAuthorizationHeader(authCache, nsHttp::Authorization, @@ -412,7 +412,7 @@ nsHttpChannelAuthProvider::PrepareForAuthentication(bool proxyAuth) // We need to remove any Proxy_Authorization header left over from a // non-request based authentication handshake (e.g., for NTLM auth). - nsCAutoString contractId; + nsAutoCString contractId; contractId.Assign(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX); contractId.Append(mProxyAuthType); @@ -428,7 +428,7 @@ nsHttpChannelAuthProvider::PrepareForAuthentication(bool proxyAuth) return rv; if (!(precedingAuthFlags & nsIHttpAuthenticator::REQUEST_BASED)) { - nsCAutoString challenges; + nsAutoCString challenges; rv = mAuthChannel->GetProxyChallenges(challenges); if (NS_FAILED(rv)) { // delete the proxy authorization header because we weren't @@ -479,7 +479,7 @@ nsHttpChannelAuthProvider::ResolveHost() rv = mAuthChannel->GetURI(getter_AddRefs(uri)); if (NS_FAILED(rv)) return rv; - nsCAutoString host; + nsAutoCString host; rv = uri->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; @@ -500,7 +500,7 @@ nsHttpChannelAuthProvider::GetCredentials(const char *challenges, nsAFlatCString &creds) { nsCOMPtr auth; - nsCAutoString challenge; + nsAutoCString challenge; nsCString authType; // force heap allocation to enable string sharing since // we'll be assigning this value into mAuthType. @@ -648,7 +648,7 @@ nsHttpChannelAuthProvider::GetCredentialsForChallenge(const char *challenge, nsresult rv = auth->GetAuthFlags(&authFlags); if (NS_FAILED(rv)) return rv; - nsCAutoString realm; + nsAutoCString realm; ParseRealm(challenge, realm); // if no realm, then use the auth type as the realm. ToUpperCase so the @@ -668,7 +668,7 @@ nsHttpChannelAuthProvider::GetCredentialsForChallenge(const char *challenge, const char *host; int32_t port; nsHttpAuthIdentity *ident; - nsCAutoString path, scheme; + nsAutoCString path, scheme; bool identFromURI = false; nsISupports **continuationState; @@ -833,7 +833,7 @@ nsHttpChannelAuthProvider::GetAuthenticator(const char *challenge, // normalize to lowercase ToLowerCase(authType); - nsCAutoString contractid; + nsAutoCString contractid; contractid.Assign(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX); contractid.Append(authType); @@ -851,7 +851,7 @@ nsHttpChannelAuthProvider::GetIdentityFromURI(uint32_t authFlags, nsAutoString passBuf; // XXX i18n - nsCAutoString buf; + nsAutoCString buf; mURI->GetUsername(buf); if (!buf.IsEmpty()) { NS_UnescapeURL(buf); @@ -1033,14 +1033,14 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthAvailable(nsISupports *aContext, const char *host; int32_t port; nsHttpAuthIdentity *ident; - nsCAutoString path, scheme; + nsAutoCString path, scheme; nsISupports **continuationState; rv = GetAuthorizationMembers(mProxyAuth, scheme, host, port, path, ident, continuationState); if (NS_FAILED(rv)) OnAuthCancelled(aContext, false); - nsCAutoString realm; + nsAutoCString realm; ParseRealm(mCurrentChallenge.get(), realm); nsHttpAuthCache *authCache = gHttpHandler->AuthCache(); @@ -1067,7 +1067,7 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthAvailable(nsISupports *aContext, return NS_OK; } - nsCAutoString unused; + nsAutoCString unused; nsCOMPtr auth; rv = GetAuthenticator(mCurrentChallenge.get(), unused, getter_AddRefs(auth)); @@ -1107,7 +1107,7 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthCancelled(nsISupports *aContext, // there are still some challenges to process, do so nsresult rv; - nsCAutoString creds; + nsAutoCString creds; rv = GetCredentials(mRemainingChallenges.get(), mProxyAuth, creds); if (NS_SUCCEEDED(rv)) { // GetCredentials loaded the credentials from the cache or @@ -1173,7 +1173,7 @@ nsHttpChannelAuthProvider::ConfirmAuth(const nsString &bundleKey, !(loadFlags & nsIChannel::LOAD_INITIAL_DOCUMENT_URI)) return true; - nsCAutoString userPass; + nsAutoCString userPass; rv = mURI->GetUserPass(userPass); if (NS_FAILED(rv) || (userPass.Length() < gHttpHandler->PhishyUserPassLength())) @@ -1193,12 +1193,12 @@ nsHttpChannelAuthProvider::ConfirmAuth(const nsString &bundleKey, if (!bundle) return true; - nsCAutoString host; + nsAutoCString host; rv = mURI->GetHost(host); if (NS_FAILED(rv)) return true; - nsCAutoString user; + nsAutoCString user; rv = mURI->GetUsername(user); if (NS_FAILED(rv)) return true; @@ -1311,7 +1311,7 @@ nsHttpChannelAuthProvider::SetAuthorizationHeader(nsHttpAuthCache *authCache, // the stored credentials. if ((!creds[0] || identFromURI) && challenge[0]) { nsCOMPtr auth; - nsCAutoString unused; + nsAutoCString unused; rv = GetAuthenticator(challenge, unused, getter_AddRefs(auth)); if (NS_SUCCEEDED(rv)) { bool proxyAuth = (header == nsHttp::Proxy_Authorization); diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp index ba9e24e2fc72..d65bb0f694e6 100644 --- a/netwerk/protocol/http/nsHttpConnection.cpp +++ b/netwerk/protocol/http/nsHttpConnection.cpp @@ -260,7 +260,7 @@ nsHttpConnection::EnsureNPNComplete() nsCOMPtr securityInfo; nsCOMPtr ssl; - nsCAutoString negotiatedNPN; + nsAutoCString negotiatedNPN; rv = mSocketTransport->GetSecurityInfo(getter_AddRefs(securityInfo)); if (NS_FAILED(rv)) @@ -1420,7 +1420,7 @@ nsHttpConnection::SetupProxyConnect() NS_ABORT_IF_FALSE(!mUsingSpdyVersion, "SPDY NPN Complete while using proxy connect stream"); - nsCAutoString buf; + nsAutoCString buf; nsresult rv = nsHttpHandler::GenerateHostPort( nsDependentCString(mConnInfo->Host()), mConnInfo->Port(), buf); if (NS_FAILED(rv)) diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 355675ad008c..b221472f3c46 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -659,7 +659,7 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry) nsCOMPtr securityInfo; nsCOMPtr sslSocketControl; - nsCAutoString negotiatedNPN; + nsAutoCString negotiatedNPN; activeSpdy->GetSecurityInfo(getter_AddRefs(securityInfo)); if (!securityInfo) { @@ -1040,7 +1040,7 @@ nsHttpConnectionMgr::ReportFailedToProcess(nsIURI *uri) { NS_ABORT_IF_FALSE(uri, "precondition"); - nsCAutoString host; + nsAutoCString host; int32_t port = -1; bool usingSSL = false; bool isHttp = false; diff --git a/netwerk/protocol/http/nsHttpDigestAuth.cpp b/netwerk/protocol/http/nsHttpDigestAuth.cpp index b3f509734556..2e38d2ee0f29 100644 --- a/netwerk/protocol/http/nsHttpDigestAuth.cpp +++ b/netwerk/protocol/http/nsHttpDigestAuth.cpp @@ -63,7 +63,7 @@ nsHttpDigestAuth::MD5Hash(const char *buf, uint32_t len) rv = mVerifier->Update((unsigned char*)buf, len); if (NS_FAILED(rv)) return rv; - nsCAutoString hashString; + nsAutoCString hashString; rv = mVerifier->Finish(false, hashString); if (NS_FAILED(rv)) return rv; @@ -118,7 +118,7 @@ nsHttpDigestAuth::GetMethodAndPath(nsIHttpAuthenticableChannel *authChannel, // XXX we should really ask the HTTP channel for this string // instead of regenerating it here. // - nsCAutoString buf; + nsAutoCString buf; path = NS_EscapeURL(path, esc_OnlyNonASCII, buf); } } @@ -139,7 +139,7 @@ nsHttpDigestAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, nsISupports **continuationState, bool *result) { - nsCAutoString realm, domain, nonce, opaque; + nsAutoCString realm, domain, nonce, opaque; bool stale; uint16_t algorithm, qop; @@ -182,7 +182,7 @@ nsHttpDigestAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, // IIS implementation requires extra quotes bool requireExtraQuotes = false; { - nsCAutoString serverVal; + nsAutoCString serverVal; authChannel->GetServerResponseHeader(serverVal); if (!serverVal.IsEmpty()) { requireExtraQuotes = !PL_strncasecmp(serverVal.get(), "Microsoft-IIS", 13); @@ -190,12 +190,12 @@ nsHttpDigestAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, } nsresult rv; - nsCAutoString httpMethod; - nsCAutoString path; + nsAutoCString httpMethod; + nsAutoCString path; rv = GetMethodAndPath(authChannel, isProxyAuth, httpMethod, path); if (NS_FAILED(rv)) return rv; - nsCAutoString realm, domain, nonce, opaque; + nsAutoCString realm, domain, nonce, opaque; bool stale; uint16_t algorithm, qop; @@ -280,7 +280,7 @@ nsHttpDigestAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, // this lets the client verify the server response (via a server // returned Authentication-Info header). also used for session info. // - nsCAutoString cnonce; + nsAutoCString cnonce; static const char hexChar[] = "0123456789abcdef"; for (int i=0; i<16; ++i) { cnonce.Append(hexChar[(int)(15.0 * rand()/(RAND_MAX + 1.0))]); @@ -312,7 +312,7 @@ nsHttpDigestAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, // cnonce // - nsCAutoString authString; + nsAutoCString authString; authString.AssignLiteral("Digest username="); rv = AppendQuotedString(cUser, authString); @@ -399,7 +399,7 @@ nsHttpDigestAuth::CalculateResponse(const char * ha1_digest, len += 4; // length of "auth" } - nsCAutoString contents; + nsAutoCString contents; contents.SetCapacity(len); contents.Assign(ha1_digest, EXPANDED_DIGEST_LENGTH); @@ -465,7 +465,7 @@ nsHttpDigestAuth::CalculateHA1(const nsAFlatCString & username, len = exlen; } - nsCAutoString contents; + nsAutoCString contents; contents.SetCapacity(len + 1); contents.Assign(username); @@ -512,7 +512,7 @@ nsHttpDigestAuth::CalculateHA2(const nsAFlatCString & method, len += EXPANDED_DIGEST_LENGTH + 1; } - nsCAutoString contents; + nsAutoCString contents; contents.SetCapacity(len); contents.Assign(method); @@ -658,7 +658,7 @@ nsresult nsHttpDigestAuth::AppendQuotedString(const nsACString & value, nsACString & aHeaderLine) { - nsCAutoString quoted; + nsAutoCString quoted; nsACString::const_iterator s, e; value.BeginReading(s); value.EndReading(e); diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index cfa00848515a..9839ec0552e9 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -677,7 +677,7 @@ nsHttpHandler::InitUserAgentComponents() int ret = uname(&name); if (ret >= 0) { - nsCAutoString buf; + nsAutoCString buf; buf = (char*)name.sysname; if (strcmp(name.machine, "x86_64") == 0 && @@ -1296,7 +1296,7 @@ PrepareAcceptLanguages(const char *i_AcceptLanguages, nsACString &o_AcceptLangua nsresult nsHttpHandler::SetAcceptLanguages(const char *aAcceptLanguages) { - nsCAutoString buf; + nsAutoCString buf; nsresult rv = PrepareAcceptLanguages(aAcceptLanguages, buf); if (NS_SUCCEEDED(rv)) mAcceptLanguages.Assign(buf); @@ -1572,7 +1572,7 @@ nsHttpHandler::SpeculativeConnect(nsIURI *aURI, } } - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = aURI->GetScheme(scheme); if (NS_FAILED(rv)) return rv; @@ -1595,7 +1595,7 @@ nsHttpHandler::SpeculativeConnect(nsIURI *aURI, if (NS_FAILED(rv)) return rv; - nsCAutoString host; + nsAutoCString host; rv = aURI->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/http/nsHttpNTLMAuth.cpp b/netwerk/protocol/http/nsHttpNTLMAuth.cpp index bb4da7fe6d93..04bbd8aca3c4 100644 --- a/netwerk/protocol/http/nsHttpNTLMAuth.cpp +++ b/netwerk/protocol/http/nsHttpNTLMAuth.cpp @@ -92,7 +92,7 @@ MatchesBaseURI(const nsCSubstring &matchScheme, static bool IsNonFqdn(nsIURI *uri) { - nsCAutoString host; + nsAutoCString host; PRNetAddr addr; if (NS_FAILED(uri->GetAsciiHost(host))) @@ -110,7 +110,7 @@ TestPref(nsIURI *uri, const char *pref) if (!prefs) return false; - nsCAutoString scheme, host; + nsAutoCString scheme, host; int32_t port; if (NS_FAILED(uri->GetScheme(scheme))) @@ -351,7 +351,7 @@ nsHttpNTLMAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, // initial challenge if (PL_strcasecmp(challenge, "NTLM") == 0) { // NTLM service name format is 'HTTP@host' for both http and https - nsCAutoString serviceName, host; + nsAutoCString serviceName, host; rv = authChannel->GetAsciiHostForAuth(host); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index 7b9f9e92b1b7..a4ce0dfd5c9f 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -55,7 +55,7 @@ static NS_DEFINE_CID(kMultiplexInputStream, NS_MULTIPLEXINPUTSTREAM_CID); static void LogHeaders(const char *lines) { - nsCAutoString buf; + nsAutoCString buf; char *p; while ((p = PL_strstr(lines, "\r\n")) != nullptr) { buf.Assign(lines, p - lines); @@ -1173,7 +1173,7 @@ nsHttpTransaction::HandleContentStart() #if defined(PR_LOGGING) if (LOG3_ENABLED()) { LOG3(("http response [\n")); - nsCAutoString headers; + nsAutoCString headers; mResponseHead->Flatten(headers, false); LogHeaders(headers.get()); LOG3(("]\n")); @@ -1422,7 +1422,7 @@ nsHttpTransaction::ProcessData(char *buf, uint32_t count, uint32_t *countRead) if (mActivityDistributor && mResponseHead && mHaveAllHeaders && !mReportedResponseHeader) { mReportedResponseHeader = true; - nsCAutoString completeResponseHeaders; + nsAutoCString completeResponseHeaders; mResponseHead->Flatten(completeResponseHeaders, false); completeResponseHeaders.AppendLiteral("\r\n"); mActivityDistributor->ObserveActivity( diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp index d4ca0871ea1e..8d200825436f 100644 --- a/netwerk/protocol/res/nsResProtocolHandler.cpp +++ b/netwerk/protocol/res/nsResProtocolHandler.cpp @@ -54,12 +54,12 @@ nsResURL::EnsureFile() NS_ENSURE_TRUE(gResHandler, NS_ERROR_NOT_AVAILABLE); - nsCAutoString spec; + nsAutoCString spec; rv = gResHandler->ResolveURI(this, spec); if (NS_FAILED(rv)) return rv; - nsCAutoString scheme; + nsAutoCString scheme; rv = net_ExtractURLScheme(spec, nullptr, nullptr, &scheme); if (NS_FAILED(rv)) return rv; @@ -128,7 +128,7 @@ nsResProtocolHandler::Init() mIOService = do_GetIOService(&rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString appURI, greURI; + nsAutoCString appURI, greURI; rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::APP, appURI); NS_ENSURE_SUCCESS(rv, rv); rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::GRE, greURI); @@ -248,7 +248,7 @@ nsResProtocolHandler::NewURI(const nsACString &aSpec, // unescape any %2f and %2e to make sure nsStandardURL coalesces them. // Later net_GetFileFromURLSpec() will do a full unescape and we want to // treat them the same way the file system will. (bugs 380994, 394075) - nsCAutoString spec; + nsAutoCString spec; const char *src = aSpec.BeginReading(); const char *end = aSpec.EndReading(); const char *last = src; @@ -286,7 +286,7 @@ nsResProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result) { NS_ENSURE_ARG_POINTER(uri); nsresult rv; - nsCAutoString spec; + nsAutoCString spec; rv = ResolveURI(uri, spec); if (NS_FAILED(rv)) return rv; @@ -321,7 +321,7 @@ nsResProtocolHandler::SetSubstitution(const nsACString& root, nsIURI *baseURI) } // If baseURI isn't a resource URI, we can set the substitution immediately. - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = baseURI->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); if (!scheme.Equals(NS_LITERAL_CSTRING("resource"))) { @@ -330,7 +330,7 @@ nsResProtocolHandler::SetSubstitution(const nsACString& root, nsIURI *baseURI) } // baseURI is a resource URI, let's resolve it first. - nsCAutoString newBase; + nsAutoCString newBase; rv = ResolveURI(baseURI, newBase); NS_ENSURE_SUCCESS(rv, rv); @@ -353,7 +353,7 @@ nsResProtocolHandler::GetSubstitution(const nsACString& root, nsIURI **result) // try invoking the directory service for "resource:root" - nsCAutoString key; + nsAutoCString key; key.AssignLiteral("resource:"); key.Append(root); @@ -383,8 +383,8 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result) { nsresult rv; - nsCAutoString host; - nsCAutoString path; + nsAutoCString host; + nsAutoCString path; rv = uri->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; @@ -393,7 +393,7 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result) if (NS_FAILED(rv)) return rv; // Unescape the path so we can perform some checks on it. - nsCAutoString unescapedPath(path); + nsAutoCString unescapedPath(path); NS_UnescapeURL(unescapedPath); // Don't misinterpret the filepath as an absolute URI. @@ -417,7 +417,7 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result) #if defined(PR_LOGGING) if (PR_LOG_TEST(gResLog, PR_LOG_DEBUG)) { - nsCAutoString spec; + nsAutoCString spec; uri->GetAsciiSpec(spec); PR_LOG(gResLog, PR_LOG_DEBUG, ("%s\n -> %s\n", spec.get(), PromiseFlatCString(result).get())); diff --git a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp index 643ed0ec034b..6f5c4a2376ad 100644 --- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp @@ -40,7 +40,7 @@ nsViewSourceChannel::Init(nsIURI* uri) { mOriginalURI = uri; - nsCAutoString path; + nsAutoCString path; nsresult rv = uri->GetPath(path); if (NS_FAILED(rv)) return rv; @@ -48,7 +48,7 @@ nsViewSourceChannel::Init(nsIURI* uri) nsCOMPtr pService(do_GetIOService(&rv)); if (NS_FAILED(rv)) return rv; - nsCAutoString scheme; + nsAutoCString scheme; rv = pService->ExtractScheme(path, scheme); if (NS_FAILED(rv)) return rv; @@ -158,12 +158,12 @@ nsViewSourceChannel::GetURI(nsIURI* *aURI) return NS_ERROR_UNEXPECTED; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); /* XXX Gross hack -- NS_NewURI goes into an infinite loop on non-flat specs. See bug 136980 */ - return NS_NewURI(aURI, nsCAutoString(NS_LITERAL_CSTRING("view-source:")+spec), nullptr); + return NS_NewURI(aURI, nsAutoCString(NS_LITERAL_CSTRING("view-source:")+spec), nullptr); } NS_IMETHODIMP @@ -274,7 +274,7 @@ nsViewSourceChannel::GetContentType(nsACString &aContentType) { // Get the current content type nsresult rv; - nsCAutoString contentType; + nsAutoCString contentType; rv = mChannel->GetContentType(contentType); if (NS_FAILED(rv)) return rv; @@ -651,7 +651,7 @@ nsViewSourceChannel::VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor) return NS_ERROR_NULL_POINTER; NS_NAMED_LITERAL_CSTRING(contentTypeStr, "Content-Type"); - nsCAutoString contentType; + nsAutoCString contentType; nsresult rv = mHttpChannel->GetResponseHeader(contentTypeStr, contentType); if (NS_SUCCEEDED(rv)) diff --git a/netwerk/protocol/viewsource/nsViewSourceHandler.cpp b/netwerk/protocol/viewsource/nsViewSourceHandler.cpp index b433ba4b5406..bccf3ab3d561 100644 --- a/netwerk/protocol/viewsource/nsViewSourceHandler.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceHandler.cpp @@ -61,7 +61,7 @@ nsViewSourceHandler::NewURI(const nsACString &aSpec, if (NS_FAILED(rv)) return rv; - nsCAutoString asciiSpec; + nsAutoCString asciiSpec; rv = innerURI->GetAsciiSpec(asciiSpec); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 4659602b0f96..11f55c3764d3 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -1992,7 +1992,7 @@ WebSocketChannel::HandleExtensions() LOG(("WebSocketChannel::HandleExtensions() %p\n", this)); nsresult rv; - nsCAutoString extensions; + nsAutoCString extensions; NS_ABORT_IF_FALSE(NS_IsMainThread(), "not main thread"); @@ -2095,7 +2095,7 @@ WebSocketChannel::SetupRequest() false); uint8_t *secKey; - nsCAutoString secKeyString; + nsAutoCString secKeyString; rv = mRandomGenerator->GenerateRandomBytes(16, &secKey); NS_ENSURE_SUCCESS(rv, rv); @@ -2283,7 +2283,7 @@ WebSocketChannel::AsyncOnChannelRedirect( // It's only a HSTS redirect if we started with non-secure, are going to // secure, and the new URI is otherwise the same as the old one. if (!(!currentIsHttps && newuriIsHttps && uriEqual)) { - nsCAutoString newSpec; + nsAutoCString newSpec; rv = newuri->GetSpec(newSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -2294,7 +2294,7 @@ WebSocketChannel::AsyncOnChannelRedirect( } if (mEncrypted && !newuriIsHttps) { - nsCAutoString spec; + nsAutoCString spec; if (NS_SUCCEEDED(newuri->GetSpec(spec))) LOG(("WebSocketChannel: Redirect to %s violates encryption rule\n", spec.get())); @@ -2774,7 +2774,7 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest, return NS_ERROR_CONNECTION_REFUSED; } - nsCAutoString respUpgrade; + nsAutoCString respUpgrade; rv = mHttpChannel->GetResponseHeader( NS_LITERAL_CSTRING("Upgrade"), respUpgrade); @@ -2798,7 +2798,7 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest, return rv; } - nsCAutoString respConnection; + nsAutoCString respConnection; rv = mHttpChannel->GetResponseHeader( NS_LITERAL_CSTRING("Connection"), respConnection); @@ -2822,7 +2822,7 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest, return rv; } - nsCAutoString respAccept; + nsAutoCString respAccept; rv = mHttpChannel->GetResponseHeader( NS_LITERAL_CSTRING("Sec-WebSocket-Accept"), respAccept); @@ -2841,7 +2841,7 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest, // If it does not, set mProtocol to "" so the protocol attribute // of the WebSocket JS object reflects that if (!mProtocol.IsEmpty()) { - nsCAutoString respProtocol; + nsAutoCString respProtocol; rv = mHttpChannel->GetResponseHeader( NS_LITERAL_CSTRING("Sec-WebSocket-Protocol"), respProtocol); diff --git a/netwerk/protocol/websocket/WebSocketChannelParent.cpp b/netwerk/protocol/websocket/WebSocketChannelParent.cpp index 819e9a458dc0..ce1e6c76ef69 100644 --- a/netwerk/protocol/websocket/WebSocketChannelParent.cpp +++ b/netwerk/protocol/websocket/WebSocketChannelParent.cpp @@ -150,7 +150,7 @@ NS_IMETHODIMP WebSocketChannelParent::OnStart(nsISupports *aContext) { LOG(("WebSocketChannelParent::OnStart() %p\n", this)); - nsCAutoString protocol, extensions; + nsAutoCString protocol, extensions; if (mChannel) { mChannel->GetProtocol(protocol); mChannel->GetExtensions(extensions); diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp index b06f67c939db..18ec7bf1829b 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp @@ -186,7 +186,7 @@ WyciwygChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext chan->GetContentLength(&contentLength); int32_t charsetSource = kCharsetUninitialized; - nsCAutoString charset; + nsAutoCString charset; chan->GetCharsetAndSource(&charsetSource, charset); nsCOMPtr securityInfo; diff --git a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp index 76b486b4ca6f..5e8fd411df90 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp @@ -359,7 +359,7 @@ nsWyciwygChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx) NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS); NS_ENSURE_ARG_POINTER(listener); - nsCAutoString spec; + nsAutoCString spec; mURI->GetSpec(spec); // open a cache entry for this channel... @@ -394,7 +394,7 @@ NS_IMETHODIMP nsWyciwygChannel::WriteToCacheEntry(const nsAString &aData) { // URIs not thread-safe, so get spec now in case we need it - nsCAutoString spec; + nsAutoCString spec; nsresult rv = mURI->GetAsciiSpec(spec); if (NS_FAILED(rv)) return rv; @@ -702,7 +702,7 @@ nsWyciwygChannel::ReadFromCache() // Get the stored security info mCacheEntry->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); - nsCAutoString tmpStr; + nsAutoCString tmpStr; rv = mCacheEntry->GetMetaDataElement("inhibit-persistent-caching", getter_Copies(tmpStr)); if (NS_SUCCEEDED(rv) && tmpStr == NS_LITERAL_CSTRING("1")) @@ -730,7 +730,7 @@ nsWyciwygChannel::WriteCharsetAndSourceToCache(int32_t aSource, mCacheEntry->SetMetaDataElement("charset", aCharset.get()); - nsCAutoString source; + nsAutoCString source; source.AppendInt(aSource); mCacheEntry->SetMetaDataElement("charset-source", source.get()); } diff --git a/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp b/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp index 76057097af2a..d7d250023318 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp @@ -109,7 +109,7 @@ nsWyciwygProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result) { // If original channel used https, make sure PSM is initialized // (this may be first channel to load during a session restore) - nsCAutoString path; + nsAutoCString path; rv = url->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); int32_t slashIndex = path.FindChar('/', 2); diff --git a/netwerk/socket/nsSocketProviderService.cpp b/netwerk/socket/nsSocketProviderService.cpp index 728687acc5c4..225f741fbce5 100644 --- a/netwerk/socket/nsSocketProviderService.cpp +++ b/netwerk/socket/nsSocketProviderService.cpp @@ -32,7 +32,7 @@ nsSocketProviderService::GetSocketProvider(const char *type, nsISocketProvider **result) { nsresult rv; - nsCAutoString contractID( + nsAutoCString contractID( NS_LITERAL_CSTRING(NS_NETWORK_SOCKET_CONTRACTID_PREFIX) + nsDependentCString(type)); diff --git a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp index 08af60a38fc7..0b5999fb4bd5 100644 --- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp +++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp @@ -395,7 +395,7 @@ bool mozTXTToHTMLConv::ShouldLinkify(const nsCString& aURL) if (!mIOService) return false; - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = mIOService->ExtractScheme(aURL, scheme); if(NS_FAILED(rv)) return false; diff --git a/netwerk/streamconv/converters/nsBinHexDecoder.cpp b/netwerk/streamconv/converters/nsBinHexDecoder.cpp index 6980ebd10df6..2c4a6e7b583a 100644 --- a/netwerk/streamconv/converters/nsBinHexDecoder.cpp +++ b/netwerk/streamconv/converters/nsBinHexDecoder.cpp @@ -479,7 +479,7 @@ nsresult nsBinHexDecoder::DetectContentType(nsIRequest* aRequest, nsCOMPtr mimeService(do_GetService("@mozilla.org/mime;1", &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString contentType; + nsAutoCString contentType; // extract the extension from aFilename and look it up. const char * fileExt = strrchr(aFilename.get(), '.'); diff --git a/netwerk/streamconv/converters/nsDirIndexParser.cpp b/netwerk/streamconv/converters/nsDirIndexParser.cpp index b046e7a61275..6e746277e31a 100644 --- a/netwerk/streamconv/converters/nsDirIndexParser.cpp +++ b/netwerk/streamconv/converters/nsDirIndexParser.cpp @@ -184,7 +184,7 @@ nsDirIndexParser::ParseFormat(const char* aFormatStr) { if (! *aFormatStr) break; - nsCAutoString name; + nsAutoCString name; int32_t len = 0; while (aFormatStr[len] && !nsCRT::IsAsciiSpace(PRUnichar(aFormatStr[len]))) ++len; @@ -224,7 +224,7 @@ nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char* aDataStr) { nsresult rv = NS_OK; - nsCAutoString filename; + nsAutoCString filename; for (int32_t i = 0; mFormat[i] != -1; ++i) { // If we've exhausted the data before we run out of fields, just diff --git a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp index 30084c942092..755408dd7211 100644 --- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp +++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp @@ -121,7 +121,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest* request, nsISupports *ctxt, printf("::OnData() received the following %d bytes...\n\n%s\n\n", streamLen, buffer); #endif // DEBUG_dougt - nsCAutoString indexFormat; + nsAutoCString indexFormat; if (!mSentHeading) { // build up the 300: line nsCOMPtr uri; @@ -219,8 +219,8 @@ nsFTPDirListingConv::GetHeaders(nsACString& headers, headers.AppendLiteral("300: "); // Bug 111117 - don't print the password - nsCAutoString pw; - nsCAutoString spec; + nsAutoCString pw; + nsAutoCString spec; uri->GetPassword(pw); if (!pw.IsEmpty()) { rv = uri->SetPassword(EmptyCString()); @@ -295,7 +295,7 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCString &aString) { } } - nsCAutoString buf; + nsAutoCString buf; aString.Append('\"'); aString.Append(NS_EscapeURL(Substring(result.fe_fname, result.fe_fname+result.fe_fnlen), diff --git a/netwerk/streamconv/converters/nsIndexedToHTML.cpp b/netwerk/streamconv/converters/nsIndexedToHTML.cpp index 82a49a357d42..7319ee564824 100644 --- a/netwerk/streamconv/converters/nsIndexedToHTML.cpp +++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp @@ -156,7 +156,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext, rv = mParser->OnStartRequest(request, aContext); if (NS_FAILED(rv)) return rv; - nsCAutoString baseUri, titleUri; + nsAutoCString baseUri, titleUri; rv = uri->GetAsciiSpec(baseUri); if (NS_FAILED(rv)) return rv; titleUri = baseUri; @@ -179,7 +179,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext, // This is done by the 300: line generation in ftp, but we don't use // that - see above - nsCAutoString pw; + nsAutoCString pw; rv = uri->GetPassword(pw); if (NS_FAILED(rv)) return rv; if (!pw.IsEmpty()) { @@ -192,7 +192,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext, if (NS_FAILED(rv)) return rv; } - nsCAutoString path; + nsAutoCString path; rv = uri->GetPath(path); if (NS_FAILED(rv)) return rv; @@ -207,7 +207,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext, if (NS_FAILED(rv)) return rv; file->SetFollowLinks(true); - nsCAutoString url; + nsAutoCString url; rv = net_GetURLSpecFromFile(file, url); if (NS_FAILED(rv)) return rv; baseUri.Assign(url); @@ -226,7 +226,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext, NS_ENSURE_SUCCESS(rv, rv); } else if (NS_SUCCEEDED(uri->SchemeIs("jar", &isScheme)) && isScheme) { - nsCAutoString path; + nsAutoCString path; rv = uri->GetPath(path); if (NS_FAILED(rv)) return rv; @@ -244,7 +244,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext, else { // default behavior for other protocols is to assume the channel's // URL references a directory ending in '/' -- fixup if necessary. - nsCAutoString path; + nsAutoCString path; rv = uri->GetPath(path); if (NS_FAILED(rv)) return rv; if (baseUri.Last() != '/') { @@ -512,7 +512,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext, if (NS_FAILED(rv) && isSchemeFile) { nsCOMPtr platformCharset(do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString charset; + nsAutoCString charset; rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, charset); NS_ENSURE_SUCCESS(rv, rv); @@ -860,7 +860,7 @@ nsIndexedToHTML::OnIndexAvailable(nsIRequest *aRequest, if (NS_FAILED(rv)) return rv; // need to escape links - nsCAutoString escapeBuf; + nsAutoCString escapeBuf; NS_ConvertUTF16toUTF8 utf8UnEscapeSpec(unEscapeSpec); diff --git a/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/netwerk/streamconv/converters/nsMultiMixedConv.cpp index 3a77cfc4eab2..9e915ea0be15 100644 --- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -647,7 +647,7 @@ nsMultiMixedConv::OnStartRequest(nsIRequest *request, nsISupports *ctxt) { // we're assuming the content-type is available at this stage NS_ASSERTION(mToken.IsEmpty(), "a second on start???"); const char *bndry = nullptr; - nsCAutoString delimiter; + nsAutoCString delimiter; nsresult rv = NS_OK; mContext = ctxt; @@ -679,7 +679,7 @@ nsMultiMixedConv::OnStartRequest(nsIRequest *request, nsISupports *ctxt) { char *attrib = (char *) strchr(bndry, ';'); if (attrib) *attrib = '\0'; - nsCAutoString boundaryString(bndry); + nsAutoCString boundaryString(bndry); if (attrib) *attrib = ';'; boundaryString.Trim(" \""); @@ -942,11 +942,11 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr, char *colon = (char *) strchr(cursor, ':'); if (colon) { *colon = '\0'; - nsCAutoString headerStr(cursor); + nsAutoCString headerStr(cursor); headerStr.CompressWhitespace(); *colon = ':'; - nsCAutoString headerVal(colon + 1); + nsAutoCString headerVal(colon + 1); headerVal.CompressWhitespace(); // examine header diff --git a/netwerk/streamconv/converters/nsUnknownDecoder.cpp b/netwerk/streamconv/converters/nsUnknownDecoder.cpp index 3a3b732e72f7..79bbb851ea73 100644 --- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp +++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp @@ -381,7 +381,7 @@ bool nsUnknownDecoder::TryContentSniffers(nsIRequest* aRequest) nsCOMPtr sniffer_id(do_QueryInterface(elem)); NS_ASSERTION(sniffer_id, "element is no nsISupportsCString!?"); - nsCAutoString contractid; + nsAutoCString contractid; nsresult rv = sniffer_id->GetData(contractid); if (NS_FAILED(rv)) { continue; @@ -505,7 +505,7 @@ bool nsUnknownDecoder::SniffURI(nsIRequest* aRequest) nsCOMPtr uri; nsresult result = channel->GetURI(getter_AddRefs(uri)); if (NS_SUCCEEDED(result) && uri) { - nsCAutoString type; + nsAutoCString type; result = mimeService->GetTypeFromURI(uri, type); if (NS_SUCCEEDED(result)) { mContentType = type; @@ -645,10 +645,10 @@ nsBinaryDetector::DetermineContentType(nsIRequest* aRequest) } // It's an HTTP channel. Check for the text/plain mess - nsCAutoString contentTypeHdr; + nsAutoCString contentTypeHdr; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Type"), contentTypeHdr); - nsCAutoString contentType; + nsAutoCString contentType; httpChannel->GetContentType(contentType); // Make sure to do a case-sensitive exact match comparison here. Apache @@ -670,7 +670,7 @@ nsBinaryDetector::DetermineContentType(nsIRequest* aRequest) // detect the type. // XXXbz we could improve this by doing a local decompress if we // wanted, I'm sure. - nsCAutoString contentEncoding; + nsAutoCString contentEncoding; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"), contentEncoding); if (!contentEncoding.IsEmpty()) { diff --git a/netwerk/streamconv/src/nsStreamConverterService.cpp b/netwerk/streamconv/src/nsStreamConverterService.cpp index ed6269920dc6..d49b626288a3 100644 --- a/netwerk/streamconv/src/nsStreamConverterService.cpp +++ b/netwerk/streamconv/src/nsStreamConverterService.cpp @@ -102,12 +102,12 @@ nsStreamConverterService::BuildGraph() { while (NS_SUCCEEDED(rv)) { // get the entry string - nsCAutoString entryString; + nsAutoCString entryString; rv = entry->GetData(entryString); if (NS_FAILED(rv)) return rv; // cobble the entry string w/ the converter key to produce a full contractID. - nsCAutoString contractID(NS_ISTREAMCONVERTER_KEY); + nsAutoCString contractID(NS_ISTREAMCONVERTER_KEY); contractID.Append(entryString); // now we've got the CONTRACTID, let's parse it up. @@ -130,7 +130,7 @@ nsStreamConverterService::AddAdjacency(const char *aContractID) { nsresult rv; // first parse out the FROM and TO MIME-types. - nsCAutoString fromStr, toStr; + nsAutoCString fromStr, toStr; rv = ParseFromTo(aContractID, fromStr, toStr); if (NS_FAILED(rv)) return rv; @@ -204,7 +204,7 @@ nsStreamConverterService::AddAdjacency(const char *aContractID) { nsresult nsStreamConverterService::ParseFromTo(const char *aContractID, nsCString &aFromRes, nsCString &aToRes) { - nsCAutoString ContractIDStr(aContractID); + nsAutoCString ContractIDStr(aContractID); int32_t fromLoc = ContractIDStr.Find("from="); int32_t toLoc = ContractIDStr.Find("to="); @@ -213,7 +213,7 @@ nsStreamConverterService::ParseFromTo(const char *aContractID, nsCString &aFromR fromLoc = fromLoc + 5; toLoc = toLoc + 3; - nsCAutoString fromStr, toStr; + nsAutoCString fromStr, toStr; ContractIDStr.Mid(fromStr, fromLoc, toLoc - 4 - fromLoc); ContractIDStr.Mid(toStr, toLoc, ContractIDStr.Length() - toLoc); @@ -293,7 +293,7 @@ nsStreamConverterService::FindConverter(const char *aContractID, nsTArray *shortestPath = new nsTArray(); if (!shortestPath) return NS_ERROR_OUT_OF_MEMORY; @@ -419,7 +419,7 @@ nsStreamConverterService::FindConverter(const char *aContractID, nsTArrayGetKey(key); diff --git a/netwerk/test/TestCookie.cpp b/netwerk/test/TestCookie.cpp index caac3465faff..995979ab26a8 100644 --- a/netwerk/test/TestCookie.cpp +++ b/netwerk/test/TestCookie.cpp @@ -652,7 +652,7 @@ main(int32_t argc, char *argv[]) // keep tabs on the second and third cookies, so we can check them later nsCOMPtr cookie2(do_QueryInterface(cookie)); if (!cookie2) break; - nsCAutoString name; + nsAutoCString name; cookie2->GetName(name); if (name == NS_LITERAL_CSTRING("test2")) expiredCookie = cookie2; @@ -709,8 +709,8 @@ main(int32_t argc, char *argv[]) // test that cookies are // a) returned by order of creation time (oldest first, newest last) // b) evicted by order of lastAccessed time, if the limit on cookies per host (50) is reached - nsCAutoString name; - nsCAutoString expected; + nsAutoCString name; + nsAutoCString expected; for (int32_t i = 0; i < 60; ++i) { name = NS_LITERAL_CSTRING("test"); name.AppendInt(i); diff --git a/netwerk/test/TestDNS.cpp b/netwerk/test/TestDNS.cpp index 40e531e3256e..906de26faf43 100644 --- a/netwerk/test/TestDNS.cpp +++ b/netwerk/test/TestDNS.cpp @@ -37,7 +37,7 @@ public: mIndex, mHost.get(), status, (void*)rec); if (NS_SUCCEEDED(status)) { - nsCAutoString buf; + nsAutoCString buf; rec->GetCanonicalName(buf); printf("%d: canonname=%s\n", mIndex, buf.get()); @@ -98,7 +98,7 @@ int main(int argc, char **argv) for (int j=0; j<2; ++j) { for (int i=1; iGetNativePath(inDir); (void)outDirSpec->GetNativePath(outDir); printf("###########\nTest: from %s to %s, bufSize = %d\n", @@ -351,7 +351,7 @@ Test(CreateFun create, uint32_t count, rv = outDirSpec->Clone(getter_AddRefs(outSpec)); // don't munge the original if (NS_FAILED(rv)) goto done; - nsCAutoString leafName; + nsAutoCString leafName; rv = inSpec->GetNativeLeafName(leafName); if (NS_FAILED(rv)) goto done; diff --git a/netwerk/test/TestIDN.cpp b/netwerk/test/TestIDN.cpp index 0e6da89c04da..a586f5d0458b 100644 --- a/netwerk/test/TestIDN.cpp +++ b/netwerk/test/TestIDN.cpp @@ -23,7 +23,7 @@ int main(int argc, char **argv) { nsCOMPtr converter = do_GetService(NS_IDNSERVICE_CONTRACTID); NS_ASSERTION(converter, "idnSDK not installed!"); if (converter) { - nsCAutoString buf; + nsAutoCString buf; nsresult rv = converter->ConvertUTF8toACE(NS_LITERAL_CSTRING(plain), buf); NS_ASSERTION(NS_SUCCEEDED(rv), "error ConvertUTF8toACE"); NS_ASSERTION(buf.Equals(NS_LITERAL_CSTRING(encoded)), diff --git a/netwerk/test/TestPerf.cpp b/netwerk/test/TestPerf.cpp index bbd499e398bf..b6c4d16f2877 100644 --- a/netwerk/test/TestPerf.cpp +++ b/netwerk/test/TestPerf.cpp @@ -17,7 +17,7 @@ load_sync_1(nsISupports *element, void *data) { nsCOMPtr stream; nsCOMPtr uri( do_QueryInterface(element) ); - nsCAutoString spec; + nsAutoCString spec; nsresult rv; rv = NS_OpenURI(getter_AddRefs(stream), uri, gIOService); @@ -98,7 +98,7 @@ NS_IMETHODIMP MyListener::OnStopRequest(nsIRequest *req, nsISupports *ctx, nsresult status) { if (NS_FAILED(status)) { - nsCAutoString spec; + nsAutoCString spec; req->GetName(spec); fprintf(stderr, "*** failed loading %s [reason=%x]\n", spec.get(), status); } diff --git a/netwerk/test/TestProtocols.cpp b/netwerk/test/TestProtocols.cpp index 38d4af7b52ee..8042c49f6609 100644 --- a/netwerk/test/TestProtocols.cpp +++ b/netwerk/test/TestProtocols.cpp @@ -97,7 +97,7 @@ SetHttpProxy(const char *proxy) NS_WARNING("invalid proxy port; must be an integer"); return NS_ERROR_UNEXPECTED; } - nsCAutoString proxyHost; + nsAutoCString proxyHost; proxyHost = Substring(proxy, colon); nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); @@ -382,7 +382,7 @@ InputTestConsumer::OnStartRequest(nsIRequest *request, nsISupports* context) LOG(("\nStarted loading: %s\n", info ? info->Name() : "UNKNOWN URL")); } - nsCAutoString value; + nsAutoCString value; nsCOMPtr channel = do_QueryInterface(request); if (channel) { @@ -421,7 +421,7 @@ InputTestConsumer::OnStartRequest(nsIRequest *request, nsISupports* context) NS_GET_IID(nsIURI), getter_AddRefs(foo)); if (foo) { - nsCAutoString spec; + nsAutoCString spec; foo->GetSpec(spec); LOG(("\ttest.foo: %s\n", spec.get())); } @@ -464,7 +464,7 @@ InputTestConsumer::OnStartRequest(nsIRequest *request, nsISupports* context) nsCOMPtr resChannel = do_QueryInterface(request); if (resChannel) { LOG(("Resumable entity identification:\n")); - nsCAutoString entityID; + nsAutoCString entityID; nsresult rv = resChannel->GetEntityID(entityID); if (NS_SUCCEEDED(rv)) { LOG(("\t|%s|\n", entityID.get())); @@ -693,7 +693,7 @@ nsresult StartLoadingURL(const char* aUrlString) NS_ERROR("Channel is not resumable!"); return NS_ERROR_UNEXPECTED; } - nsCAutoString id; + nsAutoCString id; if (gEntityID) id = gEntityID; LOG(("* resuming at %llu bytes, with entity id |%s|\n", gStartAt, id.get())); diff --git a/netwerk/test/TestServ.cpp b/netwerk/test/TestServ.cpp index 598095818aba..0adfbeca018b 100644 --- a/netwerk/test/TestServ.cpp +++ b/netwerk/test/TestServ.cpp @@ -39,7 +39,7 @@ MySocketListener::OnSocketAccepted(nsIServerSocket *serv, { LOG(("MySocketListener::OnSocketAccepted [serv=%p trans=%p]\n", serv, trans)); - nsCAutoString host; + nsAutoCString host; int32_t port; trans->GetHost(host); diff --git a/netwerk/test/TestStandardURL.cpp b/netwerk/test/TestStandardURL.cpp index 1633b25e9c66..f7b1143a8168 100644 --- a/netwerk/test/TestStandardURL.cpp +++ b/netwerk/test/TestStandardURL.cpp @@ -31,13 +31,13 @@ static void set_spec_test() static void get_spec_test() { - nsCAutoString spec; + nsAutoCString spec; test_url->GetSpec(spec); } static void resolve_test() { - nsCAutoString spec; + nsAutoCString spec; test_url->Resolve(NS_LITERAL_CSTRING("foo.html?q=45"), spec); } @@ -48,13 +48,13 @@ static void set_scheme_test() static void get_scheme_test() { - nsCAutoString scheme; + nsAutoCString scheme; test_url->GetScheme(scheme); } static void host_test() { - nsCAutoString host; + nsAutoCString host; test_url->GetHost(host); test_url->SetHost(NS_LITERAL_CSTRING("www.yahoo.com")); test_url->SetHost(host); @@ -67,13 +67,13 @@ static void set_path_test() static void get_path_test() { - nsCAutoString path; + nsAutoCString path; test_url->GetPath(path); } static void query_test() { - nsCAutoString query; + nsAutoCString query; test_url->GetQuery(query); test_url->SetQuery(NS_LITERAL_CSTRING("a=b&d=c&what-ever-you-want-to-be-called=45")); test_url->SetQuery(query); @@ -81,7 +81,7 @@ static void query_test() static void ref_test() { - nsCAutoString ref; + nsAutoCString ref; test_url->GetRef(ref); test_url->SetRef(NS_LITERAL_CSTRING("#some-book-mark")); test_url->SetRef(ref); diff --git a/netwerk/test/TestStreamTransport.cpp b/netwerk/test/TestStreamTransport.cpp index 11d596a17ec6..60e44035fb59 100644 --- a/netwerk/test/TestStreamTransport.cpp +++ b/netwerk/test/TestStreamTransport.cpp @@ -292,11 +292,11 @@ main(int argc, char* argv[]) rv = srcFile->Clone(getter_AddRefs(destFile)); if (NS_FAILED(rv)) return rv; - nsCAutoString leafName; + nsAutoCString leafName; rv = destFile->GetNativeLeafName(leafName); if (NS_FAILED(rv)) return rv; - nsCAutoString newName(leafName); + nsAutoCString newName(leafName); newName.Append(NS_LITERAL_CSTRING(".1")); rv = destFile->SetNativeLeafName(newName); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/test/urltest.cpp b/netwerk/test/urltest.cpp index 6fd2b634559d..d495b5d51877 100644 --- a/netwerk/test/urltest.cpp +++ b/netwerk/test/urltest.cpp @@ -72,7 +72,7 @@ nsresult writeoutto(const char* i_pURL, char** o_Result, int32_t urlFactory = UR if (NS_SUCCEEDED(result)) { nsCOMPtr tURL = do_QueryInterface(pURL); - nsCAutoString temp; + nsAutoCString temp; int32_t port; nsresult rv; @@ -223,11 +223,11 @@ nsresult makeAbsTest(const char* i_BaseURI, const char* relativePortion, // get the new spec - nsCAutoString newURL; + nsAutoCString newURL; status = baseURL->Resolve(nsDependentCString(relativePortion), newURL); if (NS_FAILED(status)) return status; - nsCAutoString temp; + nsAutoCString temp; baseURL->GetSpec(temp); printf("Analyzing %s\n", temp.get()); diff --git a/parser/html/nsHtml5MetaScannerCppSupplement.h b/parser/html/nsHtml5MetaScannerCppSupplement.h index 203212b8f929..c6b6376432e4 100644 --- a/parser/html/nsHtml5MetaScannerCppSupplement.h +++ b/parser/html/nsHtml5MetaScannerCppSupplement.h @@ -33,7 +33,7 @@ nsHtml5MetaScanner::tryCharset(nsString* charset) NS_ERROR("Could not get CharsetConverterManager service."); return false; } - nsCAutoString encoding; + nsAutoCString encoding; CopyUTF16toUTF8(*charset, encoding); encoding.Trim(" \t\r\n\f"); if (encoding.LowerCaseEqualsLiteral("utf-16") || @@ -47,7 +47,7 @@ nsHtml5MetaScanner::tryCharset(nsString* charset) } return true; } - nsCAutoString preferred; + nsAutoCString preferred; res = nsCharsetAlias::GetPreferred(encoding, preferred); if (NS_FAILED(res)) { return false; diff --git a/parser/html/nsHtml5Parser.cpp b/parser/html/nsHtml5Parser.cpp index e2075189cf3f..4f6431dd5bd2 100644 --- a/parser/html/nsHtml5Parser.cpp +++ b/parser/html/nsHtml5Parser.cpp @@ -97,7 +97,7 @@ nsHtml5Parser::SetDocumentCharset(const nsACString& aCharset, NS_PRECONDITION(!mExecutor->HasStarted(), "Document charset set too late."); NS_PRECONDITION(mStreamParser, "Setting charset on a script-only parser."); - nsCAutoString trimmed; + nsAutoCString trimmed; trimmed.Assign(aCharset); trimmed.Trim(" \t\r\n\f"); mStreamParser->SetDocumentCharset(trimmed, aCharsetSource); diff --git a/parser/html/nsHtml5SpeculativeLoad.cpp b/parser/html/nsHtml5SpeculativeLoad.cpp index 868fb8413cd7..d8c85aef9a73 100644 --- a/parser/html/nsHtml5SpeculativeLoad.cpp +++ b/parser/html/nsHtml5SpeculativeLoad.cpp @@ -41,7 +41,7 @@ nsHtml5SpeculativeLoad::Perform(nsHtml5TreeOpExecutor* aExecutor) aExecutor->ProcessOfflineManifest(mUrl); break; case eSpeculativeLoadSetDocumentCharset: { - nsCAutoString narrowName; + nsAutoCString narrowName; CopyUTF16toUTF8(mCharset, narrowName); NS_ASSERTION(mTypeOrCharsetSource.Length() == 1, "Unexpected charset source string"); diff --git a/parser/html/nsHtml5StreamParser.cpp b/parser/html/nsHtml5StreamParser.cpp index 2115e3faa3c4..63e204f6f5dc 100644 --- a/parser/html/nsHtml5StreamParser.cpp +++ b/parser/html/nsHtml5StreamParser.cpp @@ -190,7 +190,7 @@ nsHtml5StreamParser::nsHtml5StreamParser(nsHtml5TreeOpExecutor* aExecutor, const nsAdoptingCString& detectorName = Preferences::GetLocalizedCString("intl.charset.detector"); if (!detectorName.IsEmpty()) { - nsCAutoString detectorContractID; + nsAutoCString detectorContractID; detectorContractID.AssignLiteral(NS_CHARSET_DETECTOR_CONTRACTID_BASE); detectorContractID += detectorName; if ((mChardet = do_CreateInstance(detectorContractID.get()))) { @@ -244,7 +244,7 @@ nsHtml5StreamParser::Notify(const char* aCharset, nsDetectionConfident aConf) } else { // We've already committed to a decoder. Request a reload from the // docshell. - nsCAutoString charset(aCharset); + nsAutoCString charset(aCharset); mTreeBuilder->NeedsCharsetSwitchTo(charset, kCharsetFromAutoDetection, 0); @@ -414,7 +414,7 @@ nsHtml5StreamParser::SetEncodingFromExpat(const PRUnichar* aEncoding) { if (aEncoding) { nsDependentString utf16(aEncoding); - nsCAutoString utf8; + nsAutoCString utf8; CopyUTF16toUTF8(utf16, utf8); if (PreferredForInternalEncodingDecl(utf8)) { mCharset.Assign(utf8); @@ -942,7 +942,7 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) nsCOMPtr httpChannel(do_QueryInterface(mRequest, &rv)); if (NS_SUCCEEDED(rv)) { - nsCAutoString method; + nsAutoCString method; httpChannel->GetRequestMethod(method); // XXX does Necko have a way to renavigate POST, etc. without hitting // the network? @@ -1153,7 +1153,7 @@ nsHtml5StreamParser::OnDataAvailable(nsIRequest* aRequest, bool nsHtml5StreamParser::PreferredForInternalEncodingDecl(nsACString& aEncoding) { - nsCAutoString newEncoding(aEncoding); + nsAutoCString newEncoding(aEncoding); newEncoding.Trim(" \t\r\n\f"); if (newEncoding.LowerCaseEqualsLiteral("utf-16") || newEncoding.LowerCaseEqualsLiteral("utf-16be") || @@ -1193,7 +1193,7 @@ nsHtml5StreamParser::PreferredForInternalEncodingDecl(nsACString& aEncoding) // XXX check HTML5 non-IANA aliases here - nsCAutoString preferred; + nsAutoCString preferred; rv = nsCharsetAlias::GetPreferred(newEncoding, preferred); if (NS_FAILED(rv)) { @@ -1230,7 +1230,7 @@ nsHtml5StreamParser::internalEncodingDeclaration(nsString* aEncoding) return false; } - nsCAutoString newEncoding; + nsAutoCString newEncoding; CopyUTF16toUTF8(*aEncoding, newEncoding); if (!PreferredForInternalEncodingDecl(newEncoding)) { diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp index b433031abf60..db8df2349c38 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp @@ -1036,7 +1036,7 @@ nsHtml5TreeOpExecutor::ConvertIfNotPreloadedYet(const nsAString& aURL) NS_WARNING("Failed to create a URI"); return nullptr; } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); if (mPreloadedURLs.Contains(spec)) { return nullptr; diff --git a/parser/html/nsHtml5TreeOperation.cpp b/parser/html/nsHtml5TreeOperation.cpp index af476ea6b541..e005cb995e23 100644 --- a/parser/html/nsHtml5TreeOperation.cpp +++ b/parser/html/nsHtml5TreeOperation.cpp @@ -719,7 +719,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder, return NS_OK; } - nsCAutoString viewSourceUrl; + nsAutoCString viewSourceUrl; // URLs that return data (e.g. "http:" URLs) should be prefixed with // "view-source:". URLs that don't return data should just be returned @@ -733,7 +733,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder, viewSourceUrl.AssignLiteral("view-source:"); } - nsCAutoString spec; + nsAutoCString spec; uri->GetSpec(spec); viewSourceUrl.Append(spec); diff --git a/parser/html/nsParserUtils.cpp b/parser/html/nsParserUtils.cpp index 409896d7c1bd..2bb2cef22ff7 100644 --- a/parser/html/nsParserUtils.cpp +++ b/parser/html/nsParserUtils.cpp @@ -161,7 +161,7 @@ nsParserUtils::ParseFragment(const nsAString& aFragment, // Wrap things in a div or body for parsing, but it won't show up in // the fragment. nsAutoTArray tagStack; - nsCAutoString base, spec; + nsAutoCString base, spec; if (aIsXML) { // XHTML if (aBaseURI) { diff --git a/parser/htmlparser/src/nsExpatDriver.cpp b/parser/htmlparser/src/nsExpatDriver.cpp index 4b5521bda757..441637f45311 100644 --- a/parser/htmlparser/src/nsExpatDriver.cpp +++ b/parser/htmlparser/src/nsExpatDriver.cpp @@ -293,7 +293,7 @@ GetLocalDTDURI(const nsCatalogData* aCatalogData, nsIURI* aDTD, { NS_ASSERTION(aDTD, "Null parameter."); - nsCAutoString fileName; + nsAutoCString fileName; if (aCatalogData) { // remap the DTD to a known local DTD fileName.Assign(aCatalogData->mLocalDTD); @@ -315,7 +315,7 @@ GetLocalDTDURI(const nsCatalogData* aCatalogData, nsIURI* aDTD, } } - nsCAutoString respath("resource://gre/res/dtd/"); + nsAutoCString respath("resource://gre/res/dtd/"); respath += fileName; NS_NewURI(aResult, respath); } @@ -780,7 +780,7 @@ nsExpatDriver::OpenInputStreamFromExternalDTD(const PRUnichar* aFPIStr, return NS_ERROR_CONTENT_BLOCKED; } - nsCAutoString absURL; + nsAutoCString absURL; uri->GetSpec(absURL); CopyUTF8toUTF16(absURL, aAbsURL); diff --git a/parser/htmlparser/src/nsHTMLEntities.cpp b/parser/htmlparser/src/nsHTMLEntities.cpp index 08f09cf8c5da..005074b10de2 100644 --- a/parser/htmlparser/src/nsHTMLEntities.cpp +++ b/parser/htmlparser/src/nsHTMLEntities.cpp @@ -165,7 +165,7 @@ nsHTMLEntities::EntityToUnicode(const nsCString& aEntity) //if we see it, strip if off for this test... if(';'==aEntity.Last()) { - nsCAutoString temp(aEntity); + nsAutoCString temp(aEntity); temp.Truncate(aEntity.Length()-1); return EntityToUnicode(temp); } @@ -183,7 +183,7 @@ nsHTMLEntities::EntityToUnicode(const nsCString& aEntity) int32_t nsHTMLEntities::EntityToUnicode(const nsAString& aEntity) { - nsCAutoString theEntity; theEntity.AssignWithConversion(aEntity); + nsAutoCString theEntity; theEntity.AssignWithConversion(aEntity); if(';'==theEntity.Last()) { theEntity.Truncate(theEntity.Length()-1); } @@ -228,9 +228,9 @@ public: } // Make sure we don't find things that aren't there - value = nsHTMLEntities::EntityToUnicode(nsCAutoString("@")); + value = nsHTMLEntities::EntityToUnicode(nsAutoCString("@")); NS_ASSERTION(value == -1, "found @"); - value = nsHTMLEntities::EntityToUnicode(nsCAutoString("zzzzz")); + value = nsHTMLEntities::EntityToUnicode(nsAutoCString("zzzzz")); NS_ASSERTION(value == -1, "found zzzzz"); nsHTMLEntities::ReleaseTable(); } diff --git a/parser/htmlparser/src/nsParser.cpp b/parser/htmlparser/src/nsParser.cpp index bcaf672ae746..dba141fc77b1 100644 --- a/parser/htmlparser/src/nsParser.cpp +++ b/parser/htmlparser/src/nsParser.cpp @@ -682,7 +682,7 @@ VerifyPublicIDs() } } for (i = 0; i < ELEMENTS_OF(kPublicIDs); ++i) { - nsCAutoString lcPubID(kPublicIDs[i].name); + nsAutoCString lcPubID(kPublicIDs[i].name); ToLowerCase(lcPubID); if (nsCRT::strcmp(kPublicIDs[i].name, lcPubID.get()) != 0) { NS_NOTREACHED("doctype not lower case"); @@ -726,7 +726,7 @@ DetermineHTMLParseMode(const nsString& aBuffer, } else { // We have to check our list of public IDs to see what to do. // Yes, we want UCS2 to ASCII lossy conversion. - nsCAutoString publicID; + nsAutoCString publicID; publicID.AssignWithConversion(publicIDUCS2); // See comment above definition of kPublicIDs about case @@ -1243,7 +1243,7 @@ nsParser::Parse(nsIURI* aURL, mObserver = aListener; if (aURL) { - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURL->GetSpec(spec); if (rv != NS_OK) { return rv; @@ -1659,7 +1659,7 @@ nsParser::OnStartRequest(nsIRequest *request, nsISupports* aContext) mDTD = nullptr; nsresult rv; - nsCAutoString contentType; + nsAutoCString contentType; nsCOMPtr channel = do_QueryInterface(request); if (channel) { rv = channel->GetContentType(contentType); @@ -2012,8 +2012,8 @@ ParserWriteFunc(nsIInputStream* in, if (pws->mNeedCharsetCheck) { int32_t guessSource; - nsCAutoString guess; - nsCAutoString preferred; + nsAutoCString guess; + nsAutoCString preferred; pws->mNeedCharsetCheck = false; if (pws->mParser->DetectMetaTag(buf, theNumRead, guess, guessSource) || diff --git a/parser/xml/src/nsSAXXMLReader.cpp b/parser/xml/src/nsSAXXMLReader.cpp index 3959c1b004ff..45c85da152ab 100644 --- a/parser/xml/src/nsSAXXMLReader.cpp +++ b/parser/xml/src/nsSAXXMLReader.cpp @@ -597,7 +597,7 @@ nsSAXXMLReader::InitParser(nsIRequestObserver *aObserver, nsIChannel *aChannel) parser->SetContentSink(this); int32_t charsetSource = kCharsetFromDocTypeDefault; - nsCAutoString charset(NS_LITERAL_CSTRING("UTF-8")); + nsAutoCString charset(NS_LITERAL_CSTRING("UTF-8")); TryChannelCharset(aChannel, charsetSource, charset); parser->SetDocumentCharset(charset, charsetSource); @@ -619,10 +619,10 @@ nsSAXXMLReader::TryChannelCharset(nsIChannel *aChannel, return true; if (aChannel) { - nsCAutoString charsetVal; + nsAutoCString charsetVal; nsresult rv = aChannel->GetContentCharset(charsetVal); if (NS_SUCCEEDED(rv)) { - nsCAutoString preferred; + nsAutoCString preferred; if (NS_FAILED(nsCharsetAlias::GetPreferred(charsetVal, preferred))) return false; diff --git a/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp b/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp index 52661101fb91..a836c906624d 100644 --- a/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp +++ b/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp @@ -269,7 +269,7 @@ nsProfileDirServiceProvider::InitProfileDir(nsIFile *profileDir) if (!exists) { nsCOMPtr profileDefaultsDir; nsCOMPtr profileDirParent; - nsCAutoString profileDirName; + nsAutoCString profileDirName; (void)profileDir->GetParent(getter_AddRefs(profileDirParent)); if (!profileDirParent) @@ -371,7 +371,7 @@ nsProfileDirServiceProvider::EnsureProfileFileExists(nsIFile *aFile, nsIFile *de return rv; } - nsCAutoString leafName; + nsAutoCString leafName; rv = aFile->GetNativeLeafName(leafName); if (NS_FAILED(rv)) return rv; diff --git a/profile/dirserviceprovider/src/nsProfileLock.cpp b/profile/dirserviceprovider/src/nsProfileLock.cpp index b5db8a1ad01e..879a0beb5ef6 100644 --- a/profile/dirserviceprovider/src/nsProfileLock.cpp +++ b/profile/dirserviceprovider/src/nsProfileLock.cpp @@ -199,7 +199,7 @@ nsresult nsProfileLock::LockWithFcntl(nsIFile *aLockFile) { nsresult rv = NS_OK; - nsCAutoString lockFilePath; + nsAutoCString lockFilePath; rv = aLockFile->GetNativePath(lockFilePath); if (NS_FAILED(rv)) { NS_ERROR("Could not get native path"); @@ -308,7 +308,7 @@ static bool IsSymlinkStaleLock(struct in_addr* aAddr, const char* aFileName, nsresult nsProfileLock::LockWithSymlink(nsIFile *aLockFile, bool aHaveFcntlLock) { nsresult rv; - nsCAutoString lockFilePath; + nsAutoCString lockFilePath; rv = aLockFile->GetNativePath(lockFilePath); if (NS_FAILED(rv)) { NS_ERROR("Could not get native path"); @@ -586,7 +586,7 @@ nsresult nsProfileLock::Lock(nsIFile* aProfileDir, return NS_ERROR_FILE_ACCESS_DENIED; } #elif defined(XP_OS2) - nsCAutoString filePath; + nsAutoCString filePath; rv = lockFile->GetNativePath(filePath); if (NS_FAILED(rv)) return rv; @@ -609,7 +609,7 @@ nsresult nsProfileLock::Lock(nsIFile* aProfileDir, return NS_ERROR_FILE_ACCESS_DENIED; } #elif defined(VMS) - nsCAutoString filePath; + nsAutoCString filePath; rv = lockFile->GetNativePath(filePath); if (NS_FAILED(rv)) return rv; diff --git a/profile/dirserviceprovider/src/nsProfileStringTypes.h b/profile/dirserviceprovider/src/nsProfileStringTypes.h index d3bad31e701f..fddea519b2d7 100644 --- a/profile/dirserviceprovider/src/nsProfileStringTypes.h +++ b/profile/dirserviceprovider/src/nsProfileStringTypes.h @@ -22,7 +22,7 @@ #include "nsEmbedString.h" typedef nsCString nsPromiseFlatCString; -typedef nsCString nsCAutoString; +typedef nsCString nsAutoCString; #define PromiseFlatCString nsCString diff --git a/rdf/base/src/nsRDFContainerUtils.cpp b/rdf/base/src/nsRDFContainerUtils.cpp index 73fe32f737ea..31f4fff040e8 100644 --- a/rdf/base/src/nsRDFContainerUtils.cpp +++ b/rdf/base/src/nsRDFContainerUtils.cpp @@ -124,7 +124,7 @@ RDFContainerUtilsImpl::IndexToOrdinalResource(int32_t aIndex, nsIRDFResource **a if (aIndex <= 0) return NS_ERROR_ILLEGAL_VALUE; - nsCAutoString uri(kRDFNameSpaceURI); + nsAutoCString uri(kRDFNameSpaceURI); uri.Append('_'); uri.AppendInt(aIndex); diff --git a/rdf/base/src/nsRDFContentSink.cpp b/rdf/base/src/nsRDFContentSink.cpp index 97638d909831..97e7f0609e9b 100644 --- a/rdf/base/src/nsRDFContentSink.cpp +++ b/rdf/base/src/nsRDFContentSink.cpp @@ -833,7 +833,7 @@ RDFContentSinkImpl::GetIdAboutAttribute(const PRUnichar** aAttributes, nsAutoString relURI(aAttributes[1]); if (rdf_RequiresAbsoluteURI(relURI)) { - nsCAutoString uri; + nsAutoCString uri; rv = mDocumentURL->Resolve(NS_ConvertUTF16toUTF8(aAttributes[1]), uri); if (NS_FAILED(rv)) return rv; @@ -854,8 +854,8 @@ RDFContentSinkImpl::GetIdAboutAttribute(const PRUnichar** aAttributes, // Construct an in-line resource whose URI is the // document's URI plus the XML name specified in the ID // attribute. - nsCAutoString name; - nsCAutoString ref('#'); + nsAutoCString name; + nsAutoCString ref('#'); AppendUTF16toUTF8(aAttributes[1], ref); rv = mDocumentURL->Resolve(ref, name); @@ -925,7 +925,7 @@ RDFContentSinkImpl::GetResourceAttribute(const PRUnichar** aAttributes, nsAutoString relURI(aAttributes[1]); if (rdf_RequiresAbsoluteURI(relURI)) { nsresult rv; - nsCAutoString uri; + nsAutoCString uri; rv = mDocumentURL->Resolve(NS_ConvertUTF16toUTF8(aAttributes[1]), uri); if (NS_FAILED(rv)) return rv; diff --git a/rdf/base/src/nsRDFService.cpp b/rdf/base/src/nsRDFService.cpp index fbc07cc82f1b..eaa9b9da7a5c 100644 --- a/rdf/base/src/nsRDFService.cpp +++ b/rdf/base/src/nsRDFService.cpp @@ -939,7 +939,7 @@ RDFServiceImpl::GetResource(const nsACString& aURI, nsIRDFResource** aResource) // Try to find a factory using the component manager. nsACString::const_iterator begin; aURI.BeginReading(begin); - nsCAutoString contractID; + nsAutoCString contractID; contractID = NS_LITERAL_CSTRING(NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX) + Substring(begin, p); @@ -1017,7 +1017,7 @@ static int32_t kShift = 6; } nsresult rv; - nsCAutoString s; + nsAutoCString s; do { // Ugh, this is a really sloppy way to do this; I copied the @@ -1371,7 +1371,7 @@ RDFServiceImpl::GetDataSource(const char* aURI, bool aBlock, nsIRDFDataSource** // Attempt to canonify the URI before we look for it in the // cache. We won't bother doing this on `rdf:' URIs to avoid // useless (and expensive) protocol handler lookups. - nsCAutoString spec(aURI); + nsAutoCString spec(aURI); if (!StringBeginsWith(spec, NS_LITERAL_CSTRING("rdf:"))) { nsCOMPtr uri; @@ -1397,7 +1397,7 @@ RDFServiceImpl::GetDataSource(const char* aURI, bool aBlock, nsIRDFDataSource** nsCOMPtr ds; if (StringBeginsWith(spec, NS_LITERAL_CSTRING("rdf:"))) { // It's a built-in data source. Convert it to a contract ID. - nsCAutoString contractID( + nsAutoCString contractID( NS_LITERAL_CSTRING(NS_RDF_DATASOURCE_CONTRACTID_PREFIX) + Substring(spec, 4, spec.Length() - 4)); diff --git a/rdf/base/src/nsRDFService.h b/rdf/base/src/nsRDFService.h index d0edaa13d265..ce90705726f8 100644 --- a/rdf/base/src/nsRDFService.h +++ b/rdf/base/src/nsRDFService.h @@ -44,7 +44,7 @@ protected: PLDHashTable mDates; PLDHashTable mBlobs; - nsCAutoString mLastURIPrefix; + nsAutoCString mLastURIPrefix; nsCOMPtr mLastFactory; nsCOMPtr mDefaultResourceFactory; diff --git a/rdf/base/src/nsRDFXMLDataSource.cpp b/rdf/base/src/nsRDFXMLDataSource.cpp index 6f0b0c78159c..7a2931bd45bf 100644 --- a/rdf/base/src/nsRDFXMLDataSource.cpp +++ b/rdf/base/src/nsRDFXMLDataSource.cpp @@ -606,7 +606,7 @@ RDFXMLDataSourceImpl::GetURI(char* *aURI) return NS_OK; } - nsCAutoString spec; + nsAutoCString spec; mURL->GetSpec(spec); *aURI = ToNewCString(spec); if (!*aURI) { @@ -826,7 +826,7 @@ RDFXMLDataSourceImpl::Flush(void) return NS_ERROR_NOT_INITIALIZED; #ifdef PR_LOGGING - nsCAutoString spec; + nsAutoCString spec; mURL->GetSpec(spec); PR_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] flush(%s)", this, spec.get())); @@ -906,7 +906,7 @@ NS_IMETHODIMP RDFXMLDataSourceImpl::Refresh(bool aBlocking) { #ifdef PR_LOGGING - nsCAutoString spec; + nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } @@ -961,7 +961,7 @@ NS_IMETHODIMP RDFXMLDataSourceImpl::BeginLoad(void) { #ifdef PR_LOGGING - nsCAutoString spec; + nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } @@ -987,7 +987,7 @@ NS_IMETHODIMP RDFXMLDataSourceImpl::Interrupt(void) { #ifdef PR_LOGGING - nsCAutoString spec; + nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } @@ -1012,7 +1012,7 @@ NS_IMETHODIMP RDFXMLDataSourceImpl::Resume(void) { #ifdef PR_LOGGING - nsCAutoString spec; + nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } @@ -1037,7 +1037,7 @@ NS_IMETHODIMP RDFXMLDataSourceImpl::EndLoad(void) { #ifdef PR_LOGGING - nsCAutoString spec; + nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } diff --git a/rdf/base/src/nsRDFXMLSerializer.cpp b/rdf/base/src/nsRDFXMLSerializer.cpp index 6337f882cb3e..d528889d9953 100644 --- a/rdf/base/src/nsRDFXMLSerializer.cpp +++ b/rdf/base/src/nsRDFXMLSerializer.cpp @@ -212,7 +212,7 @@ nsRDFXMLSerializer::EnsureNewPrefix() nsresult nsRDFXMLSerializer::RegisterQName(nsIRDFResource* aResource) { - nsCAutoString uri, qname; + nsAutoCString uri, qname; aResource->GetValueUTF8(uri); nsNameSpaceMap::const_iterator iter = mNameSpaces.GetNameSpaceOf(uri); @@ -409,7 +409,7 @@ nsRDFXMLSerializer::SerializeChildAssertion(nsIOutputStream* aStream, nsCOMPtr date; if ((resource = do_QueryInterface(aValue)) != nullptr) { - nsCAutoString uri; + nsAutoCString uri; resource->GetValueUTF8(uri); rdf_MakeRelativeRef(mBaseURLSpec, uri); @@ -442,7 +442,7 @@ nsRDFXMLSerializer::SerializeChildAssertion(nsIOutputStream* aStream, int32_t value; number->GetValue(&value); - nsCAutoString n; + nsAutoCString n; n.AppendInt(value); rv = rdf_BlockingWrite(aStream, kRDFParseTypeInteger, @@ -455,7 +455,7 @@ nsRDFXMLSerializer::SerializeChildAssertion(nsIOutputStream* aStream, PRTime value; date->GetValue(&value); - nsCAutoString s; + nsAutoCString s; rdf_FormatDate(value, s); rv = rdf_BlockingWrite(aStream, kRDFParseTypeDate, @@ -575,7 +575,7 @@ nsRDFXMLSerializer::SerializeDescription(nsIOutputStream* aStream, } } - nsCAutoString uri; + nsAutoCString uri; rv = aResource->GetValueUTF8(uri); if (NS_FAILED(rv)) return rv; @@ -743,7 +743,7 @@ static const char kRDFLIOpen[] = " GetValueUTF8(uri); rdf_MakeRelativeRef(mBaseURLSpec, uri); @@ -779,7 +779,7 @@ static const char kRDFLIOpenGT[] = ">"; int32_t value; number->GetValue(&value); - nsCAutoString n; + nsAutoCString n; n.AppendInt(value); rv = rdf_BlockingWrite(aStream, kRDFParseTypeInteger, @@ -792,7 +792,7 @@ static const char kRDFLIOpenGT[] = ">"; PRTime value; date->GetValue(&value); - nsCAutoString s; + nsAutoCString s; rdf_FormatDate(value, s); rv = rdf_BlockingWrite(aStream, kRDFParseTypeDate, @@ -826,7 +826,7 @@ nsRDFXMLSerializer::SerializeContainer(nsIOutputStream* aStream, nsIRDFResource* aContainer) { nsresult rv; - nsCAutoString tag; + nsAutoCString tag; // Decide if it's a sequence, bag, or alternation, and print the // appropriate tag-open sequence @@ -856,7 +856,7 @@ nsRDFXMLSerializer::SerializeContainer(nsIOutputStream* aStream, // this because we never really know who else might be referring // to it... - nsCAutoString uri; + nsAutoCString uri; if (NS_SUCCEEDED(aContainer->GetValueUTF8(uri))) { rdf_MakeRelativeRef(mBaseURLSpec, uri); @@ -983,7 +983,7 @@ static const char kXMLVersion[] = "\n"; if (entry->mPrefix) { rv = rdf_BlockingWrite(aStream, NS_LITERAL_CSTRING(":")); if (NS_FAILED(rv)) return rv; - nsCAutoString prefix; + nsAutoCString prefix; entry->mPrefix->ToUTF8String(prefix); rv = rdf_BlockingWrite(aStream, prefix); if (NS_FAILED(rv)) return rv; @@ -991,7 +991,7 @@ static const char kXMLVersion[] = "\n"; rv = rdf_BlockingWrite(aStream, NS_LITERAL_CSTRING("=\"")); if (NS_FAILED(rv)) return rv; - nsCAutoString uri(entry->mURI); + nsAutoCString uri(entry->mURI); rdf_EscapeAttributeValue(uri); rv = rdf_BlockingWrite(aStream, uri); if (NS_FAILED(rv)) return rv; diff --git a/rdf/base/src/rdfTriplesSerializer.cpp b/rdf/base/src/rdfTriplesSerializer.cpp index 49732e07c4f7..ea8d304b86c2 100644 --- a/rdf/base/src/rdfTriplesSerializer.cpp +++ b/rdf/base/src/rdfTriplesSerializer.cpp @@ -76,7 +76,7 @@ TriplesVisitor::Visit(nsIRDFNode *aSubject, nsIRDFResource *aPredicate, } else if ((lit = do_QueryInterface(aObject)) != nullptr) { const PRUnichar *value; lit->GetValueConst(&value); - nsCAutoString object; + nsAutoCString object; object.AppendLiteral("\""); AppendUTF16toUTF8(value, object); object.AppendLiteral("\" "); diff --git a/rdf/datasource/src/nsFileSystemDataSource.cpp b/rdf/datasource/src/nsFileSystemDataSource.cpp index e9b4ed2c400a..73d0ca4be475 100644 --- a/rdf/datasource/src/nsFileSystemDataSource.cpp +++ b/rdf/datasource/src/nsFileSystemDataSource.cpp @@ -1056,7 +1056,7 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, bool allowHidden, if (leafStr.IsEmpty()) continue; - nsCAutoString fullURI; + nsAutoCString fullURI; fullURI.Assign(parentURI); if (fullURI.Last() != '/') { @@ -1069,7 +1069,7 @@ FileSystemDataSource::GetFolderList(nsIRDFResource *source, bool allowHidden, if (!escLeafStr) continue; - nsCAutoString leaf(escLeafStr); + nsAutoCString leaf(escLeafStr); NS_Free(escLeafStr); escLeafStr = nullptr; @@ -1326,7 +1326,7 @@ FileSystemDataSource::getIEFavoriteURL(nsIRDFResource *source, nsString aFileURL nsCOMPtr linereader = do_QueryInterface(strm, &rv); nsAutoString line; - nsCAutoString cLine; + nsAutoCString cLine; while(NS_SUCCEEDED(rv)) { bool isEOF; diff --git a/rdf/datasource/src/nsLocalStore.cpp b/rdf/datasource/src/nsLocalStore.cpp index 3bbd7e01ddad..d6cddc4c6f8e 100644 --- a/rdf/datasource/src/nsLocalStore.cpp +++ b/rdf/datasource/src/nsLocalStore.cpp @@ -394,7 +394,7 @@ LocalStoreImpl::LoadData() rv = NS_NewFileURI(getter_AddRefs(aURI), aFile); if (NS_FAILED(rv)) return rv; - nsCAutoString spec; + nsAutoCString spec; rv = aURI->GetSpec(spec); if (NS_FAILED(rv)) return rv; diff --git a/rdf/tests/dsds/nsRDFDataSourceDS.cpp b/rdf/tests/dsds/nsRDFDataSourceDS.cpp index aa96f6ce8a63..781463ac647b 100644 --- a/rdf/tests/dsds/nsRDFDataSourceDS.cpp +++ b/rdf/tests/dsds/nsRDFDataSourceDS.cpp @@ -124,7 +124,7 @@ nsRDFDataSourceDataSource::Init(const char *uri) // cut off "rdf:datasource?" NS_NAMED_LITERAL_CSTRING(prefix, "rdf:datasource"); - nsCAutoString mInnerURI; + nsAutoCString mInnerURI; mInnerURI = Substring(mURI, prefix.Length() + 1); // bail if datasorce is empty or we're trying to inspect ourself if (mInnerURI.IsEmpty() || mInnerURI == prefix) { diff --git a/rdf/util/src/nsRDFResource.cpp b/rdf/util/src/nsRDFResource.cpp index 2d3e7b4d08a5..13c173284788 100644 --- a/rdf/util/src/nsRDFResource.cpp +++ b/rdf/util/src/nsRDFResource.cpp @@ -153,7 +153,7 @@ nsRDFResource::GetDelegate(const char* aKey, REFNSIID aIID, void** aResult) } // Construct a ContractID of the form "@mozilla.org/rdf/delegate/[key]/[scheme];1 - nsCAutoString contractID(NS_RDF_DELEGATEFACTORY_CONTRACTID_PREFIX); + nsAutoCString contractID(NS_RDF_DELEGATEFACTORY_CONTRACTID_PREFIX); contractID.Append(aKey); contractID.Append("&scheme="); diff --git a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp index d44db1ae1b82..5cb0b01fc2b4 100644 --- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp +++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp @@ -1666,7 +1666,7 @@ nsSecureBrowserUIImpl::OnSecurityChange(nsIWebProgress *aWebProgress, channel->GetURI(getter_AddRefs(aURI)); if (aURI) { - nsCAutoString temp; + nsAutoCString temp; aURI->GetSpec(temp); PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnSecurityChange: (%x) %s\n", this, diff --git a/security/manager/boot/src/nsSecurityWarningDialogs.cpp b/security/manager/boot/src/nsSecurityWarningDialogs.cpp index 1d723b7cc3aa..3df006b36b1c 100644 --- a/security/manager/boot/src/nsSecurityWarningDialogs.cpp +++ b/security/manager/boot/src/nsSecurityWarningDialogs.cpp @@ -162,7 +162,7 @@ nsAsyncAlert::Run() // - The default value of the "show every time" checkbox is unchecked // - If the user checks the checkbox, we clear the show-once pref. - nsCAutoString showOncePref(mPrefName); + nsAutoCString showOncePref(mPrefName); showOncePref += ".show_once"; bool showOnce = false; @@ -278,7 +278,7 @@ nsSecurityWarningDialogs::ConfirmDialog(nsIInterfaceRequestor *ctx, const char * MOZ_ASSERT(NS_IsMainThread()); mozilla::Telemetry::Accumulate(mozilla::Telemetry::SECURITY_UI, aBucket); // See AlertDialog() for a description of how showOnce works. - nsCAutoString showOncePref(prefName); + nsAutoCString showOncePref(prefName); showOncePref += ".show_once"; bool showOnce = false; diff --git a/security/manager/boot/src/nsStrictTransportSecurityService.cpp b/security/manager/boot/src/nsStrictTransportSecurityService.cpp index 03f8ecc57bc8..9bbf1e42188a 100644 --- a/security/manager/boot/src/nsStrictTransportSecurityService.cpp +++ b/security/manager/boot/src/nsStrictTransportSecurityService.cpp @@ -128,7 +128,7 @@ nsStrictTransportSecurityService::GetPrincipalForURI(nsIURI* aURI, // We have to normalize the scheme of the URIs we're using, so just use https. // HSTS information is shared across all ports for a given host. - nsCAutoString host; + nsAutoCString host; rv = GetHost(aURI, host); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr uri; @@ -174,7 +174,7 @@ nsStrictTransportSecurityService::SetStsState(nsIURI* aSourceURI, expiretime); NS_ENSURE_SUCCESS(rv, rv); } else { // !includeSubdomains - nsCAutoString hostname; + nsAutoCString hostname; rv = GetHost(aSourceURI, hostname); NS_ENSURE_SUCCESS(rv, rv); @@ -192,7 +192,7 @@ nsStrictTransportSecurityService::RemoveStsState(nsIURI* aURI) // manager is used and it's not threadsafe. NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_UNEXPECTED); - nsCAutoString hostname; + nsAutoCString hostname; nsresult rv = GetHost(aURI, hostname); NS_ENSURE_SUCCESS(rv, rv); @@ -367,7 +367,7 @@ nsStrictTransportSecurityService::IsStsURI(nsIURI* aURI, bool* aResult) // set default in case if we can't find any STS information *aResult = false; - nsCAutoString host; + nsAutoCString host; nsresult rv = GetHost(aURI, host); NS_ENSURE_SUCCESS(rv, rv); @@ -579,7 +579,7 @@ nsStrictTransportSecurityService::AddPermission(nsIURI *aURI, aExpireType, aExpireTime); } - nsCAutoString host; + nsAutoCString host; nsresult rv = GetHost(aURI, host); NS_ENSURE_SUCCESS(rv, rv); STSLOG(("AddPermission for entry for %s", host.get())); diff --git a/security/manager/ssl/src/SSLServerCertVerification.cpp b/security/manager/ssl/src/SSLServerCertVerification.cpp index 230b962e2f63..df241ad13927 100644 --- a/security/manager/ssl/src/SSLServerCertVerification.cpp +++ b/security/manager/ssl/src/SSLServerCertVerification.cpp @@ -795,7 +795,7 @@ BlockServerCertChangeForSpdy(nsNSSSocketInfo *infoObject, } // Filter out sockets that did not neogtiate SPDY via NPN - nsCAutoString negotiatedNPN; + nsAutoCString negotiatedNPN; nsresult rv = infoObject->GetNegotiatedNPN(negotiatedNPN); NS_ASSERTION(NS_SUCCEEDED(rv), "GetNegotiatedNPN() failed during renegotiation"); diff --git a/security/manager/ssl/src/TransportSecurityInfo.cpp b/security/manager/ssl/src/TransportSecurityInfo.cpp index 1cd8bebb8758..248573dbb560 100644 --- a/security/manager/ssl/src/TransportSecurityInfo.cpp +++ b/security/manager/ssl/src/TransportSecurityInfo.cpp @@ -1098,7 +1098,7 @@ RememberCertErrorsTable::RememberCertErrorsTable() } static nsresult -GetHostPortKey(TransportSecurityInfo* infoObject, nsCAutoString &result) +GetHostPortKey(TransportSecurityInfo* infoObject, nsAutoCString &result) { nsresult rv; @@ -1126,7 +1126,7 @@ RememberCertErrorsTable::RememberCertHasError(TransportSecurityInfo* infoObject, { nsresult rv; - nsCAutoString hostPortKey; + nsAutoCString hostPortKey; rv = GetHostPortKey(infoObject, hostPortKey); if (NS_FAILED(rv)) return; @@ -1164,7 +1164,7 @@ RememberCertErrorsTable::LookupCertErrorBits(TransportSecurityInfo* infoObject, nsresult rv; - nsCAutoString hostPortKey; + nsAutoCString hostPortKey; rv = GetHostPortKey(infoObject, hostPortKey); if (NS_FAILED(rv)) return; diff --git a/security/manager/ssl/src/nsCRLInfo.cpp b/security/manager/ssl/src/nsCRLInfo.cpp index 0c1cd0e8e495..81594496303f 100644 --- a/security/manager/ssl/src/nsCRLInfo.cpp +++ b/security/manager/ssl/src/nsCRLInfo.cpp @@ -41,7 +41,7 @@ nsCRLInfo::nsCRLInfo(CERTSignedCrl *signedCrl) nsAutoString nameInDb; nsAutoString nextUpdateLocale; nsAutoString lastUpdateLocale; - nsCAutoString lastFetchURL; + nsAutoCString lastFetchURL; PRTime lastUpdate = 0; PRTime nextUpdate = 0; SECStatus sec_rv; diff --git a/security/manager/ssl/src/nsCRLManager.cpp b/security/manager/ssl/src/nsCRLManager.cpp index f1f1312cfb21..7c09dd814cbd 100644 --- a/security/manager/ssl/src/nsCRLManager.cpp +++ b/security/manager/ssl/src/nsCRLManager.cpp @@ -62,7 +62,7 @@ nsCRLManager::ImportCrl (uint8_t *aData, uint32_t aLength, nsIURI * aURI, uint32 CERTSignedData sd; SECStatus sec_rv; CERTSignedCrl *crl; - nsCAutoString url; + nsAutoCString url; nsCOMPtr crlData; bool importSuccessful; int32_t errorCode; @@ -191,20 +191,20 @@ done: return rv; } - nsCAutoString updateErrCntPrefStr(CRL_AUTOUPDATE_ERRCNT_PREF); + nsAutoCString updateErrCntPrefStr(CRL_AUTOUPDATE_ERRCNT_PREF); LossyAppendUTF16toASCII(crlKey, updateErrCntPrefStr); if(importSuccessful){ PRUnichar *updateTime; - nsCAutoString updateTimeStr; + nsAutoCString updateTimeStr; nsCString updateURL; int32_t timingTypePref; double dayCnt; char *dayCntStr; - nsCAutoString updateTypePrefStr(CRL_AUTOUPDATE_TIMIINGTYPE_PREF); - nsCAutoString updateTimePrefStr(CRL_AUTOUPDATE_TIME_PREF); - nsCAutoString updateUrlPrefStr(CRL_AUTOUPDATE_URL_PREF); - nsCAutoString updateDayCntPrefStr(CRL_AUTOUPDATE_DAYCNT_PREF); - nsCAutoString updateFreqCntPrefStr(CRL_AUTOUPDATE_FREQCNT_PREF); + nsAutoCString updateTypePrefStr(CRL_AUTOUPDATE_TIMIINGTYPE_PREF); + nsAutoCString updateTimePrefStr(CRL_AUTOUPDATE_TIME_PREF); + nsAutoCString updateUrlPrefStr(CRL_AUTOUPDATE_URL_PREF); + nsAutoCString updateDayCntPrefStr(CRL_AUTOUPDATE_DAYCNT_PREF); + nsAutoCString updateFreqCntPrefStr(CRL_AUTOUPDATE_FREQCNT_PREF); LossyAppendUTF16toASCII(crlKey, updateTypePrefStr); LossyAppendUTF16toASCII(crlKey, updateTimePrefStr); LossyAppendUTF16toASCII(crlKey, updateUrlPrefStr); @@ -251,8 +251,8 @@ done: } else{ int32_t errCnt; - nsCAutoString errMsg; - nsCAutoString updateErrDetailPrefStr(CRL_AUTOUPDATE_ERRDETAIL_PREF); + nsAutoCString errMsg; + nsAutoCString updateErrDetailPrefStr(CRL_AUTOUPDATE_ERRDETAIL_PREF); LossyAppendUTF16toASCII(crlKey, updateErrDetailPrefStr); errMsg.AssignWithConversion(errorMessage.get()); rv = pref->GetIntPref(updateErrCntPrefStr.get(),&errCnt); diff --git a/security/manager/ssl/src/nsCertOverrideService.cpp b/security/manager/ssl/src/nsCertOverrideService.cpp index 33dfe2fede0f..23a6b3559dd3 100644 --- a/security/manager/ssl/src/nsCertOverrideService.cpp +++ b/security/manager/ssl/src/nsCertOverrideService.cpp @@ -225,7 +225,7 @@ nsCertOverrideService::Read() return rv; } - nsCAutoString buffer; + nsAutoCString buffer; bool isMore = true; int32_t hostIndex = 0, algoIndex, fingerprintIndex, overrideBitsIndex, dbKeyIndex; @@ -263,7 +263,7 @@ nsCertOverrideService::Read() const nsASingleFragmentCString &bits_string = Substring(buffer, overrideBitsIndex, dbKeyIndex - overrideBitsIndex - 1); const nsASingleFragmentCString &db_key = Substring(buffer, dbKeyIndex, buffer.Length() - dbKeyIndex); - nsCAutoString host(tmp); + nsAutoCString host(tmp); nsCertOverride::OverrideBits bits; nsCertOverride::convertStringToBits(bits_string, bits); @@ -273,7 +273,7 @@ nsCertOverrideService::Read() continue; // Ignore broken entries nsresult portParseError; - nsCAutoString portString(Substring(host, portIndex+1)); + nsAutoCString portString(Substring(host, portIndex+1)); port = portString.ToInteger(&portParseError); if (NS_FAILED(portParseError)) continue; // Ignore broken entries @@ -305,7 +305,7 @@ WriteEntryCallback(nsCertOverrideEntry *aEntry, if (settings.mIsTemporary) return PL_DHASH_NEXT; - nsCAutoString bits_string; + nsAutoCString bits_string; nsCertOverride::convertBitsToString(settings.mOverrideBits, bits_string); @@ -504,7 +504,7 @@ nsCertOverrideService::RememberValidityOverride(const nsACString & aHostName, in } PR_FREEIF(nickname); - nsCAutoString fpStr; + nsAutoCString fpStr; nsresult rv = GetCertFingerprintByOidTag(nsscert, mOidTagForStoringNewHashes, fpStr); if (NS_FAILED(rv)) @@ -560,7 +560,7 @@ nsCertOverrideService::HasMatchingOverride(const nsACString & aHostName, int32_t *_retval = false; *aOverrideBits = nsCertOverride::ob_None; - nsCAutoString hostPort; + nsAutoCString hostPort; GetHostWithPort(aHostName, aPort, hostPort); nsCertOverride settings; @@ -577,7 +577,7 @@ nsCertOverrideService::HasMatchingOverride(const nsACString & aHostName, int32_t *aOverrideBits = settings.mOverrideBits; *aIsTemporary = settings.mIsTemporary; - nsCAutoString fpStr; + nsAutoCString fpStr; nsresult rv; if (settings.mFingerprintAlgOID.Equals(mDottedOidForStoringNewHashes)) { @@ -607,7 +607,7 @@ nsCertOverrideService::GetValidityOverride(const nsACString & aHostName, int32_t *_found = false; *aOverrideBits = nsCertOverride::ob_None; - nsCAutoString hostPort; + nsAutoCString hostPort; GetHostWithPort(aHostName, aPort, hostPort); nsCertOverride settings; @@ -640,7 +640,7 @@ nsCertOverrideService::AddEntryToList(const nsACString &aHostName, int32_t aPort nsCertOverride::OverrideBits ob, const nsACString &dbKey) { - nsCAutoString hostPort; + nsAutoCString hostPort; GetHostWithPort(aHostName, aPort, hostPort); { @@ -676,7 +676,7 @@ nsCertOverrideService::ClearValidityOverride(const nsACString & aHostName, int32 RemoveAllTemporaryOverrides(); return NS_OK; } - nsCAutoString hostPort; + nsAutoCString hostPort; GetHostWithPort(aHostName, aPort, hostPort); { ReentrantMonitorAutoEnter lock(monitor); @@ -771,7 +771,7 @@ FindMatchingCertCallback(nsCertOverrideEntry *aEntry, } if (still_ok && matchesDBKey(cai->cert, settings.mDBKey.get())) { - nsCAutoString cert_fingerprint; + nsAutoCString cert_fingerprint; nsresult rv; if (settings.mFingerprintAlgOID.Equals(cai->mDottedOidForStoringNewHashes)) { rv = GetCertFingerprintByOidTag(cai->cert, @@ -841,7 +841,7 @@ EnumerateCertOverridesCallback(nsCertOverrideEntry *aEntry, } else { if (matchesDBKey(capac->cert, settings.mDBKey.get())) { - nsCAutoString cert_fingerprint; + nsAutoCString cert_fingerprint; nsresult rv; if (settings.mFingerprintAlgOID.Equals(capac->mDottedOidForStoringNewHashes)) { rv = GetCertFingerprintByOidTag(capac->cert, @@ -884,7 +884,7 @@ nsCertOverrideService::EnumerateCertOverrides(nsIX509Cert *aCert, void nsCertOverrideService::GetHostWithPort(const nsACString & aHostName, int32_t aPort, nsACString& _retval) { - nsCAutoString hostPort(aHostName); + nsAutoCString hostPort(aHostName); if (aPort == -1) { aPort = 443; } diff --git a/security/manager/ssl/src/nsCertTree.cpp b/security/manager/ssl/src/nsCertTree.cpp index adf1a70c25eb..3cca5e5535fe 100644 --- a/security/manager/ssl/src/nsCertTree.cpp +++ b/security/manager/ssl/src/nsCertTree.cpp @@ -152,7 +152,7 @@ nsCertTreeDispInfo::GetCert(nsIX509Cert **_cert) NS_IMETHODIMP nsCertTreeDispInfo::GetHostPort(nsAString &aHostPort) { - nsCAutoString hostPort; + nsAutoCString hostPort; nsCertOverrideService::GetHostWithPort(mAsciiHost, mPort, hostPort); aHostPort = NS_ConvertUTF8toUTF16(hostPort); return NS_OK; @@ -386,7 +386,7 @@ MatchingCertOverridesCallback(const nsCertOverride &aSettings, // this entry is now associated to a displayed cert, remove // it from the list of remaining entries - nsCAutoString hostPort; + nsAutoCString hostPort; nsCertOverrideService::GetHostWithPort(aSettings.mAsciiHost, aSettings.mPort, hostPort); cap->tracker->RemoveEntry(hostPort); } @@ -402,7 +402,7 @@ CollectAllHostPortOverridesCallback(const nsCertOverride &aSettings, if (!collectorTable) return; - nsCAutoString hostPort; + nsAutoCString hostPort; nsCertOverrideService::GetHostWithPort(aSettings.mAsciiHost, aSettings.mPort, hostPort); collectorTable->PutEntry(hostPort); } @@ -426,7 +426,7 @@ AddRemaningHostPortOverridesCallback(const nsCertOverride &aSettings, if (!cap) return; - nsCAutoString hostPort; + nsAutoCString hostPort; nsCertOverrideService::GetHostWithPort(aSettings.mAsciiHost, aSettings.mPort, hostPort); if (!cap->tracker->GetEntry(hostPort)) return; @@ -1239,12 +1239,12 @@ nsCertTree::GetCellText(int32_t row, nsITreeColumn* col, if (certdi->mTypeOfEntry == nsCertTreeDispInfo::host_port_override) { ob = certdi->mOverrideBits; } - nsCAutoString temp; + nsAutoCString temp; nsCertOverride::convertBitsToString(ob, temp); _retval = NS_ConvertUTF8toUTF16(temp); } else if (NS_LITERAL_STRING("sitecol").Equals(colID)) { if (certdi->mTypeOfEntry == nsCertTreeDispInfo::host_port_override) { - nsCAutoString hostPort; + nsAutoCString hostPort; nsCertOverrideService::GetHostWithPort(certdi->mAsciiHost, certdi->mPort, hostPort); _retval = NS_ConvertUTF8toUTF16(hostPort); } diff --git a/security/manager/ssl/src/nsClientAuthRemember.cpp b/security/manager/ssl/src/nsClientAuthRemember.cpp index 1152bd8d8fdc..57955bccd1e2 100644 --- a/security/manager/ssl/src/nsClientAuthRemember.cpp +++ b/security/manager/ssl/src/nsClientAuthRemember.cpp @@ -118,7 +118,7 @@ nsClientAuthRememberService::RememberDecision(const nsACString & aHostName, if (aHostName.IsEmpty()) return NS_ERROR_INVALID_ARG; - nsCAutoString fpStr; + nsAutoCString fpStr; nsresult rv = GetCertFingerprintByOidTag(aServerCert, SEC_OID_SHA256, fpStr); if (NS_FAILED(rv)) return rv; @@ -160,12 +160,12 @@ nsClientAuthRememberService::HasRememberedDecision(const nsACString & aHostName, *_retval = false; nsresult rv; - nsCAutoString fpStr; + nsAutoCString fpStr; rv = GetCertFingerprintByOidTag(aCert, SEC_OID_SHA256, fpStr); if (NS_FAILED(rv)) return rv; - nsCAutoString hostCert; + nsAutoCString hostCert; GetHostWithCert(aHostName, fpStr, hostCert); nsClientAuthRemember settings; @@ -188,7 +188,7 @@ nsClientAuthRememberService::AddEntryToList(const nsACString &aHostName, const nsACString &db_key) { - nsCAutoString hostCert; + nsAutoCString hostCert; GetHostWithCert(aHostName, fingerprint, hostCert); { @@ -216,7 +216,7 @@ nsClientAuthRememberService::GetHostWithCert(const nsACString & aHostName, const nsACString & fingerprint, nsACString& _retval) { - nsCAutoString hostCert(aHostName); + nsAutoCString hostCert(aHostName); hostCert.AppendLiteral(":"); hostCert.Append(fingerprint); diff --git a/security/manager/ssl/src/nsCrypto.cpp b/security/manager/ssl/src/nsCrypto.cpp index 9c62d2cc714f..84ec7a4f8e5c 100644 --- a/security/manager/ssl/src/nsCrypto.cpp +++ b/security/manager/ssl/src/nsCrypto.cpp @@ -2282,7 +2282,7 @@ nsCrypto::ImportUserCertificates(const nsAString& aNickname, CMMFPKIStatus reqStatus; CERTCertificate *currCert; PK11SlotInfo *slot; - nsCAutoString localNick; + nsAutoCString localNick; nsCOMPtr ctx = new PipUIContext(); nsresult rv = NS_OK; CERTCertList *caPubs = nullptr; @@ -2771,7 +2771,7 @@ nsCrypto::SignText(const nsAString& aStringToSign, const nsAString& aCaOption, return NS_OK; } - nsCAutoString charset(document->GetDocumentCharacterSet()); + nsAutoCString charset(document->GetDocumentCharacterSet()); // XXX Doing what nsFormSubmission::GetEncoder does (see // http://bugzilla.mozilla.org/show_bug.cgi?id=81203). diff --git a/security/manager/ssl/src/nsIdentityChecking.cpp b/security/manager/ssl/src/nsIdentityChecking.cpp index c982c7bc1b80..a5280ba3e783 100644 --- a/security/manager/ssl/src/nsIdentityChecking.cpp +++ b/security/manager/ssl/src/nsIdentityChecking.cpp @@ -673,7 +673,7 @@ loadTestEVInfos() if (NS_FAILED(rv)) return; - nsCAutoString buffer; + nsAutoCString buffer; bool isMore = true; /* file format diff --git a/security/manager/ssl/src/nsNSSCertHelper.cpp b/security/manager/ssl/src/nsNSSCertHelper.cpp index 4fdc577e71ec..50dea4b05208 100644 --- a/security/manager/ssl/src/nsNSSCertHelper.cpp +++ b/security/manager/ssl/src/nsNSSCertHelper.cpp @@ -1058,7 +1058,7 @@ ProcessGeneralName(PRArenaPool *arena, if (SEC_ASN1DecodeItem(arena, &decoded, SEC_ASN1_GET(SEC_UTF8StringTemplate), ¤t->name.OthName.name) == SECSuccess) { - AppendUTF8toUTF16(nsCAutoString((char*)decoded.data, decoded.len), + AppendUTF8toUTF16(nsAutoCString((char*)decoded.data, decoded.len), value); } else { ProcessRawBytes(nssComponent, ¤t->name.OthName.name, value); diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp index 570bbda643dc..7b60487db8fb 100644 --- a/security/manager/ssl/src/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp @@ -887,7 +887,7 @@ nsNSSCertificateDB::ImportUserCertificate(uint8_t *data, uint32_t length, nsIInt nsNSSShutDownPreventionLock locker; PK11SlotInfo *slot; - nsCAutoString nickname; + nsAutoCString nickname; nsresult rv = NS_ERROR_FAILURE; int numCACerts; SECItem *CACerts; @@ -1586,7 +1586,7 @@ nsNSSCertificateDB::get_default_nickname(CERTCertificate *cert, if (NS_FAILED(rv)) return; - nsCAutoString username; + nsAutoCString username; char *temp_un = CERT_GetCommonName(&cert->subject); if (temp_un) { username = temp_un; @@ -1594,7 +1594,7 @@ nsNSSCertificateDB::get_default_nickname(CERTCertificate *cert, temp_un = nullptr; } - nsCAutoString caname; + nsAutoCString caname; char *temp_ca = CERT_GetOrgName(&cert->issuer); if (temp_ca) { caname = temp_ca; @@ -1606,7 +1606,7 @@ nsNSSCertificateDB::get_default_nickname(CERTCertificate *cert, nssComponent->GetPIPNSSBundleString("nick_template", tmpNickFmt); NS_ConvertUTF16toUTF8 nickFmt(tmpNickFmt); - nsCAutoString baseName; + nsAutoCString baseName; char *temp_nn = PR_smprintf(nickFmt.get(), username.get(), caname.get()); if (!temp_nn) { return; diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp index c9205bce6222..156c6735217f 100644 --- a/security/manager/ssl/src/nsNSSComponent.cpp +++ b/security/manager/ssl/src/nsNSSComponent.cpp @@ -841,7 +841,7 @@ nsNSSComponent::InstallLoadableRoots() continue; } - nsCAutoString processDir; + nsAutoCString processDir; mozFile->GetNativePath(processDir); fullLibraryPath = PR_GetLibraryName(processDir.get(), "nssckbi"); } @@ -1271,7 +1271,7 @@ nsresult nsNSSComponent::getParamsForNextCrlToDownload(nsAutoString *url, PRTime nsAutoString tempCrlKey; //Now, generate the crl key. Same key would be used as hashkey as well - nsCAutoString enabledPrefCString(*(allCrlsToBeUpdated+i)); + nsAutoCString enabledPrefCString(*(allCrlsToBeUpdated+i)); enabledPrefCString.ReplaceSubstring(updateEnabledPref,"."); tempCrlKey.AssignWithConversion(enabledPrefCString.get()); @@ -1286,7 +1286,7 @@ nsresult nsNSSComponent::getParamsForNextCrlToDownload(nsAutoString *url, PRTime char *tempTimeString; PRTime tempTime; - nsCAutoString timingPrefCString(updateTimePref); + nsAutoCString timingPrefCString(updateTimePref); LossyAppendUTF16toASCII(tempCrlKey, timingPrefCString); // No PRTime/Int64 type in prefs; stored as string; parsed here as int64_t rv = pref->GetCharPref(timingPrefCString.get(), &tempTimeString); @@ -1326,7 +1326,7 @@ nsresult nsNSSComponent::getParamsForNextCrlToDownload(nsAutoString *url, PRTime } if(nearestUpdateTime == 0 || tempTime < nearestUpdateTime){ - nsCAutoString urlPrefCString(updateURLPref); + nsAutoCString urlPrefCString(updateURLPref); LossyAppendUTF16toASCII(tempCrlKey, urlPrefCString); rv = pref->GetCharPref(urlPrefCString.get(), &tempUrl); if (NS_FAILED(rv) || (!tempUrl)){ @@ -1640,7 +1640,7 @@ nsNSSComponent::InitializeNSS(bool showWarningBox) } nsresult rv; - nsCAutoString profileStr; + nsAutoCString profileStr; nsCOMPtr profilePath; rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, @@ -3291,8 +3291,8 @@ PSMContentDownloader::handleContentDownloadError(nsresult errCode) if (mDoSilentDownload) { //This is the case for automatic download. Update failure history - nsCAutoString updateErrCntPrefStr(CRL_AUTOUPDATE_ERRCNT_PREF); - nsCAutoString updateErrDetailPrefStr(CRL_AUTOUPDATE_ERRDETAIL_PREF); + nsAutoCString updateErrCntPrefStr(CRL_AUTOUPDATE_ERRCNT_PREF); + nsAutoCString updateErrDetailPrefStr(CRL_AUTOUPDATE_ERRDETAIL_PREF); nsCString errMsg; int32_t errCnt; diff --git a/security/manager/ssl/src/nsNSSIOLayer.cpp b/security/manager/ssl/src/nsNSSIOLayer.cpp index 174f8d6150be..f55785d45d41 100644 --- a/security/manager/ssl/src/nsNSSIOLayer.cpp +++ b/security/manager/ssl/src/nsNSSIOLayer.cpp @@ -631,7 +631,7 @@ nsSSLIOLayerHelpers::getSiteKey(nsNSSSocketInfo *socketInfo, nsCSubstring &key) bool nsSSLIOLayerHelpers::rememberPossibleTLSProblemSite(nsNSSSocketInfo *socketInfo) { - nsCAutoString key; + nsAutoCString key; getSiteKey(socketInfo, key); if (!socketInfo->IsTLSEnabled()) { @@ -660,7 +660,7 @@ nsSSLIOLayerHelpers::rememberTolerantSite(nsNSSSocketInfo *socketInfo) if (!socketInfo->IsTLSEnabled()) return; - nsCAutoString key; + nsAutoCString key; getSiteKey(socketInfo, key); MutexAutoLock lock(*mutex); @@ -2372,7 +2372,7 @@ nsSSLIOLayerSetOptions(PRFileDesc *fd, bool forSTARTTLS, // Let's see if we're trying to connect to a site we know is // TLS intolerant. - nsCAutoString key; + nsAutoCString key; key = nsDependentCString(host) + NS_LITERAL_CSTRING(":") + nsPrintfCString("%d", port); if (nsSSLIOLayerHelpers::isKnownAsIntolerantSite(key)) { diff --git a/security/manager/ssl/src/nsNTLMAuthModule.cpp b/security/manager/ssl/src/nsNTLMAuthModule.cpp index d0cd78e83201..69f3b4bceb16 100644 --- a/security/manager/ssl/src/nsNTLMAuthModule.cpp +++ b/security/manager/ssl/src/nsNTLMAuthModule.cpp @@ -353,7 +353,7 @@ LM_Hash(const nsString &password, unsigned char *hash) { // convert password to OEM character set. we'll just use the native // filesystem charset. - nsCAutoString passbuf; + nsAutoCString passbuf; NS_CopyUnicodeToNative(password, passbuf); ToUpperCase(passbuf); uint32_t n = passbuf.Length(); @@ -577,7 +577,7 @@ GenerateType3Msg(const nsString &domain, #endif nsAutoString ucsHostBuf; // temporary buffers for oem strings - nsCAutoString oemDomainBuf, oemUserBuf, oemHostBuf; + nsAutoCString oemDomainBuf, oemUserBuf, oemHostBuf; // pointers and lengths for the string buffers; encoding is unicode if // the "negotiate unicode" flag was set in the Type-2 message. const void *domainPtr, *userPtr, *hostPtr; diff --git a/security/manager/ssl/src/nsUsageArrayHelper.cpp b/security/manager/ssl/src/nsUsageArrayHelper.cpp index e8e1f1ca37a2..2894a544f9e0 100644 --- a/security/manager/ssl/src/nsUsageArrayHelper.cpp +++ b/security/manager/ssl/src/nsUsageArrayHelper.cpp @@ -35,7 +35,7 @@ nsUsageArrayHelper::check(const char *suffix, PRUnichar **outUsages) { if (!aCertUsage) return; - nsCAutoString typestr; + nsAutoCString typestr; switch (aCertUsage) { case certificateUsageSSLClient: typestr = "VerifySSLClient"; diff --git a/startupcache/StartupCacheUtils.cpp b/startupcache/StartupCacheUtils.cpp index 98191d3b6d7b..99f3e4e7ff17 100644 --- a/startupcache/StartupCacheUtils.cpp +++ b/startupcache/StartupCacheUtils.cpp @@ -103,11 +103,11 @@ NewBufferFromStorageStream(nsIStorageStream *storageStream, static const char baseName[2][5] = { "gre/", "app/" }; static inline bool -canonicalizeBase(nsCAutoString &spec, +canonicalizeBase(nsAutoCString &spec, nsACString &out, mozilla::Omnijar::Type aType) { - nsCAutoString base; + nsAutoCString base; nsresult rv = mozilla::Omnijar::GetURIString(aType, base); if (NS_FAILED(rv) || !base.Length()) @@ -153,7 +153,7 @@ PathifyURI(nsIURI *in, nsACString &out) bool equals; nsresult rv; nsCOMPtr uri = in; - nsCAutoString spec; + nsAutoCString spec; // Resolve resource:// URIs. At the end of this if/else block, we // have both spec and uri variables identifying the same URI. @@ -195,7 +195,7 @@ PathifyURI(nsIURI *in, nsACString &out) baseFileURL = do_QueryInterface(uri, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString path; + nsAutoCString path; rv = baseFileURL->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); @@ -211,13 +211,13 @@ PathifyURI(nsIURI *in, nsACString &out) rv = PathifyURI(jarFileURI, out); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString path; + nsAutoCString path; rv = jarURI->GetJAREntry(path); NS_ENSURE_SUCCESS(rv, rv); out.Append("/"); out.Append(path); } else { // Very unlikely - nsCAutoString spec; + nsAutoCString spec; rv = uri->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/storage/src/VacuumManager.cpp b/storage/src/VacuumManager.cpp index a9434465ad7b..7afd38ea3ea3 100644 --- a/storage/src/VacuumManager.cpp +++ b/storage/src/VacuumManager.cpp @@ -64,11 +64,11 @@ BaseCallback::HandleError(mozIStorageError *aError) int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString message; + nsAutoCString message; rv = aError->GetMessage(message); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString warnMsg; + nsAutoCString warnMsg; warnMsg.AppendLiteral("An error occured during async execution: "); warnMsg.AppendInt(result); warnMsg.AppendLiteral(" "); @@ -166,7 +166,7 @@ Vacuumer::execute() // Check interval from last vacuum. int32_t now = static_cast(PR_Now() / PR_USEC_PER_SEC); int32_t lastVacuum; - nsCAutoString prefName(PREF_VACUUM_BRANCH); + nsAutoCString prefName(PREF_VACUUM_BRANCH); prefName += mDBFilename; rv = Preferences::GetInt(prefName.get(), &lastVacuum); if (NS_SUCCEEDED(rv) && (now - lastVacuum) < VACUUM_INTERVAL_SECONDS) { @@ -196,7 +196,7 @@ Vacuumer::execute() // Execute the statements separately, since the pragma may conflict with the // vacuum, if they are executed in the same transaction. nsCOMPtr pageSizeStmt; - nsCAutoString pageSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR + nsAutoCString pageSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA page_size = "); pageSizeQuery.AppendInt(expectedPageSize); rv = mDBConn->CreateAsyncStatement(pageSizeQuery, @@ -228,11 +228,11 @@ Vacuumer::HandleError(mozIStorageError *aError) int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString message; + nsAutoCString message; rv = aError->GetMessage(message); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString warnMsg; + nsAutoCString warnMsg; warnMsg.AppendLiteral("Unable to vacuum database: "); warnMsg.Append(mDBFilename); warnMsg.AppendLiteral(" - "); @@ -247,7 +247,7 @@ Vacuumer::HandleError(mozIStorageError *aError) int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString message; + nsAutoCString message; rv = aError->GetMessage(message); NS_ENSURE_SUCCESS(rv, rv); PR_LOG(gStorageLog, PR_LOG_ERROR, @@ -272,7 +272,7 @@ Vacuumer::HandleCompletion(uint16_t aReason) // Update last vacuum time. int32_t now = static_cast(PR_Now() / PR_USEC_PER_SEC); MOZ_ASSERT(!mDBFilename.IsEmpty(), "Database filename cannot be empty"); - nsCAutoString prefName(PREF_VACUUM_BRANCH); + nsAutoCString prefName(PREF_VACUUM_BRANCH); prefName += mDBFilename; DebugOnly rv = Preferences::SetInt(prefName.get(), now); MOZ_ASSERT(NS_SUCCEEDED(rv), "Should be able to set a preference"); diff --git a/storage/src/mozStorageBindingParams.cpp b/storage/src/mozStorageBindingParams.cpp index ef7e613c407f..75e821164bce 100644 --- a/storage/src/mozStorageBindingParams.cpp +++ b/storage/src/mozStorageBindingParams.cpp @@ -166,13 +166,13 @@ AsyncBindingParams::iterateOverNamedParameters(const nsACString &aName, // We do not accept any forms of names other than ":name", but we need to add // the colon for SQLite. - nsCAutoString name(":"); + nsAutoCString name(":"); name.Append(aName); int oneIdx = ::sqlite3_bind_parameter_index(closureThunk->statement, name.get()); if (oneIdx == 0) { - nsCAutoString errMsg(aName); + nsAutoCString errMsg(aName); errMsg.Append(NS_LITERAL_CSTRING(" is not a valid named parameter.")); closureThunk->err = new Error(SQLITE_RANGE, errMsg.get()); return PL_DHASH_STOP; diff --git a/storage/src/mozStorageConnection.cpp b/storage/src/mozStorageConnection.cpp index 195775513a49..66a25928d64b 100644 --- a/storage/src/mozStorageConnection.cpp +++ b/storage/src/mozStorageConnection.cpp @@ -495,7 +495,7 @@ Connection::initialize(nsIFile *aDatabaseFile, ::sqlite3_trace(mDBConn, tracefunc, this); - nsCAutoString leafName(":memory"); + nsAutoCString leafName(":memory"); if (aDatabaseFile) (void)aDatabaseFile->GetNativeLeafName(leafName); PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Opening connection to '%s' (%p)", @@ -506,7 +506,7 @@ Connection::initialize(nsIFile *aDatabaseFile, // the database has just been created, otherwise, if the database does not // use WAL journal mode, a VACUUM operation will updated its page_size. int64_t pageSize = DEFAULT_PAGE_SIZE; - nsCAutoString pageSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR + nsAutoCString pageSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA page_size = "); pageSizeQuery.AppendInt(pageSize); rv = ExecuteSimpleSQL(pageSizeQuery); @@ -527,7 +527,7 @@ Connection::initialize(nsIFile *aDatabaseFile, // Setting the cache_size forces the database open, verifying if it is valid // or corrupt. So this is executed regardless it being actually needed. // The cache_size is calculated from the actual page_size, to save memory. - nsCAutoString cacheSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR + nsAutoCString cacheSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA cache_size = "); cacheSizeQuery.AppendInt(NS_MIN(DEFAULT_CACHE_SIZE_PAGES, int32_t(MAX_CACHE_SIZE_BYTES / pageSize))); @@ -581,7 +581,7 @@ Connection::databaseElementExists(enum DatabaseElementType aElementType, { if (!mDBConn) return NS_ERROR_NOT_INITIALIZED; - nsCAutoString query("SELECT name FROM sqlite_master WHERE type = '"); + nsAutoCString query("SELECT name FROM sqlite_master WHERE type = '"); switch (aElementType) { case INDEX: query.Append("index"); @@ -696,7 +696,7 @@ Connection::internalClose() #endif #ifdef PR_LOGGING - nsCAutoString leafName(":memory"); + nsAutoCString leafName(":memory"); if (mDatabaseFile) (void)mDatabaseFile->GetNativeLeafName(leafName); PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Closing connection to '%s'", @@ -965,7 +965,7 @@ Connection::Clone(bool aReadOnly, continue; } - nsCAutoString pragmaQuery("PRAGMA "); + nsAutoCString pragmaQuery("PRAGMA "); pragmaQuery.Append(pragmas[i]); nsCOMPtr stmt; rv = CreateStatement(pragmaQuery, getter_AddRefs(stmt)); @@ -1068,7 +1068,7 @@ Connection::SetSchemaVersion(int32_t aVersion) { if (!mDBConn) return NS_ERROR_NOT_INITIALIZED; - nsCAutoString stmt(NS_LITERAL_CSTRING("PRAGMA user_version = ")); + nsAutoCString stmt(NS_LITERAL_CSTRING("PRAGMA user_version = ")); stmt.AppendInt(aVersion); return ExecuteSimpleSQL(stmt); diff --git a/storage/src/mozStoragePrivateHelpers.cpp b/storage/src/mozStoragePrivateHelpers.cpp index ff0869853b45..801ffa4fac41 100644 --- a/storage/src/mozStoragePrivateHelpers.cpp +++ b/storage/src/mozStoragePrivateHelpers.cpp @@ -72,7 +72,7 @@ convertResultCode(int aSQLiteResultCode) // generic error #ifdef DEBUG - nsCAutoString message; + nsAutoCString message; message.AppendLiteral("SQLite returned error code "); message.AppendInt(rc); message.AppendLiteral(" , Storage will convert it to NS_ERROR_FAILURE"); @@ -96,7 +96,7 @@ checkAndLogStatementPerformance(sqlite3_stmt *aStatement) if (::strstr(sql, "/* do not warn (bug ")) return; - nsCAutoString message; + nsAutoCString message; message.AppendInt(count); if (count == 1) message.Append(" sort operation has "); diff --git a/storage/src/mozStorageRow.cpp b/storage/src/mozStorageRow.cpp index d609f28452b3..c7d748b73833 100644 --- a/storage/src/mozStorageRow.cpp +++ b/storage/src/mozStorageRow.cpp @@ -67,7 +67,7 @@ Row::initialize(sqlite3_stmt *aStatement) // Associate the name (if any) with the index const char *name = ::sqlite3_column_name(aStatement, i); if (!name) break; - nsCAutoString colName(name); + nsAutoCString colName(name); mNameHashtable.Put(colName, i); } diff --git a/storage/src/mozStorageStatement.cpp b/storage/src/mozStorageStatement.cpp index 3d141e48518c..dbb778678ba1 100644 --- a/storage/src/mozStorageStatement.cpp +++ b/storage/src/mozStorageStatement.cpp @@ -338,7 +338,7 @@ Statement::Clone(mozIStorageStatement **_statement) nsRefPtr statement(new Statement()); NS_ENSURE_TRUE(statement, NS_ERROR_OUT_OF_MEMORY); - nsCAutoString sql(::sqlite3_sql(mDBStatement)); + nsAutoCString sql(::sqlite3_sql(mDBStatement)); nsresult rv = statement->initialize(mDBConnection, sql); NS_ENSURE_SUCCESS(rv, rv); @@ -422,7 +422,7 @@ Statement::GetParameterName(uint32_t aParamIndex, aParamIndex + 1); if (name == NULL) { // this thing had no name, so fake one - nsCAutoString name(":"); + nsAutoCString name(":"); name.AppendInt(aParamIndex); _name.Assign(name); } @@ -442,7 +442,7 @@ Statement::GetParameterIndex(const nsACString &aName, // We do not accept any forms of names other than ":name", but we need to add // the colon for SQLite. - nsCAutoString name(":"); + nsAutoCString name(":"); name.Append(aName); int ind = ::sqlite3_bind_parameter_index(mDBStatement, name.get()); if (ind == 0) // Named parameter not found. @@ -584,7 +584,7 @@ Statement::ExecuteStep(bool *_moreResults) #ifdef PR_LOGGING if (srv != SQLITE_ROW && srv != SQLITE_DONE) { - nsCAutoString errStr; + nsAutoCString errStr; (void)mDBConnection->GetLastErrorString(errStr); PR_LOG(gStorageLog, PR_LOG_DEBUG, ("Statement::ExecuteStep error: %s", errStr.get())); diff --git a/storage/src/mozStorageStatementParams.cpp b/storage/src/mozStorageStatementParams.cpp index a30f37c88b32..47e659a399dc 100644 --- a/storage/src/mozStorageStatementParams.cpp +++ b/storage/src/mozStorageStatementParams.cpp @@ -116,7 +116,7 @@ StatementParams::NewEnumerate(nsIXPConnectWrappedNative *aWrapper, } // Get the name of our parameter. - nsCAutoString name; + nsAutoCString name; nsresult rv = mStatement->GetParameterName(index, name); NS_ENSURE_SUCCESS(rv, rv); diff --git a/storage/src/variantToSQLiteT_impl.h b/storage/src/variantToSQLiteT_impl.h index 15f0ebd52778..30301337f813 100644 --- a/storage/src/variantToSQLiteT_impl.h +++ b/storage/src/variantToSQLiteT_impl.h @@ -66,7 +66,7 @@ variantToSQLiteT(T aObj, case nsIDataType::VTYPE_UTF8STRING: case nsIDataType::VTYPE_CSTRING: { - nsCAutoString value; + nsAutoCString value; // GetAsAUTF8String should never perform conversion when coming from // 8-bit string types, and thus can accept strings with arbitrary encoding // (including UTF8 and ASCII). diff --git a/storage/test/storage_test_harness.h b/storage/test/storage_test_harness.h index 4d7f25553993..b32e5afbc8f4 100644 --- a/storage/test/storage_test_harness.h +++ b/storage/test/storage_test_harness.h @@ -147,11 +147,11 @@ AsyncStatementSpinner::HandleError(mozIStorageError *aError) int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString message; + nsAutoCString message; rv = aError->GetMessage(message); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString warnMsg; + nsAutoCString warnMsg; warnMsg.Append("An error occurred while executing an async statement: "); warnMsg.AppendInt(result); warnMsg.Append(" "); diff --git a/storage/test/test_binding_params.cpp b/storage/test/test_binding_params.cpp index bb097224ca28..e5af6009d00e 100644 --- a/storage/test/test_binding_params.cpp +++ b/storage/test/test_binding_params.cpp @@ -35,7 +35,7 @@ test_ASCIIString() ), getter_AddRefs(select)); // Roundtrip a string through the table, and ensure it comes out as expected. - nsCAutoString inserted("I'm an ASCII string"); + nsAutoCString inserted("I'm an ASCII string"); { mozStorageStatementScoper scoper(insert); bool hasResult; @@ -44,7 +44,7 @@ test_ASCIIString() do_check_false(hasResult); } - nsCAutoString result; + nsAutoCString result; { mozStorageStatementScoper scoper(select); bool hasResult; @@ -80,7 +80,7 @@ test_CString() // Roundtrip a string through the table, and ensure it comes out as expected. static const char sCharArray[] = "I'm not a \xff\x00\xac\xde\xbb ASCII string!"; - nsCAutoString inserted(sCharArray, ArrayLength(sCharArray) - 1); + nsAutoCString inserted(sCharArray, ArrayLength(sCharArray) - 1); do_check_true(inserted.Length() == ArrayLength(sCharArray) - 1); { mozStorageStatementScoper scoper(insert); @@ -91,7 +91,7 @@ test_CString() } { - nsCAutoString result; + nsAutoCString result; mozStorageStatementScoper scoper(select); bool hasResult; @@ -127,7 +127,7 @@ test_UTFStrings() // Roundtrip a UTF8 string through the table, using UTF8 input and output. static const char sCharArray[] = "I'm a \xc3\xbb\xc3\xbc\xc3\xa2\xc3\xa4\xc3\xa7 UTF8 string!"; - nsCAutoString insertedUTF8(sCharArray, ArrayLength(sCharArray) - 1); + nsAutoCString insertedUTF8(sCharArray, ArrayLength(sCharArray) - 1); do_check_true(insertedUTF8.Length() == ArrayLength(sCharArray) - 1); NS_ConvertUTF8toUTF16 insertedUTF16(insertedUTF8); do_check_true(insertedUTF8 == NS_ConvertUTF16toUTF8(insertedUTF16)); @@ -140,7 +140,7 @@ test_UTFStrings() } { - nsCAutoString result; + nsAutoCString result; mozStorageStatementScoper scoper(select); bool hasResult; @@ -176,7 +176,7 @@ test_UTFStrings() } { - nsCAutoString result; + nsAutoCString result; mozStorageStatementScoper scoper(select); bool hasResult; diff --git a/toolkit/components/alerts/mac/mozGrowlDelegate.mm b/toolkit/components/alerts/mac/mozGrowlDelegate.mm index 6171feaa4994..3d18475d0ed2 100644 --- a/toolkit/components/alerts/mac/mozGrowlDelegate.mm +++ b/toolkit/components/alerts/mac/mozGrowlDelegate.mm @@ -169,7 +169,7 @@ do_GetService("@mozilla.org/xre/app-info;1", &rv); NS_ENSURE_SUCCESS(rv, nil); - nsCAutoString appName; + nsAutoCString appName; rv = appInfo->GetName(appName); NS_ENSURE_SUCCESS(rv, nil); diff --git a/toolkit/components/alerts/mac/nsAlertsImageLoadListener.mm b/toolkit/components/alerts/mac/nsAlertsImageLoadListener.mm index 444153e28da6..41b92895d530 100644 --- a/toolkit/components/alerts/mac/nsAlertsImageLoadListener.mm +++ b/toolkit/components/alerts/mac/nsAlertsImageLoadListener.mm @@ -44,7 +44,7 @@ nsAlertsImageLoadListener::OnStreamComplete(nsIStreamLoader* aLoader, nsCOMPtr uri; channel->GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString uriSpec; + nsAutoCString uriSpec; uri->GetSpec(uriSpec); printf("Failed to load %s\n", uriSpec.get()); } diff --git a/toolkit/components/autocomplete/nsAutoCompleteController.cpp b/toolkit/components/autocomplete/nsAutoCompleteController.cpp index 239e52da2a89..64e99eefa53d 100644 --- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp +++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp @@ -132,9 +132,9 @@ nsAutoCompleteController::SetInput(nsIAutoCompleteInput *aInput) for (uint32_t i = 0; i < searchCount; ++i) { // Use the search name to create the contract id string for the search service - nsCAutoString searchName; + nsAutoCString searchName; aInput->GetSearchAt(i, searchName); - nsCAutoString cid(searchCID); + nsAutoCString cid(searchCID); cid.Append(searchName); // Use the created cid to get a pointer to the search service and store it for later @@ -1578,7 +1578,7 @@ nsAutoCompleteController::CompleteValue(nsString &aValue) nsresult rv; nsCOMPtr ios = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString scheme; + nsAutoCString scheme; if (NS_SUCCEEDED(ios->ExtractScheme(NS_ConvertUTF16toUTF8(aValue), scheme))) { // Trying to autocomplete a URI from somewhere other than the beginning. // Only succeed if the missing portion is "http://"; otherwise do not diff --git a/toolkit/components/commandlines/nsCommandLine.cpp b/toolkit/components/commandlines/nsCommandLine.cpp index edb3de6946f0..2b5213f8d829 100644 --- a/toolkit/components/commandlines/nsCommandLine.cpp +++ b/toolkit/components/commandlines/nsCommandLine.cpp @@ -263,7 +263,7 @@ nsCommandLine::ResolveFile(const nsAString& aArgument, nsIFile* *aResult) rv = lfm->GetCFURL(&baseurl); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString path; + nsAutoCString path; NS_CopyUnicodeToNative(aArgument, path); CFURLRef newurl = @@ -293,10 +293,10 @@ nsCommandLine::ResolveFile(const nsAString& aArgument, nsIFile* *aResult) return NS_OK; } - nsCAutoString nativeArg; + nsAutoCString nativeArg; NS_CopyUnicodeToNative(aArgument, nativeArg); - nsCAutoString newpath; + nsAutoCString newpath; mWorkingDir->GetNativePath(newpath); newpath.Append('/'); @@ -345,10 +345,10 @@ nsCommandLine::ResolveFile(const nsAString& aArgument, nsIFile* *aResult) rv = lf->InitWithPath(aArgument); if (NS_FAILED(rv)) { - nsCAutoString fullPath; + nsAutoCString fullPath; mWorkingDir->GetNativePath(fullPath); - nsCAutoString carg; + nsAutoCString carg; NS_CopyUnicodeToNative(aArgument, carg); fullPath.Append('\\'); @@ -389,7 +389,7 @@ nsCommandLine::ResolveURI(const nsAString& aArgument, nsIURI* *aResult) rv = lf->InitWithPath(aArgument); if (NS_SUCCEEDED(rv)) { lf->Normalize(); - nsCAutoString url; + nsAutoCString url; // Try to resolve the url for .url files. resolveShortcutURL(lf, url); if (!url.IsEmpty()) { @@ -538,7 +538,7 @@ nsCommandLine::EnumerateHandlers(EnumerateHandlersCallback aCallback, void *aClo nsCOMPtr strenum (do_QueryInterface(entenum)); NS_ENSURE_TRUE(strenum, NS_ERROR_UNEXPECTED); - nsCAutoString entry; + nsAutoCString entry; bool hasMore; while (NS_SUCCEEDED(strenum->HasMore(&hasMore)) && hasMore) { strenum->GetNext(entry); @@ -584,7 +584,7 @@ nsCommandLine::EnumerateValidators(EnumerateValidatorsCallback aCallback, void * nsCOMPtr strenum (do_QueryInterface(entenum)); NS_ENSURE_TRUE(strenum, NS_ERROR_UNEXPECTED); - nsCAutoString entry; + nsAutoCString entry; bool hasMore; while (NS_SUCCEEDED(strenum->HasMore(&hasMore)) && hasMore) { strenum->GetNext(entry); diff --git a/toolkit/components/ctypes/ctypes.cpp b/toolkit/components/ctypes/ctypes.cpp index 0dda06372919..9481f19e5b25 100644 --- a/toolkit/components/ctypes/ctypes.cpp +++ b/toolkit/components/ctypes/ctypes.cpp @@ -23,7 +23,7 @@ namespace ctypes { static char* UnicodeToNative(JSContext *cx, const jschar *source, size_t slen) { - nsCAutoString native; + nsAutoCString native; nsDependentString unicode(reinterpret_cast(source), slen); nsresult rv = NS_CopyUnicodeToNative(unicode, native); if (NS_FAILED(rv)) { diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index 024686f4f608..3b9d9f0387cd 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -215,7 +215,7 @@ nsDownloadManager::RemoveDownloadsForURI(nsIURI *aURI) { mozStorageStatementScoper scope(mGetIdsForURIStatement); - nsCAutoString source; + nsAutoCString source; nsresult rv = aURI->GetSpec(source); NS_ENSURE_SUCCESS(rv, rv); @@ -1014,7 +1014,7 @@ nsDownloadManager::GetDownloadFromDB(uint32_t aID, nsDownload **retVal) dl->SetProgressBytes(currBytes, maxBytes); // Build mMIMEInfo only if the mimeType in DB is not empty - nsCAutoString mimeType; + nsAutoCString mimeType; rv = stmt->GetUTF8String(i++, mimeType); NS_ENSURE_SUCCESS(rv, rv); @@ -1031,7 +1031,7 @@ nsDownloadManager::GetDownloadFromDB(uint32_t aID, nsDownload **retVal) rv = dl->mMIMEInfo->SetPreferredAction(action); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString persistentDescriptor; + nsAutoCString persistentDescriptor; rv = stmt->GetUTF8String(i++, persistentDescriptor); NS_ENSURE_SUCCESS(rv, rv); @@ -1351,7 +1351,7 @@ nsDownloadManager::AddDownload(DownloadType aDownloadType, dl->mCancelable = aCancelable; // Adding to the DB - nsCAutoString source, target; + nsAutoCString source, target; aSource->GetSpec(source); aTarget->GetSpec(target); @@ -1362,7 +1362,7 @@ nsDownloadManager::AddDownload(DownloadType aDownloadType, // Break down MIMEInfo but don't panic if we can't get all the pieces - we // can still download the file - nsCAutoString persistentDescriptor, mimeType; + nsAutoCString persistentDescriptor, mimeType; nsHandlerInfoAction action = nsIMIMEInfo::saveToDisk; if (aMIMEInfo) { (void)aMIMEInfo->GetType(mimeType); @@ -2320,7 +2320,7 @@ nsDownload::SetState(DownloadState aState) #endif #ifdef MOZ_WIDGET_ANDROID nsCOMPtr mimeInfo; - nsCAutoString contentType; + nsAutoCString contentType; GetMIMEInfo(getter_AddRefs(mimeInfo)); if (mimeInfo) @@ -3079,7 +3079,7 @@ nsDownload::UpdateDB() NS_ENSURE_SUCCESS(rv, rv); if (mReferrer) { - nsCAutoString referrer; + nsAutoCString referrer; rv = mReferrer->GetSpec(referrer); NS_ENSURE_SUCCESS(rv, rv); rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("referrer"), referrer); diff --git a/toolkit/components/downloads/nsDownloadScanner.cpp b/toolkit/components/downloads/nsDownloadScanner.cpp index bf5b1901c336..50dcb5793d04 100644 --- a/toolkit/components/downloads/nsDownloadScanner.cpp +++ b/toolkit/components/downloads/nsDownloadScanner.cpp @@ -211,7 +211,7 @@ nsDownloadScanner::CheckPolicy(nsIURI *aSource, nsIURI *aTarget) if (!mAESExists || !aSource || !aTarget) return AVPOLICY_DOWNLOAD; - nsCAutoString source; + nsAutoCString source; rv = aSource->GetSpec(source); if (NS_FAILED(rv)) return AVPOLICY_DOWNLOAD; @@ -340,7 +340,7 @@ nsDownloadScanner::Scan::Start() do_GetService(XULAPPINFO_SERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString name; + nsAutoCString name; rv = appinfo->GetName(name); NS_ENSURE_SUCCESS(rv, rv); CopyUTF8toUTF16(name, mName); @@ -350,7 +350,7 @@ nsDownloadScanner::Scan::Start() rv = mDownload->GetSource(getter_AddRefs(uri)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString origin; + nsAutoCString origin; rv = uri->GetSpec(origin); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/intl/nsCharsetMenu.cpp b/toolkit/components/intl/nsCharsetMenu.cpp index e01d11dd3f05..00d813f6ccea 100644 --- a/toolkit/components/intl/nsCharsetMenu.cpp +++ b/toolkit/components/intl/nsCharsetMenu.cpp @@ -92,7 +92,7 @@ public: nsMenuEntry() { MOZ_COUNT_CTOR(nsMenuEntry); } ~nsMenuEntry() { MOZ_COUNT_DTOR(nsMenuEntry); } - nsCAutoString mCharset; + nsAutoCString mCharset; nsAutoString mTitle; }; @@ -330,7 +330,7 @@ nsCharsetMenu::SetArrayFromEnumerator(nsIUTF8StringEnumerator* aEnumerator, bool hasMore; rv = aEnumerator->HasMore(&hasMore); - nsCAutoString value; + nsAutoCString value; while (NS_SUCCEEDED(rv) && hasMore) { rv = aEnumerator->GetNext(value); if (NS_SUCCEEDED(rv)) @@ -1240,7 +1240,7 @@ nsresult nsCharsetMenu::AddMenuItemToContainer( nsresult res = NS_OK; nsCOMPtr node; - nsCAutoString id; + nsAutoCString id; if (aIDPrefix != NULL) id.Assign(aIDPrefix); id.Append(aItem->mCharset); @@ -1396,7 +1396,7 @@ nsresult nsCharsetMenu::AddFromStringToMenu( // if this charset is not on the accepted list of charsets, ignore it int32_t index; - index = aDecs.IndexOf(nsCAutoString(p), 0, nsIgnoreCaseCStringComparator()); + index = aDecs.IndexOf(nsAutoCString(p), 0, nsIgnoreCaseCStringComparator()); if (index >= 0) { // else, add it to the menu @@ -1418,7 +1418,7 @@ nsresult nsCharsetMenu::AddFromStringToMenu( nsresult nsCharsetMenu::AddSeparatorToContainer(nsIRDFContainer * aContainer) { - nsCAutoString str; + nsAutoCString str; str.AssignLiteral("----"); // hack to generate unique id's for separators @@ -1471,8 +1471,8 @@ nsresult nsCharsetMenu::WriteCacheToPrefs(nsTArray * aArray, nsresult res = NS_OK; // create together the cache string - nsCAutoString cache; - nsCAutoString sep(NS_LITERAL_CSTRING(", ")); + nsAutoCString cache; + nsAutoCString sep(NS_LITERAL_CSTRING(", ")); uint32_t count = aArray->Length(); for (uint32_t i = aCacheStart; i < count; i++) { diff --git a/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp b/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp index e522cf6f932b..715df8596579 100644 --- a/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp +++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp @@ -187,7 +187,7 @@ nsParentalControlsServiceWin::RequestURIOverride(nsIURI *aTarget, nsIInterfaceRe NS_ENSURE_ARG_POINTER(aTarget); - nsCAutoString spec; + nsAutoCString spec; aTarget->GetSpec(spec); if (spec.IsEmpty()) return NS_ERROR_INVALID_ARG; @@ -244,7 +244,7 @@ nsParentalControlsServiceWin::RequestURIOverrides(nsIArray *aTargets, nsIInterfa hWnd = GetDesktopWindow(); // The first entry should be the root uri - nsCAutoString rootSpec; + nsAutoCString rootSpec; nsCOMPtr rootURI = do_QueryElementAt(aTargets, 0); if (!rootURI) return NS_ERROR_INVALID_ARG; @@ -266,7 +266,7 @@ nsParentalControlsServiceWin::RequestURIOverrides(nsIArray *aTargets, nsIInterfa if (!uri) continue; - nsCAutoString subURI; + nsAutoCString subURI; if (NS_FAILED(uri->GetSpec(subURI))) continue; @@ -301,7 +301,7 @@ nsParentalControlsServiceWin::RequestURIOverrides(nsIArray *aTargets, nsIInterfa void nsParentalControlsServiceWin::LogFileDownload(bool blocked, nsIURI *aSource, nsIFile *aTarget) { - nsCAutoString curi; + nsAutoCString curi; if (!gEventWrite) return; @@ -313,7 +313,7 @@ nsParentalControlsServiceWin::LogFileDownload(bool blocked, nsIURI *aSource, nsI // Get the name of the currently running process nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); - nsCAutoString asciiAppName; + nsAutoCString asciiAppName; if (appInfo) appInfo->GetName(asciiAppName); nsAutoString appName = NS_ConvertUTF8toUTF16(asciiAppName); diff --git a/toolkit/components/places/AsyncFaviconHelpers.cpp b/toolkit/components/places/AsyncFaviconHelpers.cpp index d86ac77520f8..a6125a72119a 100644 --- a/toolkit/components/places/AsyncFaviconHelpers.cpp +++ b/toolkit/components/places/AsyncFaviconHelpers.cpp @@ -320,7 +320,7 @@ SniffMimeTypeForIconData(nsIRequest* aRequest, nsCOMPtr snifferCIDSupportsCString = do_QueryInterface(snifferCIDSupports); NS_ENSURE_STATE(snifferCIDSupports); - nsCAutoString snifferCID; + nsAutoCString snifferCID; rv = snifferCIDSupportsCString->GetData(snifferCID); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr sniffer = do_GetService(snifferCID.get()); @@ -389,7 +389,7 @@ OptimizeIconSize(IconData& aIcon, // Even if the page provides a large image for the favicon (eg, a highres // image or a multiresolution .ico file), don't try to store more data than // needed. - nsCAutoString newData, newMimeType; + nsAutoCString newData, newMimeType; if (aIcon.data.Length() > MAX_ICON_FILESIZE(aFaviconSvc->GetOptimizedIconDimension())) { nsresult rv = aFaviconSvc->OptimizeFaviconImage(TO_INTBUFFER(aIcon.data), aIcon.data.Length(), @@ -616,7 +616,7 @@ AsyncFetchAndSetIconFromNetwork::OnDataAvailable(nsIRequest* aRequest, uint32_t aOffset, uint32_t aCount) { - nsCAutoString buffer; + nsAutoCString buffer; nsresult rv = NS_ConsumeStream(aInputStream, aCount, buffer); if (rv != NS_BASE_STREAM_WOULD_BLOCK && NS_FAILED(rv)) { return rv; @@ -812,7 +812,7 @@ AsyncGetFaviconURLForPage::start(nsIURI* aPageURI, NS_PRECONDITION(NS_IsMainThread(), "This should be called on the main thread."); - nsCAutoString pageSpec; + nsAutoCString pageSpec; nsresult rv = aPageURI->GetSpec(pageSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -845,7 +845,7 @@ AsyncGetFaviconURLForPage::Run() NS_PRECONDITION(!NS_IsMainThread(), "This should not be called on the main thread."); - nsCAutoString iconSpec; + nsAutoCString iconSpec; nsresult rv = FetchIconURL(mDB, mPageSpec, iconSpec); MOZ_ASSERT(NS_SUCCEEDED(rv)); @@ -877,7 +877,7 @@ AsyncGetFaviconDataForPage::start(nsIURI* aPageURI, NS_PRECONDITION(NS_IsMainThread(), "This should be called on the main thread."); - nsCAutoString pageSpec; + nsAutoCString pageSpec; nsresult rv = aPageURI->GetSpec(pageSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -910,7 +910,7 @@ AsyncGetFaviconDataForPage::Run() NS_PRECONDITION(!NS_IsMainThread(), "This should not be called on the main thread."); - nsCAutoString iconSpec; + nsAutoCString iconSpec; nsresult rv = FetchIconURL(mDB, mPageSpec, iconSpec); MOZ_ASSERT(NS_SUCCEEDED(rv)); diff --git a/toolkit/components/places/Database.cpp b/toolkit/components/places/Database.cpp index 0f65472d7b5e..50ee007e687d 100644 --- a/toolkit/components/places/Database.cpp +++ b/toolkit/components/places/Database.cpp @@ -161,7 +161,7 @@ SetJournalMode(nsCOMPtr& aDBConn, enum JournalMode aJournalMode) { MOZ_ASSERT(NS_IsMainThread()); - nsCAutoString journalMode; + nsAutoCString journalMode; switch (aJournalMode) { default: MOZ_ASSERT("Trying to set an unknown journal mode."); @@ -181,7 +181,7 @@ SetJournalMode(nsCOMPtr& aDBConn, } nsCOMPtr statement; - nsCAutoString query(MOZ_STORAGE_UNIQUIFY_QUERY_STR + nsAutoCString query(MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA journal_mode = "); query.Append(journalMode); aDBConn->CreateStatement(query, getter_AddRefs(statement)); @@ -567,7 +567,7 @@ Database::InitSchema(bool* aDatabaseMigrated) // checkpointing at strategic moments. int32_t checkpointPages = static_cast(DATABASE_MAX_WAL_SIZE_IN_KIBIBYTES * 1024 / mDBPageSize); - nsCAutoString checkpointPragma("PRAGMA wal_autocheckpoint = "); + nsAutoCString checkpointPragma("PRAGMA wal_autocheckpoint = "); checkpointPragma.AppendInt(checkpointPages); rv = mMainConn->ExecuteSimpleSQL(checkpointPragma); NS_ENSURE_SUCCESS(rv, rv); @@ -591,7 +591,7 @@ Database::InitSchema(bool* aDatabaseMigrated) // Since exceeding the limit will cause a truncate, allow a slightly // larger limit than DATABASE_MAX_WAL_SIZE_IN_KIBIBYTES to reduce the number // of times it is needed. - nsCAutoString journalSizePragma("PRAGMA journal_size_limit = "); + nsAutoCString journalSizePragma("PRAGMA journal_size_limit = "); journalSizePragma.AppendInt(DATABASE_MAX_WAL_SIZE_IN_KIBIBYTES * 3); (void)mMainConn->ExecuteSimpleSQL(journalSizePragma); @@ -1038,7 +1038,7 @@ Database::CheckAndUpdateGUIDs() int64_t itemId; rv = stmt->GetInt64(0, &itemId); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString guid; + nsAutoCString guid; rv = stmt->GetUTF8String(1, guid); NS_ENSURE_SUCCESS(rv, rv); @@ -1112,7 +1112,7 @@ Database::CheckAndUpdateGUIDs() int64_t placeId; rv = stmt->GetInt64(0, &placeId); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString guid; + nsAutoCString guid; rv = stmt->GetUTF8String(1, guid); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/places/Helpers.cpp b/toolkit/components/places/Helpers.cpp index 489d6bef49c5..225dd6ade213 100644 --- a/toolkit/components/places/Helpers.cpp +++ b/toolkit/components/places/Helpers.cpp @@ -48,11 +48,11 @@ AsyncStatementCallback::HandleError(mozIStorageError *aError) int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString message; + nsAutoCString message; rv = aError->GetMessage(message); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString warnMsg; + nsAutoCString warnMsg; warnMsg.Append("An error occurred while executing an async statement: "); warnMsg.AppendInt(result); warnMsg.Append(" "); @@ -64,7 +64,7 @@ AsyncStatementCallback::HandleError(mozIStorageError *aError) } #define URI_TO_URLCSTRING(uri, spec) \ - nsCAutoString spec; \ + nsAutoCString spec; \ if (NS_FAILED(aURI->GetSpec(spec))) { \ return NS_ERROR_UNEXPECTED; \ } @@ -177,7 +177,7 @@ URIBinder::Bind(mozIStorageBindingParams* aParams, nsresult GetReversedHostname(nsIURI* aURI, nsString& aRevHost) { - nsCAutoString forward8; + nsAutoCString forward8; nsresult rv = aURI->GetHost(forward8); // Not all URIs have a host. if (NS_FAILED(rv)) diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index 668a38b83d25..b06006e78273 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -1293,7 +1293,7 @@ public: rv = destinationFile->GetLeafName(destinationFileName); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString destinationURISpec; + nsAutoCString destinationURISpec; rv = destinationFileURL->GetSpec(destinationURISpec); NS_ENSURE_SUCCESS(rv, rv); @@ -1563,7 +1563,7 @@ History::InsertPlace(const VisitData& aPlace) NS_ENSURE_SUCCESS(rv, rv); rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("hidden"), aPlace.hidden); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString guid(aPlace.guid); + nsAutoCString guid(aPlace.guid); if (aPlace.guid.IsVoid()) { rv = GenerateGUID(guid); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/places/SQLFunctions.cpp b/toolkit/components/places/SQLFunctions.cpp index c5221e9a6796..af5f01f70c83 100644 --- a/toolkit/components/places/SQLFunctions.cpp +++ b/toolkit/components/places/SQLFunctions.cpp @@ -333,7 +333,7 @@ namespace places { #define HAS_BEHAVIOR(aBitName) \ (searchBehavior & mozIPlacesAutoComplete::BEHAVIOR_##aBitName) - nsCAutoString searchString; + nsAutoCString searchString; (void)aArguments->GetUTF8String(kArgSearchString, searchString); nsCString url; (void)aArguments->GetUTF8String(kArgIndexURL, url); @@ -353,7 +353,7 @@ namespace places { int32_t visitCount = aArguments->AsInt32(kArgIndexVisitCount); bool typed = aArguments->AsInt32(kArgIndexTyped) ? true : false; bool bookmark = aArguments->AsInt32(kArgIndexBookmark) ? true : false; - nsCAutoString tags; + nsAutoCString tags; (void)aArguments->GetUTF8String(kArgIndexTags, tags); int32_t openPageCount = aArguments->AsInt32(kArgIndexOpenPageCount); @@ -378,7 +378,7 @@ namespace places { nsCString fixedURI; fixupURISpec(url, matchBehavior, fixedURI); - nsCAutoString title; + nsAutoCString title; (void)aArguments->GetUTF8String(kArgIndexTitle, title); // Determine if every token matches either the bookmark title, tags, page @@ -645,7 +645,7 @@ namespace places { GenerateGUIDFunction::OnFunctionCall(mozIStorageValueArray *aArguments, nsIVariant **_result) { - nsCAutoString guid; + nsAutoCString guid; nsresult rv = GenerateGUID(guid); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/places/nsAndroidHistory.cpp b/toolkit/components/places/nsAndroidHistory.cpp index 65316b9766ef..f0cc7c866d1a 100644 --- a/toolkit/components/places/nsAndroidHistory.cpp +++ b/toolkit/components/places/nsAndroidHistory.cpp @@ -37,7 +37,7 @@ nsAndroidHistory::RegisterVisitedCallback(nsIURI *aURI, Link *aContent) if (!aContent || !aURI) return NS_OK; - nsCAutoString uri; + nsAutoCString uri; nsresult rv = aURI->GetSpec(uri); if (NS_FAILED(rv)) return rv; NS_ConvertUTF8toUTF16 uriString(uri); @@ -63,7 +63,7 @@ nsAndroidHistory::UnregisterVisitedCallback(nsIURI *aURI, Link *aContent) if (!aContent || !aURI) return NS_OK; - nsCAutoString uri; + nsAutoCString uri; nsresult rv = aURI->GetSpec(uri); if (NS_FAILED(rv)) return rv; NS_ConvertUTF8toUTF16 uriString(uri); @@ -91,7 +91,7 @@ nsAndroidHistory::VisitURI(nsIURI *aURI, nsIURI *aLastVisitedURI, uint32_t aFlag AndroidBridge *bridge = AndroidBridge::Bridge(); if (bridge) { - nsCAutoString uri; + nsAutoCString uri; nsresult rv = aURI->GetSpec(uri); if (NS_FAILED(rv)) return rv; NS_ConvertUTF8toUTF16 uriString(uri); diff --git a/toolkit/components/places/nsAnnoProtocolHandler.cpp b/toolkit/components/places/nsAnnoProtocolHandler.cpp index 1e762a46c373..56d5606c8d92 100644 --- a/toolkit/components/places/nsAnnoProtocolHandler.cpp +++ b/toolkit/components/places/nsAnnoProtocolHandler.cpp @@ -93,7 +93,7 @@ public: // We do not allow favicons without a MIME type, so we'll return the default // icon. - nsCAutoString mimeType; + nsAutoCString mimeType; (void)row->GetUTF8String(1, mimeType); NS_ENSURE_FALSE(mimeType.IsEmpty(), NS_OK); @@ -258,7 +258,7 @@ nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval) NS_ENSURE_ARG_POINTER(aURI); nsresult rv; - nsCAutoString path; + nsAutoCString path; rv = aURI->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); @@ -268,7 +268,7 @@ nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval) // annotation info nsCOMPtr annoURI; - nsCAutoString annoName; + nsAutoCString annoName; rv = ParseAnnoURI(aURI, getter_AddRefs(annoURI), annoName); NS_ENSURE_SUCCESS(rv, rv); @@ -280,7 +280,7 @@ nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval) // normal handling for annotations uint8_t* data; uint32_t dataLen; - nsCAutoString mimeType; + nsAutoCString mimeType; // get the data from the annotation service and hand it off to the stream rv = annotationService->GetPageAnnotationBinary(annoURI, annoName, &data, @@ -337,7 +337,7 @@ nsAnnoProtocolHandler::ParseAnnoURI(nsIURI* aURI, nsIURI** aResultURI, nsCString& aName) { nsresult rv; - nsCAutoString path; + nsAutoCString path; rv = aURI->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/places/nsAnnotationService.cpp b/toolkit/components/places/nsAnnotationService.cpp index f186ed20c321..fdab03495a6e 100644 --- a/toolkit/components/places/nsAnnotationService.cpp +++ b/toolkit/components/places/nsAnnotationService.cpp @@ -1114,7 +1114,7 @@ nsAnnotationService::GetPagesWithAnnotationCOMArray(const nsACString& aName, bool hasMore = false; while (NS_SUCCEEDED(rv = stmt->ExecuteStep(&hasMore)) && hasMore) { - nsCAutoString uristring; + nsAutoCString uristring; rv = stmt->GetUTF8String(0, uristring); NS_ENSURE_SUCCESS(rv, rv); @@ -1274,7 +1274,7 @@ nsAnnotationService::GetAnnotationNamesTArray(nsIURI* aURI, bool hasResult = false; while (NS_SUCCEEDED(statement->ExecuteStep(&hasResult)) && hasResult) { - nsCAutoString name; + nsAutoCString name; rv = statement->GetUTF8String(0, name); NS_ENSURE_SUCCESS(rv, rv); if (!_result->AppendElement(name)) @@ -1539,7 +1539,7 @@ nsAnnotationService::CopyPageAnnotations(nsIURI* aSourceURI, while (NS_SUCCEEDED(sourceStmt->ExecuteStep(&hasResult)) && hasResult) { int64_t sourcePlaceId = sourceStmt->AsInt64(0); int64_t annoNameID = sourceStmt->AsInt64(1); - nsCAutoString annoName; + nsAutoCString annoName; rv = sourceStmt->GetUTF8String(2, annoName); NS_ENSURE_SUCCESS(rv, rv); int64_t annoExistsOnDest = sourceStmt->AsInt64(3); @@ -1618,7 +1618,7 @@ nsAnnotationService::CopyItemAnnotations(int64_t aSourceItemId, bool hasResult; while (NS_SUCCEEDED(sourceStmt->ExecuteStep(&hasResult)) && hasResult) { int64_t annoNameID = sourceStmt->AsInt64(0); - nsCAutoString annoName; + nsAutoCString annoName; rv = sourceStmt->GetUTF8String(1, annoName); NS_ENSURE_SUCCESS(rv, rv); int64_t annoExistsOnDest = sourceStmt->AsInt64(2); @@ -1690,11 +1690,11 @@ nsAnnotationService::GetAnnotationURI(nsIURI* aURI, if (aName.IsEmpty()) return NS_ERROR_INVALID_ARG; - nsCAutoString annoSpec; + nsAutoCString annoSpec; nsresult rv = aURI->GetSpec(annoSpec); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; spec.AssignLiteral("moz-anno:"); spec += aName; spec += NS_LITERAL_CSTRING(":"); diff --git a/toolkit/components/places/nsFaviconService.cpp b/toolkit/components/places/nsFaviconService.cpp index e597803f398f..7d5b484813fa 100644 --- a/toolkit/components/places/nsFaviconService.cpp +++ b/toolkit/components/places/nsFaviconService.cpp @@ -278,7 +278,7 @@ nsFaviconService::SetFaviconUrlForPage(nsIURI* aPageURI, nsIURI* aFaviconURI) // Now, link our icon entry with the page. int64_t pageId; - nsCAutoString guid; + nsAutoCString guid; rv = history->GetIdForPage(aPageURI, &pageId, guid); NS_ENSURE_SUCCESS(rv, rv); if (!pageId) { @@ -329,7 +329,7 @@ nsFaviconService::SendFaviconNotifications(nsIURI* aPageURI, nsIURI* aFaviconURI, const nsACString& aGUID) { - nsCAutoString faviconSpec; + nsAutoCString faviconSpec; nsNavHistory* history = nsNavHistory::GetHistoryService(); if (history && NS_SUCCEEDED(aFaviconURI->GetSpec(faviconSpec))) { history->SendPageChangedNotification(aPageURI, @@ -618,7 +618,7 @@ nsFaviconService::ReplaceFaviconDataFromDataURL(nsIURI* aFaviconURI, return rv; } - nsCAutoString mimeType; + nsAutoCString mimeType; rv = channel->GetContentType(mimeType); if (NS_FAILED(rv)) { nsMemory::Free(buffer); @@ -681,7 +681,7 @@ nsFaviconService::SetFaviconDataFromDataURL(nsIURI* aFaviconURI, return rv; } - nsCAutoString mimeType; + nsAutoCString mimeType; rv = channel->GetContentType(mimeType); NS_ENSURE_SUCCESS(rv, rv); @@ -713,7 +713,7 @@ nsFaviconService::GetFaviconData(nsIURI* aFaviconURI, nsACString& aMimeType, // If we're getting the default favicon, we need to handle it separately since // it's not in the database. if (isDefaultFavicon) { - nsCAutoString defaultData; + nsAutoCString defaultData; rv = GetDefaultFaviconData(defaultData); NS_ENSURE_SUCCESS(rv, rv); @@ -782,7 +782,7 @@ nsFaviconService::GetFaviconDataAsDataURL(nsIURI* aFaviconURI, uint8_t* data; uint32_t dataLen; - nsCAutoString mimeType; + nsAutoCString mimeType; nsresult rv = GetFaviconData(aFaviconURI, mimeType, &dataLen, &data); NS_ENSURE_SUCCESS(rv, rv); @@ -830,7 +830,7 @@ nsFaviconService::GetFaviconForPage(nsIURI* aPageURI, nsIURI** _retval) bool hasResult; if (NS_SUCCEEDED(stmt->ExecuteStep(&hasResult)) && hasResult) { - nsCAutoString url; + nsAutoCString url; rv = stmt->GetUTF8String(1, url); NS_ENSURE_SUCCESS(rv, rv); @@ -891,7 +891,7 @@ nsFaviconService::GetFaviconImageForPage(nsIURI* aPageURI, nsIURI** _retval) NS_ENSURE_SUCCESS(rv, rv); if (dataLen > 0) { // this page has a favicon entry with data - nsCAutoString favIconUri; + nsAutoCString favIconUri; rv = stmt->GetUTF8String(1, favIconUri); NS_ENSURE_SUCCESS(rv, rv); @@ -911,7 +911,7 @@ nsFaviconService::GetFaviconLinkForIcon(nsIURI* aFaviconURI, NS_ENSURE_ARG(aFaviconURI); NS_ENSURE_ARG_POINTER(aOutputURI); - nsCAutoString spec; + nsAutoCString spec; if (aFaviconURI) { nsresult rv = aFaviconURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -937,7 +937,7 @@ nsFaviconService::AddFailedFavicon(nsIURI* aFaviconURI) { NS_ENSURE_ARG(aFaviconURI); - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aFaviconURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -960,7 +960,7 @@ nsFaviconService::RemoveFailedFavicon(nsIURI* aFaviconURI) { NS_ENSURE_ARG(aFaviconURI); - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aFaviconURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -974,7 +974,7 @@ NS_IMETHODIMP nsFaviconService::IsFailedFavicon(nsIURI* aFaviconURI, bool* _retval) { NS_ENSURE_ARG(aFaviconURI); - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aFaviconURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -1009,7 +1009,7 @@ nsFaviconService::GetFaviconLinkForIconString(const nsCString& aSpec, return NS_NewURI(aOutput, aSpec); } - nsCAutoString annoUri; + nsAutoCString annoUri; annoUri.AssignLiteral("moz-anno:" FAVICON_ANNOTATION_NAME ":"); annoUri += aSpec; return NS_NewURI(aOutput, annoUri); diff --git a/toolkit/components/places/nsNavBookmarks.cpp b/toolkit/components/places/nsNavBookmarks.cpp index 9082d7aa23fd..063bf364bc7a 100644 --- a/toolkit/components/places/nsNavBookmarks.cpp +++ b/toolkit/components/places/nsNavBookmarks.cpp @@ -285,7 +285,7 @@ nsNavBookmarks::ReadRoots() bool hasResult; while (NS_SUCCEEDED(stmt->ExecuteStep(&hasResult)) && hasResult) { - nsCAutoString rootName; + nsAutoCString rootName; rv = stmt->GetUTF8String(0, rootName); NS_ENSURE_SUCCESS(rv, rv); int64_t rootId; @@ -564,14 +564,14 @@ nsNavBookmarks::InsertBookmark(int64_t aFolder, nsNavHistory* history = nsNavHistory::GetHistoryService(); NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY); int64_t placeId; - nsCAutoString placeGuid; + nsAutoCString placeGuid; nsresult rv = history->GetOrCreateIdForPage(aURI, &placeId, placeGuid); NS_ENSURE_SUCCESS(rv, rv); // Get the correct index for insertion. This also ensures the parent exists. int32_t index, folderCount; int64_t grandParentId; - nsCAutoString folderGuid; + nsAutoCString folderGuid; rv = FetchFolderInfo(aFolder, &folderCount, folderGuid, &grandParentId); NS_ENSURE_SUCCESS(rv, rv); if (aIndex == nsINavBookmarksService::DEFAULT_INDEX || @@ -587,7 +587,7 @@ nsNavBookmarks::InsertBookmark(int64_t aFolder, *aNewBookmarkId = -1; PRTime dateAdded = PR_Now(); - nsCAutoString guid; + nsAutoCString guid; nsCString title; TruncateTitle(aTitle, title); @@ -832,7 +832,7 @@ nsNavBookmarks::CreateContainerWithID(int64_t aItemId, // Get the correct index for insertion. This also ensures the parent exists. int32_t index, folderCount; int64_t grandParentId; - nsCAutoString folderGuid; + nsAutoCString folderGuid; nsresult rv = FetchFolderInfo(aParent, &folderCount, folderGuid, &grandParentId); NS_ENSURE_SUCCESS(rv, rv); @@ -850,7 +850,7 @@ nsNavBookmarks::CreateContainerWithID(int64_t aItemId, *aNewFolder = aItemId; PRTime dateAdded = PR_Now(); - nsCAutoString guid; + nsAutoCString guid; nsCString title; TruncateTitle(aTitle, title); @@ -884,7 +884,7 @@ nsNavBookmarks::InsertSeparator(int64_t aParent, // Get the correct index for insertion. This also ensures the parent exists. int32_t index, folderCount; int64_t grandParentId; - nsCAutoString folderGuid; + nsAutoCString folderGuid; nsresult rv = FetchFolderInfo(aParent, &folderCount, folderGuid, &grandParentId); NS_ENSURE_SUCCESS(rv, rv); @@ -905,7 +905,7 @@ nsNavBookmarks::InsertSeparator(int64_t aParent, // Set a NULL title rather than an empty string. nsCString voidString; voidString.SetIsVoid(true); - nsCAutoString guid; + nsAutoCString guid; PRTime dateAdded = PR_Now(); rv = InsertBookmarkInDB(-1, SEPARATOR, aParent, index, voidString, dateAdded, 0, folderGuid, grandParentId, nullptr, @@ -1312,7 +1312,7 @@ nsNavBookmarks::MoveItem(int64_t aItemId, int64_t aNewParent, int32_t aIndex) // calculate new index int32_t newIndex, folderCount; int64_t grandParentId; - nsCAutoString newParentGuid; + nsAutoCString newParentGuid; rv = FetchFolderInfo(aNewParent, &folderCount, newParentGuid, &grandParentId); NS_ENSURE_SUCCESS(rv, rv); if (aIndex == nsINavBookmarksService::DEFAULT_INDEX || @@ -1862,7 +1862,7 @@ nsNavBookmarks::ProcessFolderNodeRow( return NS_OK; } - nsCAutoString title; + nsAutoCString title; rv = aRow->GetUTF8String(nsNavHistory::kGetInfoIndex_Title, title); NS_ENSURE_SUCCESS(rv, rv); @@ -2023,7 +2023,7 @@ nsNavBookmarks::GetBookmarkedURIFor(nsIURI* aURI, nsIURI** _retval) nsNavHistory* history = nsNavHistory::GetHistoryService(); NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY); int64_t placeId; - nsCAutoString placeGuid; + nsAutoCString placeGuid; nsresult rv = history->GetIdForPage(aURI, &placeId, placeGuid); NS_ENSURE_SUCCESS(rv, rv); if (!placeId) { @@ -2088,7 +2088,7 @@ nsNavBookmarks::GetBookmarkedURIFor(nsIURI* aURI, nsIURI** _retval) bool hasBookmarkedOrigin; if (NS_SUCCEEDED(stmt->ExecuteStep(&hasBookmarkedOrigin)) && hasBookmarkedOrigin) { - nsCAutoString spec; + nsAutoCString spec; rv = stmt->GetUTF8String(0, spec); NS_ENSURE_SUCCESS(rv, rv); rv = NS_NewURI(_retval, spec); @@ -2116,7 +2116,7 @@ nsNavBookmarks::ChangeBookmarkURI(int64_t aBookmarkId, nsIURI* aNewURI) nsNavHistory* history = nsNavHistory::GetHistoryService(); NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY); int64_t newPlaceId; - nsCAutoString newPlaceGuid; + nsAutoCString newPlaceGuid; rv = history->GetOrCreateIdForPage(aNewURI, &newPlaceId, newPlaceGuid); NS_ENSURE_SUCCESS(rv, rv); if (!newPlaceId) @@ -2155,7 +2155,7 @@ nsNavBookmarks::ChangeBookmarkURI(int64_t aBookmarkId, nsIURI* aNewURI) rv = history->UpdateFrecency(bookmark.placeId); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = aNewURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -2352,7 +2352,7 @@ nsNavBookmarks::SetItemIndex(int64_t aItemId, int32_t aNewIndex) // Ensure we are not going out of range. int32_t folderCount; int64_t grandParentId; - nsCAutoString folderGuid; + nsAutoCString folderGuid; rv = FetchFolderInfo(bookmark.parentId, &folderCount, folderGuid, &grandParentId); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(aNewIndex < folderCount, NS_ERROR_INVALID_ARG); @@ -2811,7 +2811,7 @@ nsNavBookmarks::OnDeleteURI(nsIURI* aURI, #ifdef DEBUG nsNavHistory* history = nsNavHistory::GetHistoryService(); int64_t placeId; - nsCAutoString placeGuid; + nsAutoCString placeGuid; NS_ABORT_IF_FALSE( history && NS_SUCCEEDED(history->GetIdForPage(aURI, &placeId, placeGuid)) && !placeId, "OnDeleteURI was notified for a page that still exists?" diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index 1b3472e74a84..7e51163f426e 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -344,7 +344,7 @@ uint32_t nsNavHistory::GetRecentFlags(nsIURI *aURI) { uint32_t result = 0; - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Unable to get aURI's spec"); @@ -470,7 +470,7 @@ nsNavHistory::InternalAddNewPage(nsIURI* aURI, NS_ENSURE_SUCCESS(rv, rv); rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("typed"), aTyped); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("frecency"), @@ -1013,12 +1013,12 @@ nsNavHistory::EvaluateQueryForNode(const nsCOMArray& aQueries if (NS_FAILED(NS_NewURI(getter_AddRefs(nodeUri), aNode->mURI))) continue; } - nsCAutoString asciiRequest; + nsAutoCString asciiRequest; if (NS_FAILED(AsciiHostNameFromHostString(query->Domain(), asciiRequest))) continue; if (query->DomainIsHost()) { - nsCAutoString host; + nsAutoCString host; if (NS_FAILED(nodeUri->GetAsciiHost(host))) continue; @@ -1026,7 +1026,7 @@ nsNavHistory::EvaluateQueryForNode(const nsCOMArray& aQueries continue; // host names don't match } // check domain names - nsCAutoString domain; + nsAutoCString domain; DomainNameFromURI(nodeUri, domain); if (! asciiRequest.Equals(domain)) continue; // domain names don't match @@ -1049,9 +1049,9 @@ nsNavHistory::EvaluateQueryForNode(const nsCOMArray& aQueries // harder case: match prefix, note that we need to get the ASCII string // from the node's parsed URI instead of using the node's mUrl string, // because that might not be normalized - nsCAutoString nodeUriString; + nsAutoCString nodeUriString; nodeUri->GetAsciiSpec(nodeUriString); - nsCAutoString queryUriString; + nsAutoCString queryUriString; query->Uri()->GetAsciiSpec(queryUriString); if (queryUriString.Length() > nodeUriString.Length()) continue; // not long enough to match as prefix @@ -1083,7 +1083,7 @@ nsNavHistory::AsciiHostNameFromHostString(const nsACString& aHostName, nsACString& aAscii) { // To properly generate a uri we must provide a protocol. - nsCAutoString fakeURL("http://"); + nsAutoCString fakeURL("http://"); fakeURL.Append(aHostName); nsCOMPtr uri; nsresult rv = NS_NewURI(getter_AddRefs(uri), fakeURL); @@ -1151,7 +1151,7 @@ nsresult nsNavHistory::invalidateFrecencies(const nsCString& aPlaceIdsQueryString) { // Exclude place: queries by setting their frecency to zero. - nsCAutoString invalideFrecenciesSQLFragment( + nsAutoCString invalideFrecenciesSQLFragment( "UPDATE moz_places SET frecency = (CASE " "WHEN url BETWEEN 'place:' AND 'place;' " "THEN 0 " @@ -1196,7 +1196,7 @@ nsNavHistory::MarkPageAsFollowedBookmark(nsIURI* aURI) if (IsHistoryDisabled()) return NS_OK; - nsCAutoString uriString; + nsAutoCString uriString; nsresult rv = aURI->GetSpec(uriString); NS_ENSURE_SUCCESS(rv, rv); @@ -1234,7 +1234,7 @@ nsNavHistory::CanAddURI(nsIURI* aURI, bool* canAdd) return NS_OK; } - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = aURI->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); @@ -1321,7 +1321,7 @@ nsNavHistory::AddVisit(nsIURI* aURI, PRTime aTime, nsIURI* aReferringURI, rv = stmt->ExecuteStep(&alreadyVisited); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString guid; + nsAutoCString guid; int64_t pageID = 0; int32_t hidden; int32_t typed; @@ -1796,7 +1796,7 @@ PlacesSQLQueryBuilder::SelectAsURI() { nsNavHistory *history = nsNavHistory::GetHistoryService(); NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY); - nsCAutoString tagsSqlFragment; + nsAutoCString tagsSqlFragment; switch (mQueryType) { case nsINavHistoryQueryOptions::QUERY_TYPE_HISTORY: @@ -1882,7 +1882,7 @@ PlacesSQLQueryBuilder::SelectAsVisit() { nsNavHistory *history = nsNavHistory::GetHistoryService(); NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY); - nsCAutoString tagsSqlFragment; + nsAutoCString tagsSqlFragment; GetTagsSqlFragment(history->GetTagsFolder(), NS_LITERAL_CSTRING("h.id"), mHasSearchTerms, @@ -1935,16 +1935,16 @@ PlacesSQLQueryBuilder::SelectAsDay() int32_t daysOfHistory = history->GetDaysOfHistory(); for (int32_t i = 0; i <= HISTORY_DATE_CONT_NUM(daysOfHistory); i++) { - nsCAutoString dateName; + nsAutoCString dateName; // Timeframes are calculated as BeginTime <= container < EndTime. // Notice times can't be relative to now, since to recognize a query we // must ensure it won't change based on the time it is built. // So, to select till now, we really select till start of tomorrow, that is // a fixed timestamp. // These are used as limits for the inside containers. - nsCAutoString sqlFragmentContainerBeginTime, sqlFragmentContainerEndTime; + nsAutoCString sqlFragmentContainerBeginTime, sqlFragmentContainerEndTime; // These are used to query if the container should be visible. - nsCAutoString sqlFragmentSearchBeginTime, sqlFragmentSearchEndTime; + nsAutoCString sqlFragmentSearchBeginTime, sqlFragmentSearchEndTime; switch(i) { case 0: // Today @@ -2105,7 +2105,7 @@ PlacesSQLQueryBuilder::SelectAsDay() nsresult PlacesSQLQueryBuilder::SelectAsSite() { - nsCAutoString localFiles; + nsAutoCString localFiles; nsNavHistory *history = nsNavHistory::GetHistoryService(); NS_ENSURE_STATE(history); @@ -2114,9 +2114,9 @@ PlacesSQLQueryBuilder::SelectAsSite() mAddParams.Put(NS_LITERAL_CSTRING("localhost"), localFiles); // If there are additional conditions the query has to join on visits too. - nsCAutoString visitsJoin; - nsCAutoString additionalConditions; - nsCAutoString timeConstraints; + nsAutoCString visitsJoin; + nsAutoCString additionalConditions; + nsAutoCString timeConstraints; if (!mConditions.IsEmpty()) { visitsJoin.AssignLiteral("JOIN moz_historyvisits v ON v.place_id = h.id "); additionalConditions.AssignLiteral("{QUERY_OPTIONS_VISITS} " @@ -2197,8 +2197,8 @@ PlacesSQLQueryBuilder::Where() { // Set query options - nsCAutoString additionalVisitsConditions; - nsCAutoString additionalPlacesConditions; + nsAutoCString additionalVisitsConditions; + nsAutoCString additionalPlacesConditions; if (!mIncludeHidden) { additionalPlacesConditions += NS_LITERAL_CSTRING("AND hidden = 0 "); @@ -2215,7 +2215,7 @@ PlacesSQLQueryBuilder::Where() if (mResultType == nsINavHistoryQueryOptions::RESULTS_AS_URI && !additionalVisitsConditions.IsEmpty()) { // URI results don't join on visits. - nsCAutoString tmp = additionalVisitsConditions; + nsAutoCString tmp = additionalVisitsConditions; additionalVisitsConditions = "AND EXISTS (SELECT 1 FROM moz_historyvisits WHERE place_id = h.id "; additionalVisitsConditions.Append(tmp); additionalVisitsConditions.Append("LIMIT 1)"); @@ -2229,7 +2229,7 @@ PlacesSQLQueryBuilder::Where() // If we used WHERE already, we inject the conditions // in place of {ADDITIONAL_CONDITIONS} if (mQueryString.Find("{ADDITIONAL_CONDITIONS}", 0) != kNotFound) { - nsCAutoString innerCondition; + nsAutoCString innerCondition; // If we have condition AND it if (!mConditions.IsEmpty()) { innerCondition = " AND ("; @@ -2400,7 +2400,7 @@ nsNavHistory::ConstructQueryString( aQueries[i]->GetHasSearchTerms(&hasSearchTerms); } - nsCAutoString tagsSqlFragment; + nsAutoCString tagsSqlFragment; GetTagsSqlFragment(GetTagsFolder(), NS_LITERAL_CSTRING("h.id"), hasSearchTerms, @@ -2437,14 +2437,14 @@ nsNavHistory::ConstructQueryString( queryString.Append(NS_LITERAL_CSTRING("LIMIT ")); queryString.AppendInt(aOptions->MaxResults()); - nsCAutoString additionalQueryOptions; + nsAutoCString additionalQueryOptions; queryString.ReplaceSubstring("{QUERY_OPTIONS}", additionalQueryOptions.get()); return NS_OK; } - nsCAutoString conditions; + nsAutoCString conditions; for (int32_t i = 0; i < aQueries.Count(); i++) { nsCString queryClause; rv = QueryToSelectClause(aQueries[i], aOptions, i, &queryClause); @@ -2522,7 +2522,7 @@ nsNavHistory::GetQueryResults(nsNavHistoryQueryResultNode *aResultNode, nsCOMPtr statement = mDB->GetStatement(queryString); #ifdef DEBUG if (!statement) { - nsCAutoString lastErrorString; + nsAutoCString lastErrorString; (void)mDB->MainConn()->GetLastErrorString(lastErrorString); int32_t lastError = 0; (void)mDB->MainConn()->GetLastError(&lastError); @@ -2714,7 +2714,7 @@ nsNavHistory::CleanupPlacesOnVisitsDelete(const nsCString& aPlaceIdsQueryString) int64_t placeId; nsresult rv = stmt->GetInt64(0, &placeId); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString URLString; + nsAutoCString URLString; rv = stmt->GetUTF8String(1, URLString); nsCString guid; rv = stmt->GetUTF8String(2, guid); @@ -2789,7 +2789,7 @@ nsNavHistory::RemovePages(nsIURI **aURIs, uint32_t aLength) nsCString deletePlaceIdsQueryString; for (uint32_t i = 0; i < aLength; i++) { int64_t placeId; - nsCAutoString guid; + nsAutoCString guid; rv = GetIdForPage(aURIs[i], &placeId, guid); NS_ENSURE_SUCCESS(rv, rv); if (placeId != 0) { @@ -2824,13 +2824,13 @@ nsNavHistory::RemovePage(nsIURI *aURI) // Build a list of place ids to delete. int64_t placeId; - nsCAutoString guid; + nsAutoCString guid; nsresult rv = GetIdForPage(aURI, &placeId, guid); NS_ENSURE_SUCCESS(rv, rv); if (placeId == 0) { return NS_OK; } - nsCAutoString deletePlaceIdQueryString; + nsAutoCString deletePlaceIdQueryString; deletePlaceIdQueryString.AppendInt(placeId); rv = RemovePagesInternal(deletePlaceIdQueryString); @@ -2890,7 +2890,7 @@ nsNavHistory::RemovePagesFromHost(const nsACString& aHost, bool aEntireDomain) revHostSlash.Append(NS_LITERAL_STRING("/")); // build condition string based on host selection type - nsCAutoString conditionString; + nsAutoCString conditionString; if (aEntireDomain) conditionString.AssignLiteral("rev_host >= ?1 AND rev_host < ?2 "); else @@ -3134,7 +3134,7 @@ nsNavHistory::MarkPageAsTyped(nsIURI *aURI) if (IsHistoryDisabled()) return NS_OK; - nsCAutoString uriString; + nsAutoCString uriString; nsresult rv = aURI->GetSpec(uriString); NS_ENSURE_SUCCESS(rv, rv); @@ -3168,7 +3168,7 @@ nsNavHistory::MarkPageAsFollowedLink(nsIURI *aURI) if (IsHistoryDisabled()) return NS_OK; - nsCAutoString uriString; + nsAutoCString uriString; nsresult rv = aURI->GetSpec(uriString); NS_ENSURE_SUCCESS(rv, rv); @@ -3319,7 +3319,7 @@ nsNavHistory::AddVisitChain(nsIURI* aURI, // overwritten later if needed. nsCOMPtr fromVisitURI = aReferrerURI; - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -3424,7 +3424,7 @@ nsNavHistory::IsVisited(nsIURI *aURI, bool *_retval) return NS_OK; } - nsCAutoString utf8URISpec; + nsAutoCString utf8URISpec; nsresult rv = aURI->GetSpec(utf8URISpec); NS_ENSURE_SUCCESS(rv, rv); @@ -3594,7 +3594,7 @@ nsNavHistory::AsyncExecuteLegacyQueries(nsINavHistoryQuery** aQueries, #ifdef DEBUG if (NS_FAILED(rv)) { - nsCAutoString lastErrorString; + nsAutoCString lastErrorString; (void)mDB->MainConn()->GetLastErrorString(lastErrorString); int32_t lastError = 0; (void)mDB->MainConn()->GetLastError(&lastError); @@ -4013,7 +4013,7 @@ nsNavHistory::BindQueryClauseParameters(mozIStorageBaseStatement* statement, // Append numbered index to param names, to replace them correctly in // case of multiple queries. If we have just one query we don't change the // param name though. - nsCAutoString qIndex; + nsAutoCString qIndex; if (aQueryIndex > 0) qIndex.AppendInt(aQueryIndex); @@ -4097,7 +4097,7 @@ nsNavHistory::BindQueryClauseParameters(mozIStorageBaseStatement* statement, ); NS_ENSURE_SUCCESS(rv, rv); if (aQuery->UriIsPrefix()) { - nsCAutoString uriString; + nsAutoCString uriString; aQuery->Uri()->GetSpec(uriString); uriString.Append(char(0x7F)); // MAX_UTF8 rv = URIBinder::Bind( @@ -4182,7 +4182,7 @@ nsresult CreatePlacesPersistURN(nsNavHistoryQueryResultNode *aResultNode, int64_t aValue, const nsCString& aTitle, nsCString& aURN) { - nsCAutoString uri; + nsAutoCString uri; nsresult rv = aResultNode->GetUri(uri); NS_ENSURE_SUCCESS(rv, rv); @@ -4195,7 +4195,7 @@ CreatePlacesPersistURN(nsNavHistoryQueryResultNode *aResultNode, aURN.Append(NS_LITERAL_CSTRING(",")); if (!aTitle.IsEmpty()) { - nsCAutoString escapedTitle; + nsAutoCString escapedTitle; bool success = NS_Escape(aTitle, escapedTitle, url_XAlphas); NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY); aURN.Append(escapedTitle); @@ -4273,7 +4273,7 @@ nsNavHistory::FilterResultSet(nsNavHistoryQueryResultNode* aQueryNode, // Convert title and url for the current node to UTF16 strings. NS_ConvertUTF8toUTF16 nodeTitle(aSet[nodeIndex]->mTitle); // Unescape the URL for search terms matching. - nsCAutoString cNodeURL(aSet[nodeIndex]->mURI); + nsAutoCString cNodeURL(aSet[nodeIndex]->mURI); NS_ConvertUTF8toUTF16 nodeURL(NS_UnescapeURL(cNodeURL)); // Determine if every search term matches anywhere in the title, url or @@ -4404,12 +4404,12 @@ nsNavHistory::RowToResult(mozIStorageValueArray* aRow, *aResult = nullptr; // URL - nsCAutoString url; + nsAutoCString url; nsresult rv = aRow->GetUTF8String(kGetInfoIndex_URL, url); NS_ENSURE_SUCCESS(rv, rv); // title - nsCAutoString title; + nsAutoCString title; rv = aRow->GetUTF8String(kGetInfoIndex_Title, title); NS_ENSURE_SUCCESS(rv, rv); @@ -4417,7 +4417,7 @@ nsNavHistory::RowToResult(mozIStorageValueArray* aRow, PRTime time = aRow->AsInt64(kGetInfoIndex_VisitDate); // favicon - nsCAutoString favicon; + nsAutoCString favicon; rv = aRow->GetUTF8String(kGetInfoIndex_FaviconURL, favicon); NS_ENSURE_SUCCESS(rv, rv); @@ -4592,7 +4592,7 @@ nsNavHistory::VisitIdToResultNode(int64_t visitId, nsNavHistoryQueryOptions* aOptions, nsNavHistoryResultNode** aResult) { - nsCAutoString tagsFragment; + nsAutoCString tagsFragment; GetTagsSqlFragment(GetTagsFolder(), NS_LITERAL_CSTRING("h.id"), true, tagsFragment); @@ -4658,7 +4658,7 @@ nsresult nsNavHistory::BookmarkIdToResultNode(int64_t aBookmarkId, nsNavHistoryQueryOptions* aOptions, nsNavHistoryResultNode** aResult) { - nsCAutoString tagsFragment; + nsAutoCString tagsFragment; GetTagsSqlFragment(GetTagsFolder(), NS_LITERAL_CSTRING("h.id"), true, tagsFragment); // Should match kGetInfoIndex_* @@ -4698,7 +4698,7 @@ nsNavHistory::URIToResultNode(nsIURI* aURI, nsNavHistoryQueryOptions* aOptions, nsNavHistoryResultNode** aResult) { - nsCAutoString tagsFragment; + nsAutoCString tagsFragment; GetTagsSqlFragment(GetTagsFolder(), NS_LITERAL_CSTRING("h.id"), true, tagsFragment); // Should match kGetInfoIndex_* @@ -4817,7 +4817,7 @@ nsNavHistory::GetMonthYear(int32_t aMonth, int32_t aYear, nsACString& aResult) { nsIStringBundle *bundle = GetBundle(); if (bundle) { - nsCAutoString monthName; + nsAutoCString monthName; GetMonthName(aMonth, monthName); nsAutoString yearString; yearString.AppendInt(aYear); @@ -4853,7 +4853,7 @@ nsNavHistory::SetPageTitleInternal(nsIURI* aURI, const nsAString& aTitle) // Make sure the page exists by fetching its GUID and the old title. nsAutoString title; - nsCAutoString guid; + nsAutoCString guid; { nsCOMPtr stmt = mDB->GetStatement( "SELECT id, url, title, rev_host, visit_count, guid " diff --git a/toolkit/components/places/nsNavHistory.h b/toolkit/components/places/nsNavHistory.h index 4a4be03c6aea..f60207d9dbff 100644 --- a/toolkit/components/places/nsNavHistory.h +++ b/toolkit/components/places/nsNavHistory.h @@ -460,7 +460,7 @@ protected: */ nsresult DecayFrecency(); - nsresult CalculateFrecency(int64_t aPageID, int32_t aTyped, int32_t aVisitCount, nsCAutoString &aURL, int32_t *aFrecency); + nsresult CalculateFrecency(int64_t aPageID, int32_t aTyped, int32_t aVisitCount, nsAutoCString &aURL, int32_t *aFrecency); nsresult CalculateFrecencyInternal(int64_t aPageID, int32_t aTyped, int32_t aVisitCount, bool aIsBookmarked, int32_t *aFrecency); nsresult RemovePagesInternal(const nsCString& aPlaceIdsQueryString); diff --git a/toolkit/components/places/nsNavHistoryQuery.cpp b/toolkit/components/places/nsNavHistoryQuery.cpp index ead4f15e3f5e..2ca670a8edc5 100644 --- a/toolkit/components/places/nsNavHistoryQuery.cpp +++ b/toolkit/components/places/nsNavHistoryQuery.cpp @@ -150,13 +150,13 @@ inline void AppendAmpersandIfNonempty(nsACString& aString) } inline void AppendInt16(nsACString& str, int16_t i) { - nsCAutoString tmp; + nsAutoCString tmp; tmp.AppendInt(i); str.Append(tmp); } inline void AppendInt32(nsACString& str, int32_t i) { - nsCAutoString tmp; + nsAutoCString tmp; tmp.AppendInt(i); str.Append(tmp); } @@ -339,7 +339,7 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, nsCOMPtr options = do_QueryInterface(aOptions); NS_ENSURE_TRUE(options, NS_ERROR_INVALID_ARG); - nsCAutoString queryString; + nsAutoCString queryString; for (uint32_t queryIndex = 0; queryIndex < aQueryCount; queryIndex ++) { nsCOMPtr query = do_QueryInterface(aQueries[queryIndex]); if (queryIndex > 0) { @@ -414,7 +414,7 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, AppendBoolKeyValueIfTrue(queryString, NS_LITERAL_CSTRING(QUERYKEY_DOMAIN_IS_HOST), query, &nsINavHistoryQuery::GetDomainIsHost); - nsCAutoString domain; + nsAutoCString domain; nsresult rv = query->GetDomain(domain); NS_ENSURE_SUCCESS(rv, rv); nsCString escapedDomain; @@ -435,10 +435,10 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, nsCOMPtr uri; query->GetUri(getter_AddRefs(uri)); NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); // hasURI should tell is if invalid - nsCAutoString uriSpec; + nsAutoCString uriSpec; nsresult rv = uri->GetSpec(uriSpec); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString escaped; + nsAutoCString escaped; bool success = NS_Escape(uriSpec, escaped, url_XAlphas); NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY); @@ -457,9 +457,9 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, queryString.AppendLiteral(QUERYKEY_NOTANNOTATION "="); else queryString.AppendLiteral(QUERYKEY_ANNOTATION "="); - nsCAutoString annot; + nsAutoCString annot; query->GetAnnotation(annot); - nsCAutoString escaped; + nsAutoCString escaped; bool success = NS_Escape(annot, escaped, url_XAlphas); NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY); queryString.Append(escaped); @@ -479,7 +479,7 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, // tags const nsTArray &tags = query->Tags(); for (uint32_t i = 0; i < tags.Length(); ++i) { - nsCAutoString escapedTag; + nsAutoCString escapedTag; if (!NS_Escape(NS_ConvertUTF16toUTF8(tags[i]), escapedTag, url_XAlphas)) return NS_ERROR_OUT_OF_MEMORY; @@ -509,7 +509,7 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, if (options->SortingMode() == nsINavHistoryQueryOptions::SORT_BY_ANNOTATION_DESCENDING || options->SortingMode() == nsINavHistoryQueryOptions::SORT_BY_ANNOTATION_ASCENDING) { // sortingAnnotation - nsCAutoString sortingAnnotation; + nsAutoCString sortingAnnotation; if (NS_SUCCEEDED(options->GetSortingAnnotation(sortingAnnotation))) { nsCString escaped; if (!NS_Escape(sortingAnnotation, escaped, url_XAlphas)) @@ -696,7 +696,7 @@ nsNavHistory::TokensToQueries(const nsTArray& aTokens, // domain string } else if (kvp.key.EqualsLiteral(QUERYKEY_DOMAIN)) { - nsCAutoString unescapedDomain(kvp.value); + nsAutoCString unescapedDomain(kvp.value); NS_UnescapeURL(unescapedDomain); // modifies input rv = query->SetDomain(unescapedDomain); NS_ENSURE_SUCCESS(rv, rv); @@ -716,7 +716,7 @@ nsNavHistory::TokensToQueries(const nsTArray& aTokens, // uri } else if (kvp.key.EqualsLiteral(QUERYKEY_URI)) { - nsCAutoString unescapedUri(kvp.value); + nsAutoCString unescapedUri(kvp.value); NS_UnescapeURL(unescapedUri); // modifies input nsCOMPtr uri; nsresult rv = NS_NewURI(getter_AddRefs(uri), unescapedUri); @@ -732,21 +732,21 @@ nsNavHistory::TokensToQueries(const nsTArray& aTokens, // not annotation } else if (kvp.key.EqualsLiteral(QUERYKEY_NOTANNOTATION)) { - nsCAutoString unescaped(kvp.value); + nsAutoCString unescaped(kvp.value); NS_UnescapeURL(unescaped); // modifies input query->SetAnnotationIsNot(true); query->SetAnnotation(unescaped); // annotation } else if (kvp.key.EqualsLiteral(QUERYKEY_ANNOTATION)) { - nsCAutoString unescaped(kvp.value); + nsAutoCString unescaped(kvp.value); NS_UnescapeURL(unescaped); // modifies input query->SetAnnotationIsNot(false); query->SetAnnotation(unescaped); // tag } else if (kvp.key.EqualsLiteral(QUERYKEY_TAG)) { - nsCAutoString unescaped(kvp.value); + nsAutoCString unescaped(kvp.value); NS_UnescapeURL(unescaped); // modifies input NS_ConvertUTF8toUTF16 tag(unescaped); if (!tags.Contains(tag)) { @@ -1589,7 +1589,7 @@ AppendUint32KeyValueIfNonzero(nsACString& aString, aString += aName; // AppendInt requires a concrete string - nsCAutoString appendMe("="); + nsAutoCString appendMe("="); appendMe.AppendInt(value); aString.Append(appendMe); } @@ -1610,7 +1610,7 @@ AppendInt64KeyValueIfNonzero(nsACString& aString, if (value) { AppendAmpersandIfNonempty(aString); aString += aName; - nsCAutoString appendMe("="); + nsAutoCString appendMe("="); appendMe.AppendInt(static_cast(value)); aString.Append(appendMe); } diff --git a/toolkit/components/places/nsNavHistoryResult.cpp b/toolkit/components/places/nsNavHistoryResult.cpp index e3ff008aa57c..5399122722c1 100644 --- a/toolkit/components/places/nsNavHistoryResult.cpp +++ b/toolkit/components/places/nsNavHistoryResult.cpp @@ -1094,7 +1094,7 @@ int32_t nsNavHistoryContainerResultNode::SortComparison_KeywordGreater( int32_t nsNavHistoryContainerResultNode::SortComparison_AnnotationLess( nsNavHistoryResultNode* a, nsNavHistoryResultNode* b, void* closure) { - nsCAutoString annoName(static_cast(closure)); + nsAutoCString annoName(static_cast(closure)); NS_ENSURE_TRUE(!annoName.IsEmpty(), 0); bool a_itemAnno = false; @@ -1105,7 +1105,7 @@ int32_t nsNavHistoryContainerResultNode::SortComparison_AnnotationLess( if (a->mItemId != -1) { a_itemAnno = true; } else { - nsCAutoString spec; + nsAutoCString spec; if (NS_SUCCEEDED(a->GetUri(spec))) NS_NewURI(getter_AddRefs(a_uri), spec); NS_ENSURE_TRUE(a_uri, 0); @@ -1114,7 +1114,7 @@ int32_t nsNavHistoryContainerResultNode::SortComparison_AnnotationLess( if (b->mItemId != -1) { b_itemAnno = true; } else { - nsCAutoString spec; + nsAutoCString spec; if (NS_SUCCEEDED(b->GetUri(spec))) NS_NewURI(getter_AddRefs(b_uri), spec); NS_ENSURE_TRUE(b_uri, 0); @@ -1436,7 +1436,7 @@ nsNavHistoryContainerResultNode::InsertSortedChild( container->FillStats(); } - nsCAutoString sortingAnnotation; + nsAutoCString sortingAnnotation; GetSortingAnnotation(sortingAnnotation); bool itemExists; uint32_t position = FindInsertionPoint(aNode, comparator, @@ -1467,7 +1467,7 @@ nsNavHistoryContainerResultNode::EnsureItemPosition(uint32_t aIndex) { if (!comparator) return false; - nsCAutoString sortAnno; + nsAutoCString sortAnno; GetSortingAnnotation(sortAnno); if (!DoesChildNeedResorting(aIndex, comparator, sortAnno.get())) return false; @@ -1782,7 +1782,7 @@ nsNavHistoryContainerResultNode::ChangeTitles(nsIURI* aURI, bool aOnlyOne) { // uri string - nsCAutoString uriString; + nsAutoCString uriString; nsresult rv = aURI->GetSpec(uriString); NS_ENSURE_SUCCESS(rv, rv); @@ -2299,7 +2299,7 @@ nsNavHistoryQueryResultNode::FillChildren() // then have proper visit counts and dates. SortComparator comparator = GetSortingComparator(GetSortType()); if (comparator) { - nsCAutoString sortingAnnotation; + nsAutoCString sortingAnnotation; GetSortingAnnotation(sortingAnnotation); // Usually containers queries results comes already sorted from the // database, but some locales could have special rules to sort by title. @@ -2561,7 +2561,7 @@ nsNavHistoryQueryResultNode::OnVisit(nsIURI* aURI, int64_t aVisitId, if (!hasDomain) return NS_OK; - nsCAutoString host; + nsAutoCString host; if (NS_FAILED(aURI->GetAsciiHost(host))) return NS_OK; @@ -2687,7 +2687,7 @@ nsNavHistoryQueryResultNode::OnTitleChanged(nsIURI* aURI, if (mHasSearchTerms) { // Find all matching URI nodes. nsCOMArray matches; - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); RecursiveFindURIs(onlyOneEntry, this, spec, &matches); @@ -2769,7 +2769,7 @@ nsNavHistoryQueryResultNode::OnDeleteURI(nsIURI* aURI, nsINavHistoryQueryOptions::RESULTS_AS_URI || mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS); - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -2825,7 +2825,7 @@ nsNavHistoryQueryResultNode::OnPageChanged(nsIURI* aURI, const nsAString& aNewValue, const nsACString& aGUID) { - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -2872,7 +2872,7 @@ nsNavHistoryQueryResultNode::NotifyIfTagsChanged(nsIURI* aURI) { nsNavHistoryResult* result = GetResult(); NS_ENSURE_STATE(result); - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); bool onlyOneEntry = (mOptions->ResultType() == @@ -3361,7 +3361,7 @@ nsNavHistoryFolderResultNode::OnChildrenFilled() // then have proper visit counts and dates. SortComparator comparator = GetSortingComparator(GetSortType()); if (comparator) { - nsCAutoString sortingAnnotation; + nsAutoCString sortingAnnotation; GetSortingAnnotation(sortingAnnotation); RecursiveSort(sortingAnnotation.get(), comparator); } @@ -3691,7 +3691,7 @@ nsNavHistoryFolderResultNode::OnItemAdded(int64_t aItemId, bool isQuery = false; if (aItemType == nsINavBookmarksService::TYPE_BOOKMARK) { NS_ASSERTION(aURI, "Got a null URI when we are a bookmark?!"); - nsCAutoString itemURISpec; + nsAutoCString itemURISpec; rv = aURI->GetSpec(itemURISpec); NS_ENSURE_SUCCESS(rv, rv); isQuery = IsQueryURI(itemURISpec); @@ -4035,7 +4035,7 @@ nsNavHistoryFolderResultNode::OnItemMoved(int64_t aItemId, } else { // moving between two different folders, just do a remove and an add nsCOMPtr itemURI; - nsCAutoString itemTitle; + nsAutoCString itemTitle; if (aItemType == nsINavBookmarksService::TYPE_BOOKMARK) { nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService(); NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY); @@ -4746,12 +4746,12 @@ nsNavHistoryResult::OnVisit(nsIURI* aURI, int64_t aVisitId, PRTime aTime, nsCOMPtr firstChild; rv = mRootNode->GetChild(0, getter_AddRefs(firstChild)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString title; + nsAutoCString title; rv = firstChild->GetTitle(title); NS_ENSURE_SUCCESS(rv, rv); nsNavHistory* history = nsNavHistory::GetHistoryService(); NS_ENSURE_TRUE(history, NS_OK); - nsCAutoString todayLabel; + nsAutoCString todayLabel; history->GetStringFromName( NS_LITERAL_STRING("finduri-AgeInDays-is-0").get(), todayLabel); todayIsMissing = !todayLabel.Equals(title); diff --git a/toolkit/components/places/nsNavHistoryResult.h b/toolkit/components/places/nsNavHistoryResult.h index aa359c5dfb60..d76862eeda0a 100644 --- a/toolkit/components/places/nsNavHistoryResult.h +++ b/toolkit/components/places/nsNavHistoryResult.h @@ -604,7 +604,7 @@ public: // finding children: THESE DO NOT ADDREF nsNavHistoryResultNode* FindChildURI(nsIURI* aURI, uint32_t* aNodeIndex) { - nsCAutoString spec; + nsAutoCString spec; if (NS_FAILED(aURI->GetSpec(spec))) return nullptr; return FindChildURI(spec, aNodeIndex); diff --git a/toolkit/components/places/nsPlacesExportService.cpp b/toolkit/components/places/nsPlacesExportService.cpp index a1167b2eba71..264335341377 100644 --- a/toolkit/components/places/nsPlacesExportService.cpp +++ b/toolkit/components/places/nsPlacesExportService.cpp @@ -279,7 +279,7 @@ WriteFaviconAttribute(const nsACString& aURI, nsIOutputStream* aOutput) nsCOMPtr uri; nsresult rv = NS_NewURI(getter_AddRefs(uri), aURI); if (NS_FAILED(rv)) { - nsCAutoString warnMsg; + nsAutoCString warnMsg; warnMsg.Append("Bookmarks Export: Found invalid favicon '"); warnMsg.Append(aURI); warnMsg.Append("'"); @@ -296,8 +296,8 @@ WriteFaviconAttribute(const nsACString& aURI, nsIOutputStream* aOutput) return NS_OK; // no favicon NS_ENSURE_SUCCESS(rv, rv); // anything else is error - nsCAutoString faviconScheme; - nsCAutoString faviconSpec; + nsAutoCString faviconScheme; + nsAutoCString faviconSpec; rv = faviconURI->GetSpec(faviconSpec); NS_ENSURE_SUCCESS(rv, rv); rv = faviconURI->GetScheme(faviconScheme); @@ -493,7 +493,7 @@ nsPlacesExportService::WriteTitle(nsINavHistoryResultNode* aItem, if (type == nsINavHistoryResultNode::RESULT_TYPE_SEPARATOR) return NS_ERROR_INVALID_ARG; - nsCAutoString title; + nsAutoCString title; rv = aItem->GetTitle(title); NS_ENSURE_SUCCESS(rv, rv); @@ -555,13 +555,13 @@ nsPlacesExportService::WriteItem(nsINavHistoryResultNode* aItem, // before doing any attempt to write the item check that uri is valid, if the // item has a bad uri we skip it silently, otherwise we could stop while // exporting, generating a corrupt file. - nsCAutoString uri; + nsAutoCString uri; nsresult rv = aItem->GetUri(uri); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr pageURI; rv = NS_NewURI(getter_AddRefs(pageURI), uri, nullptr); if (NS_FAILED(rv)) { - nsCAutoString warnMsg; + nsAutoCString warnMsg; warnMsg.Append("Bookmarks Export: Found invalid item uri '"); warnMsg.Append(uri); warnMsg.Append("'"); @@ -681,7 +681,7 @@ nsPlacesExportService::WriteItem(nsINavHistoryResultNode* aItem, NS_ENSURE_SUCCESS(rv, rv); // title - nsCAutoString title; + nsAutoCString title; rv = aItem->GetTitle(title); NS_ENSURE_SUCCESS(rv, rv); char* escapedTitle = nsEscapeHTML(title.get()); @@ -809,7 +809,7 @@ nsPlacesExportService::WriteSeparator(nsINavHistoryResultNode* aItem, // Note: we can't write the separator ID or anything else other than NAME // because it makes Firefox 2.x crash/hang - see bug #381129 - nsCAutoString title; + nsAutoCString title; rv = mBookmarksService->GetItemTitle(itemId, title); if (NS_SUCCEEDED(rv) && !title.IsEmpty()) { rv = aOutput->Write(kNameAttribute, strlen(kNameAttribute), &dummy); @@ -848,7 +848,7 @@ nsPlacesExportService::WriteSeparator(nsINavHistoryResultNode* aItem, nsresult WriteEscapedUrl(const nsCString& aString, nsIOutputStream* aOutput) { - nsCAutoString escaped(aString); + nsAutoCString escaped(aString); int32_t offset; while ((offset = escaped.FindChar('\"')) >= 0) { escaped.Cut(offset, 1); @@ -868,7 +868,7 @@ nsPlacesExportService::WriteContainerContents(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput) { - nsCAutoString myIndent(aIndent); + nsAutoCString myIndent(aIndent); myIndent.Append(kIndent); int64_t folderId; @@ -998,7 +998,7 @@ nsPlacesExportService::ExportHTMLToFile(nsIFile* aBookmarksFile) NS_ENSURE_SUCCESS(rv, rv); // indents - nsCAutoString indent; + nsAutoCString indent; indent.Assign(kIndent); // Bookmarks Menu. diff --git a/toolkit/components/places/tests/cpp/test_IHistory.cpp b/toolkit/components/places/tests/cpp/test_IHistory.cpp index 842b7c15ae6f..daf2a915170c 100644 --- a/toolkit/components/places/tests/cpp/test_IHistory.cpp +++ b/toolkit/components/places/tests/cpp/test_IHistory.cpp @@ -37,7 +37,7 @@ new_test_uri() { // Create a unique spec. static int32_t specNumber = 0; - nsCAutoString spec = NS_LITERAL_CSTRING("http://mozilla.org/"); + nsAutoCString spec = NS_LITERAL_CSTRING("http://mozilla.org/"); spec.AppendInt(specNumber++); // Create the URI for the spec. diff --git a/toolkit/components/remote/nsXRemoteService.cpp b/toolkit/components/remote/nsXRemoteService.cpp index b642764bafd8..dc0208a9d9aa 100644 --- a/toolkit/components/remote/nsXRemoteService.cpp +++ b/toolkit/components/remote/nsXRemoteService.cpp @@ -88,7 +88,7 @@ FindExtensionParameterInCommand(const char* aParameterName, char aSeparator, nsACString* aValue) { - nsCAutoString searchFor; + nsAutoCString searchFor; searchFor.Append(aSeparator); searchFor.Append(aParameterName); searchFor.Append('='); @@ -257,7 +257,7 @@ nsXRemoteService::HandleCommand(char* aCommand, nsIDOMWindow* aWindow, // 1) Make sure that it looks remotely valid with parens // 2) Treat ping() immediately and specially - nsCAutoString command(aCommand); + nsAutoCString command(aCommand); int32_t p1, p2; p1 = command.FindChar('('); p2 = command.FindChar(')'); @@ -271,7 +271,7 @@ nsXRemoteService::HandleCommand(char* aCommand, nsIDOMWindow* aWindow, ToLowerCase(command); if (!command.EqualsLiteral("ping")) { - nsCAutoString desktopStartupID; + nsAutoCString desktopStartupID; nsDependentCString cmd(aCommand); FindExtensionParameterInCommand("DESKTOP_STARTUP_ID", cmd, '\n', @@ -324,7 +324,7 @@ nsXRemoteService::HandleCommandLine(char* aBuffer, nsIDOMWindow* aWindow, if (NS_FAILED(rv)) return "509 internal error"; - nsCAutoString desktopStartupID; + nsAutoCString desktopStartupID; char **argv = (char**) malloc(sizeof(char*) * argc); if (!argv) return "509 internal error"; diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 057f688f8e8a..4891f87d0809 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -296,7 +296,7 @@ GetShutdownTimeFileName() return NULL; mozFile->AppendNative(NS_LITERAL_CSTRING("Telemetry.ShutdownTime.txt")); - nsCAutoString nativePath; + nsAutoCString nativePath; nsresult rv = mozFile->GetNativePath(nativePath); if (!NS_SUCCEEDED(rv)) return NULL; diff --git a/toolkit/components/startup/nsUserInfoMac.mm b/toolkit/components/startup/nsUserInfoMac.mm index 64fd7b4e95a8..21f1582b2549 100644 --- a/toolkit/components/startup/nsUserInfoMac.mm +++ b/toolkit/components/startup/nsUserInfoMac.mm @@ -32,7 +32,7 @@ nsUserInfo::GetUsername(char **aUsername) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT - nsCAutoString username([NSUserName() UTF8String]); + nsAutoCString username([NSUserName() UTF8String]); *aUsername = ToNewCString(username); return NS_OK; @@ -63,7 +63,7 @@ nsUserInfo::GetPrimaryEmailAddress(nsCString &aEmailAddress) NS_IMETHODIMP nsUserInfo::GetEmailAddress(char **aEmailAddress) { - nsCAutoString email; + nsAutoCString email; if (NS_SUCCEEDED(GetPrimaryEmailAddress(email))) *aEmailAddress = ToNewCString(email); return NS_OK; @@ -72,7 +72,7 @@ nsUserInfo::GetEmailAddress(char **aEmailAddress) NS_IMETHODIMP nsUserInfo::GetDomain(char **aDomain) { - nsCAutoString email; + nsAutoCString email; if (NS_SUCCEEDED(GetPrimaryEmailAddress(email))) { int32_t index = email.FindChar('@'); if (index != -1) { diff --git a/toolkit/components/startup/nsUserInfoUnix.cpp b/toolkit/components/startup/nsUserInfoUnix.cpp index 0813c46f52f3..8d1a9e97f65f 100644 --- a/toolkit/components/startup/nsUserInfoUnix.cpp +++ b/toolkit/components/startup/nsUserInfoUnix.cpp @@ -46,7 +46,7 @@ nsUserInfo::GetFullname(PRUnichar **aFullname) printf("fullname = %s\n", pw->PW_GECOS); #endif - nsCAutoString fullname(pw->PW_GECOS); + nsAutoCString fullname(pw->PW_GECOS); // now try to parse the GECOS information, which will be in the form // Full Name, - eliminate the ", @@ -60,7 +60,7 @@ nsUserInfo::GetFullname(PRUnichar **aFullname) // replace ampersand with username if (pw->pw_name) { - nsCAutoString username(pw->pw_name); + nsAutoCString username(pw->pw_name); if (!username.IsEmpty() && nsCRT::IsLower(username.CharAt(0))) username.SetCharAt(nsCRT::ToUpper(username.CharAt(0)), 0); @@ -144,7 +144,7 @@ nsUserInfo::GetEmailAddress(char * *aEmailAddress) nsresult rv; - nsCAutoString emailAddress; + nsAutoCString emailAddress; nsXPIDLCString username; nsXPIDLCString domain; diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index cce1317c47a2..6f36903c65b9 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -792,7 +792,7 @@ TelemetryImpl::GetAddonHistogram(const nsACString &id, const nsACString &name, AddonHistogramInfo &info = histogramEntry->mData; if (!info.h) { - nsCAutoString actualName; + nsAutoCString actualName; AddonHistogramName(id, name, actualName); if (!CreateHistogramForAddon(actualName, info)) { return NS_ERROR_FAILURE; @@ -1059,7 +1059,7 @@ TelemetryImpl::GetChromeHangs(JSContext *cx, jsval *ret) const uint32_t pcCount = stack.GetStackSize(); for (size_t pcIndex = 0; pcIndex < pcCount; ++pcIndex) { - nsCAutoString pcString; + nsAutoCString pcString; const Telemetry::ProcessedStack::Frame &Frame = stack.GetFrame(pcIndex); pcString.AppendPrintf("0x%p", Frame.mOffset); JSString *str = JS_NewStringCopyZ(cx, pcString.get()); @@ -1100,7 +1100,7 @@ TelemetryImpl::GetChromeHangs(JSContext *cx, jsval *ret) } // Start address - nsCAutoString addressString; + nsAutoCString addressString; addressString.AppendPrintf("0x%p", module.mStart); JSString *str = JS_NewStringCopyZ(cx, addressString.get()); if (!str) { @@ -1398,16 +1398,16 @@ TelemetryImpl::RecordSlowStatement(const nsACString &sql, if (!sTelemetry || !sTelemetry->mCanRecord) return; - nsCAutoString fullSQL(sql); + nsAutoCString fullSQL(sql); fullSQL.AppendPrintf(" /* %s */", dbName.BeginReading()); bool isFirefoxDB = sTelemetry->mTrackedDBs.Contains(dbName); if (isFirefoxDB) { - nsCAutoString sanitizedSQL(SanitizeSQL(fullSQL)); + nsAutoCString sanitizedSQL(SanitizeSQL(fullSQL)); StoreSlowSQL(sanitizedSQL, delay, Sanitized); } else { // Report aggregate DB-level statistics for addon DBs - nsCAutoString aggregate; + nsAutoCString aggregate; aggregate.AppendPrintf("Untracked SQL for %s", dbName.BeginReading()); StoreSlowSQL(aggregate, delay, Sanitized); } diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index 4d1a38b9870d..43fc1300df57 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -244,7 +244,7 @@ Classifier::TableRequest(nsACString& aResult) if (adds.Length() > 0) { aResult.Append("a:"); - nsCAutoString addList; + nsAutoCString addList; adds.Serialize(addList); aResult.Append(addList); } @@ -253,7 +253,7 @@ Classifier::TableRequest(nsACString& aResult) if (adds.Length() > 0) aResult.Append(':'); aResult.Append("s:"); - nsCAutoString subList; + nsAutoCString subList; subs.Serialize(subList); aResult.Append(subList); } @@ -300,7 +300,7 @@ Classifier::Check(const nsACString& aSpec, LookupResultArray& aResults) #if DEBUG && defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString checking; + nsAutoCString checking; lookupHash.ToString(checking); LOG(("Checking %s (%X)", checking.get(), lookupHash.ToUint32())); } diff --git a/toolkit/components/url-classifier/Entries.h b/toolkit/components/url-classifier/Entries.h index 887e2e7fae25..7e474f115f15 100644 --- a/toolkit/components/url-classifier/Entries.h +++ b/toolkit/components/url-classifier/Entries.h @@ -51,7 +51,7 @@ struct SafebrowsingHash aPlainText.Length()); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString hashed; + nsAutoCString hashed; rv = aHash->Finish(false, hashed); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/url-classifier/HashStore.cpp b/toolkit/components/url-classifier/HashStore.cpp index bbb3a37c9c29..9c0956fa494c 100644 --- a/toolkit/components/url-classifier/HashStore.cpp +++ b/toolkit/components/url-classifier/HashStore.cpp @@ -176,8 +176,8 @@ HashStore::CheckChecksum(nsIFile* aStoreFile) { // Check for file corruption by // comparing the stored checksum to actual checksum of data - nsCAutoString hash; - nsCAutoString compareHash; + nsAutoCString hash; + nsAutoCString compareHash; char *data; uint32_t read; @@ -338,7 +338,7 @@ HashStore::SanityCheck(nsIFile *storeFile) } nsresult -HashStore::CalculateChecksum(nsCAutoString& aChecksum, bool aChecksumPresent) +HashStore::CalculateChecksum(nsAutoCString& aChecksum, bool aChecksumPresent) { aChecksum.Truncate(); diff --git a/toolkit/components/url-classifier/HashStore.h b/toolkit/components/url-classifier/HashStore.h index 4d3742e4247d..565d591ac548 100644 --- a/toolkit/components/url-classifier/HashStore.h +++ b/toolkit/components/url-classifier/HashStore.h @@ -123,7 +123,7 @@ private: nsresult ReadHeader(); nsresult SanityCheck(nsIFile* aStoreFile); - nsresult CalculateChecksum(nsCAutoString& aChecksum, bool aChecksumPresent); + nsresult CalculateChecksum(nsAutoCString& aChecksum, bool aChecksumPresent); nsresult CheckChecksum(nsIFile* aStoreFile); void UpdateHeader(); diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index c250982222f6..fae7a37954bd 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -205,7 +205,7 @@ LookupCache::Dump() return; for (uint32 i = 0; i < mCompletions.Length(); i++) { - nsCAutoString str; + nsAutoCString str; mCompletions[i].ToString(str); LOG(("Completion: %s", str.get())); } @@ -436,7 +436,7 @@ LookupCache::GetKey(const nsACString& aSpec, const nsCSubstring& host = Substring(begin, iter); if (IsCanonicalizedIP(host)) { - nsCAutoString key; + nsAutoCString key; key.Assign(host); key.Append("/"); return aHash->FromPlaintext(key, aCryptoHash); @@ -449,7 +449,7 @@ LookupCache::GetKey(const nsACString& aSpec, return NS_ERROR_FAILURE; int32_t last = int32_t(hostComponents.Length()) - 1; - nsCAutoString lookupHost; + nsAutoCString lookupHost; if (hostComponents.Length() > 2) { lookupHost.Append(hostComponents[last - 2]); @@ -481,7 +481,7 @@ LookupCache::GetLookupFragments(const nsACString& aSpec, } const nsCSubstring& host = Substring(begin, iter++); - nsCAutoString path; + nsAutoCString path; path.Assign(Substring(iter, end)); /** @@ -525,7 +525,7 @@ LookupCache::GetLookupFragments(const nsACString& aSpec, * appended that was not present in the original url. */ nsTArray paths; - nsCAutoString pathToAdd; + nsAutoCString pathToAdd; path.BeginReading(begin); path.EndReading(end); diff --git a/toolkit/components/url-classifier/ProtocolParser.cpp b/toolkit/components/url-classifier/ProtocolParser.cpp index c9b1c20dc780..6f55b261ffe3 100644 --- a/toolkit/components/url-classifier/ProtocolParser.cpp +++ b/toolkit/components/url-classifier/ProtocolParser.cpp @@ -42,7 +42,7 @@ ParseChunkRange(nsACString::const_iterator& aBegin, nsACString::const_iterator iter = aBegin; FindCharInReadable(',', iter, aEnd); - nsCAutoString element(Substring(aBegin, iter)); + nsAutoCString element(Substring(aBegin, iter)); aBegin = iter; if (aBegin != aEnd) aBegin++; @@ -151,7 +151,7 @@ ProtocolParser::FinishHMAC() return NS_OK; } - nsCAutoString clientMAC; + nsAutoCString clientMAC; mHMAC->Finish(true, clientMAC); if (clientMAC != mServerMAC) { @@ -212,7 +212,7 @@ ProtocolParser::ProcessControl(bool* aDone) { nsresult rv; - nsCAutoString line; + nsAutoCString line; *aDone = true; while (NextLine(line)) { //LOG(("Processing %s\n", line.get())); @@ -400,7 +400,7 @@ ProtocolParser::ProcessChunk(bool* aDone) } // Pull the chunk out of the pending stream data. - nsCAutoString chunk; + nsAutoCString chunk; chunk.Assign(Substring(mPending, 0, mChunkState.length)); mPending = Substring(mPending, mChunkState.length); diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h index 6943eb427136..f1aa3623ad76 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h @@ -65,7 +65,7 @@ public: protected: nsCOMPtr mHash; - nsCAutoString mCheckSum; + nsAutoCString mCheckSum; }; // returns a file output stream which can be QI'ed to nsIFileOutputStream. diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 88fc6aee0413..b7702e6a363a 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -404,7 +404,7 @@ nsUrlClassifierDBServiceWorker::GetTables(nsIUrlClassifierCallback* c) NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString response; + nsAutoCString response; mClassifier->TableRequest(response); c->HandleEvent(response); @@ -863,7 +863,7 @@ nsUrlClassifierLookupCallback::LookupComplete(nsTArray* results) nsCOMPtr completer; if (mDBService->GetCompleter(result.mTableName, getter_AddRefs(completer))) { - nsCAutoString partialHash; + nsAutoCString partialHash; partialHash.Assign(reinterpret_cast(&result.hash.prefix), PREFIX_SIZE); @@ -999,7 +999,7 @@ nsUrlClassifierLookupCallback::HandleResults() mDBService->CacheCompletions(mCacheResults.forget()); } - nsCAutoString tableStr; + nsAutoCString tableStr; for (uint32_t i = 0; i < tables.Length(); i++) { if (i != 0) tableStr.Append(','); @@ -1267,7 +1267,7 @@ nsUrlClassifierDBService::LookupURI(nsIPrincipal* aPrincipal, uri = NS_GetInnermostURI(uri); NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); - nsCAutoString key; + nsAutoCString key; // Canonicalize the url nsCOMPtr utilsService = do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID); diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index d6f4c65921f4..76786613b57b 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -144,7 +144,7 @@ nsUrlClassifierStreamUpdater::FetchUpdate(const nsACString & aUpdateUrl, nsresult rv = NS_NewURI(getter_AddRefs(uri), aUpdateUrl); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString urlSpec; + nsAutoCString urlSpec; uri->GetAsciiSpec(urlSpec); LOG(("(post) Fetching update from %s\n", urlSpec.get())); @@ -212,7 +212,7 @@ nsUrlClassifierStreamUpdater::DownloadUpdates( mIsUpdating = true; *_retval = true; - nsCAutoString urlSpec; + nsAutoCString urlSpec; mUpdateUrl->GetAsciiSpec(urlSpec); LOG(("FetchUpdate: %s", urlSpec.get())); @@ -327,7 +327,7 @@ nsUrlClassifierStreamUpdater::UpdateSuccess(uint32_t requestedTimeout) nsCOMPtr successCallback = mDownloadError ? nullptr : mSuccessCallback.get(); DownloadDone(); - nsCAutoString strTimeout; + nsAutoCString strTimeout; strTimeout.AppendInt(requestedTimeout); if (successCallback) { successCallback->HandleEvent(strTimeout); @@ -346,7 +346,7 @@ nsUrlClassifierStreamUpdater::UpdateError(nsresult result) DownloadDone(); - nsCAutoString strResult; + nsAutoCString strResult; strResult.AppendInt(static_cast(result)); if (errorCallback) { errorCallback->HandleEvent(strResult); @@ -394,7 +394,7 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request, { nsresult rv; bool downloadError = false; - nsCAutoString strStatus; + nsAutoCString strStatus; nsresult status = NS_OK; // Only update if we got http success header diff --git a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp index 4cf447d2ef0d..e5aa57411ffb 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp @@ -98,7 +98,7 @@ nsUrlClassifierUtils::GetKeyForURI(nsIURI * uri, nsACString & _retval) if (!innerURI) innerURI = uri; - nsCAutoString host; + nsAutoCString host; innerURI->GetAsciiHost(host); if (host.IsEmpty()) { @@ -108,7 +108,7 @@ nsUrlClassifierUtils::GetKeyForURI(nsIURI * uri, nsACString & _retval) nsresult rv = CanonicalizeHostname(host, _retval); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString path; + nsAutoCString path; rv = innerURI->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); @@ -117,7 +117,7 @@ nsUrlClassifierUtils::GetKeyForURI(nsIURI * uri, nsACString & _retval) if (ref != kNotFound) path.SetLength(ref); - nsCAutoString temp; + nsAutoCString temp; rv = CanonicalizePath(path, temp); NS_ENSURE_SUCCESS(rv, rv); @@ -133,17 +133,17 @@ nsresult nsUrlClassifierUtils::CanonicalizeHostname(const nsACString & hostname, nsACString & _retval) { - nsCAutoString unescaped; + nsAutoCString unescaped; if (!NS_UnescapeURL(PromiseFlatCString(hostname).get(), PromiseFlatCString(hostname).Length(), 0, unescaped)) { unescaped.Assign(hostname); } - nsCAutoString cleaned; + nsAutoCString cleaned; CleanupHostname(unescaped, cleaned); - nsCAutoString temp; + nsAutoCString temp; ParseIPAddress(cleaned, temp); if (!temp.IsEmpty()) { cleaned.Assign(temp); @@ -162,8 +162,8 @@ nsUrlClassifierUtils::CanonicalizePath(const nsACString & path, { _retval.Truncate(); - nsCAutoString decodedPath(path); - nsCAutoString temp; + nsAutoCString decodedPath(path); + nsAutoCString temp; while (NS_UnescapeURL(decodedPath.get(), decodedPath.Length(), 0, temp)) { decodedPath.Assign(temp); temp.Truncate(); @@ -261,7 +261,7 @@ nsUrlClassifierUtils::ParseIPAddress(const nsACString & host, } for (i = 0; i < parts.Length(); i++) { - nsCAutoString canonical; + nsAutoCString canonical; if (i == parts.Length() - 1) { CanonicalNum(parts[i], 5 - parts.Length(), allowOctal, canonical); @@ -387,7 +387,7 @@ nsUrlClassifierUtils::DecodeClientKey(const nsACString &key, nsACString &_retval) { // Client key is sent in urlsafe base64, we need to decode it first. - nsCAutoString base64(key); + nsAutoCString base64(key); UnUrlsafeBase64(base64); // PL_Base64Decode doesn't null-terminate unless we let it allocate, diff --git a/toolkit/components/url-classifier/tests/TestUrlClassifierUtils.cpp b/toolkit/components/url-classifier/tests/TestUrlClassifierUtils.cpp index c68d58a67719..7fec2ebeb502 100644 --- a/toolkit/components/url-classifier/tests/TestUrlClassifierUtils.cpp +++ b/toolkit/components/url-classifier/tests/TestUrlClassifierUtils.cpp @@ -262,7 +262,7 @@ void TestLongHostname() nsUrlClassifierUtils utils; utils.Init(); - nsCAutoString out; + nsAutoCString out; nsDependentCString in(str); PRIntervalTime clockStart = PR_IntervalNow(); utils.CanonicalizeHostname(in, out); diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 6786e24aa3c1..ae4f72e2f313 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -1127,9 +1127,9 @@ nsresult SetupExtraData(nsIFile* aAppDataDirectory, _wputenv(dataDirEnv.get()); #else // Save this path in the environment for the crash reporter application. - nsCAutoString dataDirEnv("MOZ_CRASHREPORTER_DATA_DIRECTORY="); + nsAutoCString dataDirEnv("MOZ_CRASHREPORTER_DATA_DIRECTORY="); - nsCAutoString dataDirectoryPath; + nsAutoCString dataDirectoryPath; rv = dataDirectory->GetNativePath(dataDirectoryPath); NS_ENSURE_SUCCESS(rv, rv); @@ -1141,7 +1141,7 @@ nsresult SetupExtraData(nsIFile* aAppDataDirectory, PR_SetEnv(env); #endif - nsCAutoString data; + nsAutoCString data; if(NS_SUCCEEDED(GetOrInit(dataDirectory, NS_LITERAL_CSTRING("InstallTime") + aBuildID, data, InitInstallTime))) @@ -1174,7 +1174,7 @@ nsresult SetupExtraData(nsIFile* aAppDataDirectory, if (filename.Length() < XP_PATH_MAX) wcsncpy(lastCrashTimeFilename, filename.get(), filename.Length()); #else - nsCAutoString filename; + nsAutoCString filename; rv = lastCrashFile->GetNativePath(filename); NS_ENSURE_SUCCESS(rv, rv); @@ -1200,7 +1200,7 @@ nsresult SetupExtraData(nsIFile* aAppDataDirectory, wcsncpy(crashMarkerFilename, markerFilename.get(), markerFilename.Length()); #else - nsCAutoString markerFilename; + nsAutoCString markerFilename; rv = markerFile->GetNativePath(markerFilename); NS_ENSURE_SUCCESS(rv, rv); @@ -1456,7 +1456,7 @@ bool GetAnnotation(const nsACString& key, nsACString& data) if (!gExceptionHandler) return false; - nsCAutoString entry; + nsAutoCString entry; if (!crashReporterAPIData_Hash->Get(key, &entry)) return false; @@ -1513,7 +1513,7 @@ SetRestartArgs(int argc, char** argv) return NS_OK; int i; - nsCAutoString envVar; + nsAutoCString envVar; char *env; char *argv0 = getenv("MOZ_APP_LAUNCHER"); for (i = 0; i < argc; i++) { @@ -1574,7 +1574,7 @@ nsresult WriteMinidumpForException(EXCEPTION_POINTERS* aExceptionInfo) #ifdef XP_MACOSX nsresult AppendObjCExceptionInfoToAppNotes(void *inException) { - nsCAutoString excString; + nsAutoCString excString; GetObjCExceptionInfo(inException, excString); AppendAppNotesToCrashReport(excString); return NS_OK; @@ -1597,7 +1597,7 @@ static nsresult PrefSubmitReports(bool* aSubmitReports, bool writePref) do_GetService("@mozilla.org/xre/app-info;1", &rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString appVendor, appName; + nsAutoCString appVendor, appName; rv = appinfo->GetVendor(appVendor); NS_ENSURE_SUCCESS(rv, rv); rv = appinfo->GetName(appName); @@ -1607,7 +1607,7 @@ static nsresult PrefSubmitReports(bool* aSubmitReports, bool writePref) (do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString regPath; + nsAutoCString regPath; regPath.AppendLiteral("Software\\"); @@ -1753,7 +1753,7 @@ static nsresult PrefSubmitReports(bool* aSubmitReports, bool writePref) return rv; } - nsCAutoString submitReportValue; + nsAutoCString submitReportValue; rv = iniParser->GetString(NS_LITERAL_CSTRING("Crash Reporter"), NS_LITERAL_CSTRING("SubmitReport"), submitReportValue); @@ -2334,7 +2334,7 @@ CheckForLastRunCrash() return false; } - nsCAutoString lastMinidump_contents; + nsAutoCString lastMinidump_contents; if (NS_FAILED(GetFileContents(lastCrashFile, lastMinidump_contents))) { return false; } @@ -2345,7 +2345,7 @@ CheckForLastRunCrash() nsDependentString lastMinidump( reinterpret_cast(lastMinidump_contents.get())); #else - nsCAutoString lastMinidump = lastMinidump_contents; + nsAutoCString lastMinidump = lastMinidump_contents; #endif nsCOMPtr lastMinidumpFile; CreateFileFromPath(lastMinidump.get(), diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp index 8add04c79f43..9679f8c863be 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -408,7 +408,7 @@ nsToolkitProfileService::Init() if (NS_FAILED(rv)) return rv; - nsCAutoString buffer; + nsAutoCString buffer; rv = parser.GetString("General", "StartWithLastProfile", buffer); if (NS_SUCCEEDED(rv) && buffer.EqualsLiteral("0")) mStartWithLast = false; @@ -417,7 +417,7 @@ nsToolkitProfileService::Init() unsigned int c = 0; for (c = 0; true; ++c) { - nsCAutoString profileID("Profile"); + nsAutoCString profileID("Profile"); profileID.AppendInt(c); rv = parser.GetString(profileID.get(), "IsRelative", buffer); @@ -425,7 +425,7 @@ nsToolkitProfileService::Init() bool isRelative = buffer.EqualsLiteral("1"); - nsCAutoString filePath; + nsAutoCString filePath; rv = parser.GetString(profileID.get(), "Path", filePath); if (NS_FAILED(rv)) { @@ -661,7 +661,7 @@ nsToolkitProfileService::CreateDefaultProfileForApp(const nsACString& aProfileNa (*aResult)->GetRootDir(getter_AddRefs(rootDir)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString profileDir; + nsAutoCString profileDir; rv = rootDir->GetRelativeDescriptor(appData, profileDir); NS_ENSURE_SUCCESS(rv, rv); @@ -722,7 +722,7 @@ nsToolkitProfileService::CreateProfileInternal(nsIFile* aRootDir, nsCOMPtr rootDir (aRootDir); - nsCAutoString dirName; + nsAutoCString dirName; if (!rootDir) { rv = gDirServiceProvider->GetUserProfilesRootDir(getter_AddRefs(rootDir), aProfileName, aAppName, @@ -867,7 +867,7 @@ nsToolkitProfileService::Flush() "StartWithLastProfile=%s\n\n", mStartWithLast ? "1" : "0"); - nsCAutoString path; + nsAutoCString path; cur = mFirst; pCount = 0; diff --git a/toolkit/system/gnome/nsAlertsIconListener.cpp b/toolkit/system/gnome/nsAlertsIconListener.cpp index bfc43d17aaa6..ea067abdca02 100644 --- a/toolkit/system/gnome/nsAlertsIconListener.cpp +++ b/toolkit/system/gnome/nsAlertsIconListener.cpp @@ -314,7 +314,7 @@ nsAlertsIconListener::InitAlertAsync(const nsAString & aImageUrl, nsCOMPtr bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID); - nsCAutoString appShortName; + nsAutoCString appShortName; if (bundleService) { nsCOMPtr bundle; bundleService->CreateBundle("chrome://branding/locale/brand.properties", diff --git a/toolkit/system/gnome/nsGConfService.cpp b/toolkit/system/gnome/nsGConfService.cpp index f9c6eb55032f..0bfaf51f3f51 100644 --- a/toolkit/system/gnome/nsGConfService.cpp +++ b/toolkit/system/gnome/nsGConfService.cpp @@ -235,7 +235,7 @@ NS_IMETHODIMP nsGConfService::GetAppForProtocol(const nsACString &aScheme, bool *aEnabled, nsACString &aHandler) { - nsCAutoString key("/desktop/gnome/url-handlers/"); + nsAutoCString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); key.Append("/command"); @@ -263,7 +263,7 @@ NS_IMETHODIMP nsGConfService::HandlerRequiresTerminal(const nsACString &aScheme, bool *aResult) { - nsCAutoString key("/desktop/gnome/url-handlers/"); + nsAutoCString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); key.Append("/requires_terminal"); @@ -281,7 +281,7 @@ NS_IMETHODIMP nsGConfService::SetAppForProtocol(const nsACString &aScheme, const nsACString &aCommand) { - nsCAutoString key("/desktop/gnome/url-handlers/"); + nsAutoCString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); key.Append("/command"); diff --git a/toolkit/system/gnome/nsGIOService.cpp b/toolkit/system/gnome/nsGIOService.cpp index d659e180b927..ff609de3f296 100644 --- a/toolkit/system/gnome/nsGIOService.cpp +++ b/toolkit/system/gnome/nsGIOService.cpp @@ -249,7 +249,7 @@ NS_IMETHODIMP nsGIOMimeApp::SetAsDefaultForURIScheme(nsACString const& aURIScheme) { GError *error = NULL; - nsCAutoString contentType("x-scheme-handler/"); + nsAutoCString contentType("x-scheme-handler/"); contentType.Append(aURIScheme); g_app_info_set_as_default_for_type(mApp, @@ -272,7 +272,7 @@ NS_IMETHODIMP nsGIOService::GetMimeTypeFromExtension(const nsACString& aExtension, nsACString& aMimeType) { - nsCAutoString fileExtToUse("file."); + nsAutoCString fileExtToUse("file."); fileExtToUse.Append(aExtension); gboolean result_uncertain; @@ -362,7 +362,7 @@ nsGIOService::GetDescriptionForMimeType(const nsACString& aMimeType, NS_IMETHODIMP nsGIOService::ShowURI(nsIURI* aURI) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); GError *error = NULL; if (!g_app_info_launch_default_for_uri(spec.get(), NULL, &error)) { diff --git a/toolkit/system/gnome/nsGnomeVFSService.cpp b/toolkit/system/gnome/nsGnomeVFSService.cpp index 6ee4fe84985d..10084d1d1ebf 100644 --- a/toolkit/system/gnome/nsGnomeVFSService.cpp +++ b/toolkit/system/gnome/nsGnomeVFSService.cpp @@ -156,7 +156,7 @@ NS_IMETHODIMP nsGnomeVFSService::GetMimeTypeFromExtension(const nsACString &aExtension, nsACString& aMimeType) { - nsCAutoString fileExtToUse("."); + nsAutoCString fileExtToUse("."); fileExtToUse.Append(aExtension); const char *mimeType = gnome_vfs_mime_type_from_name(fileExtToUse.get()); @@ -201,7 +201,7 @@ nsGnomeVFSService::GetDescriptionForMimeType(const nsACString &aMimeType, NS_IMETHODIMP nsGnomeVFSService::ShowURI(nsIURI *aURI) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); if (gnome_vfs_url_show_with_env(spec.get(), NULL) == GNOME_VFS_OK) diff --git a/toolkit/system/osxproxy/nsOSXSystemProxySettings.mm b/toolkit/system/osxproxy/nsOSXSystemProxySettings.mm index ef47bd6bc272..a725bf211cee 100644 --- a/toolkit/system/osxproxy/nsOSXSystemProxySettings.mm +++ b/toolkit/system/osxproxy/nsOSXSystemProxySettings.mm @@ -31,7 +31,7 @@ public: // is there a PAC url specified in the system configuration bool IsAutoconfigEnabled() const; // retrieve the pac url - nsresult GetAutoconfigURL(nsCAutoString& aResult) const; + nsresult GetAutoconfigURL(nsAutoCString& aResult) const; // Find the SystemConfiguration proxy & port for a given URI nsresult FindSCProxyPort(nsIURI* aURI, nsACString& aResultHost, int32_t& aResultPort, bool& aResultSocksProxy); @@ -209,7 +209,7 @@ nsOSXSystemProxySettings::IsAutoconfigEnabled() const } nsresult -nsOSXSystemProxySettings::GetAutoconfigURL(nsCAutoString& aResult) const +nsOSXSystemProxySettings::GetAutoconfigURL(nsAutoCString& aResult) const { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -228,8 +228,8 @@ nsOSXSystemProxySettings::GetAutoconfigURL(nsCAutoString& aResult) const static bool IsHostProxyEntry(const nsACString& aHost, const nsACString& aOverride) { - nsCAutoString host(aHost); - nsCAutoString override(aOverride); + nsAutoCString host(aHost); + nsAutoCString override(aOverride); int32_t overrideLength = override.Length(); int32_t tokenStart = 0; @@ -249,7 +249,7 @@ IsHostProxyEntry(const nsACString& aHost, const nsACString& aOverride) } else { if (tokenEnd == -1) tokenEnd = overrideLength; // no '*' char, match rest of string - nsCAutoString token(Substring(override, tokenStart, tokenEnd - tokenStart)); + nsAutoCString token(Substring(override, tokenStart, tokenEnd - tokenStart)); offset = host.Find(token, offset); if (offset == -1 || (!star && offset)) return false; @@ -276,7 +276,7 @@ nsOSXSystemProxySettings::IsInExceptionList(const nsACString& aHost) const NSString* currentValue = NULL; while ((currentValue = [exceptionEnumerator nextObject])) { NS_ENSURE_TRUE([currentValue isKindOfClass:[NSString class]], false); - nsCAutoString overrideStr([currentValue UTF8String]); + nsAutoCString overrideStr([currentValue UTF8String]); if (IsHostProxyEntry(aHost, overrideStr)) return true; } @@ -291,7 +291,7 @@ nsOSXSystemProxySettings::GetPACURI(nsACString& aResult) NS_ENSURE_TRUE(mProxyDict != NULL, NS_ERROR_FAILURE); - nsCAutoString pacUrl; + nsAutoCString pacUrl; if (IsAutoconfigEnabled() && NS_SUCCEEDED(GetAutoconfigURL(pacUrl))) { aResult.Assign(pacUrl); return NS_OK; @@ -307,12 +307,12 @@ nsOSXSystemProxySettings::GetProxyForURI(nsIURI* aURI, nsACString& aResult) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - nsCAutoString host; + nsAutoCString host; nsresult rv = aURI->GetHost(host); NS_ENSURE_SUCCESS(rv, rv); int32_t proxyPort; - nsCAutoString proxyHost; + nsAutoCString proxyHost; bool proxySocks; rv = FindSCProxyPort(aURI, proxyHost, proxyPort, proxySocks); diff --git a/toolkit/system/unixproxy/nsLibProxySettings.cpp b/toolkit/system/unixproxy/nsLibProxySettings.cpp index bddafe88313d..c6b181b2a138 100644 --- a/toolkit/system/unixproxy/nsLibProxySettings.cpp +++ b/toolkit/system/unixproxy/nsLibProxySettings.cpp @@ -63,7 +63,7 @@ nsUnixSystemProxySettings::GetProxyForURI(nsIURI* aURI, nsACString& aResult) nsCOMPtr ios = do_GetIOService(&rv); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = aURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp index 3f499e6005f6..97d058cbec62 100644 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp @@ -60,7 +60,7 @@ nsUnixSystemProxySettings::Init() bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) { - nsCAutoString mode; + nsAutoCString mode; return NS_SUCCEEDED(mGConf->GetString(NS_LITERAL_CSTRING("/system/proxy/mode"), mode)) && mode.EqualsASCII(aMode); } @@ -95,7 +95,7 @@ IsInNoProxyList(const nsACString& aHost, int32_t aPort, const char* noProxyVal) { NS_ASSERTION(aPort >= 0, "Negative port?"); - nsCAutoString noProxy(noProxyVal); + nsAutoCString noProxy(noProxyVal); if (noProxy.EqualsLiteral("*")) return true; @@ -121,7 +121,7 @@ IsInNoProxyList(const nsACString& aHost, int32_t aPort, const char* noProxyVal) if (FindCharInReadable(':', colon, last)) { ++colon; nsDependentCSubstring portStr(colon, last); - nsCAutoString portStr2(portStr); // We need this for ToInteger. String API's suck. + nsAutoCString portStr2(portStr); // We need this for ToInteger. String API's suck. nsresult err; port = portStr2.ToInteger(&err); if (NS_FAILED(err)) { @@ -161,7 +161,7 @@ GetProxyFromEnvironment(const nsACString& aScheme, int32_t aPort, nsACString& aResult) { - nsCAutoString envVar; + nsAutoCString envVar; envVar.Append(aScheme); envVar.AppendLiteral("_proxy"); const char* proxyVal = PR_GetEnv(envVar.get()); @@ -193,7 +193,7 @@ GetProxyFromEnvironment(const nsACString& aScheme, if (!isHTTP) return NS_ERROR_UNKNOWN_PROTOCOL; - nsCAutoString proxyHost; + nsAutoCString proxyHost; rv = proxyURI->GetHost(proxyHost); NS_ENSURE_SUCCESS(rv, rv); @@ -209,16 +209,16 @@ nsresult nsUnixSystemProxySettings::SetProxyResultFromGConf(const char* aKeyBase, const char* aType, nsACString& aResult) { - nsCAutoString hostKey; + nsAutoCString hostKey; hostKey.AppendASCII(aKeyBase); hostKey.AppendLiteral("host"); - nsCAutoString host; + nsAutoCString host; nsresult rv = mGConf->GetString(hostKey, host); NS_ENSURE_SUCCESS(rv, rv); if (host.IsEmpty()) return NS_ERROR_FAILURE; - nsCAutoString portKey; + nsAutoCString portKey; portKey.AppendASCII(aKeyBase); portKey.AppendLiteral("port"); int32_t port; @@ -248,7 +248,7 @@ nsUnixSystemProxySettings::SetProxyResultFromGSettings(const char* aKeyBase, con mSchemeProxySettings.Put(key, proxy_settings); } - nsCAutoString host; + nsAutoCString host; rv = proxy_settings->GetString(NS_LITERAL_CSTRING("host"), host); NS_ENSURE_SUCCESS(rv, rv); if (host.IsEmpty()) @@ -340,7 +340,7 @@ static bool HostIgnoredByProxy(const nsACString& aIgnore, if (FindCharInReadable('/', slash, end)) { ++slash; nsDependentCSubstring maskStr(slash, end); - nsCAutoString maskStr2(maskStr); + nsAutoCString maskStr2(maskStr); nsresult err; mask = maskStr2.ToInteger(&err); if (NS_FAILED(err)) { @@ -483,11 +483,11 @@ nsUnixSystemProxySettings::GetProxyFromGSettings(const nsACString& aScheme, nsresult nsUnixSystemProxySettings::GetProxyForURI(nsIURI* aURI, nsACString& aResult) { - nsCAutoString scheme; + nsAutoCString scheme; nsresult rv = aURI->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString host; + nsAutoCString host; rv = aURI->GetHost(host); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp index 154ea9be124b..b523b653e4a6 100644 --- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp +++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp @@ -54,7 +54,7 @@ static void SetProxyResult(const char* aType, const nsACString& aHostPort, nsACString& aResult) { nsCOMPtr uri; - nsCAutoString host; + nsAutoCString host; int32_t port; // Try parsing it as a URI. @@ -121,7 +121,7 @@ nsWindowsSystemProxySettings::MatchOverride(const nsACString& aHost) NS_ConvertUTF16toUTF8 cbuf(buf); - nsCAutoString host(aHost); + nsAutoCString host(aHost); int32_t start = 0; int32_t end = cbuf.Length(); @@ -138,7 +138,7 @@ nsWindowsSystemProxySettings::MatchOverride(const nsACString& aHost) delimiter = end; if (delimiter != start) { - const nsCAutoString override(Substring(cbuf, start, + const nsAutoCString override(Substring(cbuf, start, delimiter - start)); if (override.EqualsLiteral("")) { // This override matches local addresses. @@ -162,8 +162,8 @@ bool nsWindowsSystemProxySettings::PatternMatch(const nsACString& aHost, const nsACString& aOverride) { - nsCAutoString host(aHost); - nsCAutoString override(aOverride); + nsAutoCString host(aHost); + nsAutoCString override(aOverride); int32_t overrideLength = override.Length(); int32_t tokenStart = 0; int32_t offset = 0; @@ -181,7 +181,7 @@ nsWindowsSystemProxySettings::PatternMatch(const nsACString& aHost, } else { if (tokenEnd == -1) tokenEnd = overrideLength; - nsCAutoString token(Substring(override, tokenStart, + nsAutoCString token(Substring(override, tokenStart, tokenEnd - tokenStart)); offset = host.Find(token, offset); if (offset == -1 || (!star && offset)) @@ -226,11 +226,11 @@ nsWindowsSystemProxySettings::GetProxyForURI(nsIURI* aURI, nsACString& aResult) return NS_OK; } - nsCAutoString scheme; + nsAutoCString scheme; rv = aURI->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString host; + nsAutoCString host; rv = aURI->GetHost(host); NS_ENSURE_SUCCESS(rv, rv); @@ -241,14 +241,14 @@ nsWindowsSystemProxySettings::GetProxyForURI(nsIURI* aURI, nsACString& aResult) NS_ConvertUTF16toUTF8 cbuf(buf); - nsCAutoString prefix; + nsAutoCString prefix; ToLowerCase(scheme, prefix); prefix.Append('='); - nsCAutoString specificProxy; - nsCAutoString defaultProxy; - nsCAutoString socksProxy; + nsAutoCString specificProxy; + nsAutoCString defaultProxy; + nsAutoCString socksProxy; int32_t start = 0; int32_t end = cbuf.Length(); @@ -258,7 +258,7 @@ nsWindowsSystemProxySettings::GetProxyForURI(nsIURI* aURI, nsACString& aResult) delimiter = end; if (delimiter != start) { - const nsCAutoString proxy(Substring(cbuf, start, + const nsAutoCString proxy(Substring(cbuf, start, delimiter - start)); if (proxy.FindChar('=') == -1) { // If a proxy name is listed by itself, it is used as the diff --git a/toolkit/xre/ProfileReset.cpp b/toolkit/xre/ProfileReset.cpp index bd33bb1358b6..ad455b7ca503 100644 --- a/toolkit/xre/ProfileReset.cpp +++ b/toolkit/xre/ProfileReset.cpp @@ -36,7 +36,7 @@ CreateResetProfile(nsIToolkitProfileService* aProfileSvc, nsIToolkitProfile* *aN nsCOMPtr newProfile; // Make the new profile "default-" + the time in seconds since epoch for uniqueness. - nsCAutoString newProfileName("default-"); + nsAutoCString newProfileName("default-"); newProfileName.Append(nsPrintfCString("%lld", PR_Now() / 1000)); nsresult rv = aProfileSvc->CreateProfile(nullptr, // choose a default dir for us nullptr, // choose a default dir for us diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 4cb024906aec..91e69c44f98a 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -268,7 +268,7 @@ SaveFileToEnv(const char *name, nsIFile *file) file->GetPath(path); SetEnvironmentVariableW(NS_ConvertASCIItoUTF16(name).get(), path.get()); #else - nsCAutoString path; + nsAutoCString path; file->GetNativePath(path); SaveWordToEnv(name, path); #endif @@ -792,7 +792,7 @@ nsXULAppInfo::InvalidateCachesOnRestart() return NS_OK; } - nsCAutoString buf; + nsAutoCString buf; rv = parser.GetString("Compatibility", "InvalidateCaches", buf); if (NS_FAILED(rv)) { @@ -924,7 +924,7 @@ nsXULAppInfo::GetServerURL(nsIURL** aServerURL) if (!CrashReporter::GetEnabled()) return NS_ERROR_NOT_INITIALIZED; - nsCAutoString data; + nsAutoCString data; if (!CrashReporter::GetServerURL(data)) { return NS_ERROR_FAILURE; } @@ -954,7 +954,7 @@ nsXULAppInfo::SetServerURL(nsIURL* aServerURL) if (!schemeOk) return NS_ERROR_INVALID_ARG; } - nsCAutoString spec; + nsAutoCString spec; rv = aServerURL->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -1413,7 +1413,7 @@ HandleRemoteArgument(const char* remote, const char* aDesktopStartupID) ArgResult ar; const char *profile = 0; - nsCAutoString program(gAppData->name); + nsAutoCString program(gAppData->name); ToLowerCase(program); const char *username = getenv("LOGNAME"); @@ -1470,7 +1470,7 @@ RemoteCommandLine(const char* aDesktopStartupID) nsresult rv; ArgResult ar; - nsCAutoString program(gAppData->name); + nsAutoCString program(gAppData->name); ToLowerCase(program); const char *username = getenv("LOGNAME"); @@ -1665,7 +1665,7 @@ static nsresult LaunchChild(nsINativeAppSupport* aNative, return NS_ERROR_FAILURE; #else - nsCAutoString exePath; + nsAutoCString exePath; rv = lf->GetNativePath(exePath); if (NS_FAILED(rv)) return rv; @@ -1863,7 +1863,7 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc, nsCOMPtr profD, profLD; PRUnichar* profileNamePtr; - nsCAutoString profileName; + nsAutoCString profileName; { ScopedXPCOMStartup xpcom; @@ -2184,7 +2184,7 @@ SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc, n nsCOMPtr prefsJSFile; profile->GetRootDir(getter_AddRefs(prefsJSFile)); prefsJSFile->AppendNative(NS_LITERAL_CSTRING("prefs.js")); - nsCAutoString pathStr; + nsAutoCString pathStr; prefsJSFile->GetNativePath(pathStr); PR_fprintf(PR_STDERR, "Success: created profile '%s' at '%s'\n", arg, pathStr.get()); bool exists; @@ -2338,7 +2338,7 @@ CheckCompatibility(nsIFile* aProfileDir, const nsCString& aVersion, if (NS_FAILED(rv)) return false; - nsCAutoString buf; + nsAutoCString buf; rv = parser.GetString("Compatibility", "LastVersion", buf); if (NS_FAILED(rv) || !aVersion.Equals(buf)) return false; @@ -2410,10 +2410,10 @@ WriteVersion(nsIFile* aProfileDir, const nsCString& aVersion, return; file->AppendNative(FILE_COMPATIBILITY_INFO); - nsCAutoString platformDir; + nsAutoCString platformDir; aXULRunnerDir->GetNativePath(platformDir); - nsCAutoString appDir; + nsAutoCString appDir; if (aAppDir) aAppDir->GetNativePath(appDir); @@ -2781,8 +2781,8 @@ public: ScopedXPCOMStartup* mScopedXPCom; ScopedAppData* mAppData; nsXREDirProvider mDirProvider; - nsCAutoString mProfileName; - nsCAutoString mDesktopStartupID; + nsAutoCString mProfileName; + nsAutoCString mDesktopStartupID; bool mStartOffline; bool mShuttingDown; @@ -3028,7 +3028,7 @@ XREMain::XRE_mainInit(const nsXREAppData* aAppData, bool* aExitFlag) overrideini->GetPath(overridePathW); NS_ConvertUTF16toUTF8 overridePath(overridePathW); #else - nsCAutoString overridePath; + nsAutoCString overridePath; overrideini->GetNativePath(overridePath); #endif @@ -3257,7 +3257,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag) // Set program name to the one defined in application.ini. { - nsCAutoString program(gAppData->name); + nsAutoCString program(gAppData->name); ToLowerCase(program); g_set_prgname(program.get()); } @@ -3382,7 +3382,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag) // DESKTOP_STARTUP_ID is cleared now, // we recover it in case we need a restart. if (!mDesktopStartupID.IsEmpty()) { - nsCAutoString desktopStartupEnv; + nsAutoCString desktopStartupEnv; desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID="); desktopStartupEnv.Append(mDesktopStartupID); // Leak it with extreme prejudice! @@ -3483,7 +3483,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag) MakeOrSetMinidumpPath(mProfD); #endif - nsCAutoString version; + nsAutoCString version; BuildVersion(version); #ifdef TARGET_OS_ABI @@ -3662,7 +3662,7 @@ XREMain::XRE_mainRun() nsINIParser parser; nsresult rv = parser.Init(file); if (NS_SUCCEEDED(rv)) { - nsCAutoString buf; + nsAutoCString buf; rv = parser.GetString("XRE", "EnableProfileMigrator", buf); if (NS_SUCCEEDED(rv)) { if (buf[0] == '0' || buf[0] == 'f' || buf[0] == 'F') { @@ -3688,7 +3688,7 @@ XREMain::XRE_mainRun() gDoMigration = false; nsCOMPtr pm(do_CreateInstance(NS_PROFILEMIGRATOR_CONTRACTID)); if (pm) { - nsCAutoString aKey; + nsAutoCString aKey; if (gDoProfileReset) { // Automatically migrate from the current application if we just // reset the profile. @@ -4008,7 +4008,7 @@ XRE_InitCommandLine(int aArgc, char* aArgv[]) if (NS_FAILED(rv)) return NS_ERROR_FAILURE; - nsCAutoString canonBinPath; + nsAutoCString canonBinPath; rv = binFile->GetNativePath(canonBinPath); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; diff --git a/toolkit/xre/nsConsoleWriter.cpp b/toolkit/xre/nsConsoleWriter.cpp index 00904e8b45e9..412dd76e0299 100644 --- a/toolkit/xre/nsConsoleWriter.cpp +++ b/toolkit/xre/nsConsoleWriter.cpp @@ -84,7 +84,7 @@ WriteConsoleLog() // the memory allocated for the messages array. XPCOM arrays suck. nsXPIDLString msg; - nsCAutoString nativemsg; + nsAutoCString nativemsg; for (uint32_t i = 0; i < mcount; ++i) { rv = messages[i]->GetMessageMoz(getter_Copies(msg)); diff --git a/toolkit/xre/nsNativeAppSupportOS2.cpp b/toolkit/xre/nsNativeAppSupportOS2.cpp index 8be75068a120..1e0d49119fdd 100644 --- a/toolkit/xre/nsNativeAppSupportOS2.cpp +++ b/toolkit/xre/nsNativeAppSupportOS2.cpp @@ -1095,12 +1095,12 @@ nsNativeAppSupportOS2::HandleDDENotification( ULONG idInst, // DDEML instanc // Open a given URL... // Get the URL from the first argument in the command. - nsCAutoString url; + nsAutoCString url; ParseDDEArg(hsz2, 0, url); // Read the 3rd argument in the command to determine if a // new window is to be used. - nsCAutoString windowID; + nsAutoCString windowID; ParseDDEArg(hsz2, 2, windowID); // to open the URL in a new window, the old OS/2 code // looks for "0" while the new Win32 code looks for ""; @@ -1182,7 +1182,7 @@ nsNativeAppSupportOS2::HandleDDENotification( ULONG idInst, // DDEML instanc // Use a string buffer for the output data, first // save a quote. - nsCAutoString outpt( NS_LITERAL_CSTRING("\"") ); + nsAutoCString outpt( NS_LITERAL_CSTRING("\"") ); // Now copy the URL converting the Unicode string // to a single-byte ASCII string outpt.Append( NS_LossyConvertUTF16toASCII( url ) ); @@ -1208,7 +1208,7 @@ nsNativeAppSupportOS2::HandleDDENotification( ULONG idInst, // DDEML instanc } case topicActivate: { // Activate a Nav window... - nsCAutoString windowID; + nsAutoCString windowID; ParseDDEArg(hsz2, 0, windowID); // 4294967295 is decimal for 0xFFFFFFFF which is also a // correct value to do that Activate last window stuff @@ -1259,12 +1259,12 @@ nsNativeAppSupportOS2::HandleDDENotification( ULONG idInst, // DDEML instanc #if MOZ_DEBUG_DDE printf( "Handling dde request: [%s]...\n", (char*)request ); #endif - nsCAutoString url; + nsAutoCString url; ParseDDEArg((const char*) request, 0, url); // Read the 3rd argument in the command to determine if a // new window is to be used. - nsCAutoString windowID; + nsAutoCString windowID; ParseDDEArg((const char*) request, 2, windowID); // to open the URL in a new window, the old OS/2 code @@ -1362,7 +1362,7 @@ void nsNativeAppSupportOS2::ParseDDEArg( HSZ args, int index, nsCString& aString DWORD argLen = WinDdeQueryString( args, NULL, NULL, CP_WINANSI ); // there wasn't any string, so return empty string if ( !argLen ) return; - nsCAutoString temp; + nsAutoCString temp; // Ensure result's buffer is sufficiently big. temp.SetLength( argLen ); // Now get the string contents. @@ -1412,7 +1412,7 @@ nsNativeAppSupportOS2::HandleCommandLine(const char* aCmdLineString, int between, quoted, bSlashCount; int argc; const char *p; - nsCAutoString arg; + nsAutoCString arg; nsCOMPtr cmdLine (do_CreateInstance("@mozilla.org/toolkit/command-line;1")); diff --git a/toolkit/xre/nsNativeAppSupportQt.cpp b/toolkit/xre/nsNativeAppSupportQt.cpp index f27a4f20e8d7..95fbb77def23 100644 --- a/toolkit/xre/nsNativeAppSupportQt.cpp +++ b/toolkit/xre/nsNativeAppSupportQt.cpp @@ -106,7 +106,7 @@ nsNativeAppSupportQt::Start(bool* aRetVal) defined in your desktop file. If it doesn't, the OSSO system will happily kill your process. */ - nsCAutoString applicationName; + nsAutoCString applicationName; if (gAppData->vendor) { applicationName.Append(gAppData->vendor); applicationName.Append("."); diff --git a/toolkit/xre/nsNativeAppSupportUnix.cpp b/toolkit/xre/nsNativeAppSupportUnix.cpp index bff3386b95fd..4173c2371ba0 100644 --- a/toolkit/xre/nsNativeAppSupportUnix.cpp +++ b/toolkit/xre/nsNativeAppSupportUnix.cpp @@ -431,7 +431,7 @@ nsNativeAppSupportUnix::Start(bool *aRetVal) defined in your desktop file. If it doesn't, the OSSO system will happily kill your process. */ - nsCAutoString applicationName; + nsAutoCString applicationName; if (gAppData->vendor) { applicationName.Append(gAppData->vendor); applicationName.Append("."); @@ -528,7 +528,7 @@ nsNativeAppSupportUnix::Start(bool *aRetVal) // Set the correct/requested restart command in any case. // Is there a request to suppress default binary launcher? - nsCAutoString path; + nsAutoCString path; char* argv1 = getenv("MOZ_APP_LAUNCHER"); if(!argv1) { @@ -542,7 +542,7 @@ nsNativeAppSupportUnix::Start(bool *aRetVal) if (NS_SUCCEEDED(rv)) { // Strip off the -bin suffix to get the shell script we should run; this is what Breakpad does - nsCAutoString leafName; + nsAutoCString leafName; rv = executablePath->GetNativeLeafName(leafName); if (NS_SUCCEEDED(rv) && StringEndsWith(leafName, NS_LITERAL_CSTRING("-bin"))) { leafName.SetLength(leafName.Length() - strlen("-bin")); diff --git a/toolkit/xre/nsNativeAppSupportWin.cpp b/toolkit/xre/nsNativeAppSupportWin.cpp index e8195a0f8f03..d50f43363fb7 100644 --- a/toolkit/xre/nsNativeAppSupportWin.cpp +++ b/toolkit/xre/nsNativeAppSupportWin.cpp @@ -1030,10 +1030,10 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t // Use a string buffer for the output data, first // save a quote. - nsCAutoString outpt( NS_LITERAL_CSTRING("\"") ); + nsAutoCString outpt( NS_LITERAL_CSTRING("\"") ); // Now copy the URL converting the Unicode string // to a single-byte ASCII string - nsCAutoString tmpNativeStr; + nsAutoCString tmpNativeStr; NS_CopyUnicodeToNative( url, tmpNativeStr ); outpt.Append( tmpNativeStr ); // Add the "," used to separate the URL and the page @@ -1262,7 +1262,7 @@ nsNativeAppSupportWin::HandleCommandLine(const char* aCmdLineString, int between, quoted, bSlashCount; int argc; const char *p; - nsCAutoString arg; + nsAutoCString arg; nsCOMPtr cmdLine (do_CreateInstance("@mozilla.org/toolkit/command-line;1")); diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index f3cc6afe497f..f8a41b415c5d 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -410,7 +410,7 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, NS_ConvertUTF16toUTF8 updaterPath(updaterPathW); #else - nsCAutoString appFilePath; + nsAutoCString appFilePath; #if defined(MOZ_WIDGET_GONK) appFilePath.Assign(kB2GServiceArgv[0]); appArgc = kB2GServiceArgc; @@ -421,7 +421,7 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, return; #endif - nsCAutoString updaterPath; + nsAutoCString updaterPath; rv = updater->GetNativePath(updaterPath); if (NS_FAILED(rv)) return; @@ -433,7 +433,7 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, // platforms we will just apply to the appDir/updated. nsCOMPtr updatedDir; #if defined(XP_MACOSX) - nsCAutoString applyToDir; + nsAutoCString applyToDir; { nsCOMPtr parentDir1, parentDir2; rv = appDir->GetParent(getter_AddRefs(parentDir1)); @@ -455,7 +455,7 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, NS_ConvertUTF16toUTF8 applyToDir(applyToDirW); #else - nsCAutoString applyToDir; + nsAutoCString applyToDir; rv = updatedDir->GetNativePath(applyToDir); #endif #endif @@ -475,7 +475,7 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, NS_ConvertUTF16toUTF8 updateDirPath(updateDirPathW); #else - nsCAutoString updateDirPath; + nsAutoCString updateDirPath; rv = updateDir->GetNativePath(updateDirPath); #endif @@ -491,9 +491,9 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, // Construct the PID argument for this process. If we are using execv, then // we pass "0" which is then ignored by the updater. #if defined(USE_EXECV) - nsCAutoString pid("0"); + nsAutoCString pid("0"); #else - nsCAutoString pid; + nsAutoCString pid; pid.AppendInt((int32_t) getpid()); #endif @@ -617,12 +617,12 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, NS_ConvertUTF16toUTF8 updaterPath(updaterPathW); #else - nsCAutoString appFilePath; + nsAutoCString appFilePath; rv = appFile->GetNativePath(appFilePath); if (NS_FAILED(rv)) return; - nsCAutoString updaterPath; + nsAutoCString updaterPath; rv = updater->GetNativePath(updaterPath); if (NS_FAILED(rv)) return; @@ -635,7 +635,7 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, // platforms we will just apply to the appDir/updated. nsCOMPtr updatedDir; #if defined(XP_MACOSX) - nsCAutoString applyToDir; + nsAutoCString applyToDir; { nsCOMPtr parentDir1, parentDir2; rv = appDir->GetParent(getter_AddRefs(parentDir1)); @@ -668,7 +668,7 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, NS_ConvertUTF16toUTF8 applyToDir(applyToDirW); #else - nsCAutoString applyToDir; + nsAutoCString applyToDir; rv = updatedDir->GetNativePath(applyToDir); #endif #endif @@ -681,7 +681,7 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, NS_ConvertUTF16toUTF8 updateDirPath(updateDirPathW); #else - nsCAutoString updateDirPath; + nsAutoCString updateDirPath; rv = updateDir->GetNativePath(updateDirPath); #endif @@ -702,7 +702,7 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, // Construct the PID argument for this process. If we are using execv, then // we pass "0" which is then ignored by the updater. - nsCAutoString pid; + nsAutoCString pid; if (!restart) { // Signal the updater application that it should apply the update in the // background. @@ -822,7 +822,7 @@ ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir, const char *updRootOverride = PR_GetEnv("MOZ_UPDATE_ROOT_OVERRIDE"); if (updRootOverride && *updRootOverride) { nsCOMPtr overrideDir; - nsCAutoString path(updRootOverride); + nsAutoCString path(updRootOverride); rv = NS_NewNativeLocalFile(path, false, getter_AddRefs(overrideDir)); if (NS_FAILED(rv)) { return rv; @@ -833,7 +833,7 @@ ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir, const char *appDirOverride = PR_GetEnv("MOZ_UPDATE_APPDIR_OVERRIDE"); if (appDirOverride && *appDirOverride) { nsCOMPtr overrideDir; - nsCAutoString path(appDirOverride); + nsAutoCString path(appDirOverride); rv = NS_NewNativeLocalFile(path, false, getter_AddRefs(overrideDir)); if (NS_FAILED(rv)) { return rv; @@ -893,13 +893,13 @@ NS_IMETHODIMP nsUpdateProcessor::ProcessUpdate(nsIUpdate* aUpdate) { nsCOMPtr greDir, appDir, updRoot; - nsCAutoString appVersion; + nsAutoCString appVersion; int argc; char **argv; NS_ENSURE_ARG_POINTER(aUpdate); - nsCAutoString binPath; + nsAutoCString binPath; nsXREDirProvider* dirProvider = nsXREDirProvider::GetSingleton(); if (dirProvider) { // Normal code path // Check for and process any available updates diff --git a/toolkit/xre/nsUpdateDriver.h b/toolkit/xre/nsUpdateDriver.h index 14038aaef57e..dfd0aa24fc77 100644 --- a/toolkit/xre/nsUpdateDriver.h +++ b/toolkit/xre/nsUpdateDriver.h @@ -86,7 +86,7 @@ private: nsCOMPtr mUpdateRoot; int mArgc; char **mArgv; - nsCAutoString mAppVersion; + nsAutoCString mAppVersion; }; private: diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp index 3ff2383b40ad..d3a48ca468cf 100644 --- a/toolkit/xre/nsX11ErrorHandler.cpp +++ b/toolkit/xre/nsX11ErrorHandler.cpp @@ -23,7 +23,7 @@ X11Error(Display *display, XErrorEvent *event) { unsigned long age = NextRequest(display) - event->serial; // Get a string to represent the request that caused the error. - nsCAutoString message; + nsAutoCString message; if (event->request_code < 128) { // Core protocol request message.AppendInt(event->request_code); @@ -79,7 +79,7 @@ X11Error(Display *display, XErrorEvent *event) { buffer, sizeof(buffer)); } - nsCAutoString notes; + nsAutoCString notes; if (buffer[0]) { notes.Append(buffer); } else { diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index 7d2baf24c0f7..9ebbeda05ab7 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -467,7 +467,7 @@ LoadDirsIntoArray(nsCOMArray& aSourceDirs, if (!appended) continue; - nsCAutoString leaf; + nsAutoCString leaf; appended->GetNativeLeafName(leaf); if (!Substring(leaf, leaf.Length() - 4).Equals(NS_LITERAL_CSTRING(".xpi"))) { LoadDirIntoArray(appended, @@ -525,10 +525,10 @@ LoadExtensionDirectories(nsINIParser &parser, nsresult rv; int32_t i = 0; do { - nsCAutoString buf("Extension"); + nsAutoCString buf("Extension"); buf.AppendInt(i++); - nsCAutoString path; + nsAutoCString path; rv = parser.GetString(aSection, buf.get(), path); if (NS_FAILED(rv)) return; @@ -621,7 +621,7 @@ DumpFileArray(const char *key, { fprintf(stderr, "nsXREDirProvider::GetFilesInternal(%s)\n", key); - nsCAutoString path; + nsAutoCString path; for (int32_t i = 0; i < dirs.Count(); ++i) { dirs[i]->GetNativePath(path); fprintf(stderr, " %s\n", path.get()); @@ -1232,7 +1232,7 @@ nsXREDirProvider::GetUserDataDirectory(nsIFile** aFile, bool aLocal, NS_ENSURE_SUCCESS(rv, rv); #ifdef DEBUG_jungshik - nsCAutoString cwd; + nsAutoCString cwd; localDir->GetNativePath(cwd); printf("nsXREDirProvider::GetUserDataDirectory: %s\n", cwd.get()); #endif @@ -1251,7 +1251,7 @@ nsXREDirProvider::EnsureDirectoryExists(nsIFile* aDirectory) NS_ENSURE_SUCCESS(rv, rv); #ifdef DEBUG_jungshik if (!exists) { - nsCAutoString cwd; + nsAutoCString cwd; aDirectory->GetNativePath(cwd); printf("nsXREDirProvider::EnsureDirectoryExists: %s does not\n", cwd.get()); } @@ -1275,7 +1275,7 @@ nsXREDirProvider::EnsureProfileFileExists(nsIFile *aFile) rv = aFile->Exists(&exists); if (NS_FAILED(rv) || exists) return; - nsCAutoString leafName; + nsAutoCString leafName; rv = aFile->GetNativeLeafName(leafName); if (NS_FAILED(rv)) return; @@ -1357,9 +1357,9 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile, return NS_ERROR_FAILURE; } - nsCAutoString profile; - nsCAutoString appName; - nsCAutoString vendor; + nsAutoCString profile; + nsAutoCString appName; + nsAutoCString vendor; if (aProfileName && !aProfileName->IsEmpty()) { profile = *aProfileName; } else if (aAppName) { @@ -1412,7 +1412,7 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile, NS_ENSURE_SUCCESS(rv, rv); #elif defined(XP_UNIX) // Make it hidden (i.e. using the ".") - nsCAutoString folder("."); + nsAutoCString folder("."); if (!profile.IsEmpty()) { // Skip any leading path characters @@ -1460,7 +1460,7 @@ nsXREDirProvider::AppendProfileString(nsIFile* aFile, const char* aPath) NS_ASSERTION(aFile, "Null file!"); NS_ASSERTION(aPath, "Null path!"); - nsCAutoString pathDup(aPath); + nsAutoCString pathDup(aPath); char* path = pathDup.BeginWriting(); diff --git a/tools/profiler/TableTicker.cpp b/tools/profiler/TableTicker.cpp index a4dbe5e8556b..61a4c2bfb6e9 100644 --- a/tools/profiler/TableTicker.cpp +++ b/tools/profiler/TableTicker.cpp @@ -446,7 +446,7 @@ static JSBool WriteCallback(const jschar *buf, uint32_t len, void *data) { std::ofstream& stream = *static_cast(data); - nsCAutoString profile = NS_ConvertUTF16toUTF8(buf, len); + nsAutoCString profile = NS_ConvertUTF16toUTF8(buf, len); stream << profile.Data(); return JS_TRUE; } @@ -475,7 +475,7 @@ public: tmpPath.AppendPrintf("/sdcard/profile_%i_%i.txt", XRE_GetProcessType(), getpid()); #else nsCOMPtr tmpFile; - nsCAutoString tmpPath; + nsAutoCString tmpPath; if (NS_FAILED(NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpFile)))) { LOG("Failed to find temporary directory."); return NS_ERROR_FAILURE; @@ -569,7 +569,7 @@ JSObject* TableTicker::GetMetaJSObject(JSObjectBuilder& b) nsresult res; nsCOMPtr http = do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &res); if (!NS_FAILED(res)) { - nsCAutoString string; + nsAutoCString string; res = http->GetPlatform(string); if (!NS_FAILED(res)) @@ -586,7 +586,7 @@ JSObject* TableTicker::GetMetaJSObject(JSObjectBuilder& b) nsCOMPtr runtime = do_GetService("@mozilla.org/xre/runtime;1"); if (runtime) { - nsCAutoString string; + nsAutoCString string; res = runtime->GetXPCOMABI(string); if (!NS_FAILED(res)) @@ -599,7 +599,7 @@ JSObject* TableTicker::GetMetaJSObject(JSObjectBuilder& b) nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); if (appInfo) { - nsCAutoString string; + nsAutoCString string; res = appInfo->GetName(string); if (!NS_FAILED(res)) diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 546db63171dd..695c3e36a73d 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -489,7 +489,7 @@ nsDocLoader::OnStartRequest(nsIRequest *request, nsISupports *aCtxt) #ifdef PR_LOGGING if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) { - nsCAutoString name; + nsAutoCString name; request->GetName(name); uint32_t count = 0; @@ -570,7 +570,7 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest, #ifdef PR_LOGGING if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) { - nsCAutoString name; + nsAutoCString name; aRequest->GetName(name); uint32_t count = 0; @@ -831,7 +831,7 @@ void nsDocLoader::doStartDocumentLoad(void) { #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; GetURIStringFromRequest(mDocumentRequest, buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, @@ -856,7 +856,7 @@ void nsDocLoader::doStartDocumentLoad(void) void nsDocLoader::doStartURLLoad(nsIRequest *request) { #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; GetURIStringFromRequest(request, buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, @@ -875,7 +875,7 @@ void nsDocLoader::doStartURLLoad(nsIRequest *request) void nsDocLoader::doStopURLLoad(nsIRequest *request, nsresult aStatus) { #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; GetURIStringFromRequest(request, buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, @@ -905,7 +905,7 @@ void nsDocLoader::doStopDocumentLoad(nsIRequest *request, nsresult aStatus) { #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; GetURIStringFromRequest(request, buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, @@ -1112,7 +1112,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt, // else { #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; GetURIStringFromRequest(aRequest, buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, @@ -1220,7 +1220,7 @@ void nsDocLoader::FireOnProgressChange(nsDocLoader *aLoadInitiator, } #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; GetURIStringFromRequest(request, buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, @@ -1312,7 +1312,7 @@ void nsDocLoader::DoFireOnStateChange(nsIWebProgress * const aProgress, aStateFlags |= nsIWebProgressListener::STATE_RESTORING; #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; GetURIStringFromRequest(aRequest, buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, @@ -1763,7 +1763,7 @@ void nsDocLoader::DumpChannelInfo() info = (nsChannelInfo *)mChannelInfoList.ElementAt(i); #if defined(DEBUG) - nsCAutoString buffer; + nsAutoCString buffer; nsresult rv = NS_OK; if (info->mURI) { rv = info->mURI->GetSpec(buffer); diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index b6e728f079ac..b74a5c0fb29d 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -51,7 +51,7 @@ #include "mozilla/FunctionTimer.h" #ifdef NS_FUNCTION_TIMER #define TIME_URILOADER_FUNCTION(req) \ - nsCAutoString name__("N/A"); \ + nsAutoCString name__("N/A"); \ (req)->GetName(name__); \ NS_TIME_FUNCTION_FMT("%s (line %d) (request: %s)", \ MOZ_FUNCTION_NAME, \ @@ -431,7 +431,7 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports * // // Fourth step: try to find an nsIContentHandler for our type. // - nsCAutoString handlerContractID (NS_CONTENT_HANDLER_CONTRACTID_PREFIX); + nsAutoCString handlerContractID (NS_CONTENT_HANDLER_CONTRACTID_PREFIX); handlerContractID += mContentType; nsCOMPtr contentHandler = @@ -761,7 +761,7 @@ NS_IMETHODIMP nsURILoader::OpenURI(nsIChannel *channel, if (LOG_ENABLED()) { nsCOMPtr uri; channel->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetAsciiSpec(spec); LOG(("nsURILoader::OpenURI for %s", spec.get())); } @@ -810,7 +810,7 @@ nsresult nsURILoader::OpenChannel(nsIChannel* channel, if (LOG_ENABLED()) { nsCOMPtr uri; channel->GetURI(getter_AddRefs(uri)); - nsCAutoString spec; + nsAutoCString spec; uri->GetAsciiSpec(spec); LOG(("nsURILoader::OpenChannel for %s", spec.get())); } diff --git a/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp b/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp index 57d0b39699c7..9a56a4b4f544 100644 --- a/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp +++ b/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp @@ -50,13 +50,13 @@ nsMIMEInfoAndroid::GetMimeInfoForMimeType(const nsACString& aMimeType, } nsIHandlerApp* systemDefault = nullptr; - bridge->GetHandlersForMimeType(nsCAutoString(aMimeType).get(), + bridge->GetHandlersForMimeType(nsAutoCString(aMimeType).get(), info->mHandlerApps, &systemDefault); if (systemDefault) info->mPrefApp = systemDefault; - nsCAutoString fileExt; + nsAutoCString fileExt; bridge->GetExtensionFromMimeType(aMimeType, fileExt); info->SetPrimaryExtension(fileExt); @@ -109,15 +109,15 @@ nsMIMEInfoAndroid::GetMimeInfoForURL(const nsACString &aURL, } nsIHandlerApp* systemDefault = nullptr; - bridge->GetHandlersForURL(nsCAutoString(aURL).get(), + bridge->GetHandlersForURL(nsAutoCString(aURL).get(), mimeinfo->mHandlerApps, &systemDefault); if (systemDefault) mimeinfo->mPrefApp = systemDefault; - nsCAutoString fileExt; - nsCAutoString mimeType; + nsAutoCString fileExt; + nsAutoCString mimeType; mimeinfo->GetType(mimeType); bridge->GetExtensionFromMimeType(mimeType, fileExt); mimeinfo->SetPrimaryExtension(fileExt); @@ -338,7 +338,7 @@ nsMIMEInfoAndroid::Equals(nsIMIMEInfo *aMIMEInfo, bool *aRetVal) { if (!aMIMEInfo) return NS_ERROR_NULL_POINTER; - nsCAutoString type; + nsAutoCString type; nsresult rv = aMIMEInfo->GetMIMEType(type); if (NS_FAILED(rv)) return rv; diff --git a/uriloader/exthandler/mac/nsLocalHandlerAppMac.mm b/uriloader/exthandler/mac/nsLocalHandlerAppMac.mm index 718ae0b08af0..fd633ab726bf 100644 --- a/uriloader/exthandler/mac/nsLocalHandlerAppMac.mm +++ b/uriloader/exthandler/mac/nsLocalHandlerAppMac.mm @@ -46,7 +46,7 @@ nsLocalHandlerAppMac::LaunchWithURI(nsIURI *aURI, if (NS_FAILED(rv)) return rv; - nsCAutoString uriSpec; + nsAutoCString uriSpec; aURI->GetAsciiSpec(uriSpec); const UInt8* uriString = reinterpret_cast(uriSpec.get()); diff --git a/uriloader/exthandler/mac/nsMIMEInfoMac.mm b/uriloader/exthandler/mac/nsMIMEInfoMac.mm index cc183afa8879..64d3a82dea05 100644 --- a/uriloader/exthandler/mac/nsMIMEInfoMac.mm +++ b/uriloader/exthandler/mac/nsMIMEInfoMac.mm @@ -92,7 +92,7 @@ nsMIMEInfoMac::LoadUriInternal(nsIURI *aURI) nsresult rv = NS_ERROR_FAILURE; - nsCAutoString uri; + nsAutoCString uri; aURI->GetSpec(uri); if (!uri.IsEmpty()) { CFURLRef myURLRef = ::CFURLCreateWithBytes(kCFAllocatorDefault, diff --git a/uriloader/exthandler/mac/nsOSHelperAppService.mm b/uriloader/exthandler/mac/nsOSHelperAppService.mm index c33fff4bbe0b..ec7c5238cbd8 100644 --- a/uriloader/exthandler/mac/nsOSHelperAppService.mm +++ b/uriloader/exthandler/mac/nsOSHelperAppService.mm @@ -433,7 +433,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, NSString *extStr = [NSString stringWithCString:flatExt.get() encoding:NSASCIIStringEncoding]; NSString *typeStr = map ? [map MIMETypeForExtension:extStr] : NULL; if (typeStr) { - nsCAutoString mimeType; + nsAutoCString mimeType; mimeType.Assign((char *)[typeStr cStringUsingEncoding:NSASCIIStringEncoding]); mimeInfoMac->SetMIMEType(mimeType); haveAppForType = true; @@ -496,7 +496,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, mimeInfoMac->SetPreferredAction(nsIMIMEInfo::saveToDisk); } - nsCAutoString mimeType; + nsAutoCString mimeType; mimeInfoMac->GetMIMEType(mimeType); if (*aFound && !mimeType.IsEmpty()) { // If we have a MIME type, make sure its preferred extension is included @@ -505,7 +505,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, NSString *typeStr = [NSString stringWithCString:mimeType.get() encoding:NSASCIIStringEncoding]; NSString *extStr = map ? [map preferredExtensionForMIMEType:typeStr] : NULL; if (extStr) { - nsCAutoString preferredExt; + nsAutoCString preferredExt; preferredExt.Assign((char *)[extStr cStringUsingEncoding:NSASCIIStringEncoding]); mimeInfoMac->AppendExtension(preferredExt); } diff --git a/uriloader/exthandler/nsContentHandlerApp.cpp b/uriloader/exthandler/nsContentHandlerApp.cpp index 06774b97d3c3..915b51751dbf 100644 --- a/uriloader/exthandler/nsContentHandlerApp.cpp +++ b/uriloader/exthandler/nsContentHandlerApp.cpp @@ -60,7 +60,7 @@ NS_IMETHODIMP nsContentHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext) { - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetAsciiSpec(spec); NS_ENSURE_SUCCESS(rv,rv); const char* url = spec.get(); diff --git a/uriloader/exthandler/nsDBusHandlerApp.cpp b/uriloader/exthandler/nsDBusHandlerApp.cpp index f4f0234b9758..ac4c76b8e9cd 100644 --- a/uriloader/exthandler/nsDBusHandlerApp.cpp +++ b/uriloader/exthandler/nsDBusHandlerApp.cpp @@ -64,8 +64,8 @@ nsDBusHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *_retval) *_retval = false; return NS_OK; } - nsCAutoString service; - nsCAutoString method; + nsAutoCString service; + nsAutoCString method; nsresult rv = dbusHandlerApp->GetService(service); if (NS_FAILED(rv)) { @@ -86,7 +86,7 @@ NS_IMETHODIMP nsDBusHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext) { - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aURI->GetAsciiSpec(spec); NS_ENSURE_SUCCESS(rv,rv); const char* uri = spec.get(); diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index b7f229714db4..599f3da452c7 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -158,7 +158,7 @@ static nsresult UnescapeFragment(const nsACString& aFragment, nsIURI* aURI, nsAString& aResult) { // First, we need a charset - nsCAutoString originCharset; + nsAutoCString originCharset; nsresult rv = aURI->GetOriginCharset(originCharset); NS_ENSURE_SUCCESS(rv, rv); @@ -248,7 +248,7 @@ static bool GetFilenameAndExtensionFromChannel(nsIChannel* aChannel, // try to extract the file name from the url and use that as a first pass as the // leaf name of our temp file... - nsCAutoString leafName; + nsAutoCString leafName; url->GetFileName(leafName); if (!leafName.IsEmpty()) { @@ -558,7 +558,7 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const nsACString& aMimeConte nsIStreamListener ** aStreamListener) { nsAutoString fileName; - nsCAutoString fileExtension; + nsAutoCString fileExtension; uint32_t reason = nsIHelperAppLauncherDialog::REASON_CANTHANDLE; nsresult rv; @@ -623,7 +623,7 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const nsACString& aMimeConte bool allowURLExt = true; nsCOMPtr httpChan = do_QueryInterface(channel); if (httpChan) { - nsCAutoString requestMethod; + nsAutoCString requestMethod; httpChan->GetRequestMethod(requestMethod); allowURLExt = !requestMethod.Equals("POST"); } @@ -636,7 +636,7 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const nsACString& aMimeConte nsCOMPtr url = do_QueryInterface(uri); if (url) { - nsCAutoString query; + nsAutoCString query; // We only care about the query for HTTP and HTTPS URLs bool isHTTP, isHTTPS; @@ -678,7 +678,7 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const nsACString& aMimeConte // Try to find a mime object by looking at the mime type/extension nsCOMPtr mimeInfo; if (aMimeContentType.Equals(APPLICATION_GUESS_FROM_EXT, nsCaseInsensitiveCStringComparator())) { - nsCAutoString mimeType; + nsAutoCString mimeType; if (!fileExtension.IsEmpty()) { mimeSvc->GetFromTypeAndExtension(EmptyCString(), fileExtension, getter_AddRefs(mimeInfo)); if (mimeInfo) { @@ -714,7 +714,7 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const nsACString& aMimeConte *aStreamListener = nullptr; // We want the mimeInfo's primary extension to pass it to // nsExternalAppHandler - nsCAutoString buf; + nsAutoCString buf; mimeInfo->GetPrimaryExtension(buf); nsExternalAppHandler * handler = new nsExternalAppHandler(mimeInfo, @@ -813,7 +813,7 @@ NS_IMETHODIMP nsExternalHelperAppService::IsExposedProtocol(const char * aProtoc // check the per protocol setting first. it always takes precedence. // if not set, then use the global setting. - nsCAutoString prefName("network.protocol-handler.expose."); + nsAutoCString prefName("network.protocol-handler.expose."); prefName += aProtocolScheme; bool val; if (NS_SUCCEEDED(Preferences::GetBool(prefName.get(), &val))) { @@ -852,7 +852,7 @@ nsExternalHelperAppService::LoadURI(nsIURI *aURI, return NS_OK; } - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); if (spec.Find("%00") != -1) @@ -866,13 +866,13 @@ nsExternalHelperAppService::LoadURI(nsIURI *aURI, nsresult rv = ios->NewURI(spec, nullptr, nullptr, getter_AddRefs(uri)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString scheme; + nsAutoCString scheme; uri->GetScheme(scheme); if (scheme.IsEmpty()) return NS_OK; // must have a scheme // Deny load if the prefs say to do so - nsCAutoString externalPref(kExternalProtocolPrefPrefix); + nsAutoCString externalPref(kExternalProtocolPrefPrefix); externalPref += scheme; bool allowLoad = false; if (NS_FAILED(Preferences::GetBool(externalPref.get(), &allowLoad))) { @@ -1036,10 +1036,10 @@ nsExternalHelperAppService::SetProtocolHandlerDefaults(nsIHandlerInfo *aHandlerI aHandlerInfo->SetPreferredAction(nsIHandlerInfo::useSystemDefault); // whether or not to ask the user depends on the warning preference - nsCAutoString scheme; + nsAutoCString scheme; aHandlerInfo->GetType(scheme); - nsCAutoString warningPref(kExternalWarningPrefPrefix); + nsAutoCString warningPref(kExternalWarningPrefPrefix); warningPref += scheme; bool warn; if (NS_FAILED(Preferences::GetBool(warningPref.get(), &warn))) { @@ -1318,7 +1318,7 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel) NS_ASSERTION(strlen(b64) >= wantedFileNameLength, "not enough bytes produced for conversion!"); - nsCAutoString tempLeafName(b64, wantedFileNameLength); + nsAutoCString tempLeafName(b64, wantedFileNameLength); PR_Free(b64); b64 = nullptr; @@ -1327,7 +1327,7 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel) tempLeafName.ReplaceChar(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS, '_'); // now append our extension. - nsCAutoString ext; + nsAutoCString ext; mMimeInfo->GetPrimaryExtension(ext); if (!ext.IsEmpty()) { ext.ReplaceChar(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS, '_'); @@ -1374,7 +1374,7 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel) mOutStream = NS_BufferOutputStream(outputStream, BUFFERED_OUTPUT_SIZE); #if defined(XP_MACOSX) && !defined(__LP64__) - nsCAutoString contentType; + nsAutoCString contentType; mMimeInfo->GetMIMEType(contentType); if (contentType.LowerCaseEqualsLiteral(APPLICATION_APPLEFILE) || contentType.LowerCaseEqualsLiteral(MULTIPART_APPLEDOUBLE)) @@ -1434,7 +1434,7 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest *request, nsISuppo if (mOriginalChannel) { nsCOMPtr httpChannel(do_QueryInterface(mOriginalChannel)); if (httpChannel) { - nsCAutoString refreshHeader; + nsAutoCString refreshHeader; httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("refresh"), refreshHeader); if (!refreshHeader.IsEmpty()) { @@ -1462,7 +1462,7 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest *request, nsISuppo nsCOMPtr sourceURL(do_QueryInterface(mSourceUrl)); if (sourceURL) { - nsCAutoString extension; + nsAutoCString extension; sourceURL->GetFileExtension(extension); if (!extension.IsEmpty()) { @@ -1474,7 +1474,7 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest *request, nsISuppo rv = encEnum->HasMore(&hasMore); if (NS_SUCCEEDED(rv) && hasMore) { - nsCAutoString encType; + nsAutoCString encType; rv = encEnum->GetNext(encType); if (NS_SUCCEEDED(rv) && !encType.IsEmpty()) { @@ -1541,7 +1541,7 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest *request, nsISuppo handlerSvc->Exists(mMimeInfo, &mimeTypeIsInDatastore); if (!handlerSvc || !mimeTypeIsInDatastore) { - nsCAutoString MIMEType; + nsAutoCString MIMEType; mMimeInfo->GetMIMEType(MIMEType); if (!GetNeverAskFlagFromPref(NEVER_ASK_FOR_SAVE_TO_DISK_PREF, MIMEType.get())) @@ -2053,7 +2053,7 @@ nsresult nsExternalAppHandler::MoveFile(nsIFile * aNewFileLocation) nsCOMPtr localFileOS2 = do_QueryInterface(aNewFileLocation); if (localFileOS2) { - nsCAutoString url; + nsAutoCString url; mSourceUrl->GetSpec(url); localFileOS2->SetFileSource(url); } @@ -2441,7 +2441,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetFromTypeAndExtension(const nsACStri *_retval = nullptr; // OK... we need a type. Get one. - nsCAutoString typeToUse(aMIMEType); + nsAutoCString typeToUse(aMIMEType); if (typeToUse.IsEmpty()) { nsresult rv = GetTypeFromExtension(aFileExt, typeToUse); if (NS_FAILED(rv)) @@ -2479,7 +2479,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetFromTypeAndExtension(const nsACStri if (!found || NS_FAILED(rv)) { // No type match, try extension match if (!aFileExt.IsEmpty()) { - nsCAutoString overrideType; + nsAutoCString overrideType; rv = handlerSvc->GetTypeFromExtension(aFileExt, overrideType); if (NS_SUCCEEDED(rv) && !overrideType.IsEmpty()) { // We can't check handlerSvc->Exists() here, because we have a @@ -2516,7 +2516,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetFromTypeAndExtension(const nsACStri // If that still didn't work, set the file description to "ext File" if (NS_FAILED(rv) && !aFileExt.IsEmpty()) { // XXXzpao This should probably be localized - nsCAutoString desc(aFileExt); + nsAutoCString desc(aFileExt); desc.Append(" File"); (*_retval)->SetDescription(NS_ConvertASCIItoUTF16(desc)); LOG(("Falling back to 'File' file description\n")); @@ -2535,10 +2535,10 @@ NS_IMETHODIMP nsExternalHelperAppService::GetFromTypeAndExtension(const nsACStri #ifdef PR_LOGGING if (LOG_ENABLED()) { - nsCAutoString type; + nsAutoCString type; (*_retval)->GetMIMEType(type); - nsCAutoString ext; + nsAutoCString ext; (*_retval)->GetPrimaryExtension(ext); LOG(("MIME Info Summary: Type '%s', Primary Ext '%s'\n", type.get(), ext.get())); } @@ -2602,7 +2602,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetTypeFromExtension(const nsACString& nsCOMPtr catMan(do_GetService("@mozilla.org/categorymanager;1")); if (catMan) { // The extension in the category entry is always stored as lowercase - nsCAutoString lowercaseFileExt(aFileExt); + nsAutoCString lowercaseFileExt(aFileExt); ToLowerCase(lowercaseFileExt); // Read the MIME type from the category entry, if available nsXPIDLCString type; @@ -2652,7 +2652,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetTypeFromURI(nsIURI *aURI, nsACStrin // Now try to get an nsIURL so we don't have to do our own parsing nsCOMPtr url = do_QueryInterface(aURI); if (url) { - nsCAutoString ext; + nsAutoCString ext; rv = url->GetFileExtension(ext); if (NS_FAILED(rv)) return rv; @@ -2665,7 +2665,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetTypeFromURI(nsIURI *aURI, nsACStrin } // no url, let's give the raw spec a shot - nsCAutoString specStr; + nsAutoCString specStr; rv = aURI->GetSpec(specStr); if (NS_FAILED(rv)) return rv; @@ -2698,7 +2698,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetTypeFromFile(nsIFile* aFile, nsACSt rv = aFile->GetLeafName(fileName); if (NS_FAILED(rv)) return rv; - nsCAutoString fileExt; + nsAutoCString fileExt; if (!fileName.IsEmpty()) { int32_t len = fileName.Length(); @@ -2726,7 +2726,7 @@ nsresult nsExternalHelperAppService::FillMIMEInfoForMimeTypeFromExtras( NS_ENSURE_ARG( !aContentType.IsEmpty() ); // Look for default entry with matching mime type. - nsCAutoString MIMEType(aContentType); + nsAutoCString MIMEType(aContentType); ToLowerCase(MIMEType); int32_t numEntries = ArrayLength(extraMimeEntries); for (int32_t index = 0; index < numEntries; index++) @@ -2746,7 +2746,7 @@ nsresult nsExternalHelperAppService::FillMIMEInfoForMimeTypeFromExtras( nsresult nsExternalHelperAppService::FillMIMEInfoForExtensionFromExtras( const nsACString& aExtension, nsIMIMEInfo * aMIMEInfo) { - nsCAutoString type; + nsAutoCString type; bool found = GetTypeFromExtras(aExtension, type); if (!found) return NS_ERROR_NOT_AVAILABLE; diff --git a/uriloader/exthandler/nsExternalProtocolHandler.cpp b/uriloader/exthandler/nsExternalProtocolHandler.cpp index bd571eaa8f66..639ac3c4dfd2 100644 --- a/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -138,7 +138,7 @@ nsresult nsExtProtocolChannel::OpenURL() if (extProtService) { #ifdef DEBUG - nsCAutoString urlScheme; + nsAutoCString urlScheme; mUrl->GetScheme(urlScheme); bool haveHandler = false; extProtService->ExternalProtocolHandlerExists(urlScheme.get(), &haveHandler); @@ -340,7 +340,7 @@ bool nsExternalProtocolHandler::HaveExternalProtocolHandler(nsIURI * aURI) bool haveHandler = false; if (aURI) { - nsCAutoString scheme; + nsAutoCString scheme; aURI->GetScheme(scheme); nsCOMPtr extProtSvc(do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID)); if (extProtSvc) diff --git a/uriloader/exthandler/nsLocalHandlerApp.cpp b/uriloader/exthandler/nsLocalHandlerApp.cpp index 381245c9d5e1..56164f8944d4 100644 --- a/uriloader/exthandler/nsLocalHandlerApp.cpp +++ b/uriloader/exthandler/nsLocalHandlerApp.cpp @@ -102,7 +102,7 @@ nsLocalHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext) { // pass the entire URI to the handler. - nsCAutoString spec; + nsAutoCString spec; aURI->GetAsciiSpec(spec); return LaunchWithIProcess(spec); } diff --git a/uriloader/exthandler/nsMIMEInfoImpl.cpp b/uriloader/exthandler/nsMIMEInfoImpl.cpp index 4c47e58278da..21ac228397bb 100644 --- a/uriloader/exthandler/nsMIMEInfoImpl.cpp +++ b/uriloader/exthandler/nsMIMEInfoImpl.cpp @@ -167,7 +167,7 @@ nsMIMEInfoBase::Equals(nsIMIMEInfo *aMIMEInfo, bool *_retval) { if (!aMIMEInfo) return NS_ERROR_NULL_POINTER; - nsCAutoString type; + nsAutoCString type; nsresult rv = aMIMEInfo->GetMIMEType(type); if (NS_FAILED(rv)) return rv; @@ -300,7 +300,7 @@ nsMIMEInfoBase::LaunchWithFile(nsIFile* aFile) rv = localHandler->GetExecutable(getter_AddRefs(executable)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString path; + nsAutoCString path; aFile->GetNativePath(path); return LaunchWithIProcess(executable, path); } @@ -418,7 +418,7 @@ nsMIMEInfoImpl::LaunchDefaultWithFile(nsIFile* aFile) if (!mDefaultApplication) return NS_ERROR_FILE_NOT_FOUND; - nsCAutoString nativePath; + nsAutoCString nativePath; aFile->GetNativePath(nativePath); return LaunchWithIProcess(mDefaultApplication, nativePath); diff --git a/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp b/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp index 47087862687d..12ac1403f5ff 100644 --- a/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp +++ b/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp @@ -50,7 +50,7 @@ nsMIMEInfoOS2::~nsMIMEInfoOS2() // if the helper application is a DOS app, create an 8.3 filename static nsresult Make8Dot3Name(nsIFile *aFile, nsACString& aPath) { - nsCAutoString leafName; + nsAutoCString leafName; aFile->GetNativeLeafName(leafName); const char *lastDot = strrchr(leafName.get(), '.'); @@ -115,7 +115,7 @@ NS_IMETHODIMP nsMIMEInfoOS2::LaunchWithFile(nsIFile *aFile) return NS_ERROR_INVALID_ARG; } - nsCAutoString filePath; + nsAutoCString filePath; aFile->GetNativePath(filePath); // if there's no program, use the WPS to open the file @@ -149,7 +149,7 @@ NS_IMETHODIMP nsMIMEInfoOS2::LaunchWithFile(nsIFile *aFile) } // open the data file using the specified program file - nsCAutoString appPath; + nsAutoCString appPath; if (application) { application->GetNativePath(appPath); } @@ -269,20 +269,20 @@ nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI *aURL) if (NS_FAILED(rv)) { return NS_ERROR_FAILURE; } - nsCAutoString urlSpec; + nsAutoCString urlSpec; aURL->GetSpec(urlSpec); uri->SetSpec(urlSpec); /* Get the protocol so we can look up the preferences */ - nsCAutoString uProtocol; + nsAutoCString uProtocol; uri->GetScheme(uProtocol); - nsCAutoString branchName = NS_LITERAL_CSTRING("applications.") + uProtocol; - nsCAutoString prefName = branchName + branchName; + nsAutoCString branchName = NS_LITERAL_CSTRING("applications.") + uProtocol; + nsAutoCString prefName = branchName + branchName; nsAdoptingCString prefString = Preferences::GetCString(prefName.get()); - nsCAutoString applicationName; - nsCAutoString parameters; + nsAutoCString applicationName; + nsAutoCString parameters; if (prefString.IsEmpty()) { char szAppFromINI[CCHMAXPATH]; @@ -300,8 +300,8 @@ nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI *aURL) } // Dissect the URI - nsCAutoString uURL, uUsername, uPassword, uHost, uPort, uPath; - nsCAutoString uEmail, uGroup; + nsAutoCString uURL, uUsername, uPassword, uHost, uPort, uPath; + nsAutoCString uEmail, uGroup; int32_t iPort; // when passing to OS/2 apps later, we need ASCII URLs, @@ -352,7 +352,7 @@ nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI *aURL) int32_t pos = parameters.Find(url.get()); if (pos != kNotFound) { - nsCAutoString uURL; + nsAutoCString uURL; aURL->GetSpec(uURL); NS_UnescapeURL(uURL); uURL.Cut(0, uProtocol.Length()+1); @@ -563,7 +563,7 @@ nsMIMEInfoOS2::GetIconURLVariant(nsIFile *aApplication, nsIVariant **_retval) nsresult rv = CallCreateInstance("@mozilla.org/variant;1", _retval); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString fileURLSpec; + nsAutoCString fileURLSpec; if (aApplication) NS_GetURLSpecFromFile(aApplication, fileURLSpec); else { @@ -571,7 +571,7 @@ nsMIMEInfoOS2::GetIconURLVariant(nsIFile *aApplication, nsIVariant **_retval) fileURLSpec.Insert(NS_LITERAL_CSTRING("moztmp."), 0); } - nsCAutoString iconURLSpec(NS_LITERAL_CSTRING("moz-icon://")); + nsAutoCString iconURLSpec(NS_LITERAL_CSTRING("moz-icon://")); iconURLSpec += fileURLSpec; nsCOMPtr writable(do_QueryInterface(*_retval)); writable->SetAsAUTF8String(iconURLSpec); diff --git a/uriloader/exthandler/os2/nsOSHelperAppService.cpp b/uriloader/exthandler/os2/nsOSHelperAppService.cpp index d1d87bc47bc8..4c45fb7b6c4c 100644 --- a/uriloader/exthandler/os2/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/os2/nsOSHelperAppService.cpp @@ -326,7 +326,7 @@ nsOSHelperAppService::GetTypeAndDescriptionFromMimetypesFile(const nsAString& aF nsCOMPtr mimeTypes; bool netscapeFormat; nsAutoString buf; - nsCAutoString cBuf; + nsAutoCString cBuf; bool more = false; rv = CreateInputStream(aFilename, getter_AddRefs(mimeFile), getter_AddRefs(mimeTypes), cBuf, &netscapeFormat, &more); @@ -496,7 +496,7 @@ nsOSHelperAppService::GetExtensionsAndDescriptionFromMimetypesFile(const nsAStri nsCOMPtr mimeTypes; bool netscapeFormat; nsAutoString buf; - nsCAutoString cBuf; + nsAutoCString cBuf; bool more = false; rv = CreateInputStream(aFilename, getter_AddRefs(mimeFile), getter_AddRefs(mimeTypes), cBuf, &netscapeFormat, &more); @@ -922,7 +922,7 @@ nsOSHelperAppService::GetHandlerAndDescriptionFromMailcapFile(const nsAString& a } nsString entry, buffer; - nsCAutoString cBuffer; + nsAutoCString cBuffer; entry.SetCapacity(128); cBuffer.SetCapacity(80); rv = mailcap->ReadLine(cBuffer, &more); @@ -1030,7 +1030,7 @@ nsOSHelperAppService::GetHandlerAndDescriptionFromMailcapFile(const nsAString& a } else if (optionName.EqualsLiteral("x-mozilla-flags")) { aMozillaFlags = Substring(++equal_sign_iter, semicolon_iter); } else if (optionName.EqualsLiteral("test")) { - nsCAutoString testCommand; + nsAutoCString testCommand; rv = UnescapeCommand(Substring(++equal_sign_iter, semicolon_iter), aMajorType, aMinorType, @@ -1081,9 +1081,9 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolSch /* if applications.protocol is in prefs, then we have an external protocol handler */ nsresult rv; - nsCAutoString branchName = + nsAutoCString branchName = NS_LITERAL_CSTRING("applications.") + nsDependentCString(aProtocolScheme); - nsCAutoString prefName = branchName + branchName; + nsAutoCString prefName = branchName + branchName; nsAdoptingCString prefString = Preferences::GetCString(prefName.get()); *aHandlerExists = !prefString.IsEmpty(); @@ -1138,7 +1138,7 @@ nsOSHelperAppService::GetFromExtension(const nsCString& aFileExt) { return nullptr; } - nsCAutoString mimeType(asciiMajorType + NS_LITERAL_CSTRING("/") + asciiMinorType); + nsAutoCString mimeType(asciiMajorType + NS_LITERAL_CSTRING("/") + asciiMinorType); nsMIMEInfoOS2* mimeInfo = new nsMIMEInfoOS2(mimeType); if (!mimeInfo) return nullptr; @@ -1367,8 +1367,8 @@ WpsMimeInfoFromExtension(const char *aFileExt, nsMIMEInfoOS2 *aMI) // if the mimeinfo is bogus, change the mimetype & extensions list if (!exists) { - nsCAutoString extLower; - nsCAutoString cstr; + nsAutoCString extLower; + nsAutoCString cstr; ToLowerCase(nsDependentCString(aFileExt), extLower); cstr.Assign(NS_LITERAL_CSTRING("application/x-") + extLower); aMI->SetMIMEType(cstr); @@ -1383,7 +1383,7 @@ WpsMimeInfoFromExtension(const char *aFileExt, nsMIMEInfoOS2 *aMI) ustr.Truncate(); if (ustr.IsEmpty()) { - nsCAutoString extUpper; + nsAutoCString extUpper; ToUpperCase(nsDependentCString(aFileExt), extUpper); CopyUTF8toUTF16(extUpper, ustr); @@ -1419,7 +1419,7 @@ nsOSHelperAppService::GetFromTypeAndExtension(const nsACString& aMIMEType, // do lookups using the original extension if present; // otherwise use the extension derived from the mimetype - nsCAutoString ext; + nsAutoCString ext; if (!aFileExt.IsEmpty()) ext.Assign(aFileExt); else { @@ -1572,10 +1572,10 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval) { nsresult rv; - nsCAutoString branchName = NS_LITERAL_CSTRING("applications.") + aScheme; - nsCAutoString applicationName; + nsAutoCString branchName = NS_LITERAL_CSTRING("applications.") + aScheme; + nsAutoCString applicationName; - nsCAutoString prefName = branchName + branchName; + nsAutoCString prefName = branchName + branchName; nsAdoptingCString prefString = Preferences::GetCString(prefName.get()); if (!prefString) { // failed char szAppFromINI[CCHMAXPATH]; diff --git a/uriloader/exthandler/unix/nsGNOMERegistry.cpp b/uriloader/exthandler/unix/nsGNOMERegistry.cpp index 75b12d88892e..a4b8a0df7396 100644 --- a/uriloader/exthandler/unix/nsGNOMERegistry.cpp +++ b/uriloader/exthandler/unix/nsGNOMERegistry.cpp @@ -38,7 +38,7 @@ nsGNOMERegistry::HandlerExists(const char *aProtocolScheme) return true; } else if (gconf) { bool isEnabled; - nsCAutoString handler; + nsAutoCString handler; if (NS_FAILED(gconf->GetAppForProtocol(nsDependentCString(aProtocolScheme), &isEnabled, handler))) return false; @@ -79,7 +79,7 @@ nsGNOMERegistry::GetAppDescForScheme(const nsACString& aScheme, if (!gconf && !giovfs) return; - nsCAutoString name; + nsAutoCString name; if (giovfs) { nsCOMPtr app; if (NS_FAILED(giovfs->GetAppForURIScheme(aScheme, getter_AddRefs(app)))) @@ -111,7 +111,7 @@ nsGNOMERegistry::GetAppDescForScheme(const nsACString& aScheme, /* static */ already_AddRefed nsGNOMERegistry::GetFromExtension(const nsACString& aFileExt) { - nsCAutoString mimeType; + nsAutoCString mimeType; nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if (giovfs) { @@ -141,8 +141,8 @@ nsGNOMERegistry::GetFromType(const nsACString& aMIMEType) nsRefPtr mimeInfo = new nsMIMEInfoUnix(aMIMEType); NS_ENSURE_TRUE(mimeInfo, nullptr); - nsCAutoString name; - nsCAutoString description; + nsAutoCString name; + nsAutoCString description; nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if (giovfs) { @@ -175,7 +175,7 @@ nsGNOMERegistry::GetFromType(const nsACString& aMIMEType) // the default maemo domain-name to try and translate the string into the operating // system's native language. const char kDefaultTextDomain [] = "maemo-af-desktop"; - nsCAutoString realName (dgettext(kDefaultTextDomain, PromiseFlatCString(name).get())); + nsAutoCString realName (dgettext(kDefaultTextDomain, PromiseFlatCString(name).get())); mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(realName)); #else mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(name)); diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp index 518e5912b166..7a8c27f0c66b 100644 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp @@ -40,7 +40,7 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI) if (NS_FAILED(rv)){ HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nullptr); if (action) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetAsciiSpec(spec); if (hildon_uri_open(spec.get(), action, nullptr)) rv = NS_OK; @@ -51,7 +51,7 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI) #ifdef MOZ_WIDGET_QT if (NS_FAILED(rv)) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetAsciiSpec(spec); if (QDesktopServices::openUrl(QUrl(spec.get()))) { rv = NS_OK; @@ -68,7 +68,7 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) *_retval = false; nsRefPtr mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType); if (!mimeInfo) { - nsCAutoString ext; + nsAutoCString ext; nsresult rv = GetPrimaryExtension(ext); if (NS_SUCCEEDED(rv)) { mimeInfo = nsGNOMERegistry::GetFromExtension(ext); @@ -105,7 +105,7 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) nsresult nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile) { - nsCAutoString nativePath; + nsAutoCString nativePath; aFile->GetNativePath(nativePath); #if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS) @@ -125,7 +125,7 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile) #endif nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); - nsCAutoString uriSpec; + nsAutoCString uriSpec; if (giovfs) { // nsGIOMimeApp->Launch wants a URI string instead of local file nsresult rv; @@ -153,7 +153,7 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile) // extension mapped type nsRefPtr mimeInfo = nsGNOMERegistry::GetFromExtension(nativePath); if (mimeInfo) { - nsCAutoString type; + nsAutoCString type; mimeInfo->GetType(type); if (giovfs) { nsCOMPtr app; diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp index 1e1be172c7b7..b03b2f58f36a 100644 --- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp @@ -327,7 +327,7 @@ nsOSHelperAppService::GetTypeAndDescriptionFromMimetypesFile(const nsAString& aF nsCOMPtr mimeTypes; bool netscapeFormat; nsAutoString buf; - nsCAutoString cBuf; + nsAutoCString cBuf; bool more = false; rv = CreateInputStream(aFilename, getter_AddRefs(mimeFile), getter_AddRefs(mimeTypes), cBuf, &netscapeFormat, &more); @@ -494,7 +494,7 @@ nsOSHelperAppService::GetExtensionsAndDescriptionFromMimetypesFile(const nsAStri nsCOMPtr mimeFile; nsCOMPtr mimeTypes; bool netscapeFormat; - nsCAutoString cBuf; + nsAutoCString cBuf; nsAutoString buf; bool more = false; rv = CreateInputStream(aFilename, getter_AddRefs(mimeFile), getter_AddRefs(mimeTypes), @@ -969,7 +969,7 @@ nsOSHelperAppService::GetHandlerAndDescriptionFromMailcapFile(const nsAString& a } nsString entry, buffer; - nsCAutoString cBuffer; + nsAutoCString cBuffer; entry.SetCapacity(128); cBuffer.SetCapacity(80); rv = mailcap->ReadLine(cBuffer, &more); @@ -1077,7 +1077,7 @@ nsOSHelperAppService::GetHandlerAndDescriptionFromMailcapFile(const nsAString& a } else if (optionName.EqualsLiteral("x-mozilla-flags")) { aMozillaFlags = Substring(++equal_sign_iter, semicolon_iter); } else if (optionName.EqualsLiteral("test")) { - nsCAutoString testCommand; + nsAutoCString testCommand; rv = UnescapeCommand(Substring(++equal_sign_iter, semicolon_iter), aMajorType, aMinorType, @@ -1210,7 +1210,7 @@ nsresult nsOSHelperAppService::GetFileTokenForPath(const PRUnichar * platformApp bool exists = false; // ugly hack. Walk the PATH variable... char* unixpath = PR_GetEnv("PATH"); - nsCAutoString path(unixpath); + nsAutoCString path(unixpath); const char* start_iter = path.BeginReading(start_iter); const char* colon_iter = start_iter; @@ -1300,7 +1300,7 @@ nsOSHelperAppService::GetFromExtension(const nsCString& aFileExt) { return nullptr; } - nsCAutoString mimeType(asciiMajorType + NS_LITERAL_CSTRING("/") + asciiMinorType); + nsAutoCString mimeType(asciiMajorType + NS_LITERAL_CSTRING("/") + asciiMinorType); nsMIMEInfoUnix* mimeInfo = new nsMIMEInfoUnix(mimeType); if (!mimeInfo) return nullptr; diff --git a/uriloader/exthandler/win/nsMIMEInfoWin.cpp b/uriloader/exthandler/win/nsMIMEInfoWin.cpp index b77029416e31..43921808c604 100644 --- a/uriloader/exthandler/win/nsMIMEInfoWin.cpp +++ b/uriloader/exthandler/win/nsMIMEInfoWin.cpp @@ -175,9 +175,9 @@ static nsresult GetIconURLVariant(nsIFile* aApplication, nsIVariant* *_retval) nsresult rv = CallCreateInstance("@mozilla.org/variant;1", _retval); if (NS_FAILED(rv)) return rv; - nsCAutoString fileURLSpec; + nsAutoCString fileURLSpec; NS_GetURLSpecFromFile(aApplication, fileURLSpec); - nsCAutoString iconURLSpec; iconURLSpec.AssignLiteral("moz-icon://"); + nsAutoCString iconURLSpec; iconURLSpec.AssignLiteral("moz-icon://"); iconURLSpec += fileURLSpec; nsCOMPtr writable(do_QueryInterface(*_retval)); writable->SetAsAUTF8String(iconURLSpec); @@ -225,11 +225,11 @@ nsMIMEInfoWin::LoadUriInternal(nsIURI * aURL) if (aURL) { // extract the url spec from the url - nsCAutoString urlSpec; + nsAutoCString urlSpec; aURL->GetAsciiSpec(urlSpec); // Unescape non-ASCII characters in the URL - nsCAutoString urlCharset; + nsAutoCString urlCharset; nsAutoString utf16Spec; rv = aURL->GetOriginCharset(urlCharset); NS_ENSURE_SUCCESS(rv, rv); @@ -570,7 +570,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray **_retval) nsTArray trackList; - nsCAutoString fileExt; + nsAutoCString fileExt; GetPrimaryExtension(fileExt); nsCOMPtr regKey = @@ -592,7 +592,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray **_retval) // of file extensions related to mime type are simply not defined, // (application/rss+xml & application/atom+xml are good examples) // in which case we can only provide a generic list. - nsCAutoString mimeType; + nsAutoCString mimeType; GetMIMEType(mimeType); if (!mimeType.IsEmpty()) { workingRegistryPath.AppendLiteral("MIME\\Database\\Content Type\\"); diff --git a/uriloader/exthandler/win/nsOSHelperAppService.cpp b/uriloader/exthandler/win/nsOSHelperAppService.cpp index dc4b82b8dcb7..a9214cd0bc23 100644 --- a/uriloader/exthandler/win/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp @@ -513,7 +513,7 @@ already_AddRefed nsOSHelperAppService::GetByExtension(const nsAFl if (NS_FAILED(rv)) return nullptr; - nsCAutoString typeToUse; + nsAutoCString typeToUse; if (aTypeHint && *aTypeHint) { typeToUse.Assign(aTypeHint); } diff --git a/uriloader/prefetch/OfflineCacheUpdateChild.cpp b/uriloader/prefetch/OfflineCacheUpdateChild.cpp index 96486cbf8d37..afcc9b52757a 100644 --- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp @@ -158,7 +158,7 @@ OfflineCacheUpdateChild::AssociateDocument(nsIDOMDocument *aDocument, if (!existingCache) { #if defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString clientID; + nsAutoCString clientID; if (aApplicationCache) { aApplicationCache->GetClientID(clientID); } diff --git a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp index 4c69a3dc4596..493f1928620c 100644 --- a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp @@ -182,7 +182,7 @@ OfflineCacheUpdateGlue::ApplicationCacheAvailable(nsIApplicationCache *aApplicat if (!existingCache) { #if defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString clientID; + nsAutoCString clientID; if (aApplicationCache) { aApplicationCache->GetClientID(clientID); } diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp index 8cf31ba4b87e..1d9c9ee0011f 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp @@ -225,7 +225,7 @@ nsManifestCheck::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus) { - nsCAutoString manifestHash; + nsAutoCString manifestHash; if (NS_SUCCEEDED(aStatus)) { mManifestHash->Finish(true, manifestHash); } @@ -311,7 +311,7 @@ nsOfflineCacheUpdateItem::OpenChannel(nsOfflineCacheUpdate *aUpdate) { #if defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString spec; + nsAutoCString spec; mURI->GetSpec(spec); LOG(("%p: Opening channel for %s", this, spec.get())); } @@ -495,7 +495,7 @@ nsOfflineCacheUpdateItem::AsyncOnChannelRedirect(nsIChannel *aOldChannel, NS_ENSURE_SUCCESS(rv, rv); } - nsCAutoString oldScheme; + nsAutoCString oldScheme; mURI->GetScheme(oldScheme); bool match; @@ -532,7 +532,7 @@ nsOfflineCacheUpdateItem::GetSource(nsIDOMNode **aSource) NS_IMETHODIMP nsOfflineCacheUpdateItem::GetUri(nsAString &aURI) { - nsCAutoString spec; + nsAutoCString spec; nsresult rv = mURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -860,7 +860,7 @@ nsOfflineManifestItem::HandleManifestLine(const nsCString::const_iterator &aBegi if (NS_FAILED(DropReferenceFromURL(uri))) break; - nsCAutoString scheme; + nsAutoCString scheme; uri->GetScheme(scheme); // Manifest URIs must have the same scheme as the manifest. @@ -941,7 +941,7 @@ nsOfflineManifestItem::HandleManifestLine(const nsCString::const_iterator &aBegi if (NS_FAILED(rv)) break; - nsCAutoString scheme; + nsAutoCString scheme; bypassURI->GetScheme(scheme); bool equals; if (NS_FAILED(mURI->SchemeIs(scheme.get(), &equals)) || !equals) @@ -1059,7 +1059,7 @@ nsOfflineManifestItem::OnStartRequest(nsIRequest *aRequest, return NS_ERROR_ABORT; } - nsCAutoString contentType; + nsAutoCString contentType; rv = channel->GetContentType(contentType); NS_ENSURE_SUCCESS(rv, rv); @@ -1208,7 +1208,7 @@ nsOfflineCacheUpdate::Init(nsIURI *aManifestURI, rv = mManifestURI->GetAsciiHost(mUpdateDomain); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString manifestSpec; + nsAutoCString manifestSpec; rv = GetCacheKey(mManifestURI, manifestSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -1286,7 +1286,7 @@ nsOfflineCacheUpdate::InitPartial(nsIURI *aManifestURI, NS_ENSURE_SUCCESS(rv, rv); if (!mApplicationCache) { - nsCAutoString manifestSpec; + nsAutoCString manifestSpec; rv = GetCacheKey(mManifestURI, manifestSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -1295,7 +1295,7 @@ nsOfflineCacheUpdate::InitPartial(nsIURI *aManifestURI, NS_ENSURE_SUCCESS(rv, rv); } - nsCAutoString groupID; + nsAutoCString groupID; rv = mApplicationCache->GetGroupID(groupID); NS_ENSURE_SUCCESS(rv, rv); @@ -1542,7 +1542,7 @@ nsOfflineCacheUpdate::ManifestCheckCompleted(nsresult aStatus, nsCOMPtr kungFuDeathGrip(this); if (NS_SUCCEEDED(aStatus)) { - nsCAutoString firstManifestHash; + nsAutoCString firstManifestHash; mManifestItem->GetManifestHash(firstManifestHash); if (aManifestHash != firstManifestHash) { LOG(("Manifest has changed during cache items download [%p]", this)); @@ -1748,7 +1748,7 @@ nsOfflineCacheUpdate::ProcessNextURI() #if defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString spec; + nsAutoCString spec; runItem->mURI->GetSpec(spec); LOG(("%p: Opening channel for %s", this, spec.get())); } @@ -1871,7 +1871,7 @@ nsOfflineCacheUpdate::ScheduleImplicit() nsRefPtr update = new nsOfflineCacheUpdate(); NS_ENSURE_TRUE(update, NS_ERROR_OUT_OF_MEMORY); - nsCAutoString clientID; + nsAutoCString clientID; if (mPreviousApplicationCache) { rv = mPreviousApplicationCache->GetClientID(clientID); NS_ENSURE_SUCCESS(rv, rv); @@ -1931,7 +1931,7 @@ nsOfflineCacheUpdate::FinishNoNotify() nsCOMPtr appCacheService = do_GetService(NS_APPLICATIONCACHESERVICE_CONTRACTID); if (appCacheService) { - nsCAutoString groupID; + nsAutoCString groupID; mApplicationCache->GetGroupID(groupID); appCacheService->DeactivateGroup(groupID); } @@ -2097,7 +2097,7 @@ nsOfflineCacheUpdate::AddURI(nsIURI *aURI, uint32_t aType) return NS_ERROR_NOT_AVAILABLE; // Resource URIs must have the same scheme as the manifest. - nsCAutoString scheme; + nsAutoCString scheme; aURI->GetScheme(scheme); bool match; @@ -2137,7 +2137,7 @@ nsOfflineCacheUpdate::AddDynamicURI(nsIURI *aURI) // If this is a partial update and the resource is already in the // cache, we should only mark the entry, not fetch it again. if (mPartialUpdate) { - nsCAutoString key; + nsAutoCString key; GetCacheKey(aURI, key); uint32_t types; diff --git a/uriloader/prefetch/nsPrefetchService.cpp b/uriloader/prefetch/nsPrefetchService.cpp index 3da36cecae92..e704bdd5b29a 100644 --- a/uriloader/prefetch/nsPrefetchService.cpp +++ b/uriloader/prefetch/nsPrefetchService.cpp @@ -456,7 +456,7 @@ nsPrefetchService::ProcessNextURI() #if defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString spec; + nsAutoCString spec; mCurrentNode->mURI->GetSpec(spec); LOG(("ProcessNextURI [%s]\n", spec.get())); } @@ -642,7 +642,7 @@ nsPrefetchService::Prefetch(nsIURI *aURI, #if defined(PR_LOGGING) if (LOG_ENABLED()) { - nsCAutoString spec; + nsAutoCString spec; aURI->GetSpec(spec); LOG(("PrefetchURI [%s]\n", spec.get())); } @@ -691,7 +691,7 @@ nsPrefetchService::Prefetch(nsIURI *aURI, if (!aExplicit) { nsCOMPtr url(do_QueryInterface(aURI, &rv)); if (NS_FAILED(rv)) return rv; - nsCAutoString query; + nsAutoCString query; rv = url->GetQuery(query); if (NS_FAILED(rv) || !query.IsEmpty()) { LOG(("rejected: URL has a query string\n")); @@ -787,7 +787,7 @@ nsPrefetchNode::GetSource(nsIDOMNode **aSource) NS_IMETHODIMP nsPrefetchNode::GetUri(nsAString &aURI) { - nsCAutoString spec; + nsAutoCString spec; nsresult rv = mURI->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/widget/android/GfxInfo.cpp b/widget/android/GfxInfo.cpp index b806a8ab3a7c..c9992d303014 100644 --- a/widget/android/GfxInfo.cpp +++ b/widget/android/GfxInfo.cpp @@ -273,7 +273,7 @@ GfxInfo::AddCrashReportAnnotations() /* Add an App Note for now so that we get the data immediately. These * can go away after we store the above in the socorro db */ - nsCAutoString note; + nsAutoCString note; note.AppendPrintf("AdapterDescription: '%s'\n", mAdapterDescription.get()); CrashReporter::AppendAppNotesToCrashReport(note); diff --git a/widget/android/nsDeviceContextAndroid.cpp b/widget/android/nsDeviceContextAndroid.cpp index 1e6f562396d6..431a81ea323e 100644 --- a/widget/android/nsDeviceContextAndroid.cpp +++ b/widget/android/nsDeviceContextAndroid.cpp @@ -15,12 +15,12 @@ NS_IMPL_ISUPPORTS1(nsDeviceContextSpecAndroid, nsIDeviceContextSpec) NS_IMETHODIMP nsDeviceContextSpecAndroid::GetSurfaceForPrinter(gfxASurface** aSurface) { - nsCAutoString tmpDir(getenv("TMPDIR")); + nsAutoCString tmpDir(getenv("TMPDIR")); nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(mTempFile)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString filename("tmp-printing.pdf"); + nsAutoCString filename("tmp-printing.pdf"); mTempFile->AppendNative(filename); rv = mTempFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0660); NS_ENSURE_SUCCESS(rv, rv); diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm index 1b01ddbcb103..7c99d0fa9e2a 100644 --- a/widget/cocoa/GfxInfo.mm +++ b/widget/cocoa/GfxInfo.mm @@ -294,7 +294,7 @@ GfxInfo::AddCrashReportAnnotations() { #if defined(MOZ_CRASHREPORTER) nsString deviceID, vendorID; - nsCAutoString narrowDeviceID, narrowVendorID; + nsAutoCString narrowDeviceID, narrowVendorID; GetAdapterDeviceID(deviceID); CopyUTF16toUTF8(deviceID, narrowDeviceID); @@ -307,7 +307,7 @@ GfxInfo::AddCrashReportAnnotations() narrowDeviceID); /* Add an App Note for now so that we get the data immediately. These * can go away after we store the above in the socorro db */ - nsCAutoString note; + nsAutoCString note; /* AppendPrintf only supports 32 character strings, mrghh. */ note.Append("AdapterVendorID: "); note.Append(narrowVendorID); diff --git a/widget/cocoa/nsAppShell.mm b/widget/cocoa/nsAppShell.mm index 4d93d4f39594..1befff17661a 100644 --- a/widget/cocoa/nsAppShell.mm +++ b/widget/cocoa/nsAppShell.mm @@ -276,7 +276,7 @@ nsAppShell::Init() nibFile->AppendNative(NS_LITERAL_CSTRING("res")); nibFile->AppendNative(NS_LITERAL_CSTRING("MainMenu.nib")); - nsCAutoString nibPath; + nsAutoCString nibPath; rv = nibFile->GetNativePath(nibPath); NS_ENSURE_SUCCESS(rv, rv); diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 7bc095d402a2..8c358e1ee86b 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -1364,7 +1364,7 @@ nsresult nsChildView::ConfigureChildren(const nsTArray& aConfigur NS_IMETHODIMP nsChildView::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus) { #ifdef DEBUG - debug_DumpEvent(stdout, event->widget, event, nsCAutoString("something"), 0); + debug_DumpEvent(stdout, event->widget, event, nsAutoCString("something"), 0); #endif NS_ASSERTION(!(mTextInputHandler && mTextInputHandler->IsIMEComposing() && diff --git a/widget/cocoa/nsClipboard.mm b/widget/cocoa/nsClipboard.mm index c129a6b192e9..fe27ab3e01a2 100644 --- a/widget/cocoa/nsClipboard.mm +++ b/widget/cocoa/nsClipboard.mm @@ -499,8 +499,8 @@ nsClipboard::PasteboardDictFromTransferable(nsITransferable* aTransferable) // The Finder doesn't like getting random binary data aka // Unicode, so change it into an escaped URL containing only // ASCII. - nsCAutoString utf8Data = NS_ConvertUTF16toUTF8(url.get(), url.Length()); - nsCAutoString escData; + nsAutoCString utf8Data = NS_ConvertUTF16toUTF8(url.get(), url.Length()); + nsAutoCString escData; NS_EscapeURL(utf8Data.get(), utf8Data.Length(), esc_OnlyNonASCII|esc_AlwaysCopy, escData); // printf("Escaped url is %s, length %d\n", escData.get(), escData.Length()); diff --git a/widget/cocoa/nsMacCursor.mm b/widget/cocoa/nsMacCursor.mm index 9ffbdec5a98f..476801cbe9d7 100644 --- a/widget/cocoa/nsMacCursor.mm +++ b/widget/cocoa/nsMacCursor.mm @@ -148,7 +148,7 @@ NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; nsCOMPtr resDir; - nsCAutoString resPath; + nsAutoCString resPath; NSString* pathToImage; NSImage* cursorImage; diff --git a/widget/cocoa/nsMenuItemX.mm b/widget/cocoa/nsMenuItemX.mm index 8cd43677f8f0..32de97751f8d 100644 --- a/widget/cocoa/nsMenuItemX.mm +++ b/widget/cocoa/nsMenuItemX.mm @@ -191,7 +191,7 @@ uint32_t nsMenuItemX::ConvertGeckoToMacKeyCode(nsAString& aKeyCodeName) return 0; } - nsCAutoString keyCodeName; + nsAutoCString keyCodeName; keyCodeName.AssignWithConversion(aKeyCodeName); // We want case-insensitive comparison with data stored as uppercase. ToUpperCase(keyCodeName); diff --git a/widget/cocoa/nsPrintSettingsX.mm b/widget/cocoa/nsPrintSettingsX.mm index df81c91be2fc..553c914be93e 100644 --- a/widget/cocoa/nsPrintSettingsX.mm +++ b/widget/cocoa/nsPrintSettingsX.mm @@ -101,7 +101,7 @@ NS_IMETHODIMP nsPrintSettingsX::ReadPageFormatFromPrefs() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - nsCAutoString encodedData; + nsAutoCString encodedData; nsresult rv = Preferences::GetCString(MAC_OS_X_PAGE_SETUP_PREFNAME, &encodedData); if (NS_FAILED(rv)) { @@ -139,7 +139,7 @@ NS_IMETHODIMP nsPrintSettingsX::WritePageFormatToPrefs() if (err != noErr) return NS_ERROR_FAILURE; - nsCAutoString encodedData; + nsAutoCString encodedData; encodedData.Adopt(PL_Base64Encode((char*)[data bytes], [data length], nullptr)); if (!encodedData.get()) return NS_ERROR_OUT_OF_MEMORY; diff --git a/widget/gtk2/nsCUPSShim.cpp b/widget/gtk2/nsCUPSShim.cpp index 6840615765fc..0af898155ecf 100644 --- a/widget/gtk2/nsCUPSShim.cpp +++ b/widget/gtk2/nsCUPSShim.cpp @@ -45,7 +45,7 @@ nsCUPSShim::Init() *(symAddr[i]) = PR_FindSymbol(mCupsLib, gSymName[i]); if (! *(symAddr[i])) { #ifdef DEBUG - nsCAutoString msg(gSymName[i]); + nsAutoCString msg(gSymName[i]); msg.Append(" not found in CUPS library"); NS_WARNING(msg.get()); #endif diff --git a/widget/gtk2/nsClipboard.cpp b/widget/gtk2/nsClipboard.cpp index 514fcfe328a0..1eaabb8c408e 100644 --- a/widget/gtk2/nsClipboard.cpp +++ b/widget/gtk2/nsClipboard.cpp @@ -271,7 +271,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) guchar *data = NULL; gint length = 0; bool foundData = false; - nsCAutoString foundFlavor; + nsAutoCString foundFlavor; // Get a list of flavors this transferable can import nsCOMPtr flavors; @@ -701,7 +701,7 @@ clipboard_clear_cb(GtkClipboard *aGtkClipboard, void ConvertHTMLtoUCS2(guchar * data, int32_t dataLength, PRUnichar** unicodeData, int32_t& outUnicodeLen) { - nsCAutoString charset; + nsAutoCString charset; GetHTMLCharset(data, dataLength, charset);// get charset of HTML if (charset.EqualsLiteral("UTF-16")) {//current mozilla outUnicodeLen = (dataLength / 2) - 1; diff --git a/widget/gtk2/nsDeviceContextSpecG.cpp b/widget/gtk2/nsDeviceContextSpecG.cpp index 63f9a341bfa3..9f1d833843f1 100644 --- a/widget/gtk2/nsDeviceContextSpecG.cpp +++ b/widget/gtk2/nsDeviceContextSpecG.cpp @@ -748,7 +748,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich /* Set filename */ - nsCAutoString filename; + nsAutoCString filename; if (NS_FAILED(CopyPrinterCharPref(nullptr, printerName, "filename", filename))) { const char *path; @@ -782,7 +782,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich printerFeatures.SetCanChangeOrientation(true); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ - nsCAutoString orientation; + nsAutoCString orientation; if (NS_SUCCEEDED(CopyPrinterCharPref("postscript", printerName, "orientation", orientation))) { if (orientation.LowerCaseEqualsLiteral("portrait")) { @@ -840,7 +840,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich #ifdef SET_PRINTER_FEATURES_VIA_PREFS printerFeatures.SetCanChangePaperSize(true); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ - nsCAutoString papername; + nsAutoCString papername; if (NS_SUCCEEDED(CopyPrinterCharPref("postscript", printerName, "paper_size", papername))) { nsPaperSizePS paper; @@ -888,7 +888,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ if (hasSpoolerCmd) { - nsCAutoString command; + nsAutoCString command; if (NS_SUCCEEDED(CopyPrinterCharPref("postscript", printerName, "print_command", command))) { DO_PR_DEBUG_LOG(("setting default print command to '%s'\n", diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp index 579d454adf5d..56629cde613f 100644 --- a/widget/gtk2/nsFilePicker.cpp +++ b/widget/gtk2/nsFilePicker.cpp @@ -157,10 +157,10 @@ UpdateFilePreviewWidget(GtkFileChooser *file_chooser, gtk_file_chooser_set_preview_widget_active(file_chooser, TRUE); } -static nsCAutoString +static nsAutoCString MakeCaseInsensitiveShellGlob(const char* aPattern) { // aPattern is UTF8 - nsCAutoString result; + nsAutoCString result; unsigned int len = strlen(aPattern); for (unsigned int i = 0; i < len; i++) { @@ -272,7 +272,7 @@ nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) return NS_OK; } - nsCAutoString filter, name; + nsAutoCString filter, name; CopyUTF16toUTF8(aFilter, filter); CopyUTF16toUTF8(aTitle, name); @@ -461,11 +461,11 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) // Try to select the intended file. Even if it doesn't exist, GTK still switches // directories. defaultPath->AppendNative(defaultName); - nsCAutoString path; + nsAutoCString path; defaultPath->GetNativePath(path); gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(file_chooser), path.get()); } else { - nsCAutoString directory; + nsAutoCString directory; defaultPath->GetNativePath(directory); gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(file_chooser), directory.get()); @@ -486,7 +486,7 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) GtkFileFilter *filter = gtk_file_filter_new(); for (int j = 0; patterns[j] != NULL; ++j) { - nsCAutoString caseInsensitiveFilter = MakeCaseInsensitiveShellGlob(g_strstrip(patterns[j])); + nsAutoCString caseInsensitiveFilter = MakeCaseInsensitiveShellGlob(g_strstrip(patterns[j])); gtk_file_filter_add_pattern(filter, caseInsensitiveFilter.get()); } diff --git a/widget/gtk2/nsPSPrinters.cpp b/widget/gtk2/nsPSPrinters.cpp index ad5aea9ca302..e7d537cd31bb 100644 --- a/widget/gtk2/nsPSPrinters.cpp +++ b/widget/gtk2/nsPSPrinters.cpp @@ -63,7 +63,7 @@ nsPSPrinterList::GetPrinterList(nsTArray& aList) int num_dests = (gCupsShim.mCupsGetDests)(&dests); if (num_dests) { for (int i = 0; i < num_dests; i++) { - nsCAutoString fullName(NS_CUPS_PRINTER); + nsAutoCString fullName(NS_CUPS_PRINTER); fullName.Append(dests[i].name); if (dests[i].instance != NULL) { fullName.Append("/"); @@ -87,7 +87,7 @@ nsPSPrinterList::GetPrinterList(nsTArray& aList) aList.AppendElement( NS_LITERAL_CSTRING(NS_POSTSCRIPT_DRIVER_NAME "default")); - nsCAutoString list(PR_GetEnv("MOZILLA_POSTSCRIPT_PRINTER_LIST")); + nsAutoCString list(PR_GetEnv("MOZILLA_POSTSCRIPT_PRINTER_LIST")); if (list.IsEmpty()) { list = Preferences::GetCString("print.printer_list"); } @@ -101,7 +101,7 @@ nsPSPrinterList::GetPrinterList(nsTArray& aList) name = PL_strtok_r(nullptr, " ", &state) ) { if (0 != strcmp(name, "default")) { - nsCAutoString fullName(NS_POSTSCRIPT_DRIVER_NAME); + nsAutoCString fullName(NS_POSTSCRIPT_DRIVER_NAME); fullName.Append(name); aList.AppendElement(fullName); } diff --git a/widget/gtk2/nsPrintSettingsGTK.cpp b/widget/gtk2/nsPrintSettingsGTK.cpp index 3322d78347cf..0169e0d8f84e 100644 --- a/widget/gtk2/nsPrintSettingsGTK.cpp +++ b/widget/gtk2/nsPrintSettingsGTK.cpp @@ -421,7 +421,7 @@ nsPrintSettingsGTK::SetToFileName(const PRUnichar * aToFileName) NS_ENSURE_SUCCESS(rv, rv); // Convert the nsIFile to a URL - nsCAutoString url; + nsAutoCString url; rv = NS_GetURLSpecFromFile(file, url); NS_ENSURE_SUCCESS(rv, rv); diff --git a/widget/gtk2/nsSound.cpp b/widget/gtk2/nsSound.cpp index b7512c54d37e..0ea1e2c29096 100644 --- a/widget/gtk2/nsSound.cpp +++ b/widget/gtk2/nsSound.cpp @@ -136,7 +136,7 @@ ca_context_get_default() nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); if (appInfo) { - nsCAutoString version; + nsAutoCString version; appInfo->GetVersion(version); ca_context_change_props(ctx, "application.version", version.get(), NULL); @@ -232,7 +232,7 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, if (channel) { channel->GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString uriSpec; + nsAutoCString uriSpec; uri->GetSpec(uriSpec); printf("Failed to load %s\n", uriSpec.get()); } @@ -288,7 +288,7 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, return NS_ERROR_OUT_OF_MEMORY; } - nsCAutoString path; + nsAutoCString path; rv = canberraFile->GetNativePath(path); if (NS_FAILED(rv)) { return rv; @@ -326,7 +326,7 @@ NS_METHOD nsSound::Play(nsIURL *aURL) return NS_ERROR_OUT_OF_MEMORY; } - nsCAutoString spec; + nsAutoCString spec; rv = aURL->GetSpec(spec); if (NS_FAILED(rv)) { return rv; diff --git a/widget/gtk2/nsWindow.cpp b/widget/gtk2/nsWindow.cpp index b82e52f10d8f..8ae32cf9b31a 100644 --- a/widget/gtk2/nsWindow.cpp +++ b/widget/gtk2/nsWindow.cpp @@ -452,7 +452,7 @@ nsWindow::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus) { #ifdef DEBUG debug_DumpEvent(stdout, aEvent->widget, aEvent, - nsCAutoString("something"), 0); + nsAutoCString("something"), 0); #endif aStatus = nsEventStatus_eIgnore; @@ -1288,7 +1288,7 @@ SetUserTimeAndStartupIDForActivatedWindow(GtkWidget* aWindow) if (!GTKToolkit) return; - nsCAutoString desktopStartupID; + nsAutoCString desktopStartupID; GTKToolkit->GetDesktopStartupID(&desktopStartupID); if (desktopStartupID.IsEmpty()) { // We don't have the data we need. Fall back to an @@ -1732,7 +1732,7 @@ nsWindow::SetIcon(const nsAString& aIconSpec) if (!mShell) return NS_OK; - nsCAutoString iconName; + nsAutoCString iconName; if (aIconSpec.EqualsLiteral("default")) { nsXPIDLString brandName; @@ -1744,7 +1744,7 @@ nsWindow::SetIcon(const nsAString& aIconSpec) } nsCOMPtr iconFile; - nsCAutoString path; + nsAutoCString path; gint *iconSizes = gtk_icon_theme_get_icon_sizes(gtk_icon_theme_get_default(), diff --git a/widget/os2/nsDeviceContextSpecOS2.cpp b/widget/os2/nsDeviceContextSpecOS2.cpp index db553073def9..1e52c7cdb183 100644 --- a/widget/os2/nsDeviceContextSpecOS2.cpp +++ b/widget/os2/nsDeviceContextSpecOS2.cpp @@ -341,7 +341,7 @@ NS_IMETHODIMP nsDeviceContextSpecOS2::GetSurfaceForPrinter(gfxASurface **surface time.tm_hour, time.tm_min, time.tm_sec); printName[CCHMAXPATH-1] = '\0'; - nsCAutoString printString(printName); + nsAutoCString printString(printName); rv = pdfLocation->AppendNative(printString); NS_ENSURE_SUCCESS(rv, rv); rv = pdfLocation->GetPath(filename); @@ -639,12 +639,12 @@ nsresult GlobalPrinters::InitializeGlobalPrinters () // store printer description in prefs for the print dialog if (!prefFailed) { - nsCAutoString printerDescription; - printerDescription = nsCAutoString(nsDeviceContextSpecOS2::PrnDlg.GetPrintDriver(i)->szDeviceName); + nsAutoCString printerDescription; + printerDescription = nsAutoCString(nsDeviceContextSpecOS2::PrnDlg.GetPrintDriver(i)->szDeviceName); printerDescription += " ("; - printerDescription += nsCAutoString(nsDeviceContextSpecOS2::PrnDlg.GetDriverType(i)); + printerDescription += nsAutoCString(nsDeviceContextSpecOS2::PrnDlg.GetDriverType(i)); printerDescription += ")"; - nsCAutoString prefName("print.printer_"); + nsAutoCString prefName("print.printer_"); prefName += printer; prefName += ".printer_description"; Preferences::SetCString(prefName.get(), printerDescription); diff --git a/widget/os2/nsDragService.cpp b/widget/os2/nsDragService.cpp index 0852d2bcca17..53828393508a 100644 --- a/widget/os2/nsDragService.cpp +++ b/widget/os2/nsDragService.cpp @@ -266,7 +266,7 @@ MRESULT EXPENTRY nsDragWindowProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2) // QI'ing nsIURL will fail for mailto: and the like nsCOMPtr urlObject(do_QueryInterface(dragservice->mSourceData)); if (urlObject) { - nsCAutoString filename; + nsAutoCString filename; urlObject->GetFileName(filename); if (filename.IsEmpty()) { urlObject->GetHost(filename); @@ -517,7 +517,7 @@ nsresult nsDragService::SaveAsContents(PCSZ pszDest, nsIURL* aURL) nsresult nsDragService::SaveAsURL(PCSZ pszDest, nsIURI* aURI) { - nsCAutoString strUri; + nsAutoCString strUri; aURI->GetSpec(strUri); if (strUri.IsEmpty()) @@ -634,11 +634,11 @@ nsresult nsDragService::GetUrlAndTitle(nsISupports *aGenericData, // the hostname & filename; if not, use the first MAXTITLELTH // characters that appear after the scheme name - nsCAutoString strTitle; + nsAutoCString strTitle; nsCOMPtr urlObj( do_QueryInterface(saveURI)); if (urlObj) { - nsCAutoString strFile; + nsAutoCString strFile; urlObj->GetHost(strTitle); urlObj->GetFileName(strFile); @@ -649,7 +649,7 @@ nsresult nsDragService::GetUrlAndTitle(nsISupports *aGenericData, else { urlObj->GetDirectory(strFile); if (strFile.Length() > 1) { - nsCAutoString::const_iterator start, end, curr; + nsAutoCString::const_iterator start, end, curr; strFile.BeginReading(start); strFile.EndReading(end); strFile.EndReading(curr); @@ -880,7 +880,7 @@ NS_IMETHODIMP nsDragService::NativeDragEnter(PDRAGINFO pdinfo) nsCOMPtr file; if (NS_SUCCEEDED(NS_NewNativeLocalFile(someText, true, getter_AddRefs(file)))) { - nsCAutoString textStr; + nsAutoCString textStr; NS_GetURLSpecFromFile(file, textStr); if (!textStr.IsEmpty()) { someText.Assign(ToNewCString(textStr)); @@ -1141,7 +1141,7 @@ NS_IMETHODIMP nsDragService::NativeDrop(PDRAGINFO pdinfo, HWND hwnd, nsCOMPtr file; if (NS_SUCCEEDED(NS_NewNativeLocalFile(fileName, true, getter_AddRefs(file)))) { - nsCAutoString textStr; + nsAutoCString textStr; NS_GetURLSpecFromFile(file, textStr); if (!textStr.IsEmpty()) { dropText.Assign(ToNewCString(textStr)); @@ -1354,7 +1354,7 @@ NS_IMETHODIMP nsDragService::NativeDataToTransferable( PCSZ pszText, if (NS_SUCCEEDED(NS_NewURI(getter_AddRefs(uri), pszText))) { nsCOMPtr url (do_QueryInterface(uri)); if (url) { - nsCAutoString extension; + nsAutoCString extension; url->GetFileExtension(extension); if (!extension.IsEmpty()) { if (extension.LowerCaseEqualsLiteral("gif") || @@ -1443,7 +1443,7 @@ nsresult RenderToOS2FileComplete(PDRAGTRANSFER pdxfer, USHORT usResult, nsCOMPtr file; if (NS_SUCCEEDED(NS_NewNativeLocalFile(nsDependentCString(gTempFile), true, getter_AddRefs(file)))) { - nsCAutoString textStr; + nsAutoCString textStr; NS_GetURLSpecFromFile(file, textStr); if (!textStr.IsEmpty()) { *outText = ToNewCString(textStr); @@ -1721,7 +1721,7 @@ void SaveTypeAndSource(nsIFile *file, nsIDOMDocument *domDoc, if (ignore) return; - nsCAutoString url; + nsAutoCString url; srcUri->GetSpec(url); os2file->SetFileSource(url); diff --git a/widget/os2/nsFilePicker.cpp b/widget/os2/nsFilePicker.cpp index 20100ee5e8a3..07349e95ffb0 100644 --- a/widget/os2/nsFilePicker.cpp +++ b/widget/os2/nsFilePicker.cpp @@ -89,7 +89,7 @@ NS_IMETHODIMP nsFilePicker::Show(int16_t *retval) NS_ENSURE_ARG_POINTER(retval); bool result = false; - nsCAutoString fileBuffer; + nsAutoCString fileBuffer; char *converted = ConvertToFileSystemCharset(mDefault); if (nullptr == converted) { LossyCopyUTF16toASCII(mDefault, fileBuffer); @@ -102,7 +102,7 @@ NS_IMETHODIMP nsFilePicker::Show(int16_t *retval) char *title = ConvertToFileSystemCharset(mTitle); if (nullptr == title) title = ToNewCString(mTitle); - nsCAutoString initialDir; + nsAutoCString initialDir; if (mDisplayDirectory) mDisplayDirectory->GetNativePath(initialDir); // If no display directory, re-use the last one. @@ -315,7 +315,7 @@ NS_IMETHODIMP nsFilePicker::Show(int16_t *retval) file->InitWithNativePath(mFile); nsCOMPtr dir; if (NS_SUCCEEDED(file->GetParent(getter_AddRefs(dir)))) { - nsCAutoString newDir; + nsAutoCString newDir; dir->GetNativePath(newDir); if(!newDir.IsEmpty()) PL_strncpyz(mLastUsedDirectory, newDir.get(), MAX_PATH+1); @@ -479,7 +479,7 @@ void nsFilePicker::InitNative(nsIWidget *aParent, //------------------------------------------------------------------------- void nsFilePicker::GetFileSystemCharset(nsCString & fileSystemCharset) { - static nsCAutoString aCharset; + static nsAutoCString aCharset; nsresult rv; if (aCharset.Length() < 1) { @@ -502,7 +502,7 @@ char * nsFilePicker::ConvertToFileSystemCharset(const nsAString& inString) // get file system charset and create a unicode encoder if (nullptr == mUnicodeEncoder) { - nsCAutoString fileSystemCharset; + nsAutoCString fileSystemCharset; GetFileSystemCharset(fileSystemCharset); nsCOMPtr ccm = @@ -545,7 +545,7 @@ PRUnichar * nsFilePicker::ConvertFromFileSystemCharset(const char *inString) // get file system charset and create a unicode encoder if (nullptr == mUnicodeDecoder) { - nsCAutoString fileSystemCharset; + nsAutoCString fileSystemCharset; GetFileSystemCharset(fileSystemCharset); nsCOMPtr ccm = diff --git a/widget/os2/nsOS2Uni.cpp b/widget/os2/nsOS2Uni.cpp index 1b0e93783bc2..4088f54070f1 100644 --- a/widget/os2/nsOS2Uni.cpp +++ b/widget/os2/nsOS2Uni.cpp @@ -56,7 +56,7 @@ OS2Uni::GetUconvObject(int aCodePage, ConverterRequest aReq) if (aCodePage == gConverterInfo[i].mCodePage) { if (gConverterInfo[i].mEncoder == nullptr) { const char* convname; - nsCAutoString charset; + nsAutoCString charset; if (aCodePage == 0) { nsCOMPtr plat(do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv)); diff --git a/widget/os2/nsPrintOS2.cpp b/widget/os2/nsPrintOS2.cpp index 4c5e3bc57d25..0fbbe1508de7 100644 --- a/widget/os2/nsPrintOS2.cpp +++ b/widget/os2/nsPrintOS2.cpp @@ -212,7 +212,7 @@ void PRINTDLG::GetPrinter(ULONG printerNdx, char** printerName) if (printerNdx >= mQueueCount) return; - nsCAutoString pName(mPQBuf[printerNdx]->QueueName()); + nsAutoCString pName(mPQBuf[printerNdx]->QueueName()); pName.ReplaceChar('\r', ' '); pName.StripChars("\n"); diff --git a/widget/os2/nsRwsService.cpp b/widget/os2/nsRwsService.cpp index f8d2bd6b8c9c..8b8663577186 100644 --- a/widget/os2/nsRwsService.cpp +++ b/widget/os2/nsRwsService.cpp @@ -156,7 +156,7 @@ nsRwsService::IconFromExtension(const char *aExt, bool aNeedMini, if (NS_SUCCEEDED(rv)) return rv; - nsCAutoString path; + nsAutoCString path; rv = CreateFileForExtension(aExt, path); if (NS_SUCCEEDED(rv)) { rv = IconFromPath(path.get(), false, aNeedMini, _retval); @@ -237,7 +237,7 @@ nsRwsService::HandlerFromExtension(const char *aExt, uint32_t *aHandle, if (NS_SUCCEEDED(rv)) return rv; - nsCAutoString path; + nsAutoCString path; rv = CreateFileForExtension(aExt, path); if (NS_SUCCEEDED(rv)) { rv = HandlerFromPath(path.get(), aHandle, _retval); @@ -687,7 +687,7 @@ static nsresult CreateFileForExtension(const char *aFileExt, if (NS_FAILED(rv)) return rv; - nsCAutoString pathStr(NS_LITERAL_CSTRING("nsrws.")); + nsAutoCString pathStr(NS_LITERAL_CSTRING("nsrws.")); if (*aFileExt == '.') aFileExt++; pathStr.Append(aFileExt); diff --git a/widget/os2/nsSound.cpp b/widget/os2/nsSound.cpp index a060b136de28..6ff68a454600 100644 --- a/widget/os2/nsSound.cpp +++ b/widget/os2/nsSound.cpp @@ -130,7 +130,7 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, if (channel) { channel->GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString uriSpec; + nsAutoCString uriSpec; uri->GetSpec(uriSpec); fprintf(stderr, "nsSound::OnStreamComplete: failed to load %s\n", uriSpec.get()); @@ -246,7 +246,7 @@ NS_IMETHODIMP nsSound::PlayEventSound(uint32_t aEventId) nsresult nsSound::PlaySoundFile(const nsAString &aSoundFile) { - nsCAutoString buf; + nsAutoCString buf; nsresult rv = NS_CopyUnicodeToNative(aSoundFile, buf); NS_ENSURE_SUCCESS(rv,rv); diff --git a/widget/os2/nsWindow.cpp b/widget/os2/nsWindow.cpp index f02774aa8fbb..6d93a56aaada 100644 --- a/widget/os2/nsWindow.cpp +++ b/widget/os2/nsWindow.cpp @@ -2081,7 +2081,7 @@ do { thebesContext->Clip(); #ifdef DEBUG_PAINT - debug_DumpPaintEvent(stdout, this, &event, nsCAutoString("noname"), + debug_DumpPaintEvent(stdout, this, &event, nsAutoCString("noname"), (int32_t)mWnd); #endif diff --git a/widget/os2/os2FrameWindow.cpp b/widget/os2/os2FrameWindow.cpp index f8989ad199af..da82028b5a78 100644 --- a/widget/os2/os2FrameWindow.cpp +++ b/widget/os2/os2FrameWindow.cpp @@ -485,7 +485,7 @@ nsresult os2FrameWindow::SetIcon(const nsAString& aIconSpec) // if the file was found, try to use it if (iconFile) { - nsCAutoString path; + nsAutoCString path; iconFile->GetNativePath(path); if (mFrameIcon) { diff --git a/widget/qt/nsClipboard.cpp b/widget/qt/nsClipboard.cpp index 72f3bccf5a32..65945016fa7c 100644 --- a/widget/qt/nsClipboard.cpp +++ b/widget/qt/nsClipboard.cpp @@ -254,7 +254,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable *aTransferable, // Walk through flavors and see which flavor matches the one being pasted uint32_t flavorCount; flavorList->Count(&flavorCount); - nsCAutoString foundFlavor; + nsAutoCString foundFlavor; for (uint32_t i = 0; i < flavorCount; ++i) { @@ -273,7 +273,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable *aTransferable, { // Clipboard has text and flavor accepts text, so lets // handle the data as text - foundFlavor = nsCAutoString(flavorStr); + foundFlavor = nsAutoCString(flavorStr); // Get the text data from clipboard QString text = mimeData->text(); @@ -300,7 +300,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable *aTransferable, { // Clipboard has text/html and flavor accepts text/html, so lets // handle the data as text/html - foundFlavor = nsCAutoString(flavorStr); + foundFlavor = nsAutoCString(flavorStr); // Get the text data from clipboard QString html = mimeData->html(); diff --git a/widget/qt/nsFilePicker.cpp b/widget/qt/nsFilePicker.cpp index 1d762cc9b9b4..10967a610d8b 100644 --- a/widget/qt/nsFilePicker.cpp +++ b/widget/qt/nsFilePicker.cpp @@ -70,7 +70,7 @@ nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) return NS_OK; } - nsCAutoString filter, name; + nsAutoCString filter, name; CopyUTF16toUTF8(aFilter, filter); CopyUTF16toUTF8(aTitle, name); @@ -181,7 +181,7 @@ nsFilePicker::GetFiles(nsISimpleEnumerator* *aFiles) NS_IMETHODIMP nsFilePicker::Show(int16_t* aReturn) { - nsCAutoString directory; + nsAutoCString directory; if (mDisplayDirectory) { mDisplayDirectory->GetNativePath(directory); } diff --git a/widget/qt/nsSound.cpp b/widget/qt/nsSound.cpp index 7b770cc75bc5..eb6dddbea0a0 100644 --- a/widget/qt/nsSound.cpp +++ b/widget/qt/nsSound.cpp @@ -147,7 +147,7 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, if (channel) { channel->GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString uriSpec; + nsAutoCString uriSpec; uri->GetSpec(uriSpec); printf("Failed to load %s\n", uriSpec.get()); } diff --git a/widget/qt/nsWindow.cpp b/widget/qt/nsWindow.cpp index 4956f3db0b7e..9e9c00cfe38f 100644 --- a/widget/qt/nsWindow.cpp +++ b/widget/qt/nsWindow.cpp @@ -817,7 +817,7 @@ nsWindow::SetIcon(const nsAString& aIconSpec) return NS_OK; nsCOMPtr iconFile; - nsCAutoString path; + nsAutoCString path; nsTArray iconList; // Look for icons with the following suffixes appended to the base name. @@ -2861,7 +2861,7 @@ nsWindow::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus) { #ifdef DEBUG debug_DumpEvent(stdout, aEvent->widget, aEvent, - nsCAutoString("something"), 0); + nsAutoCString("something"), 0); #endif aStatus = nsEventStatus_eIgnore; diff --git a/widget/tests/TestAppShellSteadyState.cpp b/widget/tests/TestAppShellSteadyState.cpp index 4bc4c1a8d976..f2d3c4717662 100644 --- a/widget/tests/TestAppShellSteadyState.cpp +++ b/widget/tests/TestAppShellSteadyState.cpp @@ -315,7 +315,7 @@ GetAppShell() NS_NAMED_LITERAL_CSTRING(contractSuffix, ";1"); for (size_t index = 0; index < ArrayLength(platforms); index++) { - nsCAutoString contractID(contractPrefix); + nsAutoCString contractID(contractPrefix); contractID.AppendASCII(platforms[index]); contractID.Append(contractSuffix); diff --git a/widget/tests/TestWinTSF.cpp b/widget/tests/TestWinTSF.cpp index b33d58bbae31..150c72c075a6 100644 --- a/widget/tests/TestWinTSF.cpp +++ b/widget/tests/TestWinTSF.cpp @@ -2901,7 +2901,7 @@ TestApp::TestScrollMessages(void) #define DO_CHECK(aFailureCondition, aDescription) \ if (aFailureCondition) { \ - nsCAutoString str(aDescription); \ + nsAutoCString str(aDescription); \ str.Append(": "); \ str.Append(#aFailureCondition); \ fail(str.get()); \ diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index 27a641703cb3..147a3423796a 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -661,7 +661,7 @@ GfxInfo::AddCrashReportAnnotations() /* Add an App Note for now so that we get the data immediately. These * can go away after we store the above in the socorro db */ - nsCAutoString note; + nsAutoCString note; /* AppendPrintf only supports 32 character strings, mrghh. */ note.Append("AdapterVendorID: "); note.Append(narrowVendorID); diff --git a/widget/windows/JumpListBuilder.cpp b/widget/windows/JumpListBuilder.cpp index 3f7bbb67d690..2c93aa2d15ef 100644 --- a/widget/windows/JumpListBuilder.cpp +++ b/widget/windows/JumpListBuilder.cpp @@ -175,7 +175,7 @@ nsresult JumpListBuilder::RemoveIconCacheForItems(nsIMutableArray *items) // The local file path is stored inside the nsIURI // Get the nsIURI spec which stores the local path for the icon to remove - nsCAutoString spec; + nsAutoCString spec; nsresult rv = uri->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/widget/windows/JumpListItem.cpp b/widget/windows/JumpListItem.cpp index 760ca5528964..f029e542b885 100644 --- a/widget/windows/JumpListItem.cpp +++ b/widget/windows/JumpListItem.cpp @@ -135,7 +135,7 @@ NS_IMETHODIMP JumpListLink::CompareHash(nsIURI *aUri, bool *aResult) NS_ENSURE_ARG_POINTER(aUri); - nsCAutoString hash1, hash2; + nsAutoCString hash1, hash2; rv = mozilla::widget::FaviconHelper::HashURI(mCryptoHash, mURI, hash1); NS_ENSURE_SUCCESS(rv, rv); @@ -566,7 +566,7 @@ nsresult JumpListLink::GetShellItem(nsCOMPtr& item, nsRefPtrGetUri(getter_AddRefs(uri)); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString spec; + nsAutoCString spec; rv = uri->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/widget/windows/WinTaskbar.cpp b/widget/windows/WinTaskbar.cpp index c06eb62721ee..5d346829e5e5 100644 --- a/widget/windows/WinTaskbar.cpp +++ b/widget/windows/WinTaskbar.cpp @@ -250,7 +250,7 @@ WinTaskbar::GetAppUserModelID(nsAString & aDefaultGroupId) { getter_AddRefs(profileDir)); bool exists = false; if (profileDir && NS_SUCCEEDED(profileDir->Exists(&exists)) && exists) { - nsCAutoString path; + nsAutoCString path; if (NS_SUCCEEDED(profileDir->GetNativePath(path))) { nsAutoString id; id.AppendInt(HashString(path)); diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index e960e1d165dd..89eba4d55d51 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -774,7 +774,7 @@ nsresult FaviconHelper::HashURI(nsCOMPtr &aCryptoHash, if (!aUri) return NS_ERROR_INVALID_ARG; - nsCAutoString spec; + nsAutoCString spec; nsresult rv = aUri->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); @@ -804,7 +804,7 @@ nsresult FaviconHelper::GetOutputIconPath(nsCOMPtr aFaviconPageURI, bool aURLShortcut) { // Hash the input URI and replace any / with _ - nsCAutoString inputURIHash; + nsAutoCString inputURIHash; nsCOMPtr cryptoHash; nsresult rv = HashURI(cryptoHash, aFaviconPageURI, inputURIHash); diff --git a/widget/windows/WinUtils.h b/widget/windows/WinUtils.h index 132ca1ba02d7..5ed5d227f4a8 100644 --- a/widget/windows/WinUtils.h +++ b/widget/windows/WinUtils.h @@ -252,7 +252,7 @@ public: private: nsAutoString mIconPath; - nsCAutoString mMimeTypeOfInputData; + nsAutoCString mMimeTypeOfInputData; nsAutoArrayPtr mBuffer; uint32_t mBufferLength; }; diff --git a/widget/windows/nsClipboard.cpp b/widget/windows/nsClipboard.cpp index e083fe345f76..9c0f60439a80 100644 --- a/widget/windows/nsClipboard.cpp +++ b/widget/windows/nsClipboard.cpp @@ -773,7 +773,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v if ( IsInternetShortcut(filepath) ) { nsMemory::Free(*outData); - nsCAutoString url; + nsAutoCString url; ResolveShortcut( file, url ); if ( !url.IsEmpty() ) { // convert it to unicode and pass it out @@ -794,7 +794,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v } else { // we have a normal file, use some Necko objects to get our file path - nsCAutoString urlSpec; + nsAutoCString urlSpec; NS_GetURLSpecFromFile(file, urlSpec); // convert it to unicode and pass it out diff --git a/widget/windows/nsDataObj.cpp b/widget/windows/nsDataObj.cpp index bdda24d22db7..cf8a62e94d84 100644 --- a/widget/windows/nsDataObj.cpp +++ b/widget/windows/nsDataObj.cpp @@ -248,7 +248,7 @@ STDMETHODIMP nsDataObj::CStream::Stat(STATSTG* statstg, DWORD dwFlags) return E_FAIL; } - nsCAutoString strFileName; + nsAutoCString strFileName; nsCOMPtr sourceURL = do_QueryInterface(sourceURI); sourceURL->GetFileName(strFileName); @@ -1095,7 +1095,7 @@ nsDataObj :: GetFileContentsInternetShortcut ( FORMATETC& aFE, STGMEDIUM& aSTG ) return E_OUTOFMEMORY; // will need to change if we ever support iDNS - nsCAutoString asciiUrl; + nsAutoCString asciiUrl; LossyCopyUTF16toASCII(url, asciiUrl); nsCOMPtr icoFile; @@ -1162,7 +1162,7 @@ bool nsDataObj :: IsFlavourPresent(const char *inFlavour) flavorList->GetElementAt (i, getter_AddRefs(genericFlavor)); nsCOMPtr currentFlavor (do_QueryInterface(genericFlavor)); if (currentFlavor) { - nsCAutoString flavorStr; + nsAutoCString flavorStr; currentFlavor->GetData(flavorStr); if (flavorStr.Equals(inFlavour)) { retval = true; // found it! @@ -1988,7 +1988,7 @@ nsresult nsDataObj::GetDownloadDetails(nsIURI **aSourceURI, if (!sourceURL) return NS_ERROR_FAILURE; - nsCAutoString urlFileName; + nsAutoCString urlFileName; sourceURL->GetFileName(urlFileName); NS_UnescapeURL(urlFileName); CopyUTF8toUTF16(urlFileName, srcFileName); @@ -2026,7 +2026,7 @@ HRESULT nsDataObj::GetFileDescriptor_IStreamA(FORMATETC& aFE, STGMEDIUM& aSTG) return E_FAIL; } - nsCAutoString nativeFileName; + nsAutoCString nativeFileName; NS_UTF16ToCString(wideFileName, NS_CSTRING_ENCODING_NATIVE_FILESYSTEM, nativeFileName); strncpy(fileGroupDescA->fgd[0].cFileName, nativeFileName.get(), NS_MAX_FILEDESCRIPTOR - 1); diff --git a/widget/windows/nsDataObjCollection.cpp b/widget/windows/nsDataObjCollection.cpp index 7abbff018845..cf730c0eb32a 100644 --- a/widget/windows/nsDataObjCollection.cpp +++ b/widget/windows/nsDataObjCollection.cpp @@ -302,7 +302,7 @@ HRESULT nsDataObjCollection::GetText(LPFORMATETC pFE, LPSTGMEDIUM pSTM) hGlobalMemory = GlobalAlloc(GHND, buffersize); if (pFE->cfFormat == CF_TEXT) { - nsCAutoString text; + nsAutoCString text; for (uint32_t i = 0; i < mDataObjects.Length(); ++i) { nsDataObj* dataObj = mDataObjects.ElementAt(i); hr = dataObj->GetData(&fe, &workingmedium); diff --git a/widget/windows/nsIMM32Handler.cpp b/widget/windows/nsIMM32Handler.cpp index 73985c74e682..9ef883c90661 100644 --- a/widget/windows/nsIMM32Handler.cpp +++ b/widget/windows/nsIMM32Handler.cpp @@ -1205,7 +1205,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, if (useA_API) { // Convert each values of sIMECompClauseArray. The values mean offset of // the clauses in ANSI string. But we need the values in Unicode string. - nsCAutoString compANSIStr; + nsAutoCString compANSIStr; if (ConvertToANSIString(mCompositionString, GetKeyboardCodePage(), compANSIStr)) { uint32_t maxlen = compANSIStr.Length(); diff --git a/widget/windows/nsImageClipboard.cpp b/widget/windows/nsImageClipboard.cpp index 68f2004f5c61..50b38e2f6364 100644 --- a/widget/windows/nsImageClipboard.cpp +++ b/widget/windows/nsImageClipboard.cpp @@ -202,7 +202,7 @@ nsImageFromClipboard ::GetEncodedImageStream (unsigned char * aClipboardData, co rv = ConvertColorBitMap((unsigned char *) (pGlobal + header->bmiHeader.biSize), header, rgbData); // if that succeeded, encode the bitmap as aMIMEFormat data. Don't return early or we risk leaking rgbData if (NS_SUCCEEDED(rv)) { - nsCAutoString encoderCID(NS_LITERAL_CSTRING("@mozilla.org/image/encoder;2?type=")); + nsAutoCString encoderCID(NS_LITERAL_CSTRING("@mozilla.org/image/encoder;2?type=")); // Map image/jpg to image/jpeg (which is how the encoder is registered). if (strcmp(aMIMEFormat, kJPGImageMime) == 0) diff --git a/widget/windows/nsSound.cpp b/widget/windows/nsSound.cpp index 84ec9e27370c..a5ad2341390d 100644 --- a/widget/windows/nsSound.cpp +++ b/widget/windows/nsSound.cpp @@ -166,7 +166,7 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, nsCOMPtr uri; channel->GetURI(getter_AddRefs(uri)); if (uri) { - nsCAutoString uriSpec; + nsAutoCString uriSpec; uri->GetSpec(uriSpec); PR_LOG(gWin32SoundLog, PR_LOG_ALWAYS, ("Failed to load %s\n", uriSpec.get())); diff --git a/widget/windows/nsTextStore.cpp b/widget/windows/nsTextStore.cpp index 3dd38f72f48f..6eb7c0695b63 100644 --- a/widget/windows/nsTextStore.cpp +++ b/widget/windows/nsTextStore.cpp @@ -409,7 +409,7 @@ GetLogTextFor(TF_DA_ATTR_INFO aAttr, nsACString &aText) static nsCString GetLogTextFor(const TF_DISPLAYATTRIBUTE &aDispAttr) { - nsCAutoString str, tmp; + nsAutoCString str, tmp; str = "crText:{ "; GetLogTextFor(aDispAttr.crText, tmp); str += tmp; diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 37ba97467595..c27649e8bde7 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -2679,7 +2679,7 @@ NS_METHOD nsWindow::Invalidate(bool aEraseBackground, debug_DumpInvalidate(stdout, this, nullptr, - nsCAutoString("noname"), + nsAutoCString("noname"), (int32_t) mWnd); #endif // WIDGET_DEBUG_OUTPUT @@ -2707,7 +2707,7 @@ NS_METHOD nsWindow::Invalidate(const nsIntRect & aRect) debug_DumpInvalidate(stdout, this, &aRect, - nsCAutoString("noname"), + nsAutoCString("noname"), (int32_t) mWnd); #endif // WIDGET_DEBUG_OUTPUT @@ -3550,7 +3550,7 @@ NS_IMETHODIMP nsWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus debug_DumpEvent(stdout, event->widget, event, - nsCAutoString("something"), + nsAutoCString("something"), (int32_t) mWnd); #endif // WIDGET_DEBUG_OUTPUT diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp index bf40352c5cfe..27fb75a0bb67 100644 --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -293,7 +293,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) debug_DumpPaintEvent(stdout, this, region, - nsCAutoString("noname"), + nsAutoCString("noname"), (int32_t) mWnd); #endif // WIDGET_DEBUG_OUTPUT diff --git a/widget/xpwidgets/GfxInfoX11.cpp b/widget/xpwidgets/GfxInfoX11.cpp index 298f02a4895a..6cbf69e55201 100644 --- a/widget/xpwidgets/GfxInfoX11.cpp +++ b/widget/xpwidgets/GfxInfoX11.cpp @@ -184,7 +184,7 @@ GfxInfo::GetData() mAdapterDescription.AppendLiteral(" -- "); mAdapterDescription.Append(mRenderer); - nsCAutoString note; + nsAutoCString note; note.Append("OpenGL: "); note.Append(mAdapterDescription); note.Append(" -- "); diff --git a/widget/xpwidgets/PuppetWidget.cpp b/widget/xpwidgets/PuppetWidget.cpp index 764e3970cf96..95b061d5dd16 100644 --- a/widget/xpwidgets/PuppetWidget.cpp +++ b/widget/xpwidgets/PuppetWidget.cpp @@ -209,7 +209,7 @@ PuppetWidget::Invalidate(const nsIntRect& aRect) { #ifdef DEBUG debug_DumpInvalidate(stderr, this, &aRect, - nsCAutoString("PuppetWidget"), 0); + nsAutoCString("PuppetWidget"), 0); #endif if (mChild) { @@ -246,7 +246,7 @@ PuppetWidget::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus) { #ifdef DEBUG debug_DumpEvent(stdout, event->widget, event, - nsCAutoString("PuppetWidget"), 0); + nsAutoCString("PuppetWidget"), 0); #endif NS_ABORT_IF_FALSE(!mChild || mChild->mWindowType == eWindowType_popup, @@ -499,7 +499,7 @@ PuppetWidget::Paint() { #ifdef DEBUG debug_DumpPaintEvent(stderr, this, region, - nsCAutoString("PuppetWidget"), 0); + nsAutoCString("PuppetWidget"), 0); #endif if (mozilla::layers::LAYERS_D3D10 == mLayerManager->GetBackendType()) { diff --git a/widget/xpwidgets/nsBaseWidget.cpp b/widget/xpwidgets/nsBaseWidget.cpp index d7d36209c1b7..50538ef96972 100644 --- a/widget/xpwidgets/nsBaseWidget.cpp +++ b/widget/xpwidgets/nsBaseWidget.cpp @@ -1167,7 +1167,7 @@ nsBaseWidget::OverrideSystemMouseScrollSpeed(int32_t aOriginalDelta, return NS_OK; } - nsCAutoString factorPrefName( + nsAutoCString factorPrefName( "mousewheel.system_scroll_override_on_root_content."); if (aIsHorizontal) { factorPrefName.AppendLiteral("horizontal."); @@ -1575,7 +1575,7 @@ nsBaseWidget::debug_WantPaintFlashing() nsBaseWidget::debug_DumpEvent(FILE * aFileOut, nsIWidget * aWidget, nsGUIEvent * aGuiEvent, - const nsCAutoString & aWidgetName, + const nsAutoCString & aWidgetName, int32_t aWindowID) { if (aGuiEvent->message == NS_MOUSE_MOVE) @@ -1611,7 +1611,7 @@ nsBaseWidget::debug_DumpEvent(FILE * aFileOut, nsBaseWidget::debug_DumpPaintEvent(FILE * aFileOut, nsIWidget * aWidget, const nsIntRegion & aRegion, - const nsCAutoString & aWidgetName, + const nsAutoCString & aWidgetName, int32_t aWindowID) { NS_ASSERTION(nullptr != aFileOut,"cmon, null output FILE"); @@ -1637,7 +1637,7 @@ nsBaseWidget::debug_DumpPaintEvent(FILE * aFileOut, nsBaseWidget::debug_DumpInvalidate(FILE * aFileOut, nsIWidget * aWidget, const nsIntRect * aRect, - const nsCAutoString & aWidgetName, + const nsAutoCString & aWidgetName, int32_t aWindowID) { if (!debug_GetCachedBoolPref("nglayout.debug.invalidate_dumping")) diff --git a/widget/xpwidgets/nsBaseWidget.h b/widget/xpwidgets/nsBaseWidget.h index 77ae0bf18d0f..80420f24dbae 100644 --- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -368,19 +368,19 @@ protected: static void debug_DumpInvalidate(FILE * aFileOut, nsIWidget * aWidget, const nsIntRect * aRect, - const nsCAutoString & aWidgetName, + const nsAutoCString & aWidgetName, int32_t aWindowID); static void debug_DumpEvent(FILE * aFileOut, nsIWidget * aWidget, nsGUIEvent * aGuiEvent, - const nsCAutoString & aWidgetName, + const nsAutoCString & aWidgetName, int32_t aWindowID); static void debug_DumpPaintEvent(FILE * aFileOut, nsIWidget * aWidget, const nsIntRegion & aPaintEvent, - const nsCAutoString & aWidgetName, + const nsAutoCString & aWidgetName, int32_t aWindowID); static bool debug_GetCachedBoolPref(const char* aPrefName); diff --git a/widget/xpwidgets/nsHTMLFormatConverter.cpp b/widget/xpwidgets/nsHTMLFormatConverter.cpp index f3cfe3999b0a..a62f14efc370 100644 --- a/widget/xpwidgets/nsHTMLFormatConverter.cpp +++ b/widget/xpwidgets/nsHTMLFormatConverter.cpp @@ -171,7 +171,7 @@ nsHTMLFormatConverter::Convert(const char *aFromDataFlavor, nsISupports *aFromDa *aDataToLen = 0; if ( !nsCRT::strcmp(aFromDataFlavor, kHTMLMime) ) { - nsCAutoString toFlavor ( aToDataFlavor ); + nsAutoCString toFlavor ( aToDataFlavor ); // HTML on clipboard is going to always be double byte so it will be in a primitive // class of nsISupportsString. Also, since the data is in two byte chunks the diff --git a/widget/xpwidgets/nsPrimitiveHelpers.cpp b/widget/xpwidgets/nsPrimitiveHelpers.cpp index 21f9976d347d..c2d01812f604 100644 --- a/widget/xpwidgets/nsPrimitiveHelpers.cpp +++ b/widget/xpwidgets/nsPrimitiveHelpers.cpp @@ -106,7 +106,7 @@ nsPrimitiveHelpers :: CreateDataFromPrimitive ( const char* aFlavor, nsISupports if ( strcmp(aFlavor,kTextMime) == 0 ) { nsCOMPtr plainText ( do_QueryInterface(aPrimitive) ); if ( plainText ) { - nsCAutoString data; + nsAutoCString data; plainText->GetData ( data ); *aDataBuff = ToNewCString(data); } @@ -142,7 +142,7 @@ nsPrimitiveHelpers :: ConvertUnicodeToPlatformPlainText ( PRUnichar* inUnicode, nsresult rv; nsCOMPtr platformCharsetService = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv); - nsCAutoString platformCharset; + nsAutoCString platformCharset; if (NS_SUCCEEDED(rv)) rv = platformCharsetService->GetCharset(kPlatformCharsetSel_PlainTextInClipboard, platformCharset); if (NS_FAILED(rv)) @@ -190,7 +190,7 @@ nsPrimitiveHelpers :: ConvertPlatformPlainTextToUnicode ( const char* inText, in static bool hasConverter = false; if ( !hasConverter ) { // get the charset - nsCAutoString platformCharset; + nsAutoCString platformCharset; nsCOMPtr platformCharsetService = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) rv = platformCharsetService->GetCharset(kPlatformCharsetSel_PlainTextInClipboard, platformCharset); diff --git a/widget/xpwidgets/nsPrintOptionsImpl.cpp b/widget/xpwidgets/nsPrintOptionsImpl.cpp index be847f9ec749..e2e7d1828584 100644 --- a/widget/xpwidgets/nsPrintOptionsImpl.cpp +++ b/widget/xpwidgets/nsPrintOptionsImpl.cpp @@ -1059,7 +1059,7 @@ nsPrintOptions::ReadPrefDouble(const char * aPrefId, double& aVal) { NS_ENSURE_ARG_POINTER(aPrefId); - nsCAutoString str; + nsAutoCString str; nsresult rv = Preferences::GetCString(aPrefId, &str); if (NS_SUCCEEDED(rv) && !str.IsEmpty()) { aVal = atof(str.get()); @@ -1102,7 +1102,7 @@ void nsPrintOptions::WriteInchesFromTwipsPref(const char * aPrefId, int32_t aTwips) { double inches = NS_TWIPS_TO_INCHES(aTwips); - nsCAutoString inchesStr; + nsAutoCString inchesStr; inchesStr.AppendFloat(inches); Preferences::SetCString(aPrefId, inchesStr); diff --git a/widget/xpwidgets/nsTransferable.cpp b/widget/xpwidgets/nsTransferable.cpp index fcf6cc5d55d4..e38273318e2d 100644 --- a/widget/xpwidgets/nsTransferable.cpp +++ b/widget/xpwidgets/nsTransferable.cpp @@ -551,7 +551,7 @@ nsTransferable::FlavorsTransferableCanImport(nsISupportsArray **_retval) convertedList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); nsCOMPtr flavorWrapper ( do_QueryInterface (genericFlavor) ); - nsCAutoString flavorStr; + nsAutoCString flavorStr; flavorWrapper->GetData( flavorStr ); if (GetDataForFlavor (mDataArray, flavorStr.get()) @@ -597,7 +597,7 @@ nsTransferable::FlavorsTransferableCanExport(nsISupportsArray **_retval) convertedList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); nsCOMPtr flavorWrapper ( do_QueryInterface (genericFlavor) ); - nsCAutoString flavorStr; + nsAutoCString flavorStr; flavorWrapper->GetData( flavorStr ); if (GetDataForFlavor (mDataArray, flavorStr.get()) diff --git a/xpcom/base/MapsMemoryReporter.cpp b/xpcom/base/MapsMemoryReporter.cpp index 7a39150070a2..85a8bd868852 100644 --- a/xpcom/base/MapsMemoryReporter.cpp +++ b/xpcom/base/MapsMemoryReporter.cpp @@ -172,7 +172,7 @@ MapsReporter::MapsReporter() const uint32_t len = ArrayLength(mozillaLibraries); mMozillaLibraries.Init(len); for (uint32_t i = 0; i < len; i++) { - nsCAutoString str; + nsAutoCString str; str.Assign(mozillaLibraries[i]); mMozillaLibraries.PutEntry(str); } @@ -245,10 +245,10 @@ MapsReporter::FindLibxul() break; } - nsCAutoString pathStr; + nsAutoCString pathStr; pathStr.Append(path); - nsCAutoString basename; + nsAutoCString basename; GetBasename(pathStr, basename); if (basename.EqualsLiteral("libxul.so")) { @@ -321,7 +321,7 @@ MapsReporter::ParseMapping( return NS_ERROR_FAILURE; } - nsCAutoString name, description; + nsAutoCString name, description; GetReporterNameAndDescription(path, perms, name, description); while (true) { @@ -347,11 +347,11 @@ MapsReporter::GetReporterNameAndDescription( // If aPath points to a file, we have its absolute path, plus some // whitespace. Truncate this to its basename, and put the absolute path in // the description. - nsCAutoString absPath; + nsAutoCString absPath; absPath.Append(aPath); absPath.StripChars(" "); - nsCAutoString basename; + nsAutoCString basename; GetBasename(absPath, basename); if (basename.EqualsLiteral("[heap]")) { @@ -376,7 +376,7 @@ MapsReporter::GetReporterNameAndDescription( "syscall."); } else if (!basename.IsEmpty()) { - nsCAutoString dirname; + nsAutoCString dirname; GetDirname(absPath, dirname); // Hack: A file is a shared library if the basename contains ".so" and its @@ -496,7 +496,7 @@ MapsReporter::ParseMapBody( return NS_OK; } - nsCAutoString path; + nsAutoCString path; path.Append(category); path.Append("/"); path.Append(aName); diff --git a/xpcom/base/nsTraceRefcntImpl.cpp b/xpcom/base/nsTraceRefcntImpl.cpp index 752c12909b15..80a054e50399 100644 --- a/xpcom/base/nsTraceRefcntImpl.cpp +++ b/xpcom/base/nsTraceRefcntImpl.cpp @@ -632,7 +632,7 @@ static bool InitLog(const char* envVar, const char* msg, FILE* *result) } else { FILE *stream; - nsCAutoString fname(value); + nsAutoCString fname(value); if (XRE_GetProcessType() != GeckoProcessType_Default) { bool hasLogExtension = fname.RFind(".log", true, -1, 4) == kNotFound ? false : true; diff --git a/xpcom/build/FileLocation.cpp b/xpcom/build/FileLocation.cpp index e868ae64a290..9b36e2901222 100644 --- a/xpcom/build/FileLocation.cpp +++ b/xpcom/build/FileLocation.cpp @@ -31,7 +31,7 @@ FileLocation::FileLocation(const FileLocation &file, const char *path) file.mBaseFile->GetParent(getter_AddRefs(cfile)); #if defined(XP_WIN) || defined(XP_OS2) - nsCAutoString pathStr(path); + nsAutoCString pathStr(path); char *p; uint32_t len = pathStr.GetMutableData(&p); for (; len; ++p, --len) { diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp index 5654391dce46..4d75c7ef7b55 100644 --- a/xpcom/build/Omnijar.cpp +++ b/xpcom/build/Omnijar.cpp @@ -142,7 +142,7 @@ Omnijar::GetURIString(Type aType, nsACString &result) return NS_OK; } - nsCAutoString omniJarSpec; + nsAutoCString omniJarSpec; if (sPath[aType]) { nsresult rv = NS_GetURLSpecFromActualFile(sPath[aType], omniJarSpec); NS_ENSURE_SUCCESS(rv, rv); diff --git a/xpcom/build/mozPoisonWriteMac.cpp b/xpcom/build/mozPoisonWriteMac.cpp index ba809f9540c0..f2ce2923c0c9 100644 --- a/xpcom/build/mozPoisonWriteMac.cpp +++ b/xpcom/build/mozPoisonWriteMac.cpp @@ -351,7 +351,7 @@ void PoisonWrite() { nsCOMPtr mozFile; NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(mozFile)); if (mozFile) { - nsCAutoString nativePath; + nsAutoCString nativePath; nsresult rv = mozFile->GetNativePath(nativePath); if (NS_SUCCEEDED(rv)) { sProfileDirectory = PL_strdup(nativePath.get()); diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp index 1006e92c631d..26a38080a44e 100644 --- a/xpcom/components/ManifestParser.cpp +++ b/xpcom/components/ManifestParser.cpp @@ -417,7 +417,7 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn nsCOMPtr xapp (do_GetService(XULAPPINFO_SERVICE_CONTRACTID)); if (xapp) { - nsCAutoString s; + nsAutoCString s; rv = xapp->GetID(s); if (NS_SUCCEEDED(rv)) CopyUTF8toUTF16(s, appID); diff --git a/xpcom/components/nsCategoryManager.cpp b/xpcom/components/nsCategoryManager.cpp index 70d9213077ef..6edba5c45ce9 100644 --- a/xpcom/components/nsCategoryManager.cpp +++ b/xpcom/components/nsCategoryManager.cpp @@ -758,7 +758,7 @@ NS_CreateServicesFromCategory(const char *category, bool hasMore; while (NS_SUCCEEDED(senumerator->HasMore(&hasMore)) && hasMore) { // From here on just skip any error we get. - nsCAutoString entryString; + nsAutoCString entryString; if (NS_FAILED(senumerator->GetNext(entryString))) continue; diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index ae4c30bbf500..ee128d0c8678 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -930,7 +930,7 @@ nsComponentManagerImpl::CreateInstance(const nsCID &aClass, if (entry->mServiceObject) { nsXPIDLCString cid; cid.Adopt(aClass.ToString()); - nsCAutoString message; + nsAutoCString message; message = NS_LITERAL_CSTRING("You are calling CreateInstance \"") + cid + NS_LITERAL_CSTRING("\" when a service for this CID already exists!"); NS_ERROR(message.get()); @@ -1013,7 +1013,7 @@ nsComponentManagerImpl::CreateInstanceByContractID(const char *aContractID, #ifdef SHOW_CI_ON_EXISTING_SERVICE if (entry->mServiceObject) { - nsCAutoString message; + nsAutoCString message; message = NS_LITERAL_CSTRING("You are calling CreateInstance \"") + nsDependentCString(aContractID) + diff --git a/xpcom/components/nsNativeComponentLoader.cpp b/xpcom/components/nsNativeComponentLoader.cpp index b8be83f2eb7f..1e19828d04ee 100644 --- a/xpcom/components/nsNativeComponentLoader.cpp +++ b/xpcom/components/nsNativeComponentLoader.cpp @@ -122,7 +122,7 @@ nsNativeModuleLoader::LoadModule(FileLocation &aFile) return NULL; } - nsCAutoString filePath; + nsAutoCString filePath; file->GetNativePath(filePath); NativeLoadData data; @@ -154,7 +154,7 @@ nsNativeModuleLoader::LoadModule(FileLocation &aFile) } #ifdef IMPLEMENT_BREAK_AFTER_LOAD - nsCAutoString leafName; + nsAutoCString leafName; file->GetNativeLeafName(leafName); char *env = getenv("XPCOM_BREAK_ON_LOAD"); @@ -207,7 +207,7 @@ nsNativeModuleLoader::UnloaderFunc(nsIHashable* aHashedFile, if (PR_LOG_TEST(nsNativeModuleLoaderLog, PR_LOG_DEBUG)) { nsCOMPtr file(do_QueryInterface(aHashedFile)); - nsCAutoString filePath; + nsAutoCString filePath; file->GetNativePath(filePath); LOG(PR_LOG_DEBUG, diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index f30f79f76ea8..dadbfdaf43ee 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -251,7 +251,7 @@ DumpAtomLeaks(PLDHashTable *table, PLDHashEntryHdr *he, AtomImpl* atom = entry->mAtom; if (!atom->IsPermanent()) { ++*static_cast(arg); - nsCAutoString str; + nsAutoCString str; atom->ToUTF8String(str); fputs(str.get(), stdout); fputs("\n", stdout); diff --git a/xpcom/ds/nsHashtable.cpp b/xpcom/ds/nsHashtable.cpp index 062bc9b33da7..0ca643f85765 100644 --- a/xpcom/ds/nsHashtable.cpp +++ b/xpcom/ds/nsHashtable.cpp @@ -542,7 +542,7 @@ nsCStringKey::Clone() const nsCStringKey::nsCStringKey(nsIObjectInputStream* aStream, nsresult *aResult) : mStr(nullptr), mStrLen(0), mOwnership(OWN) { - nsCAutoString str; + nsAutoCString str; nsresult rv = aStream->ReadCString(str); mStr = ToNewCString(str); if (NS_SUCCEEDED(rv)) diff --git a/xpcom/ds/nsStaticNameTable.cpp b/xpcom/ds/nsStaticNameTable.cpp index 38660fa84f0c..daf6cca71299 100644 --- a/xpcom/ds/nsStaticNameTable.cpp +++ b/xpcom/ds/nsStaticNameTable.cpp @@ -152,7 +152,7 @@ nsStaticCaseInsensitiveNameTable::Init(const char* const aNames[], int32_t Count #ifdef DEBUG { // verify invariants of contents - nsCAutoString temp1(raw); + nsAutoCString temp1(raw); nsDependentCString temp2(raw); ToLowerCase(temp1); NS_ASSERTION(temp1.Equals(temp2), "upper case char in table"); diff --git a/xpcom/ds/nsVariant.cpp b/xpcom/ds/nsVariant.cpp index 36d89833bc8c..6875d36d8bbb 100644 --- a/xpcom/ds/nsVariant.cpp +++ b/xpcom/ds/nsVariant.cpp @@ -790,7 +790,7 @@ static nsresult ToString(const nsDiscriminatedUnion& data, #define CASE__APPENDFLOAT_NUMBER(type_, member_) \ case nsIDataType :: type_ : \ { \ - nsCAutoString str; \ + nsAutoCString str; \ str.AppendFloat(data.u. member_); \ outString.Assign(str); \ return NS_OK; \ @@ -868,7 +868,7 @@ nsVariant::ConvertToAString(const nsDiscriminatedUnion& data, return NS_OK; default: { - nsCAutoString tempCString; + nsAutoCString tempCString; nsresult rv = ToString(data, tempCString); if(NS_FAILED(rv)) return rv; @@ -971,7 +971,7 @@ nsVariant::ConvertToAUTF8String(const nsDiscriminatedUnion& data, } default: { - nsCAutoString tempCString; + nsAutoCString tempCString; nsresult rv = ToString(data, tempCString); if(NS_FAILED(rv)) return rv; @@ -1002,7 +1002,7 @@ nsVariant::ConvertToStringWithSize(const nsDiscriminatedUnion& data, uint32_t *size, char **str) { nsAutoString tempString; - nsCAutoString tempCString; + nsAutoCString tempCString; nsresult rv; switch(data.mType) @@ -1080,7 +1080,7 @@ nsVariant::ConvertToWStringWithSize(const nsDiscriminatedUnion& data, uint32_t *size, PRUnichar **str) { nsAutoString tempString; - nsCAutoString tempCString; + nsAutoCString tempCString; nsresult rv; switch(data.mType) diff --git a/xpcom/glue/BlockingResourceBase.cpp b/xpcom/glue/BlockingResourceBase.cpp index 72842c51bc4a..07024bbbd9a7 100644 --- a/xpcom/glue/BlockingResourceBase.cpp +++ b/xpcom/glue/BlockingResourceBase.cpp @@ -109,7 +109,7 @@ BlockingResourceBase::CheckAcquire(const CallStack& aCallContext) return; fputs("###!!! ERROR: Potential deadlock detected:\n", stderr); - nsCAutoString out("Potential deadlock detected:\n"); + nsAutoCString out("Potential deadlock detected:\n"); bool maybeImminent = PrintCycle(cycle, out); if (maybeImminent) { diff --git a/xpcom/glue/GenericModule.cpp b/xpcom/glue/GenericModule.cpp index 8c8012319c3a..8fa07dce51f7 100644 --- a/xpcom/glue/GenericModule.cpp +++ b/xpcom/glue/GenericModule.cpp @@ -65,7 +65,7 @@ GenericModule::RegisterSelf(nsIComponentManager* aCompMgr, if (!catman) catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID); - nsCAutoString r; + nsAutoCString r; catman->AddCategoryEntry(e->category, e->entry, e->value, true, true, getter_Copies(r)); } diff --git a/xpcom/glue/nsCategoryCache.cpp b/xpcom/glue/nsCategoryCache.cpp index d6e91d58061f..b19b1191f371 100644 --- a/xpcom/glue/nsCategoryCache.cpp +++ b/xpcom/glue/nsCategoryCache.cpp @@ -36,7 +36,7 @@ nsCategoryObserver::nsCategoryObserver(const char* aCategory, nsCOMPtr entryName = do_QueryInterface(entry, &rv); if (NS_SUCCEEDED(rv)) { - nsCAutoString categoryEntry; + nsAutoCString categoryEntry; rv = entryName->GetData(categoryEntry); nsCString entryValue; @@ -110,7 +110,7 @@ nsCategoryObserver::Observe(nsISupports* aSubject, const char* aTopic, !nsDependentString(aData).Equals(NS_ConvertASCIItoUTF16(mCategory))) return NS_OK; - nsCAutoString str; + nsAutoCString str; nsCOMPtr strWrapper(do_QueryInterface(aSubject)); if (strWrapper) strWrapper->GetData(str); @@ -137,7 +137,7 @@ nsCategoryObserver::Observe(nsISupports* aSubject, const char* aTopic, mHash.Put(str, entryValue); mListener->EntryAdded(entryValue); } else if (strcmp(aTopic, NS_XPCOM_CATEGORY_ENTRY_REMOVED_OBSERVER_ID) == 0) { - nsCAutoString val; + nsAutoCString val; if (mHash.Get(str, &val)) { mHash.Remove(str); mListener->EntryRemoved(val); diff --git a/xpcom/glue/nsINIParser.cpp b/xpcom/glue/nsINIParser.cpp index dd9441529a83..329a02d39105 100644 --- a/xpcom/glue/nsINIParser.cpp +++ b/xpcom/glue/nsINIParser.cpp @@ -69,7 +69,7 @@ nsINIParser::Init(nsIFile* aFile) fd = _wfopen(path.get(), READ_BINARYMODE); #else - nsCAutoString path; + nsAutoCString path; aFile->GetNativePath(path); fd = fopen(path.get(), READ_BINARYMODE); diff --git a/xpcom/glue/nsStringAPI.h b/xpcom/glue/nsStringAPI.h index 59cb44a4d1f6..ca2b308540a2 100644 --- a/xpcom/glue/nsStringAPI.h +++ b/xpcom/glue/nsStringAPI.h @@ -1429,7 +1429,7 @@ ToNewUnicode(const nsAString& aStr) typedef nsString PromiseFlatString; typedef nsCString PromiseFlatCString; -typedef nsCString nsCAutoString; +typedef nsCString nsAutoCString; typedef nsString nsAutoString; NS_HIDDEN_(bool) ParseString(const nsACString& aAstring, char aDelimiter, diff --git a/xpcom/io/Base64.cpp b/xpcom/io/Base64.cpp index eb45f49fbd4e..bd3d3b704e84 100644 --- a/xpcom/io/Base64.cpp +++ b/xpcom/io/Base64.cpp @@ -267,7 +267,7 @@ nsresult Base64Encode(const nsAString &aString, nsAString &aBinaryData) { NS_LossyConvertUTF16toASCII string(aString); - nsCAutoString binaryData; + nsAutoCString binaryData; nsresult rv = Base64Encode(string, binaryData); if (NS_SUCCEEDED(rv)) { @@ -319,7 +319,7 @@ nsresult Base64Decode(const nsAString &aBinaryData, nsAString &aString) { NS_LossyConvertUTF16toASCII binaryData(aBinaryData); - nsCAutoString string; + nsAutoCString string; nsresult rv = Base64Decode(binaryData, string); if (NS_SUCCEEDED(rv)) { diff --git a/xpcom/io/nsDirectoryService.cpp b/xpcom/io/nsDirectoryService.cpp index e9d0013038be..42dc977931d5 100644 --- a/xpcom/io/nsDirectoryService.cpp +++ b/xpcom/io/nsDirectoryService.cpp @@ -512,7 +512,7 @@ nsDirectoryService::RegisterCategoryProviders() bool more; while (NS_SUCCEEDED(strings->HasMore(&more)) && more) { - nsCAutoString entry; + nsAutoCString entry; strings->GetNext(entry); nsXPIDLCString contractID; diff --git a/xpcom/io/nsLocalFileCommon.cpp b/xpcom/io/nsLocalFileCommon.cpp index dcd3b1a1dd4c..5ec4bae22b3a 100644 --- a/xpcom/io/nsLocalFileCommon.cpp +++ b/xpcom/io/nsLocalFileCommon.cpp @@ -35,7 +35,7 @@ nsLocalFile::InitWithFile(nsIFile *aFile) { NS_ENSURE_ARG(aFile); - nsCAutoString path; + nsAutoCString path; aFile->GetNativePath(path); if (path.IsEmpty()) return NS_ERROR_INVALID_ARG; @@ -58,7 +58,7 @@ nsLocalFile::CreateUnique(uint32_t type, uint32_t attributes) nsAutoString pathName, leafName, rootName, suffix; rv = GetPath(pathName); #else - nsCAutoString pathName, leafName, rootName, suffix; + nsAutoCString pathName, leafName, rootName, suffix; rv = GetNativePath(pathName); #endif if (NS_FAILED(rv)) diff --git a/xpcom/io/nsLocalFileOS2.cpp b/xpcom/io/nsLocalFileOS2.cpp index 83becde55f96..20653c641581 100644 --- a/xpcom/io/nsLocalFileOS2.cpp +++ b/xpcom/io/nsLocalFileOS2.cpp @@ -245,7 +245,7 @@ class nsDirEnumerator : public nsISimpleEnumerator, nsresult Init(nsIFile* parent) { - nsCAutoString filepath; + nsAutoCString filepath; parent->GetNativeTarget(filepath); if (filepath.IsEmpty()) @@ -1121,7 +1121,7 @@ nsLocalFile::GetFileTypes(nsIArray **_retval) nsCOMPtr typeString( do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) { - nsCAutoString temp; + nsAutoCString temp; temp.Assign(ptr, lth); typeString->SetData(temp); mutArray->AppendElement(typeString, false); @@ -1332,16 +1332,16 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent, const nsACString &newName, bool move) { nsresult rv; - nsCAutoString filePath; + nsAutoCString filePath; - nsCAutoString destPath; + nsAutoCString destPath; destParent->GetNativeTarget(destPath); destPath.Append("\\"); if (newName.IsEmpty()) { - nsCAutoString aFileName; + nsAutoCString aFileName; sourceFile->GetNativeLeafName(aFileName); destPath.Append(aFileName); } @@ -1487,7 +1487,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const nsACString &newName, bool move) if (NS_FAILED(rv)) return rv; - nsCAutoString allocatedNewName; + nsAutoCString allocatedNewName; if (newName.IsEmpty()) { GetNativeLeafName(allocatedNewName); @@ -1581,7 +1581,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const nsACString &newName, bool move) { MakeDirty(); - nsCAutoString newParentPath; + nsAutoCString newParentPath; newParentDir->GetNativePath(newParentPath); if (newParentPath.IsEmpty()) @@ -1589,7 +1589,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const nsACString &newName, bool move) if (newName.IsEmpty()) { - nsCAutoString aFileName; + nsAutoCString aFileName; GetNativeLeafName(aFileName); InitWithNativePath(newParentPath); @@ -1972,7 +1972,7 @@ nsLocalFile::GetParent(nsIFile * *aParent) NS_ENSURE_ARG_POINTER(aParent); - nsCAutoString parentPath(mWorkingPath); + nsAutoCString parentPath(mWorkingPath); // cannot use nsCString::RFindChar() due to 0x5c problem int32_t offset = (int32_t) (_mbsrchr((const unsigned char *) parentPath.get(), '\\') @@ -2088,7 +2088,7 @@ nsLocalFile::IsExecutable(bool *_retval) if (NS_FAILED(rv) || !isFile) return rv; - nsCAutoString path; + nsAutoCString path; GetNativeTarget(path); // get the filename, including the leading backslash @@ -2211,7 +2211,7 @@ nsLocalFile::Equals(nsIFile *inFile, bool *_retval) NS_ENSURE_ARG(inFile); NS_ENSURE_ARG(_retval); - nsCAutoString inFilePath; + nsAutoCString inFilePath; inFile->GetNativePath(inFilePath); *_retval = inFilePath.Equals(mWorkingPath); @@ -2226,13 +2226,13 @@ nsLocalFile::Contains(nsIFile *inFile, bool recur, bool *_retval) *_retval = false; - nsCAutoString myFilePath; + nsAutoCString myFilePath; if ( NS_FAILED(GetNativeTarget(myFilePath))) GetNativePath(myFilePath); int32_t myFilePathLen = myFilePath.Length(); - nsCAutoString inFilePath; + nsAutoCString inFilePath; if ( NS_FAILED(inFile->GetNativeTarget(inFilePath))) inFile->GetNativePath(inFilePath); @@ -2339,7 +2339,7 @@ NS_IMETHODIMP nsLocalFile::Reveal() { bool isDirectory = false; - nsCAutoString path; + nsAutoCString path; IsDirectory(&isDirectory); if (isDirectory) @@ -2404,7 +2404,7 @@ nsLocalFile::InitWithPath(const nsAString &filePath) if (filePath.IsEmpty()) return InitWithNativePath(EmptyCString()); - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = NS_CopyUnicodeToNative(filePath, tmp); if (NS_SUCCEEDED(rv)) return InitWithNativePath(tmp); @@ -2418,7 +2418,7 @@ nsLocalFile::Append(const nsAString &node) if (node.IsEmpty()) return NS_OK; - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = NS_CopyUnicodeToNative(node, tmp); if (NS_SUCCEEDED(rv)) return AppendNative(tmp); @@ -2432,7 +2432,7 @@ nsLocalFile::AppendRelativePath(const nsAString &node) if (node.IsEmpty()) return NS_OK; - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = NS_CopyUnicodeToNative(node, tmp); if (NS_SUCCEEDED(rv)) return AppendRelativeNativePath(tmp); @@ -2443,7 +2443,7 @@ nsLocalFile::AppendRelativePath(const nsAString &node) NS_IMETHODIMP nsLocalFile::GetLeafName(nsAString &aLeafName) { - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = GetNativeLeafName(tmp); if (NS_SUCCEEDED(rv)) rv = NS_CopyNativeToUnicode(tmp, aLeafName); @@ -2457,7 +2457,7 @@ nsLocalFile::SetLeafName(const nsAString &aLeafName) if (aLeafName.IsEmpty()) return SetNativeLeafName(EmptyCString()); - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = NS_CopyUnicodeToNative(aLeafName, tmp); if (NS_SUCCEEDED(rv)) return SetNativeLeafName(tmp); @@ -2477,7 +2477,7 @@ nsLocalFile::CopyTo(nsIFile *newParentDir, const nsAString &newName) if (newName.IsEmpty()) return CopyToNative(newParentDir, EmptyCString()); - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = NS_CopyUnicodeToNative(newName, tmp); if (NS_SUCCEEDED(rv)) return CopyToNative(newParentDir, tmp); @@ -2491,7 +2491,7 @@ nsLocalFile::CopyToFollowingLinks(nsIFile *newParentDir, const nsAString &newNam if (newName.IsEmpty()) return CopyToFollowingLinksNative(newParentDir, EmptyCString()); - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = NS_CopyUnicodeToNative(newName, tmp); if (NS_SUCCEEDED(rv)) return CopyToFollowingLinksNative(newParentDir, tmp); @@ -2505,7 +2505,7 @@ nsLocalFile::MoveTo(nsIFile *newParentDir, const nsAString &newName) if (newName.IsEmpty()) return MoveToNative(newParentDir, EmptyCString()); - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = NS_CopyUnicodeToNative(newName, tmp); if (NS_SUCCEEDED(rv)) return MoveToNative(newParentDir, tmp); @@ -2516,7 +2516,7 @@ nsLocalFile::MoveTo(nsIFile *newParentDir, const nsAString &newName) NS_IMETHODIMP nsLocalFile::GetTarget(nsAString &_retval) { - nsCAutoString tmp; + nsAutoCString tmp; nsresult rv = GetNativeTarget(tmp); if (NS_SUCCEEDED(rv)) rv = NS_CopyNativeToUnicode(tmp, _retval); @@ -2548,7 +2548,7 @@ nsLocalFile::GetHashCode(uint32_t *aResult) nsresult NS_NewLocalFile(const nsAString &path, bool followLinks, nsIFile* *result) { - nsCAutoString buf; + nsAutoCString buf; nsresult rv = NS_CopyUnicodeToNative(path, buf); if (NS_FAILED(rv)) { *result = nullptr; diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index aebadcacbc82..19a34fd4a3e1 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -143,7 +143,7 @@ NS_IMPL_ISUPPORTS2(nsDirEnumeratorUnix, nsISimpleEnumerator, nsIDirectoryEnumera NS_IMETHODIMP nsDirEnumeratorUnix::Init(nsLocalFile *parent, bool resolveSymlinks /*ignored*/) { - nsCAutoString dirPath; + nsAutoCString dirPath; if (NS_FAILED(parent->GetNativePath(dirPath)) || dirPath.IsEmpty()) { return NS_ERROR_FILE_INVALID_PATH; @@ -296,7 +296,7 @@ nsLocalFile::InitWithNativePath(const nsACString &filePath) { if (filePath.Equals("~") || Substring(filePath, 0, 2).EqualsLiteral("~/")) { nsCOMPtr homeDir; - nsCAutoString homePath; + nsAutoCString homePath; if (NS_FAILED(NS_GetSpecialDirectory(NS_OS_HOME_DIR, getter_AddRefs(homeDir))) || NS_FAILED(homeDir->GetNativePath(homePath))) { @@ -628,7 +628,7 @@ nsLocalFile::GetNativeTargetPathName(nsIFile *newParent, else LocateNativeLeafName(nameBegin, nameEnd); - nsCAutoString dirName; + nsAutoCString dirName; if (NS_FAILED(rv = newParent->GetNativePath(dirName))) return rv; @@ -670,7 +670,7 @@ nsLocalFile::CopyDirectoryTo(nsIFile *newParent) if (NS_FAILED(rv = newParent->Create(DIRECTORY_TYPE, oldPerms))) return rv; } else { // dir exists lets try to use leaf - nsCAutoString leafName; + nsAutoCString leafName; if (NS_FAILED(rv = GetNativeLeafName(leafName))) return rv; if (NS_FAILED(rv = newParent->AppendNative(leafName))) @@ -704,7 +704,7 @@ nsLocalFile::CopyDirectoryTo(nsIFile *newParent) if (NS_FAILED(rv = entry->CopyToNative(destClone, EmptyCString()))) { #ifdef DEBUG nsresult rv2; - nsCAutoString pathName; + nsAutoCString pathName; if (NS_FAILED(rv2 = entry->GetNativePath(pathName))) return rv2; printf("Operation not supported: %s\n", pathName.get()); @@ -718,7 +718,7 @@ nsLocalFile::CopyDirectoryTo(nsIFile *newParent) if (NS_FAILED(rv = entry->CopyToNative(newParent, EmptyCString()))) { #ifdef DEBUG nsresult rv2; - nsCAutoString pathName; + nsAutoCString pathName; if (NS_FAILED(rv2 = entry->GetNativePath(pathName))) return rv2; printf("Operation not supported: %s\n", pathName.get()); @@ -754,7 +754,7 @@ nsLocalFile::CopyToNative(nsIFile *newParent, const nsACString &newName) if (NS_FAILED(rv = IsDirectory(&isDirectory))) return rv; - nsCAutoString newPathName; + nsAutoCString newPathName; if (isDirectory) { if (!newName.IsEmpty()) { if (NS_FAILED(rv = workParent->AppendNative(newName))) @@ -884,7 +884,7 @@ nsLocalFile::MoveToNative(nsIFile *newParent, const nsACString &newName) CHECK_mPath(); // check to make sure that we have a new parent - nsCAutoString newPathName; + nsAutoCString newPathName; rv = GetNativeTargetPathName(newParent, newName, newPathName); if (NS_FAILED(rv)) return rv; @@ -1523,7 +1523,7 @@ nsLocalFile::Equals(nsIFile *inFile, bool *_retval) NS_ENSURE_ARG_POINTER(_retval); *_retval = false; - nsCAutoString inPath; + nsAutoCString inPath; nsresult rv = inFile->GetNativePath(inPath); if (NS_FAILED(rv)) return rv; @@ -1541,7 +1541,7 @@ nsLocalFile::Contains(nsIFile *inFile, bool recur, bool *_retval) NS_ENSURE_ARG(inFile); NS_ENSURE_ARG_POINTER(_retval); - nsCAutoString inPath; + nsAutoCString inPath; nsresult rv; if (NS_FAILED(rv = inFile->GetNativePath(inPath))) @@ -1778,7 +1778,7 @@ nsLocalFile::Reveal() return gnomevfs->ShowURIForInput(mPath); } else { nsCOMPtr parentDir; - nsCAutoString dirPath; + nsAutoCString dirPath; if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) return NS_ERROR_FAILURE; if (NS_FAILED(parentDir->GetNativePath(dirPath))) @@ -1849,7 +1849,7 @@ nsLocalFile::Launch() #elif defined(MOZ_WIDGET_ANDROID) // Try to get a mimetype, if this fails just use the file uri alone nsresult rv; - nsCAutoString type; + nsAutoCString type; nsCOMPtr mimeService(do_GetService("@mozilla.org/mime;1", &rv)); if (NS_SUCCEEDED(rv)) rv = mimeService->GetTypeFromFile(this, type); @@ -1898,7 +1898,7 @@ NS_NewNativeLocalFile(const nsACString &path, bool followSymlinks, nsIFile **res #define SET_UCS(func, ucsArg) \ { \ - nsCAutoString buf; \ + nsAutoCString buf; \ nsresult rv = NS_CopyUnicodeToNative(ucsArg, buf); \ if (NS_FAILED(rv)) \ return rv; \ @@ -1907,7 +1907,7 @@ NS_NewNativeLocalFile(const nsACString &path, bool followSymlinks, nsIFile **res #define GET_UCS(func, ucsArg) \ { \ - nsCAutoString buf; \ + nsAutoCString buf; \ nsresult rv = (func)(buf); \ if (NS_FAILED(rv)) return rv; \ return NS_CopyNativeToUnicode(buf, ucsArg); \ @@ -1915,7 +1915,7 @@ NS_NewNativeLocalFile(const nsACString &path, bool followSymlinks, nsIFile **res #define SET_UCS_2ARGS_2(func, opaqueArg, ucsArg) \ { \ - nsCAutoString buf; \ + nsAutoCString buf; \ nsresult rv = NS_CopyUnicodeToNative(ucsArg, buf); \ if (NS_FAILED(rv)) \ return rv; \ @@ -1998,7 +1998,7 @@ nsLocalFile::GetHashCode(uint32_t *aResult) nsresult NS_NewLocalFile(const nsAString &path, bool followLinks, nsIFile* *result) { - nsCAutoString buf; + nsAutoCString buf; nsresult rv = NS_CopyUnicodeToNative(path, buf); if (NS_FAILED(rv)) return rv; @@ -2412,7 +2412,7 @@ nsLocalFile::GetBundleContentsLastModifiedTime(int64_t *aLastModTime) return GetLastModifiedTime(aLastModTime); } - nsCAutoString infoPlistPath(mPath); + nsAutoCString infoPlistPath(mPath); infoPlistPath.AppendLiteral("/Contents/Info.plist"); PRFileInfo64 info; if (PR_GetFileInfo64(infoPlistPath.get(), &info) != PR_SUCCESS) { @@ -2432,7 +2432,7 @@ NS_IMETHODIMP nsLocalFile::InitWithFile(nsIFile *aFile) { NS_ENSURE_ARG(aFile); - nsCAutoString nativePath; + nsAutoCString nativePath; nsresult rv = aFile->GetNativePath(nativePath); if (NS_FAILED(rv)) return rv; diff --git a/xpcom/string/public/nsString.h b/xpcom/string/public/nsString.h index d4e740176436..075f4a335297 100644 --- a/xpcom/string/public/nsString.h +++ b/xpcom/string/public/nsString.h @@ -55,7 +55,7 @@ PR_STATIC_ASSERT(sizeof(nsCString::char_type) == 1); /** * A helper class that converts a UTF-16 string to ASCII in a lossy manner */ -class NS_LossyConvertUTF16toASCII : public nsCAutoString +class NS_LossyConvertUTF16toASCII : public nsAutoCString { public: explicit @@ -110,7 +110,7 @@ class NS_ConvertASCIItoUTF16 : public nsAutoString /** * A helper class that converts a UTF-16 string to UTF-8 */ -class NS_ConvertUTF16toUTF8 : public nsCAutoString +class NS_ConvertUTF16toUTF8 : public nsAutoCString { public: explicit diff --git a/xpcom/string/public/nsStringFwd.h b/xpcom/string/public/nsStringFwd.h index b8a6882d8f41..0a91390f39ce 100644 --- a/xpcom/string/public/nsStringFwd.h +++ b/xpcom/string/public/nsStringFwd.h @@ -39,7 +39,7 @@ class nsXPIDLString; class nsACString; class nsCSubstringTuple; class nsCString; -class nsCAutoString; +class nsAutoCString; class nsDependentCString; class nsDependentCSubstring; class nsPromiseFlatCString; diff --git a/xpcom/string/public/nsTString.h b/xpcom/string/public/nsTString.h index 59fd659cf5b2..ea30409988f0 100644 --- a/xpcom/string/public/nsTString.h +++ b/xpcom/string/public/nsTString.h @@ -422,7 +422,7 @@ class nsTFixedString_CharT : public nsTString_CharT * * NAMES: * nsAutoString for wide characters - * nsCAutoString for narrow characters + * nsAutoCString for narrow characters */ class NS_STACK_CLASS nsTAutoString_CharT : public nsTFixedString_CharT { diff --git a/xpcom/string/public/string-template-def-char.h b/xpcom/string/public/string-template-def-char.h index ca56545e2cdc..e61c96da9ccd 100644 --- a/xpcom/string/public/string-template-def-char.h +++ b/xpcom/string/public/string-template-def-char.h @@ -11,7 +11,7 @@ #define nsTAString_IncompatibleCharT nsAString #define nsTString_CharT nsCString #define nsTFixedString_CharT nsFixedCString -#define nsTAutoString_CharT nsCAutoString +#define nsTAutoString_CharT nsAutoCString #define nsTSubstring_CharT nsACString #define nsTSubstringTuple_CharT nsCSubstringTuple #define nsTStringComparator_CharT nsCStringComparator diff --git a/xpcom/tests/TestFile.cpp b/xpcom/tests/TestFile.cpp index 9197eb5927aa..8ba3bf2a2467 100644 --- a/xpcom/tests/TestFile.cpp +++ b/xpcom/tests/TestFile.cpp @@ -140,7 +140,7 @@ static bool TestCreateUnique(nsIFile* aBase, const char* aName, int32_t aType, i } if (existsBefore) { - nsCAutoString leafName; + nsAutoCString leafName; rv = file->GetNativeLeafName(leafName); if (!VerifyResult(rv, "GetNativeLeafName")) return false; @@ -391,7 +391,7 @@ static bool TestNormalizeNativePath(nsIFile* aBase, nsIFile* aStart) if (!file) return false; - nsCAutoString path; + nsAutoCString path; nsresult rv = file->GetNativePath(path); VerifyResult(rv, "GetNativePath"); path.Append(FixName("/./..")); @@ -402,7 +402,7 @@ static bool TestNormalizeNativePath(nsIFile* aBase, nsIFile* aStart) rv = file->GetNativePath(path); VerifyResult(rv, "GetNativePath (after normalization)"); - nsCAutoString basePath; + nsAutoCString basePath; rv = aBase->GetNativePath(basePath); VerifyResult(rv, "GetNativePath (base)"); diff --git a/xpcom/tests/TestHashtables.cpp b/xpcom/tests/TestHashtables.cpp index 04400d0ebec4..2a42fe35d53d 100644 --- a/xpcom/tests/TestHashtables.cpp +++ b/xpcom/tests/TestHashtables.cpp @@ -329,7 +329,7 @@ CreateIFoo( IFoo** result ) PLDHashOperator nsIEnumRead(const uint32_t& aKey, IFoo* aFoo, void* userArg) { - nsCAutoString str; + nsAutoCString str; aFoo->GetString(str); printf(" enumerated %u = \"%s\"\n", aKey, str.get()); @@ -338,7 +338,7 @@ nsIEnumRead(const uint32_t& aKey, IFoo* aFoo, void* userArg) { PLDHashOperator nsIEnum(const uint32_t& aKey, nsCOMPtr& aData, void* userArg) { - nsCAutoString str; + nsAutoCString str; aData->GetString(str); printf(" enumerated %u = \"%s\"\n", aKey, str.get()); @@ -347,7 +347,7 @@ nsIEnum(const uint32_t& aKey, nsCOMPtr& aData, void* userArg) { PLDHashOperator nsIEnum2Read(nsISupports* aKey, uint32_t aData, void* userArg) { - nsCAutoString str; + nsAutoCString str; nsCOMPtr foo = do_QueryInterface(aKey); foo->GetString(str); @@ -358,7 +358,7 @@ nsIEnum2Read(nsISupports* aKey, uint32_t aData, void* userArg) { PLDHashOperator nsIEnum2(nsISupports* aKey, uint32_t& aData, void* userArg) { - nsCAutoString str; + nsAutoCString str; nsCOMPtr foo = do_QueryInterface(aKey); foo->GetString(str); @@ -759,7 +759,7 @@ main(void) { exit (30); } - nsCAutoString str; + nsAutoCString str; myEnt->GetString(str); printf("Found %s\n", str.get()); } @@ -827,7 +827,7 @@ main(void) { exit (30); } - nsCAutoString str; + nsAutoCString str; myEnt->GetString(str); printf("Found %s\n", str.get()); } diff --git a/xpcom/tests/TestStrings.cpp b/xpcom/tests/TestStrings.cpp index 0dd31120af59..e213d2a952b4 100644 --- a/xpcom/tests/TestStrings.cpp +++ b/xpcom/tests/TestStrings.cpp @@ -135,7 +135,7 @@ bool test_rfind_2() bool test_rfind_3() { const char text[] = "urn:mozilla:locale:en-US:necko"; - nsCAutoString value(text); + nsAutoCString value(text); int32_t i = value.RFind(":"); if (i == 24) return true; @@ -160,7 +160,7 @@ bool test_rfind_4() bool test_findinreadable() { const char text[] = "jar:jar:file:///c:/software/mozilla/mozilla_2006_02_21.jar!/browser/chrome/classic.jar!/"; - nsCAutoString value(text); + nsAutoCString value(text); nsACString::const_iterator begin, end; value.BeginReading(begin); @@ -248,7 +248,7 @@ bool test_findinreadable() bool test_rfindinreadable() { const char text[] = "jar:jar:file:///c:/software/mozilla/mozilla_2006_02_21.jar!/browser/chrome/classic.jar!/"; - nsCAutoString value(text); + nsAutoCString value(text); nsACString::const_iterator begin, end; value.BeginReading(begin); @@ -512,7 +512,7 @@ bool test_concat_2() nsCString text("text"); const nsACString& aText = text; - nsCAutoString result( fieldTextStr + aText ); + nsAutoCString result( fieldTextStr + aText ); if (strcmp(result.get(), "xyztext") == 0) return true; @@ -891,7 +891,7 @@ bool test_voided_autostr() { const char kData[] = "hello world"; - nsCAutoString str; + nsAutoCString str; if (str.IsVoid()) return false; if (!str.IsEmpty()) @@ -953,10 +953,10 @@ bool test_string_tointeger() int32_t i; nsresult rv; for (const ToIntegerTest* t = kToIntegerTests; t->str; ++t) { - int32_t result = nsCAutoString(t->str).ToInteger(&rv, t->radix); + int32_t result = nsAutoCString(t->str).ToInteger(&rv, t->radix); if (rv != t->rv || result != t->result) return false; - result = nsCAutoString(t->str).ToInteger(&i, t->radix); + result = nsAutoCString(t->str).ToInteger(&i, t->radix); if ((nsresult)i != t->rv || result != t->result) return false; } diff --git a/xpcom/tests/TestTArray.cpp b/xpcom/tests/TestTArray.cpp index a4c7c8c4fcbd..490bdad26c2c 100644 --- a/xpcom/tests/TestTArray.cpp +++ b/xpcom/tests/TestTArray.cpp @@ -321,7 +321,7 @@ typedef nsCOMPtr FilePointer; class nsFileNameComparator { public: bool Equals(const FilePointer &a, const char *b) const { - nsCAutoString name; + nsAutoCString name; a->GetNativeLeafName(name); return name.Equals(b); } diff --git a/xpcom/tests/nsIFileEnumerator.cpp b/xpcom/tests/nsIFileEnumerator.cpp index 165a08bb3be6..fee7314106a8 100644 --- a/xpcom/tests/nsIFileEnumerator.cpp +++ b/xpcom/tests/nsIFileEnumerator.cpp @@ -29,7 +29,7 @@ bool LoopInDir(nsIFile* file) if(!file) return false; - nsCAutoString name; + nsAutoCString name; if(NS_FAILED(file->GetNativeLeafName(name))) return false; diff --git a/xpcom/threads/nsEnvironment.cpp b/xpcom/threads/nsEnvironment.cpp index a3c3a067c95c..01b20a0bb47d 100644 --- a/xpcom/threads/nsEnvironment.cpp +++ b/xpcom/threads/nsEnvironment.cpp @@ -46,11 +46,11 @@ nsEnvironment::~nsEnvironment() NS_IMETHODIMP nsEnvironment::Exists(const nsAString& aName, bool *aOutValue) { - nsCAutoString nativeName; + nsAutoCString nativeName; nsresult rv = NS_CopyUnicodeToNative(aName, nativeName); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString nativeVal; + nsAutoCString nativeVal; #if defined(XP_UNIX) /* For Unix/Linux platforms we follow the Unix definition: * An environment variable exists when |getenv()| returns a non-NULL value. @@ -75,11 +75,11 @@ nsEnvironment::Exists(const nsAString& aName, bool *aOutValue) NS_IMETHODIMP nsEnvironment::Get(const nsAString& aName, nsAString& aOutValue) { - nsCAutoString nativeName; + nsAutoCString nativeName; nsresult rv = NS_CopyUnicodeToNative(aName, nativeName); NS_ENSURE_SUCCESS(rv, rv); - nsCAutoString nativeVal; + nsAutoCString nativeVal; const char *value = PR_GetEnv(nativeName.get()); if (value && *value) { rv = NS_CopyNativeToUnicode(nsDependentCString(value), aOutValue); @@ -118,8 +118,8 @@ EnsureEnvHash() NS_IMETHODIMP nsEnvironment::Set(const nsAString& aName, const nsAString& aValue) { - nsCAutoString nativeName; - nsCAutoString nativeVal; + nsAutoCString nativeName; + nsAutoCString nativeVal; nsresult rv = NS_CopyUnicodeToNative(aName, nativeName); NS_ENSURE_SUCCESS(rv, rv); diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index 6eab494fe6d1..06f1cf22c7d8 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -338,7 +338,7 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent, nsCOMPtr reg = mozilla::services::GetXULChromeRegistryService(); if (reg) { - nsCAutoString package; + nsAutoCString package; package.AssignLiteral("global"); bool isRTL = false; reg->IsLocaleRTL(package, &isRTL); diff --git a/xpfe/appshell/src/nsContentTreeOwner.cpp b/xpfe/appshell/src/nsContentTreeOwner.cpp index f325cf10aa4d..2b88d65a3a11 100644 --- a/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -757,8 +757,8 @@ NS_IMETHODIMP nsContentTreeOwner::SetTitle(const PRUnichar* aTitle) nsresult rv = fixup->CreateExposableURI(uri,getter_AddRefs(tmpuri)); if (NS_SUCCEEDED(rv) && tmpuri) { // (don't bother if there's no host) - nsCAutoString host; - nsCAutoString prepath; + nsAutoCString host; + nsAutoCString prepath; tmpuri->GetHost(host); tmpuri->GetPrePath(prepath); if (!host.IsEmpty()) { diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index 5870593f714a..4ca81e4925b6 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -589,7 +589,7 @@ void nsWebShellWindow::LoadContentAreas() { nsCOMPtr url = do_QueryInterface(mainURL); if (url) { - nsCAutoString search; + nsAutoCString search; url->GetQuery(search); AppendUTF8toUTF16(search, searchSpec); diff --git a/xpfe/components/directory/nsDirectoryViewer.cpp b/xpfe/components/directory/nsDirectoryViewer.cpp index 3dc41c18ba5d..36ed466efd11 100644 --- a/xpfe/components/directory/nsDirectoryViewer.cpp +++ b/xpfe/components/directory/nsDirectoryViewer.cpp @@ -278,7 +278,7 @@ nsHTTPIndex::OnStartRequest(nsIRequest *request, nsISupports* aContext) nsCOMPtr uri; channel->GetURI(getter_AddRefs(uri)); - nsCAutoString entryuriC; + nsAutoCString entryuriC; uri->GetSpec(entryuriC); nsCOMPtr entry; @@ -379,7 +379,7 @@ nsHTTPIndex::OnIndexAvailable(nsIRequest* aRequest, nsISupports *aContext, } // we found the filename; construct a resource for its entry - nsCAutoString entryuriC(baseStr); + nsAutoCString entryuriC(baseStr); nsXPIDLCString filename; nsresult rv = aIndex->GetLocation(getter_Copies(filename)); diff --git a/xpfe/components/windowds/nsWindowDataSource.cpp b/xpfe/components/windowds/nsWindowDataSource.cpp index 5c44232b18e9..d457bfa35699 100644 --- a/xpfe/components/windowds/nsWindowDataSource.cpp +++ b/xpfe/components/windowds/nsWindowDataSource.cpp @@ -170,7 +170,7 @@ nsWindowDataSource::OnWindowTitleChange(nsIXULWindow *window, NS_IMETHODIMP nsWindowDataSource::OnOpenWindow(nsIXULWindow *window) { - nsCAutoString windowId(NS_LITERAL_CSTRING("window-")); + nsAutoCString windowId(NS_LITERAL_CSTRING("window-")); windowId.AppendInt(windowCount++, 10); nsCOMPtr windowResource; diff --git a/xulrunner/app/nsXULRunnerApp.cpp b/xulrunner/app/nsXULRunnerApp.cpp index b8f91640f8ec..761dc4f845ea 100644 --- a/xulrunner/app/nsXULRunnerApp.cpp +++ b/xulrunner/app/nsXULRunnerApp.cpp @@ -124,7 +124,7 @@ GetGREVersion(const char *argv0, static void Usage(const char *argv0) { - nsCAutoString milestone; + nsAutoCString milestone; GetGREVersion(argv0, &milestone, nullptr); // display additional information (XXX make localizable?) @@ -280,8 +280,8 @@ int main(int argc, char* argv[]) if (argc == 2 && (IsArg(argv[1], "v") || IsArg(argv[1], "version"))) { - nsCAutoString milestone; - nsCAutoString version; + nsAutoCString milestone; + nsAutoCString version; GetGREVersion(argv[0], &milestone, &version); Output(false, "Mozilla XULRunner %s - %s\n", milestone.get(), version.get()); @@ -295,7 +295,7 @@ int main(int argc, char* argv[]) } if (argc > 1) { - nsCAutoString milestone; + nsAutoCString milestone; rv = GetGREVersion(argv[0], &milestone, nullptr); if (NS_FAILED(rv)) return 2;