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

Side by Side Diff: third_party/WebKit/Source/platform/threading/BackgroundTaskRunner.cpp

Issue 2148233002: Use convertToBaseCallback in BackgroundTaskRunner::postOnBackgroundThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused DEPS rule Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/threading/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
8 #include "base/bind_helpers.h"
9 #include "base/location.h" 7 #include "base/location.h"
10 #include "base/threading/worker_pool.h" 8 #include "base/threading/worker_pool.h"
11 #include "public/platform/WebTraceLocation.h" 9 #include "public/platform/WebTraceLocation.h"
12 10
13 namespace blink { 11 namespace blink {
14 12
15 static void RunBackgroundTask(CrossThreadClosure* closure)
16 {
17 (*closure)();
18 }
19
20 void BackgroundTaskRunner::postOnBackgroundThread(const WebTraceLocation& locati on, std::unique_ptr<CrossThreadClosure> closure, TaskSize taskSize) 13 void BackgroundTaskRunner::postOnBackgroundThread(const WebTraceLocation& locati on, std::unique_ptr<CrossThreadClosure> closure, TaskSize taskSize)
21 { 14 {
22 tracked_objects::Location baseLocation(location.functionName(), location.fil eName(), 0, nullptr); 15 tracked_objects::Location baseLocation(location.functionName(), location.fil eName(), 0, nullptr);
23 base::WorkerPool::PostTask(baseLocation, base::Bind(&RunBackgroundTask, base ::Owned(closure.release())), taskSize == TaskSizeLongRunningTask); 16 base::WorkerPool::PostTask(baseLocation, convertToBaseCallback(std::move(clo sure)), taskSize == TaskSizeLongRunningTask);
24 } 17 }
25 18
26 } // namespace blink 19 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/threading/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698