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

Unified Diff: base/pending_task.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/pending_task.h ('k') | base/pickle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pending_task.cc
diff --git a/base/pending_task.cc b/base/pending_task.cc
deleted file mode 100644
index 3d7891414c8dc7df431f0c4d8a6bf8dcb26eb9a5..0000000000000000000000000000000000000000
--- a/base/pending_task.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2011 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 "base/pending_task.h"
-
-#include "base/tracked_objects.h"
-
-namespace base {
-
-PendingTask::PendingTask(const tracked_objects::Location& posted_from,
- const base::Closure& task)
- : base::TrackingInfo(posted_from, TimeTicks()),
- task(task),
- posted_from(posted_from),
- sequence_num(0),
- nestable(true),
- is_high_res(false) {
-}
-
-PendingTask::PendingTask(const tracked_objects::Location& posted_from,
- const base::Closure& task,
- TimeTicks delayed_run_time,
- bool nestable)
- : base::TrackingInfo(posted_from, delayed_run_time),
- task(task),
- posted_from(posted_from),
- sequence_num(0),
- nestable(nestable),
- is_high_res(false) {
-}
-
-PendingTask::~PendingTask() {
-}
-
-bool PendingTask::operator<(const PendingTask& other) const {
- // Since the top of a priority queue is defined as the "greatest" element, we
- // need to invert the comparison here. We want the smaller time to be at the
- // top of the heap.
-
- if (delayed_run_time < other.delayed_run_time)
- return false;
-
- if (delayed_run_time > other.delayed_run_time)
- return true;
-
- // If the times happen to match, then we use the sequence number to decide.
- // Compare the difference to support integer roll-over.
- return (sequence_num - other.sequence_num) > 0;
-}
-
-void TaskQueue::Swap(TaskQueue* queue) {
- c.swap(queue->c); // Calls std::deque::swap.
-}
-
-} // namespace base
« no previous file with comments | « base/pending_task.h ('k') | base/pickle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698