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

Side by Side Diff: base/task_scheduler/task_tracker.h

Issue 2386653002: Replace base::Callback with base::OnceCallback in base::PendingTask (Closed)
Patch Set: revert most of task_scheduler changes Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef BASE_TASK_SCHEDULER_TASK_TRACKER_H_ 5 #ifndef BASE_TASK_SCHEDULER_TASK_TRACKER_H_
6 #define BASE_TASK_SCHEDULER_TASK_TRACKER_H_ 6 #define BASE_TASK_SCHEDULER_TASK_TRACKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/atomicops.h" 10 #include "base/atomicops.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // other threads during the call. Returns immediately when shutdown completes. 49 // other threads during the call. Returns immediately when shutdown completes.
50 void Flush(); 50 void Flush();
51 51
52 // Informs this TaskTracker that |task| is about to be posted. Returns true if 52 // Informs this TaskTracker that |task| is about to be posted. Returns true if
53 // this operation is allowed (|task| should be posted if-and-only-if it is). 53 // this operation is allowed (|task| should be posted if-and-only-if it is).
54 bool WillPostTask(const Task* task); 54 bool WillPostTask(const Task* task);
55 55
56 // Runs |task| unless the current shutdown state prevents that. 56 // Runs |task| unless the current shutdown state prevents that.
57 // |sequence_token| is the token identifying the sequence from which |task| 57 // |sequence_token| is the token identifying the sequence from which |task|
58 // was extracted. Returns true if |task| ran. WillPostTask() must have allowed 58 // was extracted. Returns true if |task| ran. WillPostTask() must have allowed
59 // |task| to be posted before this is called. 59 // |task| to be posted before this is called.
fdoray 2016/10/06 17:37:22 // |task| is non-const to allow running its OnceCl
tzik 2016/10/13 05:58:04 It's now obsolete after your CL, right? Its type i
60 bool RunTask(const Task* task, const SequenceToken& sequence_token); 60 bool RunTask(Task* task, const SequenceToken& sequence_token);
61 61
62 // Returns true once shutdown has started (Shutdown() has been called but 62 // Returns true once shutdown has started (Shutdown() has been called but
63 // might not have returned). Note: sequential consistency with the thread 63 // might not have returned). Note: sequential consistency with the thread
64 // calling Shutdown() (or SetHasShutdownStartedForTesting()) isn't guaranteed 64 // calling Shutdown() (or SetHasShutdownStartedForTesting()) isn't guaranteed
65 // by this call. 65 // by this call.
66 bool HasShutdownStarted() const; 66 bool HasShutdownStarted() const;
67 67
68 // Returns true if shutdown has completed (Shutdown() has returned). 68 // Returns true if shutdown has completed (Shutdown() has returned).
69 bool IsShutdownComplete() const; 69 bool IsShutdownComplete() const;
70 70
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // Number of BLOCK_SHUTDOWN tasks posted during shutdown. 131 // Number of BLOCK_SHUTDOWN tasks posted during shutdown.
132 HistogramBase::Sample num_block_shutdown_tasks_posted_during_shutdown_ = 0; 132 HistogramBase::Sample num_block_shutdown_tasks_posted_during_shutdown_ = 0;
133 133
134 DISALLOW_COPY_AND_ASSIGN(TaskTracker); 134 DISALLOW_COPY_AND_ASSIGN(TaskTracker);
135 }; 135 };
136 136
137 } // namespace internal 137 } // namespace internal
138 } // namespace base 138 } // namespace base
139 139
140 #endif // BASE_TASK_SCHEDULER_TASK_TRACKER_H_ 140 #endif // BASE_TASK_SCHEDULER_TASK_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698