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

Side by Side Diff: net/http/http_stream_factory.cc

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/http/http_network_layer.cc ('k') | net/tools/hresolv/hresolv.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/http/http_stream_factory.h" 5 #include "net/http/http_stream_factory.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 bool HttpStreamFactory::IsTLSIntolerantServer(const GURL& url) { 71 bool HttpStreamFactory::IsTLSIntolerantServer(const GURL& url) {
72 return ContainsKey(tls_intolerant_servers_, GetHostAndPort(url)); 72 return ContainsKey(tls_intolerant_servers_, GetHostAndPort(url));
73 } 73 }
74 74
75 void HttpStreamFactory::ProcessAlternateProtocol( 75 void HttpStreamFactory::ProcessAlternateProtocol(
76 HttpAlternateProtocols* alternate_protocols, 76 HttpAlternateProtocols* alternate_protocols,
77 const std::string& alternate_protocol_str, 77 const std::string& alternate_protocol_str,
78 const HostPortPair& http_host_port_pair) { 78 const HostPortPair& http_host_port_pair) {
79 std::vector<std::string> port_protocol_vector; 79 std::vector<std::string> port_protocol_vector;
80 SplitString(alternate_protocol_str, ':', &port_protocol_vector); 80 base::SplitString(alternate_protocol_str, ':', &port_protocol_vector);
81 if (port_protocol_vector.size() != 2) { 81 if (port_protocol_vector.size() != 2) {
82 DLOG(WARNING) << HttpAlternateProtocols::kHeader 82 DLOG(WARNING) << HttpAlternateProtocols::kHeader
83 << " header has too many tokens: " 83 << " header has too many tokens: "
84 << alternate_protocol_str; 84 << alternate_protocol_str;
85 return; 85 return;
86 } 86 }
87 87
88 int port; 88 int port;
89 if (!base::StringToInt(port_protocol_vector[0], &port) || 89 if (!base::StringToInt(port_protocol_vector[0], &port) ||
90 port <= 0 || port >= 1 << 16) { 90 port <= 0 || port >= 1 << 16) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 replacements.SetPort(port_str.c_str(), 133 replacements.SetPort(port_str.c_str(),
134 url_parse::Component(0, port_str.size())); 134 url_parse::Component(0, port_str.size()));
135 replacements.SetHost(endpoint->host().c_str(), 135 replacements.SetHost(endpoint->host().c_str(),
136 url_parse::Component(0, endpoint->host().size())); 136 url_parse::Component(0, endpoint->host().size()));
137 return url.ReplaceComponents(replacements); 137 return url.ReplaceComponents(replacements);
138 } 138 }
139 return url; 139 return url;
140 } 140 }
141 141
142 } // namespace net 142 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_layer.cc ('k') | net/tools/hresolv/hresolv.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698