author | Chris Peterson <cpeterson@mozilla.com> |
Wed, 06 Sep 2017 01:13:45 -0700 | |
changeset 382615 | 245dfda695c252ecb702d85f5c49e2bf4be9e985 |
parent 382614 | 3e20920201248575c1490dcd4ad33277c29b62a5 |
child 382616 | 231c993f7ea392f4f2d951e378d4967881dfa09a |
push id | 95361 |
push user | cpeterson@mozilla.com |
push date | Sun, 24 Sep 2017 07:13:39 +0000 |
treeherder | mozilla-inbound@39ac3246ab5c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | erahm |
bugs | 870698 |
milestone | 58.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
|
--- a/chrome/nsChromeRegistryChrome.cpp +++ b/chrome/nsChromeRegistryChrome.cpp @@ -214,17 +214,17 @@ nsChromeRegistryChrome::IsLocaleRTL(cons * LocaleService::GetAppLocaleAsLangTag. */ nsresult nsChromeRegistryChrome::GetSelectedLocale(const nsACString& aPackage, bool aAsBCP47, nsACString& aLocale) { nsAutoCString reqLocale; - if (aPackage.Equals("global")) { + if (aPackage.EqualsLiteral("global")) { LocaleService::GetInstance()->GetAppLocaleAsLangTag(reqLocale); } else { AutoTArray<nsCString, 10> requestedLocales; LocaleService::GetInstance()->GetRequestedLocales(requestedLocales); reqLocale.Assign(requestedLocales[0]); } nsCString realpackage;
--- a/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp +++ b/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp @@ -403,17 +403,17 @@ SpeechDispatcherService::Setup() // with another, non-standard suptag after it. We keep the first one // and convert it to uppercase. const char* v = list[i]->variant; const char* hyphen = strchr(v, '-'); nsDependentCSubstring variant(v, hyphen ? hyphen - v : strlen(v)); ToUpperCase(variant); // eSpeak uses UK which is not a valid region subtag in BCP47. - if (variant.Equals("UK")) { + if (variant.EqualsLiteral("UK")) { variant.AssignLiteral("GB"); } lang.AppendLiteral("-"); lang.Append(variant); } uri.Append(NS_ConvertUTF8toUTF16(lang));
--- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -757,17 +757,17 @@ NotificationTelemetryService::GetNotific uint32_t* aCapability) { nsCOMPtr<nsIPermission> permission = do_QueryInterface(aSupports); if (!permission) { return false; } nsAutoCString type; permission->GetType(type); - if (!type.Equals("desktop-notification")) { + if (!type.EqualsLiteral("desktop-notification")) { return false; } permission->GetCapability(aCapability); return true; } void NotificationTelemetryService::RecordDNDSupported()
--- a/dom/security/nsContentSecurityManager.cpp +++ b/dom/security/nsContentSecurityManager.cpp @@ -803,19 +803,19 @@ nsContentSecurityManager::IsOriginPotent } nsAutoCString host; rv = uri->GetHost(host); if (NS_FAILED(rv)) { return NS_OK; } - if (host.Equals("127.0.0.1") || - host.Equals("localhost") || - host.Equals("::1")) { + if (host.EqualsLiteral("127.0.0.1") || + host.EqualsLiteral("localhost") || + host.EqualsLiteral("::1")) { *aIsTrustWorthy = true; return NS_OK; } // If a host is not considered secure according to the default algorithm, then // check to see if it has been whitelisted by the user. We only apply this // whitelist for network resources, i.e., those with scheme "http" or "ws". // The pref should contain a comma-separated list of hostnames.
--- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -459,17 +459,17 @@ bool nsMixedContentBlocker::IsPotentiallyTrustworthyLoopbackURL(nsIURI* aURL) { nsAutoCString host; nsresult rv = aURL->GetHost(host); NS_ENSURE_SUCCESS(rv, false); // We could also allow 'localhost' (if we can guarantee that it resolves // to a loopback address), but Chrome doesn't support it as of writing. For // web compat, lets only allow what Chrome allows. - return host.Equals("127.0.0.1") || host.Equals("::1"); + return host.EqualsLiteral("127.0.0.1") || host.EqualsLiteral("::1"); } /* Static version of ShouldLoad() that contains all the Mixed Content Blocker * logic. Called from non-static ShouldLoad(). */ nsresult nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect, uint32_t aContentType,
--- a/dom/xhr/XMLHttpRequestMainThread.cpp +++ b/dom/xhr/XMLHttpRequestMainThread.cpp @@ -1966,17 +1966,17 @@ XMLHttpRequestMainThread::OnStartRequest if (!mOverrideMimeType.IsEmpty()) { channel->SetContentType(NS_ConvertUTF16toUTF8(mOverrideMimeType)); } // Fallback to 'application/octet-stream' nsAutoCString type; channel->GetContentType(type); - if (type.Equals(UNKNOWN_CONTENT_TYPE)) { + if (type.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) { channel->SetContentType(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM)); } DetectCharset(); // Set up arraybuffer if (mResponseType == XMLHttpRequestResponseType::Arraybuffer && NS_SUCCEEDED(status)) { @@ -2708,17 +2708,17 @@ XMLHttpRequestMainThread::InitiateFetch( // Since we expect XML data, set the type hint accordingly // if the channel doesn't know any content type. // This means that we always try to parse local files as XML // ignoring return value, as this is not critical. Use text/xml as fallback // MIME type. nsAutoCString contentType; if (NS_FAILED(mChannel->GetContentType(contentType)) || contentType.IsEmpty() || - contentType.Equals(UNKNOWN_CONTENT_TYPE)) { + contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) { mChannel->SetContentType(NS_LITERAL_CSTRING("text/xml")); } // Set up the preflight if needed if (!IsSystemXHR()) { nsTArray<nsCString> CORSUnsafeHeaders; mAuthorRequestHeaders.GetCORSUnsafeHeaders(CORSUnsafeHeaders); nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
--- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp +++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp @@ -276,17 +276,17 @@ txStylesheetSink::OnStartRequest(nsIRequ channel->GetContentType(contentType); // Time to sniff! Note: this should go away once file channels do // sniffing themselves. nsCOMPtr<nsIURI> uri; channel->GetURI(getter_AddRefs(uri)); bool sniff; if (NS_SUCCEEDED(uri->SchemeIs("file", &sniff)) && sniff && - contentType.Equals(UNKNOWN_CONTENT_TYPE)) { + contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) { nsresult rv; nsCOMPtr<nsIStreamConverterService> serv = do_GetService("@mozilla.org/streamConverters;1", &rv); if (NS_SUCCEEDED(rv)) { nsCOMPtr<nsIStreamListener> converter; rv = serv->AsyncConvertData(UNKNOWN_CONTENT_TYPE, "*/*", mListener,
--- a/intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp +++ b/intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp @@ -22,11 +22,11 @@ TEST(Intl_Locale_LocaleService, Negotiat availableLocales.AppendElement(NS_LITERAL_CSTRING("sr-Cyrl")); availableLocales.AppendElement(NS_LITERAL_CSTRING("sr-Latn")); LocaleService::GetInstance()->NegotiateLanguages( requestedLocales, availableLocales, defaultLocale, strategy, supportedLocales); ASSERT_TRUE(supportedLocales.Length() == 2); - ASSERT_TRUE(supportedLocales[0].Equals("sr-Cyrl")); - ASSERT_TRUE(supportedLocales[1].Equals("en-US")); + ASSERT_TRUE(supportedLocales[0].EqualsLiteral("sr-Cyrl")); + ASSERT_TRUE(supportedLocales[1].EqualsLiteral("en-US")); }
--- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -1426,20 +1426,21 @@ XRE_XPCShellMain(int argc, char** argv, return result; } void XPCShellDirProvider::SetGREDirs(nsIFile* greDir) { mGREDir = greDir; mGREDir->Clone(getter_AddRefs(mGREBinDir)); + #ifdef XP_MACOSX nsAutoCString leafName; mGREDir->GetNativeLeafName(leafName); - if (leafName.Equals("Resources")) { + if (leafName.EqualsLiteral("Resources")) { mGREBinDir->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS")); } #endif } void XPCShellDirProvider::SetAppFile(nsIFile* appFile) {
--- a/netwerk/protocol/http/AlternateServices.cpp +++ b/netwerk/protocol/http/AlternateServices.cpp @@ -223,17 +223,17 @@ AltSvcMapping::MakeHashKey(nsCString &ou const nsACString &originHost, int32_t originPort, bool privateBrowsing, const OriginAttributes &originAttributes) { outKey.Truncate(); if (originPort == -1) { - bool isHttps = originScheme.Equals("https"); + bool isHttps = originScheme.EqualsLiteral("https"); originPort = isHttps ? NS_HTTPS_DEFAULT_PORT : NS_HTTP_DEFAULT_PORT; } outKey.Append(originScheme); outKey.Append(':'); outKey.Append(originHost); outKey.Append(':'); outKey.AppendInt(originPort);
--- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -1229,21 +1229,21 @@ HttpBaseChannel::DoApplyContentConversio if (NS_FAILED(rv)) { LOG(("Unexpected failure of AsyncConvertData %s\n", val)); return rv; } LOG(("converter removed '%s' content-encoding\n", val)); if (gHttpHandler->IsTelemetryEnabled()) { int mode = 0; - if (from.Equals("gzip") || from.Equals("x-gzip")) { + if (from.EqualsLiteral("gzip") || from.EqualsLiteral("x-gzip")) { mode = 1; - } else if (from.Equals("deflate") || from.Equals("x-deflate")) { + } else if (from.EqualsLiteral("deflate") || from.EqualsLiteral("x-deflate")) { mode = 2; - } else if (from.Equals("br")) { + } else if (from.EqualsLiteral("br")) { mode = 3; } Telemetry::Accumulate(Telemetry::HTTP_CONTENT_ENCODING, mode); } nextListener = converter; } else { if (val)
--- a/netwerk/protocol/res/nsResProtocolHandler.cpp +++ b/netwerk/protocol/res/nsResProtocolHandler.cpp @@ -94,38 +94,38 @@ nsResProtocolHandler::GetSubstitutionInt } bool nsResProtocolHandler::ResolveSpecialCases(const nsACString& aHost, const nsACString& aPath, const nsACString& aPathname, nsACString& aResult) { - if (aHost.Equals("") || aHost.Equals(kAPP)) { + if (aHost.EqualsLiteral("") || aHost.EqualsLiteral(kAPP)) { aResult.Assign(mAppURI); } else if (aHost.Equals(kGRE)) { aResult.Assign(mGREURI); } else { return false; } aResult.Append(aPath); return true; } nsresult nsResProtocolHandler::SetSubstitution(const nsACString& aRoot, nsIURI* aBaseURI) { - MOZ_ASSERT(!aRoot.Equals("")); - MOZ_ASSERT(!aRoot.Equals(kAPP)); - MOZ_ASSERT(!aRoot.Equals(kGRE)); + MOZ_ASSERT(!aRoot.EqualsLiteral("")); + MOZ_ASSERT(!aRoot.EqualsLiteral(kAPP)); + MOZ_ASSERT(!aRoot.EqualsLiteral(kGRE)); return SubstitutingProtocolHandler::SetSubstitution(aRoot, aBaseURI); } nsresult nsResProtocolHandler::SetSubstitutionWithFlags(const nsACString& aRoot, nsIURI* aBaseURI, uint32_t aFlags) { - MOZ_ASSERT(!aRoot.Equals("")); - MOZ_ASSERT(!aRoot.Equals(kAPP)); - MOZ_ASSERT(!aRoot.Equals(kGRE)); + MOZ_ASSERT(!aRoot.EqualsLiteral("")); + MOZ_ASSERT(!aRoot.EqualsLiteral(kAPP)); + MOZ_ASSERT(!aRoot.EqualsLiteral(kGRE)); return SubstitutingProtocolHandler::SetSubstitutionWithFlags(aRoot, aBaseURI, aFlags); }
--- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp @@ -415,17 +415,17 @@ nsViewSourceChannel::GetContentType(nsAC nsAutoCString contentType; rv = mChannel->GetContentType(contentType); if (NS_FAILED(rv)) return rv; // If we don't know our type, just say so. The unknown // content decoder will then kick in automatically, and it // will call our SetOriginalContentType method instead of our // SetContentType method to set the type it determines. - if (!contentType.Equals(UNKNOWN_CONTENT_TYPE)) { + if (!contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) { contentType = VIEWSOURCE_CONTENT_TYPE; } mContentType = contentType; } aContentType = mContentType; return NS_OK;
--- a/netwerk/streamconv/converters/nsBinHexDecoder.cpp +++ b/netwerk/streamconv/converters/nsBinHexDecoder.cpp @@ -488,26 +488,26 @@ nsresult nsBinHexDecoder::DetectContentT const char * fileExt = strrchr(aFilename.get(), '.'); if (!fileExt) { return NS_OK; } mimeService->GetTypeFromExtension(nsDependentCString(fileExt), contentType); // Only set the type if it's not empty and, to prevent recursive loops, not the binhex type - if (!contentType.IsEmpty() && !contentType.Equals(APPLICATION_BINHEX)) { + if (!contentType.IsEmpty() && + !contentType.EqualsLiteral(APPLICATION_BINHEX)) { channel->SetContentType(contentType); } else { channel->SetContentType(NS_LITERAL_CSTRING(UNKNOWN_CONTENT_TYPE)); } return NS_OK; } - NS_IMETHODIMP nsBinHexDecoder::OnStopRequest(nsIRequest* request, nsISupports *aCtxt, nsresult aStatus) { nsresult rv = NS_OK; if (!mNextListener) return NS_ERROR_FAILURE; // don't do anything here...we'll fire our own on stop request when we are done
--- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp +++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp @@ -929,17 +929,17 @@ nsBinaryDetector::DetermineContentType(n Unused << httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"), contentEncoding); if (!contentEncoding.IsEmpty()) { return; } LastDitchSniff(aRequest); MutexAutoLock lock(mMutex); - if (mContentType.Equals(APPLICATION_OCTET_STREAM)) { + if (mContentType.EqualsLiteral(APPLICATION_OCTET_STREAM)) { // We want to guess at it instead mContentType = APPLICATION_GUESS_FROM_EXT; } else { // Let the text/plain type we already have be, so that other content // sniffers can also get a shot at this data. mContentType.Truncate(); } }
--- a/netwerk/test/gtest/TestStandardURL.cpp +++ b/netwerk/test/gtest/TestStandardURL.cpp @@ -157,17 +157,17 @@ TEST(TestStandardURL, From_test_standard "000177.0.00000.0x0001", "127.0.0.1.", "0X7F.0X00.0X00.0X01", "0X7F.0X01", "0X7F000001", "0X007F.0X0000.0X0000.0X0001", "000177.0.00000.0X0001"}; for (uint32_t i = 0; i < sizeof(localIPv4s)/sizeof(localIPv4s[0]); i ++) { nsCString encHost(localIPv4s[i]); ASSERT_EQ(NS_OK, Test_NormalizeIPv4(encHost, result)); - ASSERT_TRUE(result.Equals("127.0.0.1")); + ASSERT_TRUE(result.EqualsLiteral("127.0.0.1")); } const char* nonIPv4s[] = {"0xfffffffff", "0x100000000", "4294967296", "1.2.0x10000", "1.0x1000000", "256.0.0.1", "1.256.1", "-1.0.0.0", "1.2.3.4.5", "010000000000000000", "2+3", "0.0.0.-1", "1.2.3.4..", "1..2", ".1.2.3.4"}; for (uint32_t i = 0; i < sizeof(nonIPv4s)/sizeof(nonIPv4s[0]); i ++) { nsCString encHost(nonIPv4s[i]);
--- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -2331,17 +2331,17 @@ nsNSSComponent::Observe(nsISupports* aSu } else if (prefName.EqualsLiteral("security.ssl.enable_alpn")) { SSL_OptionSetDefault(SSL_ENABLE_ALPN, Preferences::GetBool("security.ssl.enable_alpn", ALPN_ENABLED_DEFAULT)); } else if (prefName.EqualsLiteral("security.tls.enable_0rtt_data")) { SSL_OptionSetDefault(SSL_ENABLE_0RTT_DATA, Preferences::GetBool("security.tls.enable_0rtt_data", ENABLED_0RTT_DATA_DEFAULT)); - } else if (prefName.Equals("security.ssl.disable_session_identifiers")) { + } else if (prefName.EqualsLiteral("security.ssl.disable_session_identifiers")) { ConfigureTLSSessionIdentifiers(); } else if (prefName.EqualsLiteral("security.OCSP.enabled") || prefName.EqualsLiteral("security.OCSP.require") || prefName.EqualsLiteral("security.OCSP.GET.enabled") || prefName.EqualsLiteral("security.pki.cert_short_lifetime_in_days") || prefName.EqualsLiteral("security.ssl.enable_ocsp_stapling") || prefName.EqualsLiteral("security.ssl.enable_ocsp_must_staple") || prefName.EqualsLiteral("security.pki.certificate_transparency.mode") ||
--- a/toolkit/components/places/nsFaviconService.cpp +++ b/toolkit/components/places/nsFaviconService.cpp @@ -397,17 +397,17 @@ nsFaviconService::SetAndFetchFaviconForP } } // If the page url points to an image, the icon's url will be the same. // TODO (Bug 403651): store a resample of the image. For now avoid that // for database size and UX concerns. // Don't store favicons for error pages too. if (icon.spec.Equals(page.spec) || - icon.spec.Equals(FAVICON_ERRORPAGE_URL)) { + icon.spec.EqualsLiteral(FAVICON_ERRORPAGE_URL)) { return NS_OK; } RefPtr<AsyncFetchAndSetIconForPage> event = new AsyncFetchAndSetIconForPage(icon, page, loadPrivate, aCallback, aLoadingPrincipal, aRequestContextID);
--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp +++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp @@ -200,17 +200,17 @@ nsRFPService::GetSpoofedUserAgent(nsACSt nsAutoCString updateChannel; rv = runtime->GetDefaultUpdateChannel(updateChannel); NS_ENSURE_SUCCESS(rv, rv); // If we are running in Firefox ESR, determine whether the formula of ESR // version has changed. Once changed, we must update the formula in this // function. - if (updateChannel.Equals("esr")) { + if (updateChannel.EqualsLiteral("esr")) { MOZ_ASSERT(((firefoxVersion % 7) == 3), "Please udpate ESR version formula in nsRFPService.cpp"); } uint32_t spoofedVersion = firefoxVersion - ((firefoxVersion - 3) % 7); userAgent.Assign(nsPrintfCString( "Mozilla/5.0 (%s; rv:%d.0) Gecko/%s Firefox/%d.0", SPOOFED_OSCPU, spoofedVersion, LEGACY_BUILD_ID, spoofedVersion));
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -655,17 +655,17 @@ nsUrlClassifierDBServiceWorker::NotifyUp nsresult updateStatus = mUpdateStatus; if (NS_FAILED(mUpdateStatus)) { updateStatus = NS_ERROR_GET_MODULE(mUpdateStatus) == NS_ERROR_MODULE_URL_CLASSIFIER ? mUpdateStatus : NS_ERROR_UC_UPDATE_UNKNOWN; } // Do not record telemetry for testing tables. - if (!provider.Equals(TESTING_TABLE_PROVIDER_NAME)) { + if (!provider.EqualsLiteral(TESTING_TABLE_PROVIDER_NAME)) { Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR, provider, NS_ERROR_GET_CODE(updateStatus)); } if (!mUpdateObserver) { // In the normal shutdown process, CancelUpdate() would NOT be // called prior to NotifyUpdateObserver(). However, CancelUpdate() // is a public API which can be called in the test case at any point.
--- a/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp +++ b/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp @@ -37,19 +37,19 @@ IsValidHost(const nsACString& host) { bool isLocked; prefs->PrefIsLocked("xpinstall.enabled", &isLocked); if (isLocked) { return false; } } } - if (host.Equals("addons.mozilla.org") || - host.Equals("discovery.addons.mozilla.org") || - host.Equals("testpilot.firefox.com")) { + if (host.EqualsLiteral("addons.mozilla.org") || + host.EqualsLiteral("discovery.addons.mozilla.org") || + host.EqualsLiteral("testpilot.firefox.com")) { return true; } // When testing allow access to the developer sites. if (Preferences::GetBool("extensions.webapi.testing", false)) { if (host.LowerCaseEqualsLiteral("addons.allizom.org") || host.LowerCaseEqualsLiteral("discovery.addons.allizom.org") || host.LowerCaseEqualsLiteral("addons-dev.allizom.org") ||
--- a/tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h +++ b/tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h @@ -169,17 +169,17 @@ class ScopedXPCOM : public nsIDirectoryS if (!greD) { return greD.forget(); } greD->Clone(getter_AddRefs(mGREBinD)); #ifdef XP_MACOSX nsAutoCString leafName; mGREBinD->GetNativeLeafName(leafName); - if (leafName.Equals("Resources")) { + if (leafName.EqualsLiteral("Resources")) { mGREBinD->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS")); } #endif nsCOMPtr<nsIFile> copy = mGREBinD; return copy.forget(); }
--- a/xpcom/tests/TestHarness.h +++ b/xpcom/tests/TestHarness.h @@ -188,17 +188,17 @@ class ScopedXPCOM : public nsIDirectoryS if (!greD) { return greD.forget(); } greD->Clone(getter_AddRefs(mGREBinD)); #ifdef XP_MACOSX nsAutoCString leafName; mGREBinD->GetNativeLeafName(leafName); - if (leafName.Equals("Resources")) { + if (leafName.EqualsLiteral("Resources")) { mGREBinD->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS")); } #endif nsCOMPtr<nsIFile> copy = mGREBinD; return copy.forget(); }