blob: 01dbd8588bae299767aed627115505fd6578df3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCHEDULER_MAIN_THREAD_AGENT_GROUP_SCHEDULER_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCHEDULER_MAIN_THREAD_AGENT_GROUP_SCHEDULER_IMPL_H_
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/scheduler/public/agent_group_scheduler.h"
namespace base {
class SingleThreadTaskRunner;
}
namespace blink {
namespace scheduler {
class MainThreadSchedulerImpl;
class MainThreadTaskQueue;
// AgentGroupScheduler implementation which schedules per-AgentSchedulingGroup
// tasks.
class PLATFORM_EXPORT AgentGroupSchedulerImpl : public AgentGroupScheduler {
public:
explicit AgentGroupSchedulerImpl(
MainThreadSchedulerImpl& main_thread_scheduler);
AgentGroupSchedulerImpl(const AgentGroupSchedulerImpl&) = delete;
AgentGroupSchedulerImpl& operator=(const AgentGroupSchedulerImpl&) = delete;
~AgentGroupSchedulerImpl() override;
std::unique_ptr<PageScheduler> CreatePageScheduler(
PageScheduler::Delegate*) override;
scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() override {
return default_task_runner_;
}
MainThreadSchedulerImpl& GetMainThreadScheduler() {
return main_thread_scheduler_;
}
AgentGroupScheduler& AsAgentGroupScheduler() override;
private:
scoped_refptr<MainThreadTaskQueue> default_task_queue_;
scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
MainThreadSchedulerImpl& main_thread_scheduler_; // Not owned.
};
} // namespace scheduler
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCHEDULER_MAIN_THREAD_AGENT_GROUP_SCHEDULER_IMPL_H_
|