Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: net/spdy/spdy_session.cc

Issue 186683002: Reland "Add base::TimeDelta::Max()" again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediate to review Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_response_headers.cc ('k') | sync/sessions/nudge_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/http/http_response_headers.cc ('k') | sync/sessions/nudge_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698