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

Side by Side Diff: net/quic/quic_connection_helper.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
« no previous file with comments | « net/quic/quic_connection_helper.h ('k') | net/quic/quic_connection_logger.h » ('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/quic/quic_connection_helper.h" 5 #include "net/quic/quic_connection_helper.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/task_runner.h" 10 #include "base/task_runner.h"
(...skipping 25 matching lines...) Expand all
36 // Since tasks can not be un-posted, OnAlarm will be invoked which 36 // Since tasks can not be un-posted, OnAlarm will be invoked which
37 // will notice that deadline has not yet been reached, and will set 37 // will notice that deadline has not yet been reached, and will set
38 // the alarm for the new deadline. 38 // the alarm for the new deadline.
39 return; 39 return;
40 } 40 }
41 // The scheduled task is after new deadline. Invalidate the weak ptrs 41 // The scheduled task is after new deadline. Invalidate the weak ptrs
42 // so that task does not execute when we're not expecting it. 42 // so that task does not execute when we're not expecting it.
43 weak_factory_.InvalidateWeakPtrs(); 43 weak_factory_.InvalidateWeakPtrs();
44 } 44 }
45 45
46 int64 delay_us = deadline().Subtract(clock_->Now()).ToMicroseconds(); 46 int64_t delay_us = deadline().Subtract(clock_->Now()).ToMicroseconds();
47 if (delay_us < 0) { 47 if (delay_us < 0) {
48 delay_us = 0; 48 delay_us = 0;
49 } 49 }
50 task_runner_->PostDelayedTask( 50 task_runner_->PostDelayedTask(
51 FROM_HERE, 51 FROM_HERE,
52 base::Bind(&QuicChromeAlarm::OnAlarm, weak_factory_.GetWeakPtr()), 52 base::Bind(&QuicChromeAlarm::OnAlarm, weak_factory_.GetWeakPtr()),
53 base::TimeDelta::FromMicroseconds(delay_us)); 53 base::TimeDelta::FromMicroseconds(delay_us));
54 task_deadline_ = deadline(); 54 task_deadline_ = deadline();
55 } 55 }
56 56
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 QuicRandom* QuicConnectionHelper::GetRandomGenerator() { 108 QuicRandom* QuicConnectionHelper::GetRandomGenerator() {
109 return random_generator_; 109 return random_generator_;
110 } 110 }
111 111
112 QuicAlarm* QuicConnectionHelper::CreateAlarm(QuicAlarm::Delegate* delegate) { 112 QuicAlarm* QuicConnectionHelper::CreateAlarm(QuicAlarm::Delegate* delegate) {
113 return new QuicChromeAlarm(clock_, task_runner_, delegate); 113 return new QuicChromeAlarm(clock_, task_runner_, delegate);
114 } 114 }
115 115
116 } // namespace net 116 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_helper.h ('k') | net/quic/quic_connection_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698