OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/tools/dump_cache/url_utilities.h" | 5 #include "net/tools/dump_cache/url_utilities.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/strings/string_util.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 std::string UrlUtilities::GetUrlHost(const std::string& url) { | 13 std::string UrlUtilities::GetUrlHost(const std::string& url) { |
14 size_t b = url.find("//"); | 14 size_t b = url.find("//"); |
15 if (b == std::string::npos) | 15 if (b == std::string::npos) |
16 b = 0; | 16 b = 0; |
17 else | 17 else |
18 b += 2; | 18 b += 2; |
19 size_t next_slash = url.find_first_of('/', b); | 19 size_t next_slash = url.find_first_of('/', b); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // Unexpected, % followed by end of string, pass it through. | 117 // Unexpected, % followed by end of string, pass it through. |
118 if (state == ESCAPE1 || state == ESCAPE2) { | 118 if (state == ESCAPE1 || state == ESCAPE2) { |
119 unescaped_url.push_back('%'); | 119 unescaped_url.push_back('%'); |
120 unescaped_url.append(escape_text); | 120 unescaped_url.append(escape_text); |
121 } | 121 } |
122 return unescaped_url; | 122 return unescaped_url; |
123 } | 123 } |
124 | 124 |
125 } // namespace net | 125 } // namespace net |
126 | 126 |
OLD | NEW |