зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1402666 - Part 1: Replace Replace("") with ReplaceLiteral(""). r=erahm
MozReview-Commit-ID: s2hrTSkBiJ --HG-- extra : rebase_source : d3b3551ed7ed1d5c8f70fc98d72510a13868ada1 extra : source : 1c45e10702e7884cd536a25b1d39c3de90fd2914
This commit is contained in:
Родитель
ec6e052af1
Коммит
14c40f3dac
|
@ -258,32 +258,32 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
|
|||
// Do nothing.
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ttp")) {
|
||||
// ttp -> http.
|
||||
uriString.Replace(0, 3, "http");
|
||||
uriString.ReplaceLiteral(0, 3, "http");
|
||||
scheme.AssignLiteral("http");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ttps")) {
|
||||
// ttps -> https.
|
||||
uriString.Replace(0, 4, "https");
|
||||
uriString.ReplaceLiteral(0, 4, "https");
|
||||
scheme.AssignLiteral("https");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("tps")) {
|
||||
// tps -> https.
|
||||
uriString.Replace(0, 3, "https");
|
||||
uriString.ReplaceLiteral(0, 3, "https");
|
||||
scheme.AssignLiteral("https");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ps")) {
|
||||
// ps -> https.
|
||||
uriString.Replace(0, 2, "https");
|
||||
uriString.ReplaceLiteral(0, 2, "https");
|
||||
scheme.AssignLiteral("https");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ile")) {
|
||||
// ile -> file.
|
||||
uriString.Replace(0, 3, "file");
|
||||
uriString.ReplaceLiteral(0, 3, "file");
|
||||
scheme.AssignLiteral("file");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("le")) {
|
||||
// le -> file.
|
||||
uriString.Replace(0, 2, "file");
|
||||
uriString.ReplaceLiteral(0, 2, "file");
|
||||
scheme.AssignLiteral("file");
|
||||
info->mFixupChangedProtocol = true;
|
||||
}
|
||||
|
|
|
@ -10983,7 +10983,7 @@ IsConsideredSameOriginForUIR(nsIPrincipal* aTriggeringPrincipal,
|
|||
rv = resultURI->GetSpec(tmpResultSpec);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
// replace http with https
|
||||
tmpResultSpec.Replace(0, 4, "https");
|
||||
tmpResultSpec.ReplaceLiteral(0, 4, "https");
|
||||
|
||||
nsCOMPtr<nsIURI> tmpResultURI;
|
||||
rv = NS_NewURI(getter_AddRefs(tmpResultURI), tmpResultSpec);
|
||||
|
|
|
@ -297,7 +297,7 @@ CollectWindowReports(nsGlobalWindow *aWindow,
|
|||
|
||||
// Use |windowPath|, but replace "explicit/" with "event-counts/".
|
||||
nsCString censusWindowPath(windowPath);
|
||||
censusWindowPath.Replace(0, strlen("explicit"), "event-counts");
|
||||
censusWindowPath.ReplaceLiteral(0, strlen("explicit"), "event-counts");
|
||||
|
||||
// Remember the path for later.
|
||||
aWindowPaths->Put(aWindow->WindowID(), windowPath);
|
||||
|
|
|
@ -113,7 +113,7 @@ nsHyphenationManager::GetHyphenator(nsIAtom *aLocale)
|
|||
}
|
||||
int32_t i = localeStr.RFindChar('-');
|
||||
if (i > 1) {
|
||||
localeStr.Replace(i, localeStr.Length() - i, "-*");
|
||||
localeStr.ReplaceLiteral(i, localeStr.Length() - i, "-*");
|
||||
nsCOMPtr<nsIAtom> fuzzyLocale = NS_Atomize(localeStr);
|
||||
return GetHyphenator(fuzzyLocale);
|
||||
} else {
|
||||
|
|
|
@ -11,7 +11,7 @@ static nsAutoCString nt(nsAutoCString aDatetime)
|
|||
// Replace "January 01" with "January 1" (found on Windows).
|
||||
int32_t ind = datetime.Find("January 01");
|
||||
if (ind != kNotFound)
|
||||
datetime.Replace(ind, 10, "January 1");
|
||||
datetime.ReplaceLiteral(ind, 10, "January 1");
|
||||
|
||||
// Strip trailing " GMT" (found on Mac/Linux).
|
||||
ind = datetime.Find(" GMT");
|
||||
|
@ -21,10 +21,11 @@ static nsAutoCString nt(nsAutoCString aDatetime)
|
|||
// Strip leading "Thursday, " or "Wednesday, " (found on Windows).
|
||||
ind = datetime.Find("Thursday, ");
|
||||
if (ind == 0)
|
||||
datetime.Replace(0, 10, "");
|
||||
datetime.ReplaceLiteral(0, 10, "");
|
||||
|
||||
ind = datetime.Find("Wednesday, ");
|
||||
if (ind == 0)
|
||||
datetime.Replace(0, 11, "");
|
||||
datetime.ReplaceLiteral(0, 11, "");
|
||||
|
||||
return datetime;
|
||||
}
|
||||
|
|
|
@ -1384,7 +1384,7 @@ nsStandardURL::GetSensitiveInfoHiddenSpec(nsACString &result)
|
|||
return rv;
|
||||
}
|
||||
if (mPassword.mLen >= 0) {
|
||||
result.Replace(mPassword.mPos, mPassword.mLen, "****");
|
||||
result.ReplaceLiteral(mPassword.mPos, mPassword.mLen, "****");
|
||||
}
|
||||
CALL_RUST_GETTER_STR(result, GetSensitiveInfoHiddenSpec, result);
|
||||
return NS_OK;
|
||||
|
|
|
@ -60,7 +60,7 @@ SetTime(PRTime offsetTime,nsAutoCString& serverString,nsAutoCString& cookieStrin
|
|||
// Set cookie string
|
||||
PR_ExplodeTime(SetExpiryTime , PR_GMTParameters, &explodedTime);
|
||||
PR_FormatTimeUSEnglish(timeStringPreset, 40, "%c GMT", &explodedTime);
|
||||
cookieString.Replace(0, strlen("test=expiry; expires=") + strlen(timeStringPreset) + 1, "test=expiry; expires=");
|
||||
cookieString.ReplaceLiteral(0, strlen("test=expiry; expires=") + strlen(timeStringPreset) + 1, "test=expiry; expires=");
|
||||
cookieString.Append(timeStringPreset);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче