Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "components/scheduler/scheduler_export.h" | 13 #include "components/scheduler/scheduler_export.h" |
| 14 #include "third_party/WebKit/public/platform/WebViewScheduler.h" | 14 #include "third_party/WebKit/public/platform/WebViewScheduler.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class SingleThreadTaskRunner; | 17 class SingleThreadTaskRunner; |
| 18 } // namespace base | 18 } // namespace base |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 class WebView; | 21 class WebView; |
| 22 } // namespace blink | 22 } // namespace blink |
| 23 | 23 |
| 24 namespace scheduler { | 24 namespace scheduler { |
| 25 | 25 |
| 26 class AutoAdvancingVirtualTimeDomain; | |
| 26 class RendererSchedulerImpl; | 27 class RendererSchedulerImpl; |
| 27 class WebFrameSchedulerImpl; | 28 class WebFrameSchedulerImpl; |
| 28 | 29 |
| 29 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler { | 30 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler { |
| 30 public: | 31 public: |
| 31 WebViewSchedulerImpl(blink::WebView* web_view, | 32 WebViewSchedulerImpl(blink::WebView* web_view, |
| 32 RendererSchedulerImpl* renderer_scheduler, | 33 RendererSchedulerImpl* renderer_scheduler, |
| 33 bool disable_background_timer_throttling); | 34 bool disable_background_timer_throttling); |
| 34 | 35 |
| 35 ~WebViewSchedulerImpl() override; | 36 ~WebViewSchedulerImpl() override; |
| 36 | 37 |
| 37 // blink::WebViewScheduler implementation: | 38 // blink::WebViewScheduler implementation: |
| 38 void setPageVisible(bool page_visible) override; | 39 void setPageVisible(bool page_visible) override; |
| 39 blink::WebPassOwnPtr<blink::WebFrameScheduler> createFrameScheduler() | 40 blink::WebPassOwnPtr<blink::WebFrameScheduler> createFrameScheduler() |
| 40 override; | 41 override; |
| 42 void useVirtualTime() override; | |
|
Sami
2016/02/01 11:15:07
Now that this is WebView-specific, I guess it give
alex clarke (OOO till 29th)
2016/02/01 14:16:54
Quite a few :( One problem is the order in which
| |
| 43 void setAllowVirtualTimeToAdvance( | |
| 44 bool allow_virtual_time_to_advance) override; | |
| 41 | 45 |
| 42 // Virtual for testing. | 46 // Virtual for testing. |
| 43 virtual void AddConsoleWarning(const std::string& message); | 47 virtual void AddConsoleWarning(const std::string& message); |
| 44 | 48 |
| 45 scoped_ptr<WebFrameSchedulerImpl> createWebFrameSchedulerImpl(); | 49 scoped_ptr<WebFrameSchedulerImpl> createWebFrameSchedulerImpl(); |
| 46 | 50 |
| 47 private: | 51 private: |
| 48 friend class WebFrameSchedulerImpl; | 52 friend class WebFrameSchedulerImpl; |
| 49 | 53 |
| 50 void Unregister(WebFrameSchedulerImpl* frame_scheduler); | 54 void Unregister(WebFrameSchedulerImpl* frame_scheduler); |
| 51 | 55 |
| 52 std::set<WebFrameSchedulerImpl*> frame_schedulers_; | 56 std::set<WebFrameSchedulerImpl*> frame_schedulers_; |
| 57 scoped_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; | |
| 53 blink::WebView* web_view_; | 58 blink::WebView* web_view_; |
| 54 RendererSchedulerImpl* renderer_scheduler_; | 59 RendererSchedulerImpl* renderer_scheduler_; |
| 55 bool page_visible_; | 60 bool page_visible_; |
| 56 bool disable_background_timer_throttling_; | 61 bool disable_background_timer_throttling_; |
| 62 bool allow_virtual_time_to_advance_; | |
| 57 | 63 |
| 58 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); | 64 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); |
| 59 }; | 65 }; |
| 60 | 66 |
| 61 } // namespace scheduler | 67 } // namespace scheduler |
| 62 | 68 |
| 63 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ | 69 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ |
| OLD | NEW |