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

Unified Diff: url/url_util.cc

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary url:: prefix. Created 6 years, 7 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_util.h ('k') | url/url_util_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_util.cc
diff --git a/url/url_util.cc b/url/url_util.cc
index ff1fdf905200478611efc0c650a0eefc98ced499..f693a87a9c5ff1965bd1b01a4672fb749c642c48 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -14,10 +14,6 @@
namespace url {
-const char kFileScheme[] = "file";
-const char kFileSystemScheme[] = "filesystem";
-const char kMailtoScheme[] = "mailto";
-
namespace {
// ASCII-specific tolower. The standard library's tolower is locale sensitive,
@@ -41,12 +37,12 @@ const int kNumStandardURLSchemes = 8;
const char* kStandardURLSchemes[kNumStandardURLSchemes] = {
"http",
"https",
- kFileScheme, // Yes, file urls can have a hostname!
+ url::kFileScheme, // Yes, file urls can have a hostname!
blundell 2014/05/28 11:21:49 nit: it looks like this code is already in the url
Sungmann Cho 2014/05/28 11:54:59 Done.
"ftp",
"gopher",
"ws", // WebSocket.
"wss", // WebSocket secure.
- kFileSystemScheme,
+ url::kFileSystemScheme,
};
// List of the currently installed standard schemes. This list is lazily
@@ -161,12 +157,12 @@ bool DoCanonicalize(const CHAR* in_spec,
// This is the parsed version of the input URL, we have to canonicalize it
// before storing it in our object.
bool success;
- if (DoCompareSchemeComponent(spec, scheme, kFileScheme)) {
+ if (DoCompareSchemeComponent(spec, scheme, url::kFileScheme)) {
// File URLs are special.
ParseFileURL(spec, spec_len, &parsed_input);
success = CanonicalizeFileURL(spec, spec_len, parsed_input,
charset_converter, output, output_parsed);
- } else if (DoCompareSchemeComponent(spec, scheme, kFileSystemScheme)) {
+ } else if (DoCompareSchemeComponent(spec, scheme, url::kFileSystemScheme)) {
// Filesystem URLs are special.
ParseFileSystemURL(spec, spec_len, &parsed_input);
success = CanonicalizeFileSystemURL(spec, spec_len, parsed_input,
@@ -179,7 +175,7 @@ bool DoCanonicalize(const CHAR* in_spec,
success = CanonicalizeStandardURL(spec, spec_len, parsed_input,
charset_converter, output, output_parsed);
- } else if (DoCompareSchemeComponent(spec, scheme, kMailtoScheme)) {
+ } else if (DoCompareSchemeComponent(spec, scheme, url::kMailToScheme)) {
// Mailto are treated like a standard url with only a scheme, path, query
ParseMailtoURL(spec, spec_len, &parsed_input);
success = CanonicalizeMailtoURL(spec, spec_len, parsed_input, output,
@@ -335,11 +331,11 @@ bool DoReplaceComponents(const char* spec,
// If we get here, then we know the scheme doesn't need to be replaced, so can
// just key off the scheme in the spec to know how to do the replacements.
- if (DoCompareSchemeComponent(spec, parsed.scheme, kFileScheme)) {
+ if (DoCompareSchemeComponent(spec, parsed.scheme, url::kFileScheme)) {
return ReplaceFileURL(spec, parsed, replacements, charset_converter, output,
out_parsed);
}
- if (DoCompareSchemeComponent(spec, parsed.scheme, kFileSystemScheme)) {
+ if (DoCompareSchemeComponent(spec, parsed.scheme, url::kFileSystemScheme)) {
return ReplaceFileSystemURL(spec, parsed, replacements, charset_converter,
output, out_parsed);
}
@@ -347,7 +343,7 @@ bool DoReplaceComponents(const char* spec,
return ReplaceStandardURL(spec, parsed, replacements, charset_converter,
output, out_parsed);
}
- if (DoCompareSchemeComponent(spec, parsed.scheme, kMailtoScheme)) {
+ if (DoCompareSchemeComponent(spec, parsed.scheme, url::kMailToScheme)) {
return ReplaceMailtoURL(spec, parsed, replacements, output, out_parsed);
}
« no previous file with comments | « url/url_util.h ('k') | url/url_util_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698