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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 trusted_spdy_proxy_(trusted_spdy_proxy) { | 317 trusted_spdy_proxy_(trusted_spdy_proxy) { |
318 DCHECK(HttpStreamFactory::spdy_enabled()); | 318 DCHECK(HttpStreamFactory::spdy_enabled()); |
319 net_log_.BeginEvent( | 319 net_log_.BeginEvent( |
320 NetLog::TYPE_SPDY_SESSION, | 320 NetLog::TYPE_SPDY_SESSION, |
321 base::Bind(&NetLogSpdySessionCallback, &host_port_proxy_pair_)); | 321 base::Bind(&NetLogSpdySessionCallback, &host_port_proxy_pair_)); |
322 next_unclaimed_push_stream_sweep_time_ = g_time_func() + | 322 next_unclaimed_push_stream_sweep_time_ = g_time_func() + |
323 base::TimeDelta::FromSeconds(kMinPushedStreamLifetimeSeconds); | 323 base::TimeDelta::FromSeconds(kMinPushedStreamLifetimeSeconds); |
324 // TODO(mbelshe): consider randomization of the stream_hi_water_mark. | 324 // TODO(mbelshe): consider randomization of the stream_hi_water_mark. |
325 } | 325 } |
326 | 326 |
| 327 SpdySession::PendingCreateStream::PendingCreateStream( |
| 328 const GURL& url, RequestPriority priority, |
| 329 scoped_refptr<SpdyStream>* spdy_stream, |
| 330 const BoundNetLog& stream_net_log, |
| 331 const CompletionCallback& callback) |
| 332 : url(&url), |
| 333 priority(priority), |
| 334 spdy_stream(spdy_stream), |
| 335 stream_net_log(&stream_net_log), |
| 336 callback(callback) { |
| 337 } |
| 338 |
327 SpdySession::PendingCreateStream::~PendingCreateStream() {} | 339 SpdySession::PendingCreateStream::~PendingCreateStream() {} |
328 | 340 |
| 341 SpdySession::CallbackResultPair::CallbackResultPair( |
| 342 const CompletionCallback& callback_in, int result_in) |
| 343 : callback(callback_in), |
| 344 result(result_in) { |
| 345 } |
| 346 |
329 SpdySession::CallbackResultPair::~CallbackResultPair() {} | 347 SpdySession::CallbackResultPair::~CallbackResultPair() {} |
330 | 348 |
331 SpdySession::~SpdySession() { | 349 SpdySession::~SpdySession() { |
332 if (state_ != CLOSED) { | 350 if (state_ != CLOSED) { |
333 state_ = CLOSED; | 351 state_ = CLOSED; |
334 | 352 |
335 // Cleanup all the streams. | 353 // Cleanup all the streams. |
336 CloseAllStreams(net::ERR_ABORTED); | 354 CloseAllStreams(net::ERR_ABORTED); |
337 } | 355 } |
338 | 356 |
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 SSLClientSocket* SpdySession::GetSSLClientSocket() const { | 1990 SSLClientSocket* SpdySession::GetSSLClientSocket() const { |
1973 if (!is_secure_) | 1991 if (!is_secure_) |
1974 return NULL; | 1992 return NULL; |
1975 SSLClientSocket* ssl_socket = | 1993 SSLClientSocket* ssl_socket = |
1976 reinterpret_cast<SSLClientSocket*>(connection_->socket()); | 1994 reinterpret_cast<SSLClientSocket*>(connection_->socket()); |
1977 DCHECK(ssl_socket); | 1995 DCHECK(ssl_socket); |
1978 return ssl_socket; | 1996 return ssl_socket; |
1979 } | 1997 } |
1980 | 1998 |
1981 } // namespace net | 1999 } // namespace net |
OLD | NEW |