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

Unified Diff: net/quic/quic_alarm.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_alarm.h ('k') | net/quic/quic_alarm_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_alarm.cc
diff --git a/net/quic/quic_alarm.cc b/net/quic/quic_alarm.cc
deleted file mode 100644
index b5aca8caa175aae288f0d6f7c23f39b61bfed29a..0000000000000000000000000000000000000000
--- a/net/quic/quic_alarm.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/quic_alarm.h"
-
-#include "base/logging.h"
-
-namespace net {
-
-QuicAlarm::QuicAlarm(Delegate* delegate)
- : delegate_(delegate),
- deadline_(QuicTime::Zero()) {
-}
-
-QuicAlarm::~QuicAlarm() {}
-
-void QuicAlarm::Set(QuicTime deadline) {
- DCHECK(!IsSet());
- DCHECK(deadline.IsInitialized());
- deadline_ = deadline;
- SetImpl();
-}
-
-void QuicAlarm::Cancel() {
- deadline_ = QuicTime::Zero();
- CancelImpl();
-}
-
-void QuicAlarm::Update(QuicTime deadline, QuicTime::Delta granularity) {
- if (!deadline.IsInitialized()) {
- Cancel();
- return;
- }
- if (std::abs(deadline.Subtract(deadline_).ToMicroseconds()) <
- granularity.ToMicroseconds()) {
- return;
- }
- Cancel();
- Set(deadline);
-}
-
-bool QuicAlarm::IsSet() const {
- return deadline_.IsInitialized();
-}
-
-void QuicAlarm::Fire() {
- if (!deadline_.IsInitialized()) {
- return;
- }
-
- deadline_ = QuicTime::Zero();
- QuicTime deadline = delegate_->OnAlarm();
- // delegate_->OnAlarm() might call Set(), in which case deadline_ will
- // already contain the new value, so don't overwrite it.
- if (!deadline_.IsInitialized() && deadline.IsInitialized()) {
- Set(deadline);
- }
-}
-
-} // namespace net
« no previous file with comments | « net/quic/quic_alarm.h ('k') | net/quic/quic_alarm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698