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