[M120 Migration] Set IO|GPU thread type with higher priorites
[platform/framework/web/chromium-efl.git] / gin / v8_foreground_task_runner_base.h
1 // Copyright 2017 The Chromium Authors
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 GIN_V8_FOREGROUND_TASK_RUNNER_BASE_H_
6 #define GIN_V8_FOREGROUND_TASK_RUNNER_BASE_H_
7
8 #include "v8/include/v8-platform.h"
9
10 #include "gin/gin_export.h"
11 #include "gin/public/v8_idle_task_runner.h"
12
13 namespace gin {
14
15 // Base class for the V8ForegroundTaskRunners to share the capability of
16 // enabling IdleTasks.
17 class V8ForegroundTaskRunnerBase : public v8::TaskRunner {
18  public:
19   V8ForegroundTaskRunnerBase();
20
21   ~V8ForegroundTaskRunnerBase() override;
22
23   void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner);
24
25   bool IdleTasksEnabled() override;
26
27  protected:
28   V8IdleTaskRunner* idle_task_runner() { return idle_task_runner_.get(); }
29
30  private:
31   std::unique_ptr<V8IdleTaskRunner> idle_task_runner_;
32 };
33
34 }  // namespace gin
35
36 #endif  // GIN_V8_FOREGROUND_TASK_RUNNER_BASE_H_