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

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

Issue 1941083002: JobController 1: Adding a new class HttpStreamFactoryImpl::JobController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add JobFactory interface in JobController, remove JobControllerPeer Created 4 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 &alternate_protocol_str); 62 &alternate_protocol_str);
63 if (!alternate_protocol_str.empty()) { 63 if (!alternate_protocol_str.empty()) {
64 alternate_protocol_values.push_back(alternate_protocol_str); 64 alternate_protocol_values.push_back(alternate_protocol_str);
65 } 65 }
66 } 66 }
67 67
68 ProcessAlternateProtocol(session->http_server_properties(), 68 ProcessAlternateProtocol(session->http_server_properties(),
69 alternate_protocol_values, http_server, *session); 69 alternate_protocol_values, http_server, *session);
70 } 70 }
71 71
72 GURL HttpStreamFactory::ApplyHostMappingRules(const GURL& url,
73 HostPortPair* endpoint) {
74 const HostMappingRules* mapping_rules = GetHostMappingRules();
75 if (mapping_rules && mapping_rules->RewriteHost(endpoint)) {
76 url::Replacements<char> replacements;
77 const std::string port_str = base::UintToString(endpoint->port());
78 replacements.SetPort(port_str.c_str(), url::Component(0, port_str.size()));
79 replacements.SetHost(endpoint->host().c_str(),
80 url::Component(0, endpoint->host().size()));
81 return url.ReplaceComponents(replacements);
82 }
83 return url;
84 }
85
86 HttpStreamFactory::HttpStreamFactory() {} 72 HttpStreamFactory::HttpStreamFactory() {}
87 73
88 void HttpStreamFactory::ProcessAlternativeService( 74 void HttpStreamFactory::ProcessAlternativeService(
89 const base::WeakPtr<HttpServerProperties>& http_server_properties, 75 const base::WeakPtr<HttpServerProperties>& http_server_properties,
90 base::StringPiece alternative_service_str, 76 base::StringPiece alternative_service_str,
91 const url::SchemeHostPort& http_server, 77 const url::SchemeHostPort& http_server,
92 const HttpNetworkSession& session) { 78 const HttpNetworkSession& session) {
93 SpdyAltSvcWireFormat::AlternativeServiceVector alternative_service_vector; 79 SpdyAltSvcWireFormat::AlternativeServiceVector alternative_service_vector;
94 if (!SpdyAltSvcWireFormat::ParseHeaderFieldValue( 80 if (!SpdyAltSvcWireFormat::ParseHeaderFieldValue(
95 alternative_service_str, &alternative_service_vector)) { 81 alternative_service_str, &alternative_service_vector)) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 const url::SchemeHostPort& server) { 190 const url::SchemeHostPort& server) {
205 HostPortPair host_port_pair(server.host(), server.port()); 191 HostPortPair host_port_pair(server.host(), server.port());
206 const HostMappingRules* mapping_rules = GetHostMappingRules(); 192 const HostMappingRules* mapping_rules = GetHostMappingRules();
207 if (mapping_rules) 193 if (mapping_rules)
208 mapping_rules->RewriteHost(&host_port_pair); 194 mapping_rules->RewriteHost(&host_port_pair);
209 return url::SchemeHostPort(server.scheme(), host_port_pair.host(), 195 return url::SchemeHostPort(server.scheme(), host_port_pair.host(),
210 host_port_pair.port()); 196 host_port_pair.port());
211 } 197 }
212 198
213 } // namespace net 199 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698