| 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 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "components/scheduler/scheduler_export.h" | 12 #include "components/scheduler/scheduler_export.h" |
| 12 #include "third_party/WebKit/public/platform/WebViewScheduler.h" | 13 #include "third_party/WebKit/public/platform/WebViewScheduler.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 16 } // namespace base | 17 } // namespace base |
| 17 | 18 |
| 18 namespace blink { | 19 namespace blink { |
| 19 class WebView; | 20 class WebView; |
| 20 } // namespace blink | 21 } // namespace blink |
| 21 | 22 |
| 22 namespace scheduler { | 23 namespace scheduler { |
| 23 | 24 |
| 24 class RendererSchedulerImpl; | 25 class RendererSchedulerImpl; |
| 25 class WebFrameSchedulerImpl; | 26 class WebFrameSchedulerImpl; |
| 26 | 27 |
| 27 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler { | 28 class SCHEDULER_EXPORT WebViewSchedulerImpl : public blink::WebViewScheduler { |
| 28 public: | 29 public: |
| 29 WebViewSchedulerImpl(blink::WebView* web_view, | 30 WebViewSchedulerImpl(blink::WebView* web_view, |
| 30 RendererSchedulerImpl* renderer_scheduler); | 31 RendererSchedulerImpl* renderer_scheduler); |
| 31 | 32 |
| 32 ~WebViewSchedulerImpl() override; | 33 ~WebViewSchedulerImpl() override; |
| 33 | 34 |
| 34 // blink::WebViewScheduler implementation: | 35 // blink::WebViewScheduler implementation: |
| 35 void setPageInBackground(bool background) override; | 36 void setPageInBackground(bool page_in_background) override; |
| 36 blink::WebPassOwnPtr<blink::WebFrameScheduler> createFrameScheduler() | 37 blink::WebPassOwnPtr<blink::WebFrameScheduler> createFrameScheduler() |
| 37 override; | 38 override; |
| 38 | 39 |
| 39 blink::WebView* web_view() const { return web_view_; } | 40 blink::WebView* web_view() const { return web_view_; } |
| 40 | 41 |
| 42 scoped_ptr<WebFrameSchedulerImpl> createWebFrameSchedulerImpl(); |
| 43 |
| 41 private: | 44 private: |
| 42 friend class WebFrameSchedulerImpl; | 45 friend class WebFrameSchedulerImpl; |
| 43 | 46 |
| 44 void Unregister(WebFrameSchedulerImpl* frame_scheduler); | 47 void Unregister(WebFrameSchedulerImpl* frame_scheduler); |
| 45 | 48 |
| 46 std::set<WebFrameSchedulerImpl*> frame_schedulers_; | 49 std::set<WebFrameSchedulerImpl*> frame_schedulers_; |
| 47 blink::WebView* web_view_; | 50 blink::WebView* web_view_; |
| 48 RendererSchedulerImpl* renderer_scheduler_; | 51 RendererSchedulerImpl* renderer_scheduler_; |
| 49 bool background_; | 52 bool page_in_background_; |
| 50 | 53 |
| 51 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); | 54 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 } // namespace scheduler | 57 } // namespace scheduler |
| 55 | 58 |
| 56 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ | 59 #endif // COMPONENTS_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER_IMPL_H_ |
| OLD | NEW |