Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: ios/chrome/browser/chrome_url_util.mm

Issue 1868763002: Remove URLRequest::IsHandledProtocol and IsHandledURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase (needs fixing) Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc ('k') | net/url_request/url_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/chrome_url_util.mm
diff --git a/ios/chrome/browser/chrome_url_util.mm b/ios/chrome/browser/chrome_url_util.mm
index 40dff897e48377b68299b85709a2514339cdf6d5..439e65852ac2d132b3a16f48798fbaa264a34257 100644
--- a/ios/chrome/browser/chrome_url_util.mm
+++ b/ios/chrome/browser/chrome_url_util.mm
@@ -45,13 +45,15 @@ bool UrlHasChromeScheme(NSURL* url) {
bool IsHandledProtocol(const std::string& scheme) {
DCHECK_EQ(scheme, base::ToLowerASCII(scheme));
- if (scheme == url::kAboutScheme)
- return true;
- if (scheme == url::kDataScheme)
- return true;
- if (scheme == kChromeUIScheme)
- return true;
- return net::URLRequest::IsHandledProtocol(scheme);
+ static const char* const kProtocolList[] = {
+ kChromeUIScheme, url::kDataScheme, url::kAboutScheme, url::kHttpScheme,
+ url::kHttpsScheme, url::kWsScheme, url::kWssScheme,
+ };
+ for (size_t i = 0; i < arraysize(kProtocolList); ++i) {
+ if (scheme == kProtocolList[i])
+ return true;
+ }
+ return false;
}
@implementation ChromeAppConstants {
« no previous file with comments | « ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc ('k') | net/url_request/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698