☠☠ backed out by 418858fa8233 ☠ ☠ | |
author | Tom Schuster <evilpies@gmail.com> |
Fri, 02 Aug 2019 08:54:18 +0000 | |
changeset 485906 | e44c9fd81e5b0455f608127e09e98a51a5a49253 |
parent 485905 | 3da6e9e86be4a4a9eeaceec222398475b6679193 |
child 485907 | 418858fa823396ccc16c9cefb1b482228d7da747 |
push id | 113824 |
push user | csabou@mozilla.com |
push date | Fri, 02 Aug 2019 16:06:39 +0000 |
treeherder | mozilla-inbound@c0b4e4289875 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Ehsan |
bugs | 1558915 |
milestone | 70.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/toolkit/components/antitracking/AntiTrackingCommon.cpp +++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp @@ -215,20 +215,17 @@ int32_t CookiesBehavior(nsILoadInfo* aLo // Bug 1537753. if (StaticPrefs::extensions_cookiesBehavior_overrideOnTopLevel() && BasePrincipal::Cast(aTopLevelPrincipal)->AddonPolicy()) { return nsICookieService::BEHAVIOR_ACCEPT; } // WebExtensions 3rd party URI always get BEHAVIOR_ACCEPT as cookieBehavior, // this is semantically equivalent to the principal having a AddonPolicy(). - bool is3rdPartyMozExt = false; - if (NS_SUCCEEDED( - a3rdPartyURI->SchemeIs("moz-extension", &is3rdPartyMozExt)) && - is3rdPartyMozExt) { + if (a3rdPartyURI->SchemeIs("moz-extension")) { return nsICookieService::BEHAVIOR_ACCEPT; } nsCOMPtr<nsICookieSettings> cookieSettings; nsresult rv = aLoadInfo->GetCookieSettings(getter_AddRefs(cookieSettings)); if (NS_WARN_IF(NS_FAILED(rv))) { return nsICookieService::BEHAVIOR_REJECT; }
--- a/toolkit/components/antitracking/StorageAccess.cpp +++ b/toolkit/components/antitracking/StorageAccess.cpp @@ -133,22 +133,18 @@ static StorageAccess InternalStorageAllo // This means that behavior for storage with internal about: URIs should not // be affected, which is desireable due to the lack of automated testing for // about: URIs with these preferences set, and the importance of the correct // functioning of these URIs even with custom preferences. nsCOMPtr<nsIURI> uri = aURI; if (!uri) { Unused << aPrincipal->GetURI(getter_AddRefs(uri)); } - if (uri) { - bool isAbout = false; - MOZ_ALWAYS_SUCCEEDS(uri->SchemeIs("about", &isAbout)); - if (isAbout) { - return access; - } + if (uri && uri->SchemeIs("about")) { + return access; } if (!StorageDisabledByAntiTracking(aWindow, aChannel, aPrincipal, aURI, aRejectedReason)) { return access; } // We want to have a partitioned storage only for trackers.
--- a/toolkit/components/places/nsNavBookmarks.cpp +++ b/toolkit/components/places/nsNavBookmarks.cpp @@ -1914,20 +1914,17 @@ nsNavBookmarks::OnPageChanged(nsIURI* aU NS_ENSURE_SUCCESS(rv, rv); changeData.property = NS_LITERAL_CSTRING("favicon"); changeData.isAnnotation = false; changeData.newValue = NS_ConvertUTF16toUTF8(aNewValue); changeData.bookmark.lastModified = 0; changeData.bookmark.type = TYPE_BOOKMARK; // Favicons may be set to either pure URIs or to folder URIs - bool isPlaceURI; - rv = aURI->SchemeIs("place", &isPlaceURI); - NS_ENSURE_SUCCESS(rv, rv); - if (isPlaceURI) { + if (aURI->SchemeIs("place")) { nsNavHistory* history = nsNavHistory::GetHistoryService(); NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY); nsCOMPtr<nsINavHistoryQuery> query; nsCOMPtr<nsINavHistoryQueryOptions> options; rv = history->QueryStringToQuery(changeData.bookmark.url, getter_AddRefs(query), getter_AddRefs(options));
--- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -173,18 +173,17 @@ nsresult nsUrlClassifierStreamUpdater::F rv = AddRequestBody(aRequestPayload); NS_ENSURE_SUCCESS(rv, rv); } // Set the appropriate content type for file/data URIs, for unit testing // purposes. // This is only used for testing and should be deleted. bool match; - if ((NS_SUCCEEDED(aUpdateUrl->SchemeIs("file", &match)) && match) || - (NS_SUCCEEDED(aUpdateUrl->SchemeIs("data", &match)) && match)) { + if (aUpdateUrl->SchemeIs("file") || aUpdateUrl->SchemeIs("data")) { mChannel->SetContentType( NS_LITERAL_CSTRING("application/vnd.google.safebrowsing-update")); } else { // We assume everything else is an HTTP request. // Disable keepalive. nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel, &rv); NS_ENSURE_SUCCESS(rv, rv);
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp @@ -612,17 +612,17 @@ nsresult nsWindowWatcher::OpenWindowInte // We expect BrowserParent to have provided us the absolute URI of the window // we're to open, so there's no need to call URIfromURL (or more importantly, // to check for a chrome URI, which cannot be opened from a remote tab). if (aUrl) { rv = URIfromURL(aUrl, aParent, getter_AddRefs(uriToLoad)); if (NS_FAILED(rv)) { return rv; } - uriToLoad->SchemeIs("chrome", &uriToLoadIsChrome); + uriToLoadIsChrome = uriToLoad->SchemeIs("chrome"); } bool nameSpecified = false; if (aName) { CopyUTF8toUTF16(MakeStringSpan(aName), name); nameSpecified = true; } else { name.SetIsVoid(true);
--- a/toolkit/mozapps/extensions/AddonContentPolicy.cpp +++ b/toolkit/mozapps/extensions/AddonContentPolicy.cpp @@ -107,20 +107,18 @@ AddonContentPolicy::ShouldLoad(nsIURI* a if (!requestOrigin) { return NS_OK; } // Only apply this policy to requests from documents loaded from // moz-extension URLs, or to resources being loaded from moz-extension URLs. bool equals; - if (!((NS_SUCCEEDED(aContentLocation->SchemeIs("moz-extension", &equals)) && - equals) || - (NS_SUCCEEDED(requestOrigin->SchemeIs("moz-extension", &equals)) && - equals))) { + if (!(aContentLocation->SchemeIs("moz-extension") || + requestOrigin->SchemeIs("moz-extension"))) { return NS_OK; } if (contentType == nsIContentPolicy::TYPE_SCRIPT) { NS_ConvertUTF8toUTF16 typeString(aMimeTypeGuess); nsContentTypeParser mimeParser(typeString); // Reject attempts to load JavaScript scripts with a non-default version.
--- a/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp +++ b/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp @@ -50,19 +50,17 @@ static bool IsValidHost(const nsACString // Checks if the given uri is secure and matches one of the hosts allowed to // access the API. bool AddonManagerWebAPI::IsValidSite(nsIURI* uri) { if (!uri) { return false; } - bool isSecure; - nsresult rv = uri->SchemeIs("https", &isSecure); - if (NS_FAILED(rv) || !isSecure) { + if (!uri->SchemeIs("https")) { if (!(xpc::IsInAutomation() && Preferences::GetBool("extensions.webapi.testing.http", false))) { return false; } } nsAutoCString host; rv = uri->GetHost(host);
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp @@ -170,20 +170,17 @@ static nsresult GetProxyFromEnvironment( // Use our URI parser to crack the proxy URI nsCOMPtr<nsIURI> proxyURI; nsresult rv = NS_NewURI(getter_AddRefs(proxyURI), proxyVal); NS_ENSURE_SUCCESS(rv, rv); // Is there a way to specify "socks://" or something in these environment // variables? I can't find any documentation. - bool isHTTP; - rv = proxyURI->SchemeIs("http", &isHTTP); - NS_ENSURE_SUCCESS(rv, rv); - if (!isHTTP) return NS_ERROR_UNKNOWN_PROTOCOL; + if (!proxyURI->SchemeIs("http")) return NS_ERROR_UNKNOWN_PROTOCOL; nsAutoCString proxyHost; rv = proxyURI->GetHost(proxyHost); NS_ENSURE_SUCCESS(rv, rv); int32_t proxyPort; rv = proxyURI->GetPort(&proxyPort); NS_ENSURE_SUCCESS(rv, rv);
--- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -996,26 +996,21 @@ nsXULAppInfo::GetServerURL(nsIURL** aSer url = do_QueryInterface(uri); NS_ADDREF(*aServerURL = url); return NS_OK; } NS_IMETHODIMP nsXULAppInfo::SetServerURL(nsIURL* aServerURL) { - bool schemeOk; - // only allow https or http URLs - nsresult rv = aServerURL->SchemeIs("https", &schemeOk); - NS_ENSURE_SUCCESS(rv, rv); - if (!schemeOk) { - rv = aServerURL->SchemeIs("http", &schemeOk); - NS_ENSURE_SUCCESS(rv, rv); - - if (!schemeOk) return NS_ERROR_INVALID_ARG; - } + // Only allow https or http URLs + if (!aServerURL->SchemeIs("http") && !aServerURL->SchemeIs("https")) { + return NS_ERROR_INVALID_ARG; + } + nsAutoCString spec; rv = aServerURL->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); return CrashReporter::SetServerURL(spec); } NS_IMETHODIMP