Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Side by Side Diff: components/scheduler/renderer/web_view_scheduler_impl.h

Issue 2023033003: scheduler: Throttle timers in out-of-view frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cross origin check, tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_VIEW_SCHEDULER_IMPL_H_ 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ 6 #define COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 17 matching lines...) Expand all
28 namespace scheduler { 28 namespace scheduler {
29 29
30 class AutoAdvancingVirtualTimeDomain; 30 class AutoAdvancingVirtualTimeDomain;
31 class RendererSchedulerImpl; 31 class RendererSchedulerImpl;
32 class WebFrameSchedulerImpl; 32 class WebFrameSchedulerImpl;
33 33
34 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler { 34 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler {
35 public: 35 public:
36 WebViewSchedulerImpl(blink::WebView* web_view, 36 WebViewSchedulerImpl(blink::WebView* web_view,
37 RendererSchedulerImpl* renderer_scheduler, 37 RendererSchedulerImpl* renderer_scheduler,
38 bool disable_background_timer_throttling); 38 bool disable_background_timer_throttling,
39 bool allow_hidden_timer_throttling);
39 40
40 ~WebViewSchedulerImpl() override; 41 ~WebViewSchedulerImpl() override;
41 42
42 // blink::WebViewScheduler implementation: 43 // blink::WebViewScheduler implementation:
43 void setPageVisible(bool page_visible) override; 44 void setPageVisible(bool page_visible) override;
44 std::unique_ptr<blink::WebFrameScheduler> createFrameScheduler( 45 std::unique_ptr<blink::WebFrameScheduler> createFrameScheduler(
45 blink::BlameContext* blame_context) override; 46 blink::BlameContext* blame_context) override;
46 void enableVirtualTime() override; 47 void enableVirtualTime() override;
47 void setAllowVirtualTimeToAdvance( 48 void setAllowVirtualTimeToAdvance(
48 bool allow_virtual_time_to_advance) override; 49 bool allow_virtual_time_to_advance) override;
(...skipping 14 matching lines...) Expand all
63 } 64 }
64 65
65 std::set<WebFrameSchedulerImpl*> frame_schedulers_; 66 std::set<WebFrameSchedulerImpl*> frame_schedulers_;
66 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; 67 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_;
67 TaskQueue::PumpPolicy virtual_time_pump_policy_; 68 TaskQueue::PumpPolicy virtual_time_pump_policy_;
68 blink::WebView* web_view_; 69 blink::WebView* web_view_;
69 RendererSchedulerImpl* renderer_scheduler_; 70 RendererSchedulerImpl* renderer_scheduler_;
70 bool page_visible_; 71 bool page_visible_;
71 bool disable_background_timer_throttling_; 72 bool disable_background_timer_throttling_;
72 bool allow_virtual_time_to_advance_; 73 bool allow_virtual_time_to_advance_;
74 bool allow_hidden_timer_throttling_;
73 75
74 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); 76 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl);
75 }; 77 };
76 78
77 } // namespace scheduler 79 } // namespace scheduler
78 80
79 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ 81 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698