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 #ifndef COMPONENTS_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULER_IMPL_H_ | 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULER_IMPL_H_ |
6 #define COMPONENTS_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULER_IMPL_H_ | 6 #define COMPONENTS_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULER_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/trace_event/trace_event.h" |
11 #include "components/scheduler/base/task_queue.h" | 12 #include "components/scheduler/base/task_queue.h" |
12 #include "components/scheduler/scheduler_export.h" | 13 #include "components/scheduler/scheduler_export.h" |
13 #include "third_party/WebKit/public/platform/WebFrameScheduler.h" | 14 #include "third_party/WebKit/public/platform/WebFrameScheduler.h" |
14 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 15 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
18 } // namespace base | 19 } // namespace base |
19 | 20 |
| 21 namespace blink { |
| 22 class WebBlameContext; |
| 23 } |
| 24 |
20 namespace scheduler { | 25 namespace scheduler { |
21 | 26 |
22 class AutoAdvancingVirtualTimeDomain; | 27 class AutoAdvancingVirtualTimeDomain; |
| 28 class FrameBlameContext; |
23 class RendererSchedulerImpl; | 29 class RendererSchedulerImpl; |
24 class TaskQueue; | 30 class TaskQueue; |
25 class WebTaskRunnerImpl; | 31 class WebTaskRunnerImpl; |
26 class WebViewSchedulerImpl; | 32 class WebViewSchedulerImpl; |
27 | 33 |
28 class SCHEDULER_EXPORT WebFrameSchedulerImpl : public blink::WebFrameScheduler { | 34 class SCHEDULER_EXPORT WebFrameSchedulerImpl : public blink::WebFrameScheduler { |
29 public: | 35 public: |
30 WebFrameSchedulerImpl(RendererSchedulerImpl* renderer_scheduler, | 36 WebFrameSchedulerImpl(RendererSchedulerImpl* renderer_scheduler, |
31 WebViewSchedulerImpl* parent_web_view_scheduler); | 37 WebViewSchedulerImpl* parent_web_view_scheduler, |
| 38 blink::WebBlameContext* blame_context); |
32 | 39 |
33 ~WebFrameSchedulerImpl() override; | 40 ~WebFrameSchedulerImpl() override; |
34 | 41 |
35 // blink::WebFrameScheduler implementation: | 42 // blink::WebFrameScheduler implementation: |
36 void setFrameVisible(bool frame_visible) override; | 43 void setFrameVisible(bool frame_visible) override; |
37 void setPageVisible(bool page_visible) override; | 44 void setPageVisible(bool page_visible) override; |
38 blink::WebTaskRunner* loadingTaskRunner() override; | 45 blink::WebTaskRunner* loadingTaskRunner() override; |
39 blink::WebTaskRunner* timerTaskRunner() override; | 46 blink::WebTaskRunner* timerTaskRunner() override; |
40 void setFrameOrigin(const blink::WebSecurityOrigin& origin) override; | 47 void setFrameOrigin(const blink::WebSecurityOrigin& origin) override; |
41 | 48 |
42 void OnVirtualTimeDomainChanged(); | 49 void OnVirtualTimeDomainChanged(); |
43 | 50 |
44 private: | 51 private: |
45 friend class WebViewSchedulerImpl; | 52 friend class WebViewSchedulerImpl; |
46 | 53 |
47 void DetachFromWebViewScheduler(); | 54 void DetachFromWebViewScheduler(); |
48 void ApplyPolicyToTimerQueue(); | 55 void ApplyPolicyToTimerQueue(); |
49 | 56 |
50 scoped_refptr<TaskQueue> loading_task_queue_; | 57 scoped_refptr<TaskQueue> loading_task_queue_; |
51 scoped_refptr<TaskQueue> timer_task_queue_; | 58 scoped_refptr<TaskQueue> timer_task_queue_; |
52 scoped_ptr<WebTaskRunnerImpl> loading_web_task_runner_; | 59 scoped_ptr<WebTaskRunnerImpl> loading_web_task_runner_; |
53 scoped_ptr<WebTaskRunnerImpl> timer_web_task_runner_; | 60 scoped_ptr<WebTaskRunnerImpl> timer_web_task_runner_; |
54 RendererSchedulerImpl* renderer_scheduler_; // NOT OWNED | 61 RendererSchedulerImpl* renderer_scheduler_; // NOT OWNED |
55 WebViewSchedulerImpl* parent_web_view_scheduler_; // NOT OWNED | 62 WebViewSchedulerImpl* parent_web_view_scheduler_; // NOT OWNED |
56 TaskQueue::PumpPolicy virtual_time_pump_policy_; | 63 TaskQueue::PumpPolicy virtual_time_pump_policy_; |
57 blink::WebSecurityOrigin origin_; | 64 blink::WebSecurityOrigin origin_; |
58 bool frame_visible_; | 65 bool frame_visible_; |
59 bool page_visible_; | 66 bool page_visible_; |
| 67 scoped_ptr<FrameBlameContext> blame_context_; |
60 | 68 |
61 DISALLOW_COPY_AND_ASSIGN(WebFrameSchedulerImpl); | 69 DISALLOW_COPY_AND_ASSIGN(WebFrameSchedulerImpl); |
62 }; | 70 }; |
63 | 71 |
64 } // namespace scheduler | 72 } // namespace scheduler |
65 | 73 |
66 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULER_IMPL_H_ | 74 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_FRAME_SCHEDULER_IMPL_H_ |
OLD | NEW |