Bug 1374580 (part 1) - Remove nsASingleFragment{,C}String typedefs. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 20 Jun 2017 19:18:17 +1000
changeset 365626 87b31f17dd993477d662161290335e01844530ed
parent 365625 3fc6cdc7d80f820bc98dd8d03c902a5e4bc3a064
child 365627 2915d4b7849612e583048650beabe33bad2cfeca
push id91802
push usernnethercote@mozilla.com
push dateFri, 23 Jun 2017 04:52:55 +0000
treeherdermozilla-inbound@6352096eb0de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1374580
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1374580 (part 1) - Remove nsASingleFragment{,C}String typedefs. r=froydnj. All the instances are converted as follows. - nsASingleFragmentString --> nsAString - nsASingleFragmentCString --> nsACString
dom/base/nsXMLContentSerializer.cpp
dom/base/nsXMLContentSerializer.h
dom/xbl/nsXBLContentSink.cpp
dom/xslt/base/txStringUtils.h
dom/xslt/xpath/txExprLexer.cpp
dom/xslt/xpath/txExprLexer.h
dom/xslt/xpath/txExprParser.cpp
dom/xslt/xslt/txStylesheetCompileHandlers.cpp
layout/inspector/inCSSValueSearch.cpp
netwerk/base/nsStandardURL.cpp
netwerk/base/nsStandardURL.h
netwerk/cookie/nsCookieService.cpp
netwerk/cookie/nsCookieService.h
security/manager/ssl/nsCertOverrideService.cpp
xpcom/io/nsUnicharInputStream.cpp
xpcom/string/nsReadableUtils.cpp
xpcom/string/nsReadableUtils.h
xpcom/string/nsStringFwd.h
--- a/dom/base/nsXMLContentSerializer.cpp
+++ b/dom/base/nsXMLContentSerializer.cpp
@@ -1432,19 +1432,19 @@ nsXMLContentSerializer::AppendToStringCo
     }
   }
 
   return true;
 }
 
 bool
 nsXMLContentSerializer::AppendFormatedWrapped_WhitespaceSequence(
-                        nsASingleFragmentString::const_char_iterator &aPos,
-                        const nsASingleFragmentString::const_char_iterator aEnd,
-                        const nsASingleFragmentString::const_char_iterator aSequenceStart,
+                        nsAString::const_char_iterator &aPos,
+                        const nsAString::const_char_iterator aEnd,
+                        const nsAString::const_char_iterator aSequenceStart,
                         bool &aMayIgnoreStartOfLineWhitespaceSequence,
                         nsAString &aOutputStr)
 {
   // Handle the complete sequence of whitespace.
   // Continue to iterate until we find the first non-whitespace char.
   // Updates "aPos" to point to the first unhandled char.
   // Also updates the aMayIgnoreStartOfLineWhitespaceSequence flag,
   // as well as the other "global" state flags.
@@ -1510,19 +1510,19 @@ nsXMLContentSerializer::AppendFormatedWr
     }
   }
 
   return true;
 }
 
 bool
 nsXMLContentSerializer::AppendWrapped_NonWhitespaceSequence(
-                        nsASingleFragmentString::const_char_iterator &aPos,
-                        const nsASingleFragmentString::const_char_iterator aEnd,
-                        const nsASingleFragmentString::const_char_iterator aSequenceStart,
+                        nsAString::const_char_iterator &aPos,
+                        const nsAString::const_char_iterator aEnd,
+                        const nsAString::const_char_iterator aSequenceStart,
                         bool &aMayIgnoreStartOfLineWhitespaceSequence,
                         bool &aSequenceStartAfterAWhiteSpace,
                         nsAString& aOutputStr)
 {
   mMayIgnoreLineBreakSequence = false;
   aMayIgnoreStartOfLineWhitespaceSequence = false;
 
   // Handle the complete sequence of non-whitespace in this block
@@ -1675,24 +1675,24 @@ nsXMLContentSerializer::AppendWrapped_No
       aSequenceStartAfterAWhiteSpace = false;
     }
   } while (onceAgainBecauseWeAddedBreakInFront);
 
   return true;
 }
 
 bool
-nsXMLContentSerializer::AppendToStringFormatedWrapped(const nsASingleFragmentString& aStr,
+nsXMLContentSerializer::AppendToStringFormatedWrapped(const nsAString& aStr,
                                                       nsAString& aOutputStr)
 {
   if (mBodyOnly && !mInBody) {
     return true;
   }
 
-  nsASingleFragmentString::const_char_iterator pos, end, sequenceStart;
+  nsAString::const_char_iterator pos, end, sequenceStart;
 
   aStr.BeginReading(pos);
   aStr.EndReading(end);
 
   bool sequenceStartAfterAWhitespace = false;
   if (pos < end) {
     nsAString::const_char_iterator end2;
     aOutputStr.EndReading(end2);
@@ -1724,29 +1724,29 @@ nsXMLContentSerializer::AppendToStringFo
     }
   }
 
   return true;
 }
 
 bool
 nsXMLContentSerializer::AppendWrapped_WhitespaceSequence(
-                        nsASingleFragmentString::const_char_iterator &aPos,
-                        const nsASingleFragmentString::const_char_iterator aEnd,
-                        const nsASingleFragmentString::const_char_iterator aSequenceStart,
+                        nsAString::const_char_iterator &aPos,
+                        const nsAString::const_char_iterator aEnd,
+                        const nsAString::const_char_iterator aSequenceStart,
                         nsAString &aOutputStr)
 {
   // Handle the complete sequence of whitespace.
   // Continue to iterate until we find the first non-whitespace char.
   // Updates "aPos" to point to the first unhandled char.
   mAddSpace = false;
   mIsIndentationAddedOnCurrentLine = false;
 
   bool leaveLoop = false;
-  nsASingleFragmentString::const_char_iterator lastPos = aPos;
+  nsAString::const_char_iterator lastPos = aPos;
 
   do {
     switch (*aPos) {
       case ' ':
       case '\t':
         // if there are too many spaces on a line, we wrap
         if (mColPos >= mMaxColumn) {
           if (lastPos != aPos) {
@@ -1778,24 +1778,24 @@ nsXMLContentSerializer::AppendWrapped_Wh
   if (lastPos != aPos) {
     NS_ENSURE_TRUE(aOutputStr.Append(lastPos, aPos - lastPos, mozilla::fallible), false);
   }
 
   return true;
 }
 
 bool
-nsXMLContentSerializer::AppendToStringWrapped(const nsASingleFragmentString& aStr,
+nsXMLContentSerializer::AppendToStringWrapped(const nsAString& aStr,
                                               nsAString& aOutputStr)
 {
   if (mBodyOnly && !mInBody) {
     return true;
   }
 
-  nsASingleFragmentString::const_char_iterator pos, end, sequenceStart;
+  nsAString::const_char_iterator pos, end, sequenceStart;
 
   aStr.BeginReading(pos);
   aStr.EndReading(end);
 
   // not used in this case, but needed by AppendWrapped_NonWhitespaceSequence
   bool mayIgnoreStartOfLineWhitespaceSequence = false;
   mMayIgnoreLineBreakSequence = false;
 
--- a/dom/base/nsXMLContentSerializer.h
+++ b/dom/base/nsXMLContentSerializer.h
@@ -108,50 +108,50 @@ class nsXMLContentSerializer : public ns
   bool AppendToStringConvertLF(const nsAString& aStr,
                                nsAString& aOutputStr);
 
   /**
    * Appends a string by wrapping it when necessary.
    * It updates the column position.
    */
   MOZ_MUST_USE
-  bool AppendToStringWrapped(const nsASingleFragmentString& aStr,
+  bool AppendToStringWrapped(const nsAString& aStr,
                              nsAString& aOutputStr);
 
   /**
    * Appends a string by formating and wrapping it when necessary
    * It updates the column position.
    */
   MOZ_MUST_USE
-  bool AppendToStringFormatedWrapped(const nsASingleFragmentString& aStr,
+  bool AppendToStringFormatedWrapped(const nsAString& aStr,
                                      nsAString& aOutputStr);
 
   // used by AppendToStringWrapped
   MOZ_MUST_USE
   bool AppendWrapped_WhitespaceSequence(
-          nsASingleFragmentString::const_char_iterator &aPos,
-          const nsASingleFragmentString::const_char_iterator aEnd,
-          const nsASingleFragmentString::const_char_iterator aSequenceStart,
+          nsAString::const_char_iterator &aPos,
+          const nsAString::const_char_iterator aEnd,
+          const nsAString::const_char_iterator aSequenceStart,
           nsAString &aOutputStr);
 
   // used by AppendToStringFormatedWrapped
   MOZ_MUST_USE
   bool AppendFormatedWrapped_WhitespaceSequence(
-          nsASingleFragmentString::const_char_iterator &aPos,
-          const nsASingleFragmentString::const_char_iterator aEnd,
-          const nsASingleFragmentString::const_char_iterator aSequenceStart,
+          nsAString::const_char_iterator &aPos,
+          const nsAString::const_char_iterator aEnd,
+          const nsAString::const_char_iterator aSequenceStart,
           bool &aMayIgnoreStartOfLineWhitespaceSequence,
           nsAString &aOutputStr);
 
   // used by AppendToStringWrapped and AppendToStringFormatedWrapped
   MOZ_MUST_USE
   bool AppendWrapped_NonWhitespaceSequence(
-          nsASingleFragmentString::const_char_iterator &aPos,
-          const nsASingleFragmentString::const_char_iterator aEnd,
-          const nsASingleFragmentString::const_char_iterator aSequenceStart,
+          nsAString::const_char_iterator &aPos,
+          const nsAString::const_char_iterator aEnd,
+          const nsAString::const_char_iterator aSequenceStart,
           bool &aMayIgnoreStartOfLineWhitespaceSequence,
           bool &aSequenceStartAfterAWhiteSpace,
           nsAString &aOutputStr);
 
   /**
    * add mLineBreak to the string
    * It updates the column position and other flags.
    */
--- a/dom/xbl/nsXBLContentSink.cpp
+++ b/dom/xbl/nsXBLContentSink.cpp
@@ -84,17 +84,17 @@ nsXBLContentSink::MaybeStartLayout(bool 
 {
   return;
 }
 
 nsresult
 nsXBLContentSink::FlushText(bool aReleaseTextNode)
 {
   if (mTextLength != 0) {
-    const nsASingleFragmentString& text = Substring(mText, mText+mTextLength);
+    const nsAString& text = Substring(mText, mText+mTextLength);
     if (mState == eXBL_InHandlers) {
       NS_ASSERTION(mBinding, "Must have binding here");
       // Get the text and add it to the event handler.
       if (mSecondaryState == eXBL_InHandler)
         mHandler->AppendHandlerText(text);
       mTextLength = 0;
       return NS_OK;
     }
--- a/dom/xslt/base/txStringUtils.h
+++ b/dom/xslt/base/txStringUtils.h
@@ -12,17 +12,17 @@
 #include "nsContentUtils.h" // For ASCIIToLower().
 
 typedef nsCaseInsensitiveStringComparator txCaseInsensitiveStringComparator;
 
 /**
  * Check equality between a string and an atom containing ASCII.
  */
 inline bool
-TX_StringEqualsAtom(const nsASingleFragmentString& aString, nsIAtom* aAtom)
+TX_StringEqualsAtom(const nsAString& aString, nsIAtom* aAtom)
 {
   return aAtom->Equals(aString);
 }
 
 inline already_AddRefed<nsIAtom>
 TX_ToLowerCaseAtom(nsIAtom* aAtom)
 {
   nsAutoString str;
--- a/dom/xslt/xpath/txExprLexer.cpp
+++ b/dom/xslt/xpath/txExprLexer.cpp
@@ -87,17 +87,17 @@ txExprLexer::nextIsOperatorToken(Token* 
     aToken->mType > Token::UNION_OP;
 
 }
 
 /**
  * Parses the given string into a sequence of Tokens
  */
 nsresult
-txExprLexer::parse(const nsASingleFragmentString& aPattern)
+txExprLexer::parse(const nsAString& aPattern)
 {
   iterator start, end;
   start = aPattern.BeginReading(mPosition);
   aPattern.EndReading(end);
 
   //-- initialize previous token, this will automatically get
   //-- deleted when it goes out of scope
   Token nullToken(nullptr, nullptr, Token::NULL_TOKEN);
--- a/dom/xslt/xpath/txExprLexer.h
+++ b/dom/xslt/xpath/txExprLexer.h
@@ -83,17 +83,17 @@ public:
         //-- Special endtoken
         END // 36
     };
 
 
     /**
      * Constructors
      */
-    typedef nsASingleFragmentString::const_char_iterator iterator;
+    typedef nsAString::const_char_iterator iterator;
 
     Token(iterator aStart, iterator aEnd, Type aType)
         : mStart(aStart),
           mEnd(aEnd),
           mType(aType),
           mNext(nullptr)
     {
     }
@@ -131,19 +131,19 @@ public:
 
     /**
      * Parse the given string.
      * returns an error result if lexing failed.
      * The given string must outlive the use of the lexer, as the
      * generated Tokens point to Substrings of it.
      * mPosition points to the offending location in case of an error.
      */
-    nsresult parse(const nsASingleFragmentString& aPattern);
+    nsresult parse(const nsAString& aPattern);
 
-    typedef nsASingleFragmentString::const_char_iterator iterator;
+    typedef nsAString::const_char_iterator iterator;
     iterator mPosition;
 
     /**
      * Functions for iterating over the TokenList
      */
 
     Token* nextToken();
     Token* peek()
--- a/dom/xslt/xpath/txExprParser.cpp
+++ b/dom/xslt/xpath/txExprParser.cpp
@@ -150,28 +150,28 @@ txExprParser::createExprInternal(const n
                                  uint32_t aSubStringPos,
                                  txIParseContext* aContext, Expr** aExpr)
 {
     NS_ENSURE_ARG_POINTER(aExpr);
     *aExpr = nullptr;
     txExprLexer lexer;
     nsresult rv = lexer.parse(aExpression);
     if (NS_FAILED(rv)) {
-        nsASingleFragmentString::const_char_iterator start;
+        nsAString::const_char_iterator start;
         aExpression.BeginReading(start);
         aContext->SetErrorOffset(lexer.mPosition - start + aSubStringPos);
         return rv;
     }
     nsAutoPtr<Expr> expr;
     rv = createExpr(lexer, aContext, getter_Transfers(expr));
     if (NS_SUCCEEDED(rv) && lexer.peek()->mType != Token::END) {
         rv = NS_ERROR_XPATH_BINARY_EXPECTED;
     }
     if (NS_FAILED(rv)) {
-        nsASingleFragmentString::const_char_iterator start;
+        nsAString::const_char_iterator start;
         aExpression.BeginReading(start);
         aContext->SetErrorOffset(lexer.peek()->mStart - start + aSubStringPos);
 
         return rv;
     }
 
     txXPathOptimizer optimizer;
     Expr* newExpr = nullptr;
--- a/dom/xslt/xslt/txStylesheetCompileHandlers.cpp
+++ b/dom/xslt/xslt/txStylesheetCompileHandlers.cpp
@@ -1007,17 +1007,17 @@ txFnStartStripSpace(int32_t aNamespaceID
                                nsGkAtoms::elements, true, &attr);
     NS_ENSURE_SUCCESS(rv, rv);
 
     bool strip = aLocalName == nsGkAtoms::stripSpace;
 
     nsAutoPtr<txStripSpaceItem> stripItem(new txStripSpaceItem);
     nsWhitespaceTokenizer tokenizer(attr->mValue);
     while (tokenizer.hasMoreTokens()) {
-        const nsASingleFragmentString& name = tokenizer.nextToken();
+        const nsAString& name = tokenizer.nextToken();
         int32_t ns = kNameSpaceID_None;
         nsCOMPtr<nsIAtom> prefix, localName;
         rv = XMLUtils::splitQName(name, getter_AddRefs(prefix),
                                   getter_AddRefs(localName));
         if (NS_FAILED(rv)) {
             // check for "*" or "prefix:*"
             uint32_t length = name.Length();
             const char16_t* c;
--- a/layout/inspector/inCSSValueSearch.cpp
+++ b/layout/inspector/inCSSValueSearch.cpp
@@ -350,18 +350,17 @@ inCSSValueSearch::SearchStyleRule(nsIDOM
   return NS_OK;
 }
 
 nsresult
 inCSSValueSearch::SearchStyleValue(const nsAFlatString& aValue, nsIURI* aBaseURL)
 {
   if (StringBeginsWith(aValue, NS_LITERAL_STRING("url(")) &&
       StringEndsWith(aValue, NS_LITERAL_STRING(")"))) {
-    const nsASingleFragmentString &url =
-      Substring(aValue, 4, aValue.Length() - 5);
+    const nsAString& url = Substring(aValue, 4, aValue.Length() - 5);
     // XXXldb Need to do more with |mReturnRelativeURLs|, perhaps?
     nsCOMPtr<nsIURI> uri;
     nsresult rv = NS_NewURI(getter_AddRefs(uri), url, nullptr, aBaseURL);
     NS_ENSURE_SUCCESS(rv, rv);
     nsAutoCString spec;
     rv = uri->GetSpec(spec);
     NS_ENSURE_SUCCESS(rv, rv);
     nsAutoString *result = new NS_ConvertUTF8toUTF16(spec);
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -255,17 +255,17 @@ nsSegmentEncoder::EncodeSegmentCount(con
             appended = true;
         }
         len += extraLen;
     }
     return len;
 }
 
 const nsACString &nsStandardURL::
-nsSegmentEncoder::EncodeSegment(const nsASingleFragmentCString &str,
+nsSegmentEncoder::EncodeSegment(const nsACString& str,
                                 int16_t mask,
                                 nsAFlatCString &result)
 {
     const char *text;
     bool encoded;
     EncodeSegmentCount(str.BeginReading(text), URLSegment(0, str.Length()), mask, result, encoded);
     if (encoded)
         return result;
--- a/netwerk/base/nsStandardURL.h
+++ b/netwerk/base/nsStandardURL.h
@@ -132,17 +132,17 @@ public: /* internal -- HPUX compiler can
                                    int16_t mask,
                                    nsAFlatCString &buf,
                                    bool& appended,
                                    uint32_t extraLen = 0);
          
         // Encode the given string if necessary, and return a reference to
         // the encoded string.  Returns a reference to |buf| if encoding
         // is required.  Otherwise, a reference to |str| is returned.
-        const nsACString &EncodeSegment(const nsASingleFragmentCString &str,
+        const nsACString& EncodeSegment(const nsACString& str,
                                         int16_t mask,
                                         nsAFlatCString &buf);
     private:
       const Encoding* mEncoding;
     };
     friend class nsSegmentEncoder;
 
     static nsresult NormalizeIPv4(const nsCSubstring &host, nsCString &result);
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -3018,17 +3018,17 @@ nsCookieService::ImportCookies(nsIFile *
   // First, ensure we've read in everything from the database, if we have one.
   EnsureReadComplete();
 
   static const char kTrue[] = "TRUE";
 
   nsAutoCString buffer, baseDomain;
   bool isMore = true;
   int32_t hostIndex, isDomainIndex, pathIndex, secureIndex, expiresIndex, nameIndex, cookieIndex;
-  nsASingleFragmentCString::char_iterator iter;
+  nsACString::char_iterator iter;
   int32_t numInts;
   int64_t expires;
   bool isDomain, isHttpOnly = false;
   uint32_t originalCookieCount = mDefaultDBState->cookieCount;
 
   int64_t currentTimeInUsec = PR_Now();
   int64_t currentTime = currentTimeInUsec / PR_USEC_PER_SEC;
   // we use lastAccessedCounter to keep cookies in recently-used order,
@@ -3094,17 +3094,17 @@ nsCookieService::ImportCookies(nsIFile *
     buffer.BeginWriting(iter);
     *(iter += nameIndex - 1) = char(0);
     numInts = PR_sscanf(buffer.get() + expiresIndex, "%lld", &expires);
     if (numInts != 1 || expires < currentTime) {
       continue;
     }
 
     isDomain = Substring(buffer, isDomainIndex, pathIndex - isDomainIndex - 1).EqualsLiteral(kTrue);
-    const nsASingleFragmentCString &host = Substring(buffer, hostIndex, isDomainIndex - hostIndex - 1);
+    const nsACString& host = Substring(buffer, hostIndex, isDomainIndex - hostIndex - 1);
     // check for bad legacy cookies (domain not starting with a dot, or containing a port),
     // and discard
     if ((isDomain && !host.IsEmpty() && host.First() != '.') ||
         host.Contains(':')) {
       continue;
     }
 
     // compute the baseDomain from the host
@@ -3861,23 +3861,23 @@ nsCookieService::AddInternal(const nsCoo
 static inline bool iswhitespace     (char c) { return c == ' '  || c == '\t'; }
 static inline bool isterminator     (char c) { return c == '\n' || c == '\r'; }
 static inline bool isvalueseparator (char c) { return isterminator(c) || c == ';'; }
 static inline bool istokenseparator (char c) { return isvalueseparator(c) || c == '='; }
 
 // Parse a single token/value pair.
 // Returns true if a cookie terminator is found, so caller can parse new cookie.
 bool
-nsCookieService::GetTokenValue(nsASingleFragmentCString::const_char_iterator &aIter,
-                               nsASingleFragmentCString::const_char_iterator &aEndIter,
+nsCookieService::GetTokenValue(nsACString::const_char_iterator &aIter,
+                               nsACString::const_char_iterator &aEndIter,
                                nsDependentCSubstring                         &aTokenString,
                                nsDependentCSubstring                         &aTokenValue,
                                bool                                          &aEqualsFound)
 {
-  nsASingleFragmentCString::const_char_iterator start, lastSpace;
+  nsACString::const_char_iterator start, lastSpace;
   // initialize value string to clear garbage
   aTokenValue.Rebind(aIter, aIter);
 
   // find <token>, including any <LWS> between the end-of-token and the
   // token separator. we'll remove trailing <LWS> next
   while (aIter != aEndIter && iswhitespace(*aIter))
     ++aIter;
   start = aIter;
@@ -3936,18 +3936,18 @@ nsCookieService::ParseAttributes(nsDepen
 {
   static const char kPath[]    = "path";
   static const char kDomain[]  = "domain";
   static const char kExpires[] = "expires";
   static const char kMaxage[]  = "max-age";
   static const char kSecure[]  = "secure";
   static const char kHttpOnly[]  = "httponly";
 
-  nsASingleFragmentCString::const_char_iterator tempBegin, tempEnd;
-  nsASingleFragmentCString::const_char_iterator cookieStart, cookieEnd;
+  nsACString::const_char_iterator tempBegin, tempEnd;
+  nsACString::const_char_iterator cookieStart, cookieEnd;
   aCookieHeader.BeginReading(cookieStart);
   aCookieHeader.EndReading(cookieEnd);
 
   aCookieAttributes.isSecure = false;
   aCookieAttributes.isHttpOnly = false;
 
   nsDependentCSubstring tokenString(cookieStart, cookieStart);
   nsDependentCSubstring tokenValue (cookieStart, cookieStart);
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -297,17 +297,17 @@ class nsCookieService final : public nsI
     void                          GetCookieStringInternal(nsIURI *aHostURI, bool aIsForeign, bool aHttpBound, const OriginAttributes& aOriginAttrs, nsCString &aCookie);
     nsresult                      SetCookieStringCommon(nsIURI *aHostURI, const char *aCookieHeader, const char *aServerTime, nsIChannel *aChannel, bool aFromHttp);
     void                          SetCookieStringInternal(nsIURI *aHostURI, bool aIsForeign, nsDependentCString &aCookieHeader, const nsCString &aServerTime, bool aFromHttp, const OriginAttributes &aOriginAttrs, nsIChannel* aChannel);
     bool                          SetCookieInternal(nsIURI *aHostURI, const nsCookieKey& aKey, bool aRequireHostMatch, CookieStatus aStatus, nsDependentCString &aCookieHeader, int64_t aServerTime, bool aFromHttp, nsIChannel* aChannel);
     void                          AddInternal(const nsCookieKey& aKey, nsCookie *aCookie, int64_t aCurrentTimeInUsec, nsIURI *aHostURI, const char *aCookieHeader, bool aFromHttp);
     void                          RemoveCookieFromList(const nsListIter &aIter, mozIStorageBindingParamsArray *aParamsArray = nullptr);
     void                          AddCookieToList(const nsCookieKey& aKey, nsCookie *aCookie, DBState *aDBState, mozIStorageBindingParamsArray *aParamsArray, bool aWriteToDB = true);
     void                          UpdateCookieInList(nsCookie *aCookie, int64_t aLastAccessed, mozIStorageBindingParamsArray *aParamsArray);
-    static bool                   GetTokenValue(nsASingleFragmentCString::const_char_iterator &aIter, nsASingleFragmentCString::const_char_iterator &aEndIter, nsDependentCSubstring &aTokenString, nsDependentCSubstring &aTokenValue, bool &aEqualsFound);
+    static bool                   GetTokenValue(nsACString::const_char_iterator &aIter, nsACString::const_char_iterator &aEndIter, nsDependentCSubstring &aTokenString, nsDependentCSubstring &aTokenValue, bool &aEqualsFound);
     static bool                   ParseAttributes(nsDependentCString &aCookieHeader, nsCookieAttributes &aCookie);
     bool                          RequireThirdPartyCheck();
     CookieStatus                  CheckPrefs(nsIURI *aHostURI, bool aIsForeign, const char *aCookieHeader);
     bool                          CheckDomain(nsCookieAttributes &aCookie, nsIURI *aHostURI, const nsCString &aBaseDomain, bool aRequireHostMatch);
     static bool                   CheckPath(nsCookieAttributes &aCookie, nsIURI *aHostURI);
     static bool                   CheckPrefixes(nsCookieAttributes &aCookie, bool aSecureRequest);
     static bool                   GetExpiry(nsCookieAttributes &aCookie, int64_t aServerTime, int64_t aCurrentTime);
     void                          RemoveAllFromMemory();
--- a/security/manager/ssl/nsCertOverrideService.cpp
+++ b/security/manager/ssl/nsCertOverrideService.cpp
@@ -223,21 +223,21 @@ nsCertOverrideService::Read(const MutexA
     // todo: use iterators?
     if ((algoIndex         = buffer.FindChar('\t', hostIndex)         + 1) == 0 ||
         (fingerprintIndex  = buffer.FindChar('\t', algoIndex)         + 1) == 0 ||
         (overrideBitsIndex = buffer.FindChar('\t', fingerprintIndex)  + 1) == 0 ||
         (dbKeyIndex        = buffer.FindChar('\t', overrideBitsIndex) + 1) == 0) {
       continue;
     }
 
-    const nsASingleFragmentCString &tmp = Substring(buffer, hostIndex, algoIndex - hostIndex - 1);
-    const nsASingleFragmentCString &algo_string = Substring(buffer, algoIndex, fingerprintIndex - algoIndex - 1);
-    const nsASingleFragmentCString &fingerprint = Substring(buffer, fingerprintIndex, overrideBitsIndex - fingerprintIndex - 1);
-    const nsASingleFragmentCString &bits_string = Substring(buffer, overrideBitsIndex, dbKeyIndex - overrideBitsIndex - 1);
-    const nsASingleFragmentCString &db_key = Substring(buffer, dbKeyIndex, buffer.Length() - dbKeyIndex);
+    const nsACString& tmp = Substring(buffer, hostIndex, algoIndex - hostIndex - 1);
+    const nsACString& algo_string = Substring(buffer, algoIndex, fingerprintIndex - algoIndex - 1);
+    const nsACString& fingerprint = Substring(buffer, fingerprintIndex, overrideBitsIndex - fingerprintIndex - 1);
+    const nsACString& bits_string = Substring(buffer, overrideBitsIndex, dbKeyIndex - overrideBitsIndex - 1);
+    const nsACString& db_key = Substring(buffer, dbKeyIndex, buffer.Length() - dbKeyIndex);
 
     nsAutoCString host(tmp);
     nsCertOverride::OverrideBits bits;
     nsCertOverride::convertStringToBits(bits_string, bits);
 
     int32_t port;
     int32_t portIndex = host.RFindChar(':');
     if (portIndex == kNotFound)
--- a/xpcom/io/nsUnicharInputStream.cpp
+++ b/xpcom/io/nsUnicharInputStream.cpp
@@ -318,18 +318,18 @@ UTF8InputStream::Fill(nsresult* aErrorCo
   NS_ASSERTION(dstLen <= mUnicharData.Capacity(),
                "Ouch. I would overflow my buffer if I wasn't so careful.");
   if (dstLen > mUnicharData.Capacity()) {
     return 0;
   }
 
   ConvertUTF8toUTF16 converter(mUnicharData.Elements());
 
-  nsASingleFragmentCString::const_char_iterator start = mByteData.Elements();
-  nsASingleFragmentCString::const_char_iterator end = mByteData.Elements() + srcLen;
+  nsACString::const_char_iterator start = mByteData.Elements();
+  nsACString::const_char_iterator end = mByteData.Elements() + srcLen;
 
   copy_string(start, end, converter);
   if (converter.Length() != dstLen) {
     *aErrorCode = NS_BASE_STREAM_BAD_CONVERSION;
     return -1;
   }
 
   mUnicharDataOffset = 0;
--- a/xpcom/string/nsReadableUtils.cpp
+++ b/xpcom/string/nsReadableUtils.cpp
@@ -1287,18 +1287,18 @@ const nsAFlatCString&
 NullCString()
 {
   static const nsXPIDLCString sNull;
 
   return sNull;
 }
 
 int32_t
-CompareUTF8toUTF16(const nsASingleFragmentCString& aUTF8String,
-                   const nsASingleFragmentString& aUTF16String)
+CompareUTF8toUTF16(const nsACString& aUTF8String,
+                   const nsAString& aUTF16String)
 {
   static const uint32_t NOT_ASCII = uint32_t(~0x7F);
 
   const char* u8;
   const char* u8end;
   aUTF8String.BeginReading(u8);
   aUTF8String.EndReading(u8end);
 
--- a/xpcom/string/nsReadableUtils.h
+++ b/xpcom/string/nsReadableUtils.h
@@ -409,18 +409,18 @@ const nsAFlatCString& NullCString();
 /**
 * Compare a UTF-8 string to an UTF-16 string.
 *
 * Returns 0 if the strings are equal, -1 if aUTF8String is less
 * than aUTF16Count, and 1 in the reverse case.  In case of fatal
 * error (eg the strings are not valid UTF8 and UTF16 respectively),
 * this method will return INT32_MIN.
 */
-int32_t CompareUTF8toUTF16(const nsASingleFragmentCString& aUTF8String,
-                           const nsASingleFragmentString& aUTF16String);
+int32_t CompareUTF8toUTF16(const nsACString& aUTF8String,
+                           const nsAString& aUTF16String);
 
 void AppendUCS4ToUTF16(const uint32_t aSource, nsAString& aDest);
 
 template<class T>
 inline bool
 EnsureStringLength(T& aStr, uint32_t aLen)
 {
   aStr.SetLength(aLen);
--- a/xpcom/string/nsStringFwd.h
+++ b/xpcom/string/nsStringFwd.h
@@ -59,15 +59,13 @@ class nsXPIDLCString;
 /**
  * typedefs for backwards compatibility
  */
 
 typedef nsAString             nsSubstring;
 typedef nsACString            nsCSubstring;
 
 typedef nsString              nsAFlatString;
-typedef nsSubstring           nsASingleFragmentString;
 
 typedef nsCString             nsAFlatCString;
-typedef nsCSubstring          nsASingleFragmentCString;
 
 
 #endif /* !defined(nsStringFwd_h___) */