diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-22 00:09:23 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-22 00:09:23 +0000 |
commit | 0318f92ba7c54fc5ef6397c6d58250fea95c7196 (patch) | |
tree | 5bcef0db3fb7334c5a4fd6d25444a2b86c17ec5e /url/url_canon_fileurl.cc | |
parent | 7b691d3fee8d10f130007016caefa0c6c6cd0681 (diff) | |
download | chromium_src-0318f92ba7c54fc5ef6397c6d58250fea95c7196.zip chromium_src-0318f92ba7c54fc5ef6397c6d58250fea95c7196.tar.gz chromium_src-0318f92ba7c54fc5ef6397c6d58250fea95c7196.tar.bz2 |
Renamed namespaces in src/url.
url_util -> url
url_parse -> url
url_canon -> url
BUG=364747
R=brettw@chromium.org, thestig@chromium.org, willchan@chromium.org
Review URL: https://codereview.chromium.org/242463002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url/url_canon_fileurl.cc')
-rw-r--r-- | url/url_canon_fileurl.cc | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/url/url_canon_fileurl.cc b/url/url_canon_fileurl.cc index 123583a..1322be7 100644 --- a/url/url_canon_fileurl.cc +++ b/url/url_canon_fileurl.cc @@ -9,7 +9,7 @@ #include "url/url_file.h" #include "url/url_parse_internal.h" -namespace url_canon { +namespace url { namespace { @@ -25,10 +25,10 @@ int FileDoDriveSpec(const CHAR* spec, int begin, int end, CanonOutput* output) { // The path could be one of several things: /foo/bar, c:/foo/bar, /c:/foo, // (with backslashes instead of slashes as well). - int num_slashes = url_parse::CountConsecutiveSlashes(spec, begin, end); + int num_slashes = CountConsecutiveSlashes(spec, begin, end); int after_slashes = begin + num_slashes; - if (!url_parse::DoesBeginWindowsDriveSpec(spec, after_slashes, end)) + if (!DoesBeginWindowsDriveSpec(spec, after_slashes, end)) return begin; // Haven't consumed any characters // A drive spec is the start of a path, so we need to add a slash for the @@ -53,9 +53,9 @@ int FileDoDriveSpec(const CHAR* spec, int begin, int end, template<typename CHAR, typename UCHAR> bool DoFileCanonicalizePath(const CHAR* spec, - const url_parse::Component& path, + const Component& path, CanonOutput* output, - url_parse::Component* out_path) { + Component* out_path) { // Copies and normalizes the "c:" at the beginning, if present. out_path->begin = output->length(); int after_drive; @@ -72,9 +72,8 @@ bool DoFileCanonicalizePath(const CHAR* spec, // Use the regular path canonicalizer to canonicalize the rest of the // path. Give it a fake output component to write into. DoCanonicalizeFile // will compute the full path component. - url_parse::Component sub_path = - url_parse::MakeRange(after_drive, path.end()); - url_parse::Component fake_output_path; + Component sub_path = MakeRange(after_drive, path.end()); + Component fake_output_path; success = CanonicalizePath(spec, sub_path, output, &fake_output_path); } else { // No input path, canonicalize to a slash. @@ -87,14 +86,14 @@ bool DoFileCanonicalizePath(const CHAR* spec, template<typename CHAR, typename UCHAR> bool DoCanonicalizeFileURL(const URLComponentSource<CHAR>& source, - const url_parse::Parsed& parsed, + const Parsed& parsed, CharsetConverter* query_converter, CanonOutput* output, - url_parse::Parsed* new_parsed) { + Parsed* new_parsed) { // Things we don't set in file: URLs. - new_parsed->username = url_parse::Component(); - new_parsed->password = url_parse::Component(); - new_parsed->port = url_parse::Component(); + new_parsed->username = Component(); + new_parsed->password = Component(); + new_parsed->port = Component(); // Scheme (known, so we don't bother running it through the more // complicated scheme canonicalizer). @@ -124,10 +123,10 @@ bool DoCanonicalizeFileURL(const URLComponentSource<CHAR>& source, bool CanonicalizeFileURL(const char* spec, int spec_len, - const url_parse::Parsed& parsed, + const Parsed& parsed, CharsetConverter* query_converter, CanonOutput* output, - url_parse::Parsed* new_parsed) { + Parsed* new_parsed) { return DoCanonicalizeFileURL<char, unsigned char>( URLComponentSource<char>(spec), parsed, query_converter, output, new_parsed); @@ -135,56 +134,56 @@ bool CanonicalizeFileURL(const char* spec, bool CanonicalizeFileURL(const base::char16* spec, int spec_len, - const url_parse::Parsed& parsed, + const Parsed& parsed, CharsetConverter* query_converter, CanonOutput* output, - url_parse::Parsed* new_parsed) { + Parsed* new_parsed) { return DoCanonicalizeFileURL<base::char16, base::char16>( URLComponentSource<base::char16>(spec), parsed, query_converter, output, new_parsed); } bool FileCanonicalizePath(const char* spec, - const url_parse::Component& path, + const Component& path, CanonOutput* output, - url_parse::Component* out_path) { + Component* out_path) { return DoFileCanonicalizePath<char, unsigned char>(spec, path, output, out_path); } bool FileCanonicalizePath(const base::char16* spec, - const url_parse::Component& path, + const Component& path, CanonOutput* output, - url_parse::Component* out_path) { + Component* out_path) { return DoFileCanonicalizePath<base::char16, base::char16>(spec, path, output, out_path); } bool ReplaceFileURL(const char* base, - const url_parse::Parsed& base_parsed, + const Parsed& base_parsed, const Replacements<char>& replacements, CharsetConverter* query_converter, CanonOutput* output, - url_parse::Parsed* new_parsed) { + Parsed* new_parsed) { URLComponentSource<char> source(base); - url_parse::Parsed parsed(base_parsed); + Parsed parsed(base_parsed); SetupOverrideComponents(base, replacements, &source, &parsed); return DoCanonicalizeFileURL<char, unsigned char>( source, parsed, query_converter, output, new_parsed); } bool ReplaceFileURL(const char* base, - const url_parse::Parsed& base_parsed, + const Parsed& base_parsed, const Replacements<base::char16>& replacements, CharsetConverter* query_converter, CanonOutput* output, - url_parse::Parsed* new_parsed) { + Parsed* new_parsed) { RawCanonOutput<1024> utf8; URLComponentSource<char> source(base); - url_parse::Parsed parsed(base_parsed); + Parsed parsed(base_parsed); SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); return DoCanonicalizeFileURL<char, unsigned char>( source, parsed, query_converter, output, new_parsed); } -} // namespace url_canon +} // namespace url |