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

Side by Side 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, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/threading/BackgroundTaskRunner.h" 5 #include "platform/threading/BackgroundTaskRunner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
8 #include "base/location.h" 9 #include "base/location.h"
9 #include "base/threading/worker_pool.h" 10 #include "base/threading/worker_pool.h"
10 #include "public/platform/WebTraceLocation.h" 11 #include "public/platform/WebTraceLocation.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 static void RunBackgroundTask(PassOwnPtr<CrossThreadClosure> closure) 15 static void RunBackgroundTask(CrossThreadClosure* closure)
15 { 16 {
16 (*closure)(); 17 (*closure)();
17 } 18 }
18 19
19 void BackgroundTaskRunner::postOnBackgroundThread(const WebTraceLocation& locati on, PassOwnPtr<CrossThreadClosure> closure, TaskSize taskSize) 20 void BackgroundTaskRunner::postOnBackgroundThread(const WebTraceLocation& locati on, PassOwnPtr<CrossThreadClosure> closure, TaskSize taskSize)
20 { 21 {
21 tracked_objects::Location baseLocation(location.functionName(), location.fil eName(), 0, nullptr); 22 tracked_objects::Location baseLocation(location.functionName(), location.fil eName(), 0, nullptr);
22 base::WorkerPool::PostTask(baseLocation, base::Bind(&RunBackgroundTask, clos ure), taskSize == TaskSizeLongRunningTask); 23 base::WorkerPool::PostTask(baseLocation, base::Bind(&RunBackgroundTask, base ::Owned(closure.leakPtr())), taskSize == TaskSizeLongRunningTask);
23 } 24 }
24 25
25 } // namespace blink 26 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/testing/FontTestHelpers.cpp ('k') | third_party/WebKit/Source/platform/threading/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698