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/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/task_runner.h" | 9 #include "base/task_runner.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 QuicTime::Delta delay) { | 59 QuicTime::Delta delay) { |
60 // TODO(rch): Coalesce these alarms. | 60 // TODO(rch): Coalesce these alarms. |
61 task_runner_->PostDelayedTask( | 61 task_runner_->PostDelayedTask( |
62 FROM_HERE, | 62 FROM_HERE, |
63 base::Bind(&QuicConnectionHelper::OnResendAlarm, | 63 base::Bind(&QuicConnectionHelper::OnResendAlarm, |
64 weak_factory_.GetWeakPtr(), sequence_number), | 64 weak_factory_.GetWeakPtr(), sequence_number), |
65 base::TimeDelta::FromMicroseconds(delay.ToMicroseconds())); | 65 base::TimeDelta::FromMicroseconds(delay.ToMicroseconds())); |
66 } | 66 } |
67 | 67 |
68 void QuicConnectionHelper::SetSendAlarm(QuicTime::Delta delay) { | 68 void QuicConnectionHelper::SetSendAlarm(QuicTime::Delta delay) { |
69 DCHECK(!send_alarm_registered_); | |
70 send_alarm_registered_ = true; | 69 send_alarm_registered_ = true; |
71 task_runner_->PostDelayedTask( | 70 task_runner_->PostDelayedTask( |
72 FROM_HERE, | 71 FROM_HERE, |
73 base::Bind(&QuicConnectionHelper::OnSendAlarm, | 72 base::Bind(&QuicConnectionHelper::OnSendAlarm, |
74 weak_factory_.GetWeakPtr()), | 73 weak_factory_.GetWeakPtr()), |
75 base::TimeDelta::FromMicroseconds(delay.ToMicroseconds())); | 74 base::TimeDelta::FromMicroseconds(delay.ToMicroseconds())); |
76 } | 75 } |
77 | 76 |
78 void QuicConnectionHelper::SetTimeoutAlarm(QuicTime::Delta delay) { | 77 void QuicConnectionHelper::SetTimeoutAlarm(QuicTime::Delta delay) { |
79 DCHECK(!timeout_alarm_registered_); | 78 DCHECK(!timeout_alarm_registered_); |
(...skipping 29 matching lines...) Expand all Loading... |
109 timeout_alarm_registered_ = false; | 108 timeout_alarm_registered_ = false; |
110 connection_->CheckForTimeout(); | 109 connection_->CheckForTimeout(); |
111 } | 110 } |
112 | 111 |
113 void QuicConnectionHelper::OnWriteComplete(int result) { | 112 void QuicConnectionHelper::OnWriteComplete(int result) { |
114 // TODO(rch): Inform the connection about the result. | 113 // TODO(rch): Inform the connection about the result. |
115 connection_->OnCanWrite(); | 114 connection_->OnCanWrite(); |
116 } | 115 } |
117 | 116 |
118 } // namespace net | 117 } // namespace net |
OLD | NEW |