Bug 1346078: Remove nsAString_internal and just use the nsAString name directly. r?bsmedberg draft
authorDavid Major <dmajor@mozilla.com>
Fri, 10 Mar 2017 15:17:23 +1300
changeset 499675 246b6903c8525128b099e2da338de2d51b354397
parent 499651 6fe55ee72096f3c070b7bf2dc6988a56e028332e
child 549411 d261eb27d3dd56bd403e6fc6f43c08438f162fad
push id49472
push userdmajor@mozilla.com
push dateThu, 16 Mar 2017 02:49:07 +0000
reviewersbsmedberg
bugs1346078
milestone55.0a1
Bug 1346078: Remove nsAString_internal and just use the nsAString name directly. r?bsmedberg MozReview-Commit-ID: DWDEDMIVKm7
build/valgrind/cross-architecture.sup
dom/media/webrtc/MediaEngineTabVideoSource.cpp
dom/media/webrtc/MediaEngineTabVideoSource.h
editor/composer/nsEditorSpellCheck.cpp
editor/libeditor/ChangeStyleTransaction.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/HTMLEditUtils.cpp
editor/libeditor/SelectionState.cpp
editor/txtsvc/nsTextServicesDocument.cpp
js/src/devtools/rootAnalysis/annotations.js
netwerk/base/nsSocketTransport2.cpp
netwerk/protocol/http/TunnelUtils.cpp
python/lldbutils/README.txt
python/lldbutils/lldbutils/general.py
security/certverifier/OCSPRequestor.cpp
xpcom/base/nscore.h
--- a/build/valgrind/cross-architecture.sup
+++ b/build/valgrind/cross-architecture.sup
@@ -10,33 +10,33 @@
    ...
    fun:_ZL9SaveToEnvPKc
    ...
 }
 {
    PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 793549.)
    Memcheck:Leak
    ...
-   fun:_ZL13SaveWordToEnvPKcRK19nsACString_internal
+   fun:_ZL13SaveWordToEnvPKcRK10nsACString
    ...
 }
 {
    PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 944133.)
    Memcheck:Leak
    ...
    fun:_ZN13CrashReporter14SetRestartArgsEiPPc
    ...
 }
 {
    PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 793548.)
    Memcheck:Leak
    fun:malloc
    ...
-   fun:_Z12ToNewCStringRK19nsACString_internal
-   fun:_ZN13CrashReporter14SetupExtraDataEP7nsIFileRK19nsACString_internal
+   fun:_Z12ToNewCStringRK10nsACString
+   fun:_ZN13CrashReporter14SetupExtraDataEP7nsIFileRK10nsACString
    ...
 }
 {
    We purposely leak the StatisticsReporter object
    Memcheck:Leak
    fun:malloc
    fun:moz_xmalloc
    fun:operator new
--- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp
@@ -127,23 +127,23 @@ MediaEngineTabVideoSource::DestroyRunnab
 
   mVideoSource->mWindow = nullptr;
   mVideoSource->mTabSource = nullptr;
 
   return NS_OK;
 }
 
 void
-MediaEngineTabVideoSource::GetName(nsAString_internal& aName) const
+MediaEngineTabVideoSource::GetName(nsAString& aName) const
 {
   aName.AssignLiteral(u"&getUserMedia.videoSource.tabShare;");
 }
 
 void
-MediaEngineTabVideoSource::GetUUID(nsACString_internal& aUuid) const
+MediaEngineTabVideoSource::GetUUID(nsACString& aUuid) const
 {
   aUuid.AssignLiteral("tab");
 }
 
 #define DEFAULT_TABSHARE_VIDEO_MAX_WIDTH 4096
 #define DEFAULT_TABSHARE_VIDEO_MAX_HEIGHT 4096
 #define DEFAULT_TABSHARE_VIDEO_FRAMERATE 30
 
--- a/dom/media/webrtc/MediaEngineTabVideoSource.h
+++ b/dom/media/webrtc/MediaEngineTabVideoSource.h
@@ -14,18 +14,18 @@ namespace mozilla {
 
 class MediaEngineTabVideoSource : public MediaEngineVideoSource, nsIDOMEventListener, nsITimerCallback {
   public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIDOMEVENTLISTENER
     NS_DECL_NSITIMERCALLBACK
     MediaEngineTabVideoSource();
 
-    void GetName(nsAString_internal&) const override;
-    void GetUUID(nsACString_internal&) const override;
+    void GetName(nsAString&) const override;
+    void GetUUID(nsACString&) const override;
 
     bool GetScary() const override {
       return true;
     }
 
     nsresult Allocate(const dom::MediaTrackConstraints &,
                       const mozilla::MediaEnginePrefs&,
                       const nsString& aDeviceId,
--- a/editor/composer/nsEditorSpellCheck.cpp
+++ b/editor/composer/nsEditorSpellCheck.cpp
@@ -7,17 +7,17 @@
 #include <stdlib.h>                     // for getenv
 
 #include "mozilla/Attributes.h"         // for final
 #include "mozilla/Preferences.h"        // for Preferences
 #include "mozilla/Services.h"           // for GetXULChromeRegistryService
 #include "mozilla/dom/Element.h"        // for Element
 #include "mozilla/dom/Selection.h"
 #include "mozilla/mozalloc.h"           // for operator delete, etc
-#include "nsAString.h"                  // for nsAString_internal::IsEmpty, etc
+#include "nsAString.h"                  // for nsAString::IsEmpty, etc
 #include "nsComponentManagerUtils.h"    // for do_CreateInstance
 #include "nsDebug.h"                    // for NS_ENSURE_TRUE, etc
 #include "nsDependentSubstring.h"       // for Substring
 #include "nsEditorSpellCheck.h"
 #include "nsError.h"                    // for NS_ERROR_NOT_INITIALIZED, etc
 #include "nsIChromeRegistry.h"          // for nsIXULChromeRegistry
 #include "nsIContent.h"                 // for nsIContent
 #include "nsIContentPrefService.h"      // for nsIContentPrefService, etc
--- a/editor/libeditor/ChangeStyleTransaction.cpp
+++ b/editor/libeditor/ChangeStyleTransaction.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ChangeStyleTransaction.h"
 
 #include "mozilla/dom/Element.h"        // for Element
-#include "nsAString.h"                  // for nsAString_internal::Append, etc.
+#include "nsAString.h"                  // for nsAString::Append, etc.
 #include "nsCRT.h"                      // for nsCRT::IsAsciiSpace
 #include "nsDebug.h"                    // for NS_ENSURE_SUCCESS, etc.
 #include "nsError.h"                    // for NS_ERROR_NULL_POINTER, etc.
 #include "nsGkAtoms.h"                  // for nsGkAtoms, etc.
 #include "nsICSSDeclaration.h"          // for nsICSSDeclaration.
 #include "nsLiteralString.h"            // for NS_LITERAL_STRING, etc.
 #include "nsReadableUtils.h"            // for ToNewUnicode
 #include "nsString.h"                   // for nsAutoString, nsString, etc.
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -35,17 +35,17 @@
 #include "mozilla/dom/Selection.h"      // for Selection, etc.
 #include "mozilla/Services.h"           // for GetObserverService
 #include "mozilla/TextComposition.h"    // for TextComposition
 #include "mozilla/TextEvents.h"
 #include "mozilla/dom/Element.h"        // for Element, nsINode::AsElement
 #include "mozilla/dom/Text.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/mozalloc.h"           // for operator new, etc.
-#include "nsAString.h"                  // for nsAString_internal::Length, etc.
+#include "nsAString.h"                  // for nsAString::Length, etc.
 #include "nsCCUncollectableMarker.h"    // for nsCCUncollectableMarker
 #include "nsCaret.h"                    // for nsCaret
 #include "nsCaseTreatment.h"
 #include "nsCharTraits.h"               // for NS_IS_HIGH_SURROGATE, etc.
 #include "nsComponentManagerUtils.h"    // for do_CreateInstance
 #include "nsComputedDOMStyle.h"         // for nsComputedDOMStyle
 #include "nsContentUtils.h"             // for nsContentUtils
 #include "nsDOMString.h"                // for DOMStringIsNull
--- a/editor/libeditor/HTMLEditUtils.cpp
+++ b/editor/libeditor/HTMLEditUtils.cpp
@@ -5,17 +5,17 @@
 
 #include "HTMLEditUtils.h"
 
 #include "TextEditUtils.h"              // for TextEditUtils
 #include "mozilla/ArrayUtils.h"         // for ArrayLength
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc.
 #include "mozilla/EditorBase.h"         // for EditorBase
 #include "mozilla/dom/Element.h"        // for Element, nsINode
-#include "nsAString.h"                  // for nsAString_internal::IsEmpty
+#include "nsAString.h"                  // for nsAString::IsEmpty
 #include "nsCOMPtr.h"                   // for nsCOMPtr, operator==, etc.
 #include "nsCaseTreatment.h"
 #include "nsDebug.h"                    // for NS_PRECONDITION, etc.
 #include "nsError.h"                    // for NS_SUCCEEDED
 #include "nsGkAtoms.h"                  // for nsGkAtoms, nsGkAtoms::a, etc.
 #include "nsHTMLTags.h"
 #include "nsIAtom.h"                    // for nsIAtom
 #include "nsIDOMHTMLAnchorElement.h"    // for nsIDOMHTMLAnchorElement
--- a/editor/libeditor/SelectionState.cpp
+++ b/editor/libeditor/SelectionState.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/SelectionState.h"
 
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc.
 #include "mozilla/EditorUtils.h"        // for EditorUtils
 #include "mozilla/dom/Selection.h"      // for Selection
-#include "nsAString.h"                  // for nsAString_internal::Length
+#include "nsAString.h"                  // for nsAString::Length
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"                    // for NS_ENSURE_TRUE, etc.
 #include "nsError.h"                    // for NS_OK, etc.
 #include "nsIContent.h"                 // for nsIContent
 #include "nsIDOMCharacterData.h"        // for nsIDOMCharacterData
 #include "nsIDOMNode.h"                 // for nsIDOMNode
 #include "nsISupportsImpl.h"            // for nsRange::Release
 #include "nsRange.h"                    // for nsRange
--- a/editor/txtsvc/nsTextServicesDocument.cpp
+++ b/editor/txtsvc/nsTextServicesDocument.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stddef.h>                     // for nullptr
 
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc
 #include "mozilla/dom/Selection.h"
 #include "mozilla/mozalloc.h"           // for operator new, etc
-#include "nsAString.h"                  // for nsAString_internal::Length, etc
+#include "nsAString.h"                  // for nsAString::Length, etc
 #include "nsContentUtils.h"             // for nsContentUtils
 #include "nsDebug.h"                    // for NS_ENSURE_TRUE, etc
 #include "nsDependentSubstring.h"       // for Substring
 #include "nsError.h"                    // for NS_OK, NS_ERROR_FAILURE, etc
 #include "nsFilteredContentIterator.h"  // for nsFilteredContentIterator
 #include "nsIContent.h"                 // for nsIContent, etc
 #include "nsIContentIterator.h"         // for nsIContentIterator
 #include "nsID.h"                       // for NS_GET_IID
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -191,18 +191,17 @@ var ignoreFunctions = {
     // These are a little overzealous -- these destructors *can* GC if they end
     // up wrapping a pending exception. See bug 898815 for the heavyweight fix.
     "void js::AutoCompartment::~AutoCompartment(int32)" : true,
     "void JSAutoCompartment::~JSAutoCompartment(int32)" : true,
 
     // The nsScriptNameSpaceManager functions can't actually GC.  They
     // just use a PLDHashTable which has function pointers, which makes the
     // analysis think maybe they can.
-    "nsGlobalNameStruct* nsScriptNameSpaceManager::LookupNavigatorName(nsAString_internal*)": true,
-    "nsGlobalNameStruct* nsScriptNameSpaceManager::LookupName(nsAString_internal*, uint16**)": true,
+    "nsGlobalNameStruct* nsScriptNameSpaceManager::LookupName(nsAString*, uint16**)": true,
 
     // Similar to heap snapshot mock classes, and GTests below. This posts a
     // synchronous runnable when a GTest fails, and we are pretty sure that the
     // particular runnable it posts can't even GC, but the analysis isn't
     // currently smart enough to determine that. In either case, this is (a)
     // only in GTests, and (b) only when the Gtest has already failed. We have
     // static and dynamic checks for no GC in the non-test code, and in the test
     // code we fall back to only the dynamic checks.
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -2398,25 +2398,25 @@ nsSocketTransport::GetHost(nsACString &h
 NS_IMETHODIMP
 nsSocketTransport::GetPort(int32_t *port)
 {
     *port = (int32_t) SocketPort();
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetNetworkInterfaceId(nsACString_internal &aNetworkInterfaceId)
+nsSocketTransport::GetNetworkInterfaceId(nsACString &aNetworkInterfaceId)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "wrong thread");
     aNetworkInterfaceId = mNetworkInterfaceId;
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::SetNetworkInterfaceId(const nsACString_internal &aNetworkInterfaceId)
+nsSocketTransport::SetNetworkInterfaceId(const nsACString &aNetworkInterfaceId)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "wrong thread");
     mNetworkInterfaceId = aNetworkInterfaceId;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSocketTransport::GetScriptableOriginAttributes(JSContext* aCx,
--- a/netwerk/protocol/http/TunnelUtils.cpp
+++ b/netwerk/protocol/http/TunnelUtils.cpp
@@ -1586,23 +1586,23 @@ SocketTransportShim::GetHost(nsACString 
 
 NS_IMETHODIMP
 SocketTransportShim::GetTimeout(uint32_t aType, uint32_t *_retval)
 {
   return mWrapped->GetTimeout(aType, _retval);
 }
 
 NS_IMETHODIMP
-SocketTransportShim::GetNetworkInterfaceId(nsACString_internal &aNetworkInterfaceId)
+SocketTransportShim::GetNetworkInterfaceId(nsACString &aNetworkInterfaceId)
 {
   return mWrapped->GetNetworkInterfaceId(aNetworkInterfaceId);
 }
 
 NS_IMETHODIMP
-SocketTransportShim::SetNetworkInterfaceId(const nsACString_internal &aNetworkInterfaceId)
+SocketTransportShim::SetNetworkInterfaceId(const nsACString &aNetworkInterfaceId)
 {
   return mWrapped->SetNetworkInterfaceId(aNetworkInterfaceId);
 }
 
 NS_IMETHODIMP
 SocketTransportShim::SetTimeout(uint32_t aType, uint32_t aValue)
 {
   return mWrapped->SetTimeout(aType, aValue);
--- a/python/lldbutils/README.txt
+++ b/python/lldbutils/README.txt
@@ -129,23 +129,23 @@ the "expr -R -- EXPR" command can be use
   nsFixedString, nsFixedCString,
   nsAutoString, nsAutoCString
 
   Strings have a type summary that shows the actual string.
 
   (lldb) frame info
   frame #0: 0x000000010400cfea XUL`nsCSSParser::ParseProperty(this=0x00007fff5fbf5248, aPropID=eCSSProperty_margin_top, aPropValue=0x00007fff5fbf53f8, aSheetURI=0x0000000115ae8c00, aBaseURI=0x0000000115ae8c00, aSheetPrincipal=0x000000010ff9e040, aDeclaration=0x00000001826fd580, aChanged=0x00007fff5fbf5247, aIsImportant=false, aIsSVGMode=false) + 74 at nsCSSParser.cpp:12851
   (lldb) p aPropValue
-  (const nsAString_internal) $16 = u"-25px"
+  (const nsAString) $16 = u"-25px"
 
   (lldb) p this
   (nsHTMLDocument *) $18 = 0x0000000115b56000
   (lldb) p mContentType
   (nsCString) $19 = {
-    nsACString_internal = "text/html"
+    nsACString = "text/html"
   }
 
 * nscolor
 
   nscolors (32-bit RGBA colors) have a type summary that shows the color as
   one of the CSS 2.1 color keywords, a six digit hex color, an rgba() color,
   or the "transparent" keyword.
 
--- a/python/lldbutils/lldbutils/general.py
+++ b/python/lldbutils/lldbutils/general.py
@@ -87,18 +87,18 @@ def callfunc(debugger, command, result, 
 
     sym = symbols[0]
     arg_types = '()'
     if sym.name and sym.name.startswith(funcname + '('):
         arg_types = sym.name[len(funcname):]
     debugger.HandleCommand('print ((void(*)%s)0x%0x)(%s' % (arg_types, sym.addr.GetLoadAddress(target), args))
 
 def init(debugger):
-    debugger.HandleCommand("type summary add nsAString_internal -F lldbutils.general.summarize_string")
-    debugger.HandleCommand("type summary add nsACString_internal -F lldbutils.general.summarize_string")
+    debugger.HandleCommand("type summary add nsAString -F lldbutils.general.summarize_string")
+    debugger.HandleCommand("type summary add nsACString -F lldbutils.general.summarize_string")
     debugger.HandleCommand("type summary add nsFixedString -F lldbutils.general.summarize_string")
     debugger.HandleCommand("type summary add nsFixedCString -F lldbutils.general.summarize_string")
     debugger.HandleCommand("type summary add nsAutoString -F lldbutils.general.summarize_string")
     debugger.HandleCommand("type summary add nsAutoCString -F lldbutils.general.summarize_string")
     debugger.HandleCommand("type synthetic add -x \"nsTArray<\" -l lldbutils.general.TArraySyntheticChildrenProvider")
     debugger.HandleCommand("type synthetic add -x \"AutoTArray<\" -l lldbutils.general.TArraySyntheticChildrenProvider")
     debugger.HandleCommand("type synthetic add -x \"FallibleTArray<\" -l lldbutils.general.TArraySyntheticChildrenProvider")
     debugger.HandleCommand("command script add -f lldbutils.general.prefcnt -f lldbutils.general.prefcnt prefcnt")
--- a/security/certverifier/OCSPRequestor.cpp
+++ b/security/certverifier/OCSPRequestor.cpp
@@ -136,17 +136,17 @@ DoOCSPRequest(const UniquePLArenaPool& a
   }
   if (port == -1) {
     port = 80;
   } else if (port < 0 || port > 0xffff) {
     return Result::ERROR_CERT_BAD_ACCESS_LOCATION;
   }
   nsAutoCString
     hostname(url + authorityPos + hostnamePos,
-             static_cast<nsACString_internal::size_type>(hostnameLen));
+             static_cast<nsACString::size_type>(hostnameLen));
 
   nsNSSHttpServerSession* serverSessionPtr = nullptr;
   Result rv = nsNSSHttpInterface::createSessionFcn(
     hostname.BeginReading(), static_cast<uint16_t>(port), &serverSessionPtr);
   if (rv != Success) {
     return rv;
   }
   UniqueHTTPServerSession serverSession(serverSessionPtr);
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -182,28 +182,16 @@
 #ifdef __cplusplus
 #define NS_EXTERN_C extern "C"
 #else
 #define NS_EXTERN_C
 #endif
 
 #define XPCOM_API(type) NS_EXTERN_C type
 
-#ifdef MOZILLA_INTERNAL_API
-   /*
-     The frozen string API has different definitions of nsAC?String
-     classes than the internal API. On systems that explicitly declare
-     dllexport symbols this is not a problem, but on ELF systems
-     internal symbols can accidentally "shine through"; we rename the
-     internal classes to avoid symbol conflicts.
-   */
-#  define nsAString nsAString_internal
-#  define nsACString nsACString_internal
-#endif
-
 #if (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
 /* Make refcnt logging part of the build. This doesn't mean that
  * actual logging will occur (that requires a separate enable; see
  * nsTraceRefcnt and nsISupportsImpl.h for more information).  */
 #define NS_BUILD_REFCNT_LOGGING
 #endif
 
 /* If NO_BUILD_REFCNT_LOGGING is defined then disable refcnt logging