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

Side by Side Diff: base/pending_task.cc

Issue 11066071: tidy up PendingTask from previous change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use >= rather than == Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/pending_task.h ('k') | no next file » | 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) 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() { 11 #if _MSC_VER >= 1700
12 // This a temporary fix for compiling on VS2012. http://crbug.com/154744
13 PendingTask::PendingTask() : sequence_num(-1), nestable(false) {
12 } 14 }
15 #endif
13 16
14 PendingTask::PendingTask(const tracked_objects::Location& posted_from, 17 PendingTask::PendingTask(const tracked_objects::Location& posted_from,
15 const base::Closure& task) 18 const base::Closure& task)
16 : base::TrackingInfo(posted_from, TimeTicks()), 19 : base::TrackingInfo(posted_from, TimeTicks()),
17 task(task), 20 task(task),
18 posted_from(posted_from), 21 posted_from(posted_from),
19 sequence_num(0), 22 sequence_num(0),
20 nestable(true) { 23 nestable(true) {
21 } 24 }
22 25
(...skipping 25 matching lines...) Expand all
48 // If the times happen to match, then we use the sequence number to decide. 51 // If the times happen to match, then we use the sequence number to decide.
49 // Compare the difference to support integer roll-over. 52 // Compare the difference to support integer roll-over.
50 return (sequence_num - other.sequence_num) > 0; 53 return (sequence_num - other.sequence_num) > 0;
51 } 54 }
52 55
53 void TaskQueue::Swap(TaskQueue* queue) { 56 void TaskQueue::Swap(TaskQueue* queue) {
54 c.swap(queue->c); // Calls std::deque::swap. 57 c.swap(queue->c); // Calls std::deque::swap.
55 } 58 }
56 59
57 } // namespace base 60 } // namespace base
OLDNEW
« no previous file with comments | « base/pending_task.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698