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