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

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

Issue 2334623003: Store net::ProxyServer in HttpResponseInfo object (Closed)
Patch Set: Rebased Created 4 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
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_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "net/http/http_response_headers.h" 46 #include "net/http/http_response_headers.h"
47 #include "net/http/http_response_info.h" 47 #include "net/http/http_response_info.h"
48 #include "net/http/http_server_properties.h" 48 #include "net/http/http_server_properties.h"
49 #include "net/http/http_status_code.h" 49 #include "net/http/http_status_code.h"
50 #include "net/http/http_stream.h" 50 #include "net/http/http_stream.h"
51 #include "net/http/http_stream_factory.h" 51 #include "net/http/http_stream_factory.h"
52 #include "net/http/http_util.h" 52 #include "net/http/http_util.h"
53 #include "net/http/transport_security_state.h" 53 #include "net/http/transport_security_state.h"
54 #include "net/http/url_security_manager.h" 54 #include "net/http/url_security_manager.h"
55 #include "net/log/net_log_event_type.h" 55 #include "net/log/net_log_event_type.h"
56 #include "net/proxy/proxy_server.h"
56 #include "net/socket/client_socket_factory.h" 57 #include "net/socket/client_socket_factory.h"
57 #include "net/socket/socks_client_socket_pool.h" 58 #include "net/socket/socks_client_socket_pool.h"
58 #include "net/socket/ssl_client_socket.h" 59 #include "net/socket/ssl_client_socket.h"
59 #include "net/socket/ssl_client_socket_pool.h" 60 #include "net/socket/ssl_client_socket_pool.h"
60 #include "net/socket/transport_client_socket_pool.h" 61 #include "net/socket/transport_client_socket_pool.h"
61 #include "net/spdy/spdy_http_stream.h" 62 #include "net/spdy/spdy_http_stream.h"
62 #include "net/spdy/spdy_session.h" 63 #include "net/spdy/spdy_session.h"
63 #include "net/spdy/spdy_session_pool.h" 64 #include "net/spdy/spdy_session_pool.h"
64 #include "net/ssl/ssl_cert_request_info.h" 65 #include "net/ssl/ssl_cert_request_info.h"
65 #include "net/ssl/ssl_connection_status_flags.h" 66 #include "net/ssl/ssl_connection_status_flags.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 450 }
450 stream_.reset(stream); 451 stream_.reset(stream);
451 server_ssl_config_ = used_ssl_config; 452 server_ssl_config_ = used_ssl_config;
452 proxy_info_ = used_proxy_info; 453 proxy_info_ = used_proxy_info;
453 response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated(); 454 response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated();
454 response_.alpn_negotiated_protocol = SSLClientSocket::NextProtoToString( 455 response_.alpn_negotiated_protocol = SSLClientSocket::NextProtoToString(
455 stream_request_->negotiated_protocol()); 456 stream_request_->negotiated_protocol());
456 response_.was_fetched_via_spdy = stream_request_->using_spdy(); 457 response_.was_fetched_via_spdy = stream_request_->using_spdy();
457 response_.was_fetched_via_proxy = !proxy_info_.is_direct(); 458 response_.was_fetched_via_proxy = !proxy_info_.is_direct();
458 if (response_.was_fetched_via_proxy && !proxy_info_.is_empty()) 459 if (response_.was_fetched_via_proxy && !proxy_info_.is_empty())
459 response_.proxy_server = proxy_info_.proxy_server().host_port_pair(); 460 response_.proxy_server = proxy_info_.proxy_server();
461 else if (!response_.was_fetched_via_proxy && proxy_info_.is_direct())
462 response_.proxy_server = ProxyServer::Direct();
eroman 2016/10/05 01:45:12 Do we need an else that sets an invalid ProxyServe
tbansal1 2016/10/06 14:35:09 Done.
460 OnIOComplete(OK); 463 OnIOComplete(OK);
461 } 464 }
462 465
463 void HttpNetworkTransaction::OnBidirectionalStreamImplReady( 466 void HttpNetworkTransaction::OnBidirectionalStreamImplReady(
464 const SSLConfig& used_ssl_config, 467 const SSLConfig& used_ssl_config,
465 const ProxyInfo& used_proxy_info, 468 const ProxyInfo& used_proxy_info,
466 BidirectionalStreamImpl* stream) { 469 BidirectionalStreamImpl* stream) {
467 NOTREACHED(); 470 NOTREACHED();
468 } 471 }
469 472
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 DCHECK(stream_request_); 1633 DCHECK(stream_request_);
1631 1634
1632 // Since the transaction can restart with auth credentials, it may create a 1635 // Since the transaction can restart with auth credentials, it may create a
1633 // stream more than once. Accumulate all of the connection attempts across 1636 // stream more than once. Accumulate all of the connection attempts across
1634 // those streams by appending them to the vector: 1637 // those streams by appending them to the vector:
1635 for (const auto& attempt : stream_request_->connection_attempts()) 1638 for (const auto& attempt : stream_request_->connection_attempts())
1636 connection_attempts_.push_back(attempt); 1639 connection_attempts_.push_back(attempt);
1637 } 1640 }
1638 1641
1639 } // namespace net 1642 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698