| 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 26 matching lines...) Expand all Loading... |
| 37 RendererSchedulerImpl* renderer_scheduler, | 37 RendererSchedulerImpl* renderer_scheduler, |
| 38 bool disable_background_timer_throttling); | 38 bool disable_background_timer_throttling); |
| 39 | 39 |
| 40 ~WebViewSchedulerImpl() override; | 40 ~WebViewSchedulerImpl() override; |
| 41 | 41 |
| 42 // blink::WebViewScheduler implementation: | 42 // blink::WebViewScheduler implementation: |
| 43 void setPageVisible(bool page_visible) override; | 43 void setPageVisible(bool page_visible) override; |
| 44 std::unique_ptr<blink::WebFrameScheduler> createFrameScheduler( | 44 std::unique_ptr<blink::WebFrameScheduler> createFrameScheduler( |
| 45 blink::BlameContext* blame_context) override; | 45 blink::BlameContext* blame_context) override; |
| 46 void enableVirtualTime() override; | 46 void enableVirtualTime() override; |
| 47 void setAllowVirtualTimeToAdvance( | 47 bool virtualTimeAllowedToAdvance() const override; |
| 48 bool allow_virtual_time_to_advance) 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 incrementPendingResourceLoadCount(); |
| 57 void decrementPendingResourceLoadCount(); |
| 58 |
| 56 private: | 59 private: |
| 57 friend class WebFrameSchedulerImpl; | 60 friend class WebFrameSchedulerImpl; |
| 58 | 61 |
| 59 void Unregister(WebFrameSchedulerImpl* frame_scheduler); | 62 void Unregister(WebFrameSchedulerImpl* frame_scheduler); |
| 60 | 63 |
| 61 AutoAdvancingVirtualTimeDomain* virtual_time_domain() const { | 64 AutoAdvancingVirtualTimeDomain* virtual_time_domain() const { |
| 62 return virtual_time_domain_.get(); | 65 return virtual_time_domain_.get(); |
| 63 } | 66 } |
| 64 | 67 |
| 68 void setAllowVirtualTimeToAdvance(bool allow_virtual_time_to_advance); |
| 69 |
| 65 std::set<WebFrameSchedulerImpl*> frame_schedulers_; | 70 std::set<WebFrameSchedulerImpl*> frame_schedulers_; |
| 66 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; | 71 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; |
| 67 TaskQueue::PumpPolicy virtual_time_pump_policy_; | 72 TaskQueue::PumpPolicy virtual_time_pump_policy_; |
| 68 blink::WebView* web_view_; | 73 blink::WebView* web_view_; |
| 69 RendererSchedulerImpl* renderer_scheduler_; | 74 RendererSchedulerImpl* renderer_scheduler_; |
| 75 int pending_resource_load_count_; |
| 76 VirtualTimePolicy virtual_time_policy_; |
| 70 bool page_visible_; | 77 bool page_visible_; |
| 71 bool disable_background_timer_throttling_; | 78 bool disable_background_timer_throttling_; |
| 72 bool allow_virtual_time_to_advance_; | 79 bool allow_virtual_time_to_advance_; |
| 73 | 80 |
| 74 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); | 81 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); |
| 75 }; | 82 }; |
| 76 | 83 |
| 77 } // namespace scheduler | 84 } // namespace scheduler |
| 78 | 85 |
| 79 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ | 86 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ |
| OLD | NEW |