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_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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void setVirtualTimePolicy(VirtualTimePolicy virtual_time_policy) override; | 48 void setVirtualTimePolicy(VirtualTimePolicy virtual_time_policy) override; |
49 | 49 |
50 // Virtual for testing. | 50 // Virtual for testing. |
51 virtual void AddConsoleWarning(const std::string& message); | 51 virtual void AddConsoleWarning(const std::string& message); |
52 | 52 |
53 std::unique_ptr<WebFrameSchedulerImpl> createWebFrameSchedulerImpl( | 53 std::unique_ptr<WebFrameSchedulerImpl> createWebFrameSchedulerImpl( |
54 base::trace_event::BlameContext* blame_context); | 54 base::trace_event::BlameContext* blame_context); |
55 | 55 |
56 void DidStartLoading(unsigned long identifier); | 56 void DidStartLoading(unsigned long identifier); |
57 void DidStopLoading(unsigned long identifier); | 57 void DidStopLoading(unsigned long identifier); |
| 58 void IncrementBackgroundParserCount(); |
| 59 void DecrementBackgroundParserCount(); |
58 | 60 |
59 private: | 61 private: |
60 friend class WebFrameSchedulerImpl; | 62 friend class WebFrameSchedulerImpl; |
61 | 63 |
62 void Unregister(WebFrameSchedulerImpl* frame_scheduler); | 64 void Unregister(WebFrameSchedulerImpl* frame_scheduler); |
63 | 65 |
64 AutoAdvancingVirtualTimeDomain* virtual_time_domain() const { | 66 AutoAdvancingVirtualTimeDomain* virtual_time_domain() const { |
65 return virtual_time_domain_.get(); | 67 return virtual_time_domain_.get(); |
66 } | 68 } |
67 | 69 |
68 void setAllowVirtualTimeToAdvance(bool allow_virtual_time_to_advance); | 70 void setAllowVirtualTimeToAdvance(bool allow_virtual_time_to_advance); |
| 71 void ApplyVirtualTimePolicy(); |
69 | 72 |
70 std::set<WebFrameSchedulerImpl*> frame_schedulers_; | 73 std::set<WebFrameSchedulerImpl*> frame_schedulers_; |
71 std::set<unsigned long> pending_loads_; | 74 std::set<unsigned long> pending_loads_; |
72 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; | 75 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; |
73 TaskQueue::PumpPolicy virtual_time_pump_policy_; | 76 TaskQueue::PumpPolicy virtual_time_pump_policy_; |
74 blink::WebView* web_view_; | 77 blink::WebView* web_view_; |
75 RendererSchedulerImpl* renderer_scheduler_; | 78 RendererSchedulerImpl* renderer_scheduler_; |
76 VirtualTimePolicy virtual_time_policy_; | 79 VirtualTimePolicy virtual_time_policy_; |
| 80 int background_parser_count_; |
77 bool page_visible_; | 81 bool page_visible_; |
78 bool disable_background_timer_throttling_; | 82 bool disable_background_timer_throttling_; |
79 bool allow_virtual_time_to_advance_; | 83 bool allow_virtual_time_to_advance_; |
80 | 84 |
81 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); | 85 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); |
82 }; | 86 }; |
83 | 87 |
84 } // namespace scheduler | 88 } // namespace scheduler |
85 | 89 |
86 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ | 90 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ |
OLD | NEW |