| 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 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1820 if ((now - last_activity_time_) > connection_at_risk_of_loss_time_) | 1820 if ((now - last_activity_time_) > connection_at_risk_of_loss_time_) |
| 1821 SendPrefacePing(); | 1821 SendPrefacePing(); |
| 1822 } | 1822 } |
| 1823 | 1823 |
| 1824 void SpdySession::SendPrefacePing() { | 1824 void SpdySession::SendPrefacePing() { |
| 1825 WritePingFrame(next_ping_id_); | 1825 WritePingFrame(next_ping_id_); |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 void SpdySession::WritePingFrame(uint32 unique_id) { | 1828 void SpdySession::WritePingFrame(uint32 unique_id) { |
| 1829 DCHECK(buffered_spdy_framer_.get()); | 1829 DCHECK(buffered_spdy_framer_.get()); |
| 1830 scoped_ptr<SpdyPingControlFrame> ping_frame( | 1830 scoped_ptr<SpdyFrame> ping_frame( |
| 1831 buffered_spdy_framer_->CreatePingFrame(unique_id)); | 1831 buffered_spdy_framer_->CreatePingFrame(unique_id)); |
| 1832 QueueFrame(ping_frame.release(), HIGHEST); | 1832 QueueFrame(ping_frame.release(), HIGHEST); |
| 1833 | 1833 |
| 1834 if (net_log().IsLoggingAllEvents()) { | 1834 if (net_log().IsLoggingAllEvents()) { |
| 1835 net_log().AddEvent( | 1835 net_log().AddEvent( |
| 1836 NetLog::TYPE_SPDY_SESSION_PING, | 1836 NetLog::TYPE_SPDY_SESSION_PING, |
| 1837 base::Bind(&NetLogSpdyPingCallback, unique_id, "sent")); | 1837 base::Bind(&NetLogSpdyPingCallback, unique_id, "sent")); |
| 1838 } | 1838 } |
| 1839 if (unique_id % 2 != 0) { | 1839 if (unique_id % 2 != 0) { |
| 1840 next_ping_id_ += 2; | 1840 next_ping_id_ += 2; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 SSLClientSocket* SpdySession::GetSSLClientSocket() const { | 1985 SSLClientSocket* SpdySession::GetSSLClientSocket() const { |
| 1986 if (!is_secure_) | 1986 if (!is_secure_) |
| 1987 return NULL; | 1987 return NULL; |
| 1988 SSLClientSocket* ssl_socket = | 1988 SSLClientSocket* ssl_socket = |
| 1989 reinterpret_cast<SSLClientSocket*>(connection_->socket()); | 1989 reinterpret_cast<SSLClientSocket*>(connection_->socket()); |
| 1990 DCHECK(ssl_socket); | 1990 DCHECK(ssl_socket); |
| 1991 return ssl_socket; | 1991 return ssl_socket; |
| 1992 } | 1992 } |
| 1993 | 1993 |
| 1994 } // namespace net | 1994 } // namespace net |
| OLD | NEW |