| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2718 return; | 2718 return; |
| 2719 } | 2719 } |
| 2720 | 2720 |
| 2721 DCHECK(check_ping_status_pending_); | 2721 DCHECK(check_ping_status_pending_); |
| 2722 | 2722 |
| 2723 base::TimeTicks now = time_func_(); | 2723 base::TimeTicks now = time_func_(); |
| 2724 base::TimeDelta delay = hung_interval_ - (now - last_activity_time_); | 2724 base::TimeDelta delay = hung_interval_ - (now - last_activity_time_); |
| 2725 | 2725 |
| 2726 if (delay.InMilliseconds() < 0 || last_activity_time_ < last_check_time) { | 2726 if (delay.InMilliseconds() < 0 || last_activity_time_ < last_check_time) { |
| 2727 // Track all failed PING messages in a separate bucket. | 2727 // Track all failed PING messages in a separate bucket. |
| 2728 const base::TimeDelta kFailedPing = | 2728 RecordPingRTTHistogram(base::TimeDelta::Max()); |
| 2729 base::TimeDelta::FromInternalValue(INT_MAX); | |
| 2730 RecordPingRTTHistogram(kFailedPing); | |
| 2731 CloseSessionResult result = | 2729 CloseSessionResult result = |
| 2732 DoCloseSession(ERR_SPDY_PING_FAILED, "Failed ping."); | 2730 DoCloseSession(ERR_SPDY_PING_FAILED, "Failed ping."); |
| 2733 DCHECK_EQ(result, SESSION_CLOSED_AND_REMOVED); | 2731 DCHECK_EQ(result, SESSION_CLOSED_AND_REMOVED); |
| 2734 return; | 2732 return; |
| 2735 } | 2733 } |
| 2736 | 2734 |
| 2737 // Check the status of connection after a delay. | 2735 // Check the status of connection after a delay. |
| 2738 base::MessageLoop::current()->PostDelayedTask( | 2736 base::MessageLoop::current()->PostDelayedTask( |
| 2739 FROM_HERE, | 2737 FROM_HERE, |
| 2740 base::Bind(&SpdySession::CheckPingStatus, weak_factory_.GetWeakPtr(), | 2738 base::Bind(&SpdySession::CheckPingStatus, weak_factory_.GetWeakPtr(), |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3041 if (!queue->empty()) { | 3039 if (!queue->empty()) { |
| 3042 SpdyStreamId stream_id = queue->front(); | 3040 SpdyStreamId stream_id = queue->front(); |
| 3043 queue->pop_front(); | 3041 queue->pop_front(); |
| 3044 return stream_id; | 3042 return stream_id; |
| 3045 } | 3043 } |
| 3046 } | 3044 } |
| 3047 return 0; | 3045 return 0; |
| 3048 } | 3046 } |
| 3049 | 3047 |
| 3050 } // namespace net | 3048 } // namespace net |
| OLD | NEW |