OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/pending_task.h" | 5 #include "base/pending_task.h" |
6 | 6 |
7 #include "base/tracked_objects.h" | 7 #include "base/tracked_objects.h" |
8 | 8 |
9 namespace base { | 9 namespace base { |
10 | 10 |
11 PendingTask::PendingTask() { | |
12 } | |
Ryan Sleevi
2012/10/08 23:08:42
drive by: Isn't sequence_num uninitialized because
| |
13 | |
11 PendingTask::PendingTask(const tracked_objects::Location& posted_from, | 14 PendingTask::PendingTask(const tracked_objects::Location& posted_from, |
12 const base::Closure& task) | 15 const base::Closure& task) |
13 : base::TrackingInfo(posted_from, TimeTicks()), | 16 : base::TrackingInfo(posted_from, TimeTicks()), |
14 task(task), | 17 task(task), |
15 posted_from(posted_from), | 18 posted_from(posted_from), |
16 sequence_num(0), | 19 sequence_num(0), |
17 nestable(true) { | 20 nestable(true) { |
18 } | 21 } |
19 | 22 |
20 PendingTask::PendingTask(const tracked_objects::Location& posted_from, | 23 PendingTask::PendingTask(const tracked_objects::Location& posted_from, |
(...skipping 24 matching lines...) Expand all Loading... | |
45 // If the times happen to match, then we use the sequence number to decide. | 48 // If the times happen to match, then we use the sequence number to decide. |
46 // Compare the difference to support integer roll-over. | 49 // Compare the difference to support integer roll-over. |
47 return (sequence_num - other.sequence_num) > 0; | 50 return (sequence_num - other.sequence_num) > 0; |
48 } | 51 } |
49 | 52 |
50 void TaskQueue::Swap(TaskQueue* queue) { | 53 void TaskQueue::Swap(TaskQueue* queue) { |
51 c.swap(queue->c); // Calls std::deque::swap. | 54 c.swap(queue->c); // Calls std::deque::swap. |
52 } | 55 } |
53 | 56 |
54 } // namespace base | 57 } // namespace base |
OLD | NEW |