Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj

Differential Revision: https://phabricator.services.mozilla.com/D80860
This commit is contained in:
Simon Giesecke
2020-07-01 08:29:29 +00:00
parent f8f0145474
commit a69d79b6db
1219 changed files with 10215 additions and 12215 deletions

View File

@@ -145,7 +145,7 @@ ScriptPreloader& ScriptPreloader::GetChildSingleton() {
if (!singleton) {
singleton = new ScriptPreloader();
if (XRE_IsParentProcess()) {
Unused << singleton->InitCache(NS_LITERAL_STRING("scriptCache-child"));
Unused << singleton->InitCache(u"scriptCache-child"_ns);
}
ClearOnShutdown(&singleton);
}
@@ -384,7 +384,7 @@ Result<nsCOMPtr<nsIFile>, nsresult> ScriptPreloader::GetCacheFile(
nsCOMPtr<nsIFile> cacheFile;
MOZ_TRY(mProfD->Clone(getter_AddRefs(cacheFile)));
MOZ_TRY(cacheFile->AppendNative(NS_LITERAL_CSTRING("startupCache")));
MOZ_TRY(cacheFile->AppendNative("startupCache"_ns));
Unused << cacheFile->Create(nsIFile::DIRECTORY_TYPE, 0777);
MOZ_TRY(cacheFile->Append(mBaseName + suffix));
@@ -398,16 +398,14 @@ Result<Ok, nsresult> ScriptPreloader::OpenCache() {
MOZ_TRY(NS_GetSpecialDirectory("ProfLDS", getter_AddRefs(mProfD)));
nsCOMPtr<nsIFile> cacheFile;
MOZ_TRY_VAR(cacheFile, GetCacheFile(NS_LITERAL_STRING(".bin")));
MOZ_TRY_VAR(cacheFile, GetCacheFile(u".bin"_ns));
bool exists;
MOZ_TRY(cacheFile->Exists(&exists));
if (exists) {
MOZ_TRY(cacheFile->MoveTo(nullptr,
mBaseName + NS_LITERAL_STRING("-current.bin")));
MOZ_TRY(cacheFile->MoveTo(nullptr, mBaseName + u"-current.bin"_ns));
} else {
MOZ_TRY(
cacheFile->SetLeafName(mBaseName + NS_LITERAL_STRING("-current.bin")));
MOZ_TRY(cacheFile->SetLeafName(mBaseName + u"-current.bin"_ns));
MOZ_TRY(cacheFile->Exists(&exists));
if (!exists) {
return Err(NS_ERROR_FILE_NOT_FOUND);
@@ -660,7 +658,7 @@ Result<Ok, nsresult> ScriptPreloader::WriteCache() {
}
nsCOMPtr<nsIFile> cacheFile;
MOZ_TRY_VAR(cacheFile, GetCacheFile(NS_LITERAL_STRING("-new.bin")));
MOZ_TRY_VAR(cacheFile, GetCacheFile(u"-new.bin"_ns));
bool exists;
MOZ_TRY(cacheFile->Exists(&exists));
@@ -712,7 +710,7 @@ Result<Ok, nsresult> ScriptPreloader::WriteCache() {
}
}
MOZ_TRY(cacheFile->MoveTo(nullptr, mBaseName + NS_LITERAL_STRING(".bin")));
MOZ_TRY(cacheFile->MoveTo(nullptr, mBaseName + u".bin"_ns));
return Ok();
}