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

Unified Diff: url/url_canon_stdurl.cc

Issue 335353002: Replace some hard coded schemes with the constants in /url/url_constants.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typos. Created 6 years, 6 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 | « url/url_canon_relative.cc ('k') | url/url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_stdurl.cc
diff --git a/url/url_canon_stdurl.cc b/url/url_canon_stdurl.cc
index 1f5000e72c6dbad1a03ea29152ce4c8a19083d76..7a61de8902d7e555fead2fe771bbe2c9fb5fcd87 100644
--- a/url/url_canon_stdurl.cc
+++ b/url/url_canon_stdurl.cc
@@ -7,6 +7,7 @@
#include "url/url_canon.h"
#include "url/url_canon_internal.h"
+#include "url/url_constants.h"
namespace url {
@@ -98,25 +99,25 @@ int DefaultPortForScheme(const char* scheme, int scheme_len) {
int default_port = PORT_UNSPECIFIED;
switch (scheme_len) {
case 4:
- if (!strncmp(scheme, "http", scheme_len))
+ if (!strncmp(scheme, kHttpScheme, scheme_len))
default_port = 80;
break;
case 5:
- if (!strncmp(scheme, "https", scheme_len))
+ if (!strncmp(scheme, kHttpsScheme, scheme_len))
default_port = 443;
break;
case 3:
- if (!strncmp(scheme, "ftp", scheme_len))
+ if (!strncmp(scheme, kFtpScheme, scheme_len))
default_port = 21;
- else if (!strncmp(scheme, "wss", scheme_len))
+ else if (!strncmp(scheme, kWssScheme, scheme_len))
default_port = 443;
break;
case 6:
- if (!strncmp(scheme, "gopher", scheme_len))
+ if (!strncmp(scheme, kGopherScheme, scheme_len))
default_port = 70;
break;
case 2:
- if (!strncmp(scheme, "ws", scheme_len))
+ if (!strncmp(scheme, kWsScheme, scheme_len))
default_port = 80;
break;
}
« no previous file with comments | « url/url_canon_relative.cc ('k') | url/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698