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

Unified Diff: third_party/WebKit/Source/platform/threading/BackgroundTaskRunner.cpp

Issue 1916703002: Prepare for move-only PassOwnPtr in the remaining directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@core1
Patch Set: Merge with trunk. Created 4 years, 8 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/threading/BackgroundTaskRunner.cpp
diff --git a/third_party/WebKit/Source/platform/threading/BackgroundTaskRunner.cpp b/third_party/WebKit/Source/platform/threading/BackgroundTaskRunner.cpp
index c75e7e8302daeffc9e4c27cf163c493988d3229b..e7c38470efc677cbf5b35521e0313fa2591cc48c 100644
--- a/third_party/WebKit/Source/platform/threading/BackgroundTaskRunner.cpp
+++ b/third_party/WebKit/Source/platform/threading/BackgroundTaskRunner.cpp
@@ -5,13 +5,14 @@
#include "platform/threading/BackgroundTaskRunner.h"
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/location.h"
#include "base/threading/worker_pool.h"
#include "public/platform/WebTraceLocation.h"
namespace blink {
-static void RunBackgroundTask(PassOwnPtr<CrossThreadClosure> closure)
+static void RunBackgroundTask(std::unique_ptr<CrossThreadClosure> closure)
{
(*closure)();
}
@@ -19,7 +20,7 @@ static void RunBackgroundTask(PassOwnPtr<CrossThreadClosure> closure)
void BackgroundTaskRunner::postOnBackgroundThread(const WebTraceLocation& location, PassOwnPtr<CrossThreadClosure> closure, TaskSize taskSize)
{
tracked_objects::Location baseLocation(location.functionName(), location.fileName(), 0, nullptr);
- base::WorkerPool::PostTask(baseLocation, base::Bind(&RunBackgroundTask, closure), taskSize == TaskSizeLongRunningTask);
+ base::WorkerPool::PostTask(baseLocation, base::Bind(&RunBackgroundTask, base::Passed(std::unique_ptr<CrossThreadClosure>(closure.leakPtr()))), taskSize == TaskSizeLongRunningTask);
haraken 2016/04/25 11:44:42 so complicated... But this is the only place to p
tzik 2016/04/25 12:22:33 Can we use base::Owned(closure.leakPtr()) here?
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698