1 // Copyright 2018 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_TASKS_TASK_UTILS_H_ 6 #define V8_TASKS_TASK_UTILS_H_ 7 8 #include <functional> 9 #include <memory> 10 11 namespace v8 { 12 13 namespace internal { 14 15 class CancelableIdleTask; 16 class CancelableTask; 17 class CancelableTaskManager; 18 class Isolate; 19 20 std::unique_ptr<CancelableTask> MakeCancelableTask(Isolate*, 21 std::function<void()>); 22 std::unique_ptr<CancelableTask> MakeCancelableTask(CancelableTaskManager*, 23 std::function<void()>); 24 25 std::unique_ptr<CancelableIdleTask> MakeCancelableIdleTask( 26 Isolate*, std::function<void(double)>); 27 std::unique_ptr<CancelableIdleTask> MakeCancelableIdleTask( 28 CancelableTaskManager* manager, std::function<void(double)>); 29 30 } // namespace internal 31 } // namespace v8 32 33 #endif // V8_TASKS_TASK_UTILS_H_ 34