OLD | NEW |
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/quic/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
11 #include "base/profiler/scoped_tracker.h" | 11 #include "base/profiler/scoped_tracker.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
17 #include "net/base/network_activity_monitor.h" | 17 #include "net/base/network_activity_monitor.h" |
18 #include "net/http/transport_security_state.h" | 18 #include "net/http/transport_security_state.h" |
19 #include "net/quic/crypto/proof_verifier_chromium.h" | 19 #include "net/quic/crypto/proof_verifier_chromium.h" |
20 #include "net/quic/crypto/quic_server_info.h" | 20 #include "net/quic/crypto/quic_server_info.h" |
| 21 #include "net/quic/network_connection.h" |
21 #include "net/quic/quic_connection_helper.h" | 22 #include "net/quic/quic_connection_helper.h" |
22 #include "net/quic/quic_crypto_client_stream_factory.h" | 23 #include "net/quic/quic_crypto_client_stream_factory.h" |
23 #include "net/quic/quic_server_id.h" | 24 #include "net/quic/quic_server_id.h" |
24 #include "net/quic/quic_stream_factory.h" | 25 #include "net/quic/quic_stream_factory.h" |
25 #include "net/spdy/spdy_session.h" | 26 #include "net/spdy/spdy_session.h" |
26 #include "net/ssl/channel_id_service.h" | 27 #include "net/ssl/channel_id_service.h" |
27 #include "net/ssl/ssl_connection_status_flags.h" | 28 #include "net/ssl/ssl_connection_status_flags.h" |
28 #include "net/ssl/ssl_info.h" | 29 #include "net/ssl/ssl_info.h" |
29 #include "net/udp/datagram_client_socket.h" | 30 #include "net/udp/datagram_client_socket.h" |
30 | 31 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 ResetAndReturn(&callback_).Run(rv); | 153 ResetAndReturn(&callback_).Run(rv); |
153 } | 154 } |
154 | 155 |
155 QuicClientSession::QuicClientSession( | 156 QuicClientSession::QuicClientSession( |
156 QuicConnection* connection, | 157 QuicConnection* connection, |
157 scoped_ptr<DatagramClientSocket> socket, | 158 scoped_ptr<DatagramClientSocket> socket, |
158 QuicStreamFactory* stream_factory, | 159 QuicStreamFactory* stream_factory, |
159 TransportSecurityState* transport_security_state, | 160 TransportSecurityState* transport_security_state, |
160 scoped_ptr<QuicServerInfo> server_info, | 161 scoped_ptr<QuicServerInfo> server_info, |
161 const QuicConfig& config, | 162 const QuicConfig& config, |
| 163 NetworkConnection* network_connection, |
162 base::TaskRunner* task_runner, | 164 base::TaskRunner* task_runner, |
163 NetLog* net_log) | 165 NetLog* net_log) |
164 : QuicClientSessionBase(connection, config), | 166 : QuicClientSessionBase(connection, config), |
165 require_confirmation_(false), | 167 require_confirmation_(false), |
166 stream_factory_(stream_factory), | 168 stream_factory_(stream_factory), |
167 socket_(socket.Pass()), | 169 socket_(socket.Pass()), |
168 read_buffer_(new IOBufferWithSize(kMaxPacketSize)), | 170 read_buffer_(new IOBufferWithSize(kMaxPacketSize)), |
169 transport_security_state_(transport_security_state), | 171 transport_security_state_(transport_security_state), |
170 server_info_(server_info.Pass()), | 172 server_info_(server_info.Pass()), |
171 read_pending_(false), | 173 read_pending_(false), |
172 num_total_streams_(0), | 174 num_total_streams_(0), |
173 task_runner_(task_runner), | 175 task_runner_(task_runner), |
174 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_QUIC_SESSION)), | 176 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_QUIC_SESSION)), |
175 logger_(new QuicConnectionLogger(this, net_log_)), | 177 logger_(new QuicConnectionLogger(this, network_connection, net_log_)), |
176 num_packets_read_(0), | 178 num_packets_read_(0), |
177 going_away_(false), | 179 going_away_(false), |
178 weak_factory_(this) { | 180 weak_factory_(this) { |
179 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. | 181 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. |
180 tracked_objects::ScopedTracker tracking_profile1( | 182 tracked_objects::ScopedTracker tracking_profile1( |
181 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 183 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
182 "422516 QuicClientSession::QuicClientSession1")); | 184 "422516 QuicClientSession::QuicClientSession1")); |
183 | 185 |
184 connection->set_debug_visitor(logger_); | 186 connection->set_debug_visitor(logger_); |
185 IPEndPoint address; | 187 IPEndPoint address; |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 return; | 948 return; |
947 | 949 |
948 // TODO(rch): re-enable this code once beta is cut. | 950 // TODO(rch): re-enable this code once beta is cut. |
949 // if (stream_factory_) | 951 // if (stream_factory_) |
950 // stream_factory_->OnSessionConnectTimeout(this); | 952 // stream_factory_->OnSessionConnectTimeout(this); |
951 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); | 953 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); |
952 // DCHECK_EQ(0u, GetNumOpenStreams()); | 954 // DCHECK_EQ(0u, GetNumOpenStreams()); |
953 } | 955 } |
954 | 956 |
955 } // namespace net | 957 } // namespace net |
OLD | NEW |