diff options
author | sungmann.cho@navercorp.com <sungmann.cho@navercorp.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-28 21:32:26 +0000 |
---|---|---|
committer | sungmann.cho@navercorp.com <sungmann.cho@navercorp.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-28 21:32:26 +0000 |
commit | cca6f39ac7e4b12707b42ad05efd822106e8f396 (patch) | |
tree | bb3d0dd8fe7ac653b1debc119237df2a968f790d /url | |
parent | 7db86399f99987aa1a041692f53b41353b7ebf7b (diff) | |
download | chromium_src-cca6f39ac7e4b12707b42ad05efd822106e8f396.zip chromium_src-cca6f39ac7e4b12707b42ad05efd822106e8f396.tar.gz chromium_src-cca6f39ac7e4b12707b42ad05efd822106e8f396.tar.bz2 |
Move some content url constants to /url.
This CL moves the content url constants below to /url:
content::kBlobScheme
content::kDataScheme
content::kFileScheme
content::kFileSystemScheme
content::kFtpScheme
content::kJavaScriptScheme
content::kMailToScheme
This is a follow up to https://codereview.chromium.org/254763005.
BUG=306258
TBR=finnur@chromium.org,mkosiba@chromium.org,derat@chromium.org
TEST=compile
Review URL: https://codereview.chromium.org/273193004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url')
-rw-r--r-- | url/url_canon_filesystemurl.cc | 2 | ||||
-rw-r--r-- | url/url_constants.cc | 7 | ||||
-rw-r--r-- | url/url_constants.h | 7 | ||||
-rw-r--r-- | url/url_util.cc | 16 | ||||
-rw-r--r-- | url/url_util.h | 1 | ||||
-rw-r--r-- | url/url_util_internal.h | 4 |
6 files changed, 22 insertions, 15 deletions
diff --git a/url/url_canon_filesystemurl.cc b/url/url_canon_filesystemurl.cc index f330e22..18e9055 100644 --- a/url/url_canon_filesystemurl.cc +++ b/url/url_canon_filesystemurl.cc @@ -43,7 +43,7 @@ bool DoCanonicalizeFileSystemURL(const CHAR* spec, return false; bool success = true; - if (CompareSchemeComponent(spec, inner_parsed->scheme, kFileScheme)) { + if (CompareSchemeComponent(spec, inner_parsed->scheme, url::kFileScheme)) { new_inner_parsed.scheme.begin = output->length(); output->Append("file://", 7); new_inner_parsed.scheme.len = 4; diff --git a/url/url_constants.cc b/url/url_constants.cc index 7df30da..2949d44 100644 --- a/url/url_constants.cc +++ b/url/url_constants.cc @@ -6,7 +6,14 @@ namespace url { +const char kBlobScheme[] = "blob"; +const char kDataScheme[] = "data"; +const char kFileScheme[] = "file"; +const char kFileSystemScheme[] = "filesystem"; +const char kFtpScheme[] = "ftp"; const char kHttpScheme[] = "http"; const char kHttpsScheme[] = "https"; +const char kJavaScriptScheme[] = "javascript"; +const char kMailToScheme[] = "mailto"; } // namespace url diff --git a/url/url_constants.h b/url/url_constants.h index 9d184d9..18b4bfc 100644 --- a/url/url_constants.h +++ b/url/url_constants.h @@ -9,8 +9,15 @@ namespace url { +URL_EXPORT extern const char kBlobScheme[]; +URL_EXPORT extern const char kDataScheme[]; +URL_EXPORT extern const char kFileScheme[]; +URL_EXPORT extern const char kFileSystemScheme[]; +URL_EXPORT extern const char kFtpScheme[]; URL_EXPORT extern const char kHttpScheme[]; URL_EXPORT extern const char kHttpsScheme[]; +URL_EXPORT extern const char kJavaScriptScheme[]; +URL_EXPORT extern const char kMailToScheme[]; } // namespace url diff --git a/url/url_util.cc b/url/url_util.cc index ff1fdf9..7cb2de2 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, @@ -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); } diff --git a/url/url_util.h b/url/url_util.h index 4229525..458d1e8 100644 --- a/url/url_util.h +++ b/url/url_util.h @@ -9,6 +9,7 @@ #include "base/strings/string16.h" #include "url/url_canon.h" +#include "url/url_constants.h" #include "url/url_export.h" #include "url/url_parse.h" diff --git a/url/url_util_internal.h b/url/url_util_internal.h index c6274cc..c72598f 100644 --- a/url/url_util_internal.h +++ b/url/url_util_internal.h @@ -12,10 +12,6 @@ namespace url { -extern const char kFileScheme[]; -extern const char kFileSystemScheme[]; -extern const char kMailtoScheme[]; - // Given a string and a range inside the string, compares it to the given // lower-case |compare_to| buffer. bool CompareSchemeComponent(const char* spec, |