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

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

Issue 2496953002: Revert of Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Created 4 years, 1 month 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_session.cc ('k') | net/http/http_network_transaction_unittest.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) 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/proxy/proxy_server.h"
57 #include "net/socket/client_socket_factory.h" 57 #include "net/socket/client_socket_factory.h"
58 #include "net/socket/next_proto.h"
59 #include "net/socket/socks_client_socket_pool.h" 58 #include "net/socket/socks_client_socket_pool.h"
59 #include "net/socket/ssl_client_socket.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"
66 #include "net/ssl/ssl_private_key.h" 67 #include "net/ssl/ssl_private_key.h"
67 #include "net/ssl/token_binding.h" 68 #include "net/ssl/token_binding.h"
68 #include "url/gurl.h" 69 #include "url/gurl.h"
69 #include "url/url_canon.h" 70 #include "url/url_canon.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 DCHECK(stream_request_.get()); 465 DCHECK(stream_request_.get());
465 466
466 if (stream_) { 467 if (stream_) {
467 total_received_bytes_ += stream_->GetTotalReceivedBytes(); 468 total_received_bytes_ += stream_->GetTotalReceivedBytes();
468 total_sent_bytes_ += stream_->GetTotalSentBytes(); 469 total_sent_bytes_ += stream_->GetTotalSentBytes();
469 } 470 }
470 stream_.reset(stream); 471 stream_.reset(stream);
471 server_ssl_config_ = used_ssl_config; 472 server_ssl_config_ = used_ssl_config;
472 proxy_info_ = used_proxy_info; 473 proxy_info_ = used_proxy_info;
473 response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated(); 474 response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated();
474 response_.alpn_negotiated_protocol = 475 response_.alpn_negotiated_protocol = SSLClientSocket::NextProtoToString(
475 NextProtoToString(stream_request_->negotiated_protocol()); 476 stream_request_->negotiated_protocol());
476 response_.was_fetched_via_spdy = stream_request_->using_spdy(); 477 response_.was_fetched_via_spdy = stream_request_->using_spdy();
477 response_.was_fetched_via_proxy = !proxy_info_.is_direct(); 478 response_.was_fetched_via_proxy = !proxy_info_.is_direct();
478 if (response_.was_fetched_via_proxy && !proxy_info_.is_empty()) 479 if (response_.was_fetched_via_proxy && !proxy_info_.is_empty())
479 response_.proxy_server = proxy_info_.proxy_server(); 480 response_.proxy_server = proxy_info_.proxy_server();
480 else if (!response_.was_fetched_via_proxy && proxy_info_.is_direct()) 481 else if (!response_.was_fetched_via_proxy && proxy_info_.is_direct())
481 response_.proxy_server = ProxyServer::Direct(); 482 response_.proxy_server = ProxyServer::Direct();
482 else 483 else
483 response_.proxy_server = ProxyServer(); 484 response_.proxy_server = ProxyServer();
484 OnIOComplete(OK); 485 OnIOComplete(OK);
485 } 486 }
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 DCHECK(stream_request_); 1700 DCHECK(stream_request_);
1700 1701
1701 // Since the transaction can restart with auth credentials, it may create a 1702 // Since the transaction can restart with auth credentials, it may create a
1702 // stream more than once. Accumulate all of the connection attempts across 1703 // stream more than once. Accumulate all of the connection attempts across
1703 // those streams by appending them to the vector: 1704 // those streams by appending them to the vector:
1704 for (const auto& attempt : stream_request_->connection_attempts()) 1705 for (const auto& attempt : stream_request_->connection_attempts())
1705 connection_attempts_.push_back(attempt); 1706 connection_attempts_.push_back(attempt);
1706 } 1707 }
1707 1708
1708 } // namespace net 1709 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698