| OLD | NEW |
| 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/location.h" | 8 #include "base/location.h" |
| 9 #include "base/threading/worker_pool.h" | 9 #include "base/threading/worker_pool.h" |
| 10 #include "public/platform/WebTraceLocation.h" | 10 #include "public/platform/WebTraceLocation.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 static void RunBackgroundTask(PassOwnPtr<Closure> closure) | 14 static void RunBackgroundTask(PassOwnPtr<CrossThreadClosure> closure) |
| 15 { | 15 { |
| 16 (*closure)(); | 16 (*closure)(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void BackgroundTaskRunner::postOnBackgroundThread(const WebTraceLocation& locati
on, PassOwnPtr<Closure> closure, TaskSize taskSize) | 19 void BackgroundTaskRunner::postOnBackgroundThread(const WebTraceLocation& locati
on, PassOwnPtr<CrossThreadClosure> closure, TaskSize taskSize) |
| 20 { | 20 { |
| 21 tracked_objects::Location baseLocation(location.functionName(), location.fil
eName(), 0, nullptr); | 21 tracked_objects::Location baseLocation(location.functionName(), location.fil
eName(), 0, nullptr); |
| 22 base::WorkerPool::PostTask(baseLocation, base::Bind(&RunBackgroundTask, clos
ure), taskSize == TaskSizeLongRunningTask); | 22 base::WorkerPool::PostTask(baseLocation, base::Bind(&RunBackgroundTask, clos
ure), taskSize == TaskSizeLongRunningTask); |
| 23 } | 23 } |
| 24 | 24 |
| 25 } // namespace blink | 25 } // namespace blink |
| OLD | NEW |