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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: s/base::ResetAndReturn/std::move/ Created 3 years, 9 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
Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
index 79503356b851cf354ffc12f40d93ef4b862e6fac..154491d76f0058b7811faac702a06ee33e7f7394 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -10,6 +10,7 @@
#include <memory>
#include <set>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/pending_task.h"
#include "base/threading/thread_checker.h"
@@ -68,13 +69,13 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
public:
Task();
Task(const tracked_objects::Location& posted_from,
- const base::Closure& task,
+ base::Closure task,
base::TimeTicks desired_run_time,
EnqueueOrder sequence_number,
bool nestable);
Task(const tracked_objects::Location& posted_from,
- const base::Closure& task,
+ base::Closure task,
base::TimeTicks desired_run_time,
EnqueueOrder sequence_number,
bool nestable,
@@ -130,10 +131,10 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
void UnregisterTaskQueue() override;
bool RunsTasksOnCurrentThread() const override;
bool PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure task,
base::TimeDelta delay) override;
bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure task,
base::TimeDelta delay) override;
std::unique_ptr<QueueEnabledVoter> CreateQueueEnabledVoter() override;
bool IsQueueEnabled() const override;
@@ -284,10 +285,10 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
~TaskQueueImpl() override;
bool PostImmediateTaskImpl(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure task,
TaskType task_type);
bool PostDelayedTaskImpl(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure task,
base::TimeDelta delay,
TaskType task_type);
@@ -309,7 +310,7 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
// empty.
void PushOntoImmediateIncomingQueueLocked(
const tracked_objects::Location& posted_from,
- const base::Closure& task,
+ base::Closure task,
base::TimeTicks desired_run_time,
EnqueueOrder sequence_number,
bool nestable);

Powered by Google App Engine
This is Rietveld 408576698