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

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

Issue 2373663002: Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Fix compile errors. 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"
58 #include "net/socket/socks_client_socket_pool.h" 59 #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"
61 #include "net/socket/transport_client_socket_pool.h" 60 #include "net/socket/transport_client_socket_pool.h"
62 #include "net/spdy/spdy_http_stream.h" 61 #include "net/spdy/spdy_http_stream.h"
63 #include "net/spdy/spdy_session.h" 62 #include "net/spdy/spdy_session.h"
64 #include "net/spdy/spdy_session_pool.h" 63 #include "net/spdy/spdy_session_pool.h"
65 #include "net/ssl/ssl_cert_request_info.h" 64 #include "net/ssl/ssl_cert_request_info.h"
66 #include "net/ssl/ssl_connection_status_flags.h" 65 #include "net/ssl/ssl_connection_status_flags.h"
67 #include "net/ssl/ssl_private_key.h" 66 #include "net/ssl/ssl_private_key.h"
68 #include "net/ssl/token_binding.h" 67 #include "net/ssl/token_binding.h"
69 #include "url/gurl.h" 68 #include "url/gurl.h"
70 #include "url/url_canon.h" 69 #include "url/url_canon.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 DCHECK(stream_request_.get()); 464 DCHECK(stream_request_.get());
466 465
467 if (stream_) { 466 if (stream_) {
468 total_received_bytes_ += stream_->GetTotalReceivedBytes(); 467 total_received_bytes_ += stream_->GetTotalReceivedBytes();
469 total_sent_bytes_ += stream_->GetTotalSentBytes(); 468 total_sent_bytes_ += stream_->GetTotalSentBytes();
470 } 469 }
471 stream_.reset(stream); 470 stream_.reset(stream);
472 server_ssl_config_ = used_ssl_config; 471 server_ssl_config_ = used_ssl_config;
473 proxy_info_ = used_proxy_info; 472 proxy_info_ = used_proxy_info;
474 response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated(); 473 response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated();
475 response_.alpn_negotiated_protocol = SSLClientSocket::NextProtoToString( 474 response_.alpn_negotiated_protocol =
476 stream_request_->negotiated_protocol()); 475 NextProtoToString(stream_request_->negotiated_protocol());
477 response_.was_fetched_via_spdy = stream_request_->using_spdy(); 476 response_.was_fetched_via_spdy = stream_request_->using_spdy();
478 response_.was_fetched_via_proxy = !proxy_info_.is_direct(); 477 response_.was_fetched_via_proxy = !proxy_info_.is_direct();
479 if (response_.was_fetched_via_proxy && !proxy_info_.is_empty()) 478 if (response_.was_fetched_via_proxy && !proxy_info_.is_empty())
480 response_.proxy_server = proxy_info_.proxy_server(); 479 response_.proxy_server = proxy_info_.proxy_server();
481 else if (!response_.was_fetched_via_proxy && proxy_info_.is_direct()) 480 else if (!response_.was_fetched_via_proxy && proxy_info_.is_direct())
482 response_.proxy_server = ProxyServer::Direct(); 481 response_.proxy_server = ProxyServer::Direct();
483 else 482 else
484 response_.proxy_server = ProxyServer(); 483 response_.proxy_server = ProxyServer();
485 OnIOComplete(OK); 484 OnIOComplete(OK);
486 } 485 }
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 DCHECK(stream_request_); 1699 DCHECK(stream_request_);
1701 1700
1702 // Since the transaction can restart with auth credentials, it may create a 1701 // Since the transaction can restart with auth credentials, it may create a
1703 // stream more than once. Accumulate all of the connection attempts across 1702 // stream more than once. Accumulate all of the connection attempts across
1704 // those streams by appending them to the vector: 1703 // those streams by appending them to the vector:
1705 for (const auto& attempt : stream_request_->connection_attempts()) 1704 for (const auto& attempt : stream_request_->connection_attempts())
1706 connection_attempts_.push_back(attempt); 1705 connection_attempts_.push_back(attempt);
1707 } 1706 }
1708 1707
1709 } // namespace net 1708 } // 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