Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit f1364a7

Browse files
committed
Bug 1374580 (part 3) - Remove ns{,C}Substring typedefs. r=froydnj.
All the instances are converted as follows. - nsSubstring --> nsAString - nsCSubstring --> nsACString --HG-- extra : rebase_source : cfd2238c52e3cb4d13e3bd5ddb80ba6584ab6d91
1 parent fe9268c commit f1364a7

119 files changed

Lines changed: 363 additions & 379 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

accessible/base/nsCoreUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,9 @@ nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
633633
}
634634

635635
bool
636-
nsCoreUtils::IsWhitespaceString(const nsSubstring& aString)
636+
nsCoreUtils::IsWhitespaceString(const nsAString& aString)
637637
{
638-
nsSubstring::const_char_iterator iterBegin, iterEnd;
638+
nsAString::const_char_iterator iterBegin, iterEnd;
639639

640640
aString.BeginReading(iterBegin);
641641
aString.EndReading(iterEnd);

accessible/base/nsCoreUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class nsCoreUtils
299299
* only. In contrast to nsWhitespaceTokenizer class it takes into account
300300
* non-breaking space (0xa0).
301301
*/
302-
static bool IsWhitespaceString(const nsSubstring& aString);
302+
static bool IsWhitespaceString(const nsAString& aString);
303303

304304
/**
305305
* Returns true if the given character is whitespace symbol.

docshell/base/nsDocShell.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11427,7 +11427,7 @@ nsDocShell::AddHeadersToChannel(nsIInputStream* aHeadersData,
1142711427
return NS_OK;
1142811428
}
1142911429

11430-
const nsCSubstring& oneHeader = StringHead(headersString, crlf);
11430+
const nsACString& oneHeader = StringHead(headersString, crlf);
1143111431

1143211432
colon = oneHeader.FindChar(':');
1143311433
if (colon == kNotFound) {

dom/base/Navigator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ Navigator::GetAcceptLanguages(nsTArray<nsString>& aLanguages)
401401
int32_t pos = 0;
402402
bool first = true;
403403
while (localeTokenizer.hasMoreTokens()) {
404-
const nsSubstring& code = localeTokenizer.nextToken();
404+
const nsAString& code = localeTokenizer.nextToken();
405405

406406
if (code.Length() == 2 && !first) {
407407
nsAutoString upper(code);

dom/base/nsContentSink.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ nsContentSink::DoProcessLinkHeader()
356356
// see <http://tools.ietf.org/html/rfc5988#section-5.2>
357357

358358
bool
359-
nsContentSink::LinkContextIsOurDocument(const nsSubstring& aAnchor)
359+
nsContentSink::LinkContextIsOurDocument(const nsAString& aAnchor)
360360
{
361361
if (aAnchor.IsEmpty()) {
362362
// anchor parameter not present or empty -> same document reference
@@ -680,10 +680,10 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
680680

681681

682682
nsresult
683-
nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
684-
const nsSubstring& aRel, const nsSubstring& aTitle,
685-
const nsSubstring& aType, const nsSubstring& aMedia,
686-
const nsSubstring& aCrossOrigin)
683+
nsContentSink::ProcessLink(const nsAString& aAnchor, const nsAString& aHref,
684+
const nsAString& aRel, const nsAString& aTitle,
685+
const nsAString& aType, const nsAString& aMedia,
686+
const nsAString& aCrossOrigin)
687687
{
688688
uint32_t linkTypes =
689689
nsStyleLinkElement::ParseLinkTypes(aRel);
@@ -734,11 +734,11 @@ nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
734734

735735
nsresult
736736
nsContentSink::ProcessStyleLink(nsIContent* aElement,
737-
const nsSubstring& aHref,
737+
const nsAString& aHref,
738738
bool aAlternate,
739-
const nsSubstring& aTitle,
740-
const nsSubstring& aType,
741-
const nsSubstring& aMedia)
739+
const nsAString& aTitle,
740+
const nsAString& aType,
741+
const nsAString& aMedia)
742742
{
743743
if (aAlternate && aTitle.IsEmpty()) {
744744
// alternates must have title return without error, for now

dom/base/nsContentSink.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class nsContentSink : public nsICSSLoaderObserver,
113113
virtual void UpdateChildCounts() = 0;
114114

115115
bool IsTimeToNotify();
116-
bool LinkContextIsOurDocument(const nsSubstring& aAnchor);
116+
bool LinkContextIsOurDocument(const nsAString& aAnchor);
117117
bool Decode5987Format(nsAString& aEncoded);
118118

119119
static void InitializeStatics();
@@ -151,17 +151,17 @@ class nsContentSink : public nsICSSLoaderObserver,
151151
nsresult ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue,
152152
nsIContent* aContent = nullptr);
153153
nsresult ProcessLinkHeader(const nsAString& aLinkData);
154-
nsresult ProcessLink(const nsSubstring& aAnchor,
155-
const nsSubstring& aHref, const nsSubstring& aRel,
156-
const nsSubstring& aTitle, const nsSubstring& aType,
157-
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin);
154+
nsresult ProcessLink(const nsAString& aAnchor,
155+
const nsAString& aHref, const nsAString& aRel,
156+
const nsAString& aTitle, const nsAString& aType,
157+
const nsAString& aMedia, const nsAString& aCrossOrigin);
158158

159159
virtual nsresult ProcessStyleLink(nsIContent* aElement,
160-
const nsSubstring& aHref,
160+
const nsAString& aHref,
161161
bool aAlternate,
162-
const nsSubstring& aTitle,
163-
const nsSubstring& aType,
164-
const nsSubstring& aMedia);
162+
const nsAString& aTitle,
163+
const nsAString& aType,
164+
const nsAString& aMedia);
165165

166166
void PrefetchHref(const nsAString &aHref, nsINode *aSource,
167167
bool aExplicit);

dom/ipc/ContentChild.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker)
15191519
nsAdoptingCString extraSyscalls =
15201520
Preferences::GetCString("security.sandbox.content.syscall_whitelist");
15211521
if (extraSyscalls) {
1522-
for (const nsCSubstring& callNrString : extraSyscalls.Split(',')) {
1522+
for (const nsACString& callNrString : extraSyscalls.Split(',')) {
15231523
nsresult rv;
15241524
int callNr = PromiseFlatCString(callNrString).ToInteger(&rv);
15251525
if (NS_SUCCEEDED(rv)) {

dom/media/VideoUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ ParseCodecsString(const nsAString& aCodecs, nsTArray<nsString>& aOutCodecs)
417417
bool expectMoreTokens = false;
418418
nsCharSeparatedTokenizer tokenizer(aCodecs, ',');
419419
while (tokenizer.hasMoreTokens()) {
420-
const nsSubstring& token = tokenizer.nextToken();
420+
const nsAString& token = tokenizer.nextToken();
421421
expectMoreTokens = tokenizer.separatorAfterCurrentToken();
422422
aOutCodecs.AppendElement(token);
423423
}

dom/plugins/base/nsPluginTags.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static bool ExtensionInList(const nsCString& aExtensionList,
4343
{
4444
nsCCharSeparatedTokenizer extensions(aExtensionList, ',');
4545
while (extensions.hasMoreTokens()) {
46-
const nsCSubstring& extension = extensions.nextToken();
46+
const nsACString& extension = extensions.nextToken();
4747
if (extension.Equals(aExtension, nsCaseInsensitiveCStringComparator())) {
4848
return true;
4949
}

dom/security/FramingChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ FramingChecker::CheckFrameOptions(nsIChannel* aChannel,
239239
// be many. If any want to deny the load, deny the load.
240240
nsCharSeparatedTokenizer tokenizer(xfoHeaderValue, ',');
241241
while (tokenizer.hasMoreTokens()) {
242-
const nsSubstring& tok = tokenizer.nextToken();
242+
const nsAString& tok = tokenizer.nextToken();
243243
if (!CheckOneFrameOptionsPolicy(httpChannel, tok, aDocShell)) {
244244
// cancel the load and display about:blank
245245
httpChannel->Cancel(NS_BINDING_ABORTED);

0 commit comments

Comments
 (0)