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

Side by Side Diff: base/task_scheduler/sequence.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_SEQUENCE_H_ 5 #ifndef BASE_TASK_SCHEDULER_SEQUENCE_H_
6 #define BASE_TASK_SCHEDULER_SEQUENCE_H_ 6 #define BASE_TASK_SCHEDULER_SEQUENCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 27 matching lines...) Expand all
38 // 38 //
39 // This class is thread-safe. 39 // This class is thread-safe.
40 class BASE_EXPORT Sequence : public RefCountedThreadSafe<Sequence> { 40 class BASE_EXPORT Sequence : public RefCountedThreadSafe<Sequence> {
41 public: 41 public:
42 Sequence(); 42 Sequence();
43 43
44 // Adds |task| at the end of the sequence's queue. Returns true if the 44 // Adds |task| at the end of the sequence's queue. Returns true if the
45 // sequence was empty before this operation. 45 // sequence was empty before this operation.
46 bool PushTask(std::unique_ptr<Task> task); 46 bool PushTask(std::unique_ptr<Task> task);
47 47
48 // Returns the task in front of the sequence's queue, if any. 48 // Returns the task in front of the sequence's queue, if any.
fdoray 2016/10/06 17:37:22 // The returned Task is non-const to allow running
tzik 2016/10/13 05:58:04 Reverted this part per your CL.
49 const Task* PeekTask() const; 49 Task* PeekTask() const;
50 50
51 // Removes the task in front of the sequence's queue. Returns true if the 51 // Removes the task in front of the sequence's queue. Returns true if the
52 // sequence is empty after this operation. Cannot be called on an empty 52 // sequence is empty after this operation. Cannot be called on an empty
53 // sequence. 53 // sequence.
54 bool PopTask(); 54 bool PopTask();
55 55
56 // Returns a SequenceSortKey representing the priority of the sequence. Cannot 56 // Returns a SequenceSortKey representing the priority of the sequence. Cannot
57 // be called on an empty sequence. 57 // be called on an empty sequence.
58 SequenceSortKey GetSortKey() const; 58 SequenceSortKey GetSortKey() const;
59 59
(...skipping 16 matching lines...) Expand all
76 size_t num_tasks_per_priority_[static_cast<int>(TaskPriority::HIGHEST) + 1] = 76 size_t num_tasks_per_priority_[static_cast<int>(TaskPriority::HIGHEST) + 1] =
77 {}; 77 {};
78 78
79 DISALLOW_COPY_AND_ASSIGN(Sequence); 79 DISALLOW_COPY_AND_ASSIGN(Sequence);
80 }; 80 };
81 81
82 } // namespace internal 82 } // namespace internal
83 } // namespace base 83 } // namespace base
84 84
85 #endif // BASE_TASK_SCHEDULER_SEQUENCE_H_ 85 #endif // BASE_TASK_SCHEDULER_SEQUENCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698