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

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

Issue 179763006: Revert 253502 "Add base::TimeDelta::Max()." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 | « trunk/src/net/http/http_response_headers.cc ('k') | trunk/src/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 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RecordPingRTTHistogram(base::TimeDelta::Max()); 2726 const base::TimeDelta kFailedPing =
2727 base::TimeDelta::FromInternalValue(INT_MAX);
2728 RecordPingRTTHistogram(kFailedPing);
2727 CloseSessionResult result = 2729 CloseSessionResult result =
2728 DoCloseSession(ERR_SPDY_PING_FAILED, "Failed ping."); 2730 DoCloseSession(ERR_SPDY_PING_FAILED, "Failed ping.");
2729 DCHECK_EQ(result, SESSION_CLOSED_AND_REMOVED); 2731 DCHECK_EQ(result, SESSION_CLOSED_AND_REMOVED);
2730 return; 2732 return;
2731 } 2733 }
2732 2734
2733 // Check the status of connection after a delay. 2735 // Check the status of connection after a delay.
2734 base::MessageLoop::current()->PostDelayedTask( 2736 base::MessageLoop::current()->PostDelayedTask(
2735 FROM_HERE, 2737 FROM_HERE,
2736 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
3037 if (!queue->empty()) { 3039 if (!queue->empty()) {
3038 SpdyStreamId stream_id = queue->front(); 3040 SpdyStreamId stream_id = queue->front();
3039 queue->pop_front(); 3041 queue->pop_front();
3040 return stream_id; 3042 return stream_id;
3041 } 3043 }
3042 } 3044 }
3043 return 0; 3045 return 0;
3044 } 3046 }
3045 3047
3046 } // namespace net 3048 } // namespace net
OLDNEW
« no previous file with comments | « trunk/src/net/http/http_response_headers.cc ('k') | trunk/src/sync/sessions/nudge_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698