| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 5 #ifndef MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
| 6 #define MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 6 #define MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/threading/thread_local_storage.h" | 10 #include "base/threading/thread_local_storage.h" |
| 11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 12 #include "cc/blink/web_compositor_support_impl.h" | 12 #include "cc/blink/web_compositor_support_impl.h" |
| 13 #include "mojo/services/html_viewer/blink_resource_map.h" | 13 #include "mojo/services/html_viewer/blink_resource_map.h" |
| 14 #include "mojo/services/html_viewer/webmimeregistry_impl.h" | 14 #include "mojo/services/html_viewer/webmimeregistry_impl.h" |
| 15 #include "mojo/services/html_viewer/webscheduler_impl.h" |
| 15 #include "mojo/services/html_viewer/webthemeengine_impl.h" | 16 #include "mojo/services/html_viewer/webthemeengine_impl.h" |
| 16 #include "third_party/WebKit/public/platform/Platform.h" | 17 #include "third_party/WebKit/public/platform/Platform.h" |
| 17 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" | 18 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" |
| 18 | 19 |
| 19 namespace html_viewer { | 20 namespace html_viewer { |
| 20 | 21 |
| 21 class BlinkPlatformImpl : public blink::Platform { | 22 class BlinkPlatformImpl : public blink::Platform { |
| 22 public: | 23 public: |
| 23 explicit BlinkPlatformImpl(); | 24 explicit BlinkPlatformImpl(); |
| 24 virtual ~BlinkPlatformImpl(); | 25 virtual ~BlinkPlatformImpl(); |
| 25 | 26 |
| 26 // blink::Platform methods: | 27 // blink::Platform methods: |
| 27 virtual blink::WebMimeRegistry* mimeRegistry(); | 28 virtual blink::WebMimeRegistry* mimeRegistry(); |
| 28 virtual blink::WebThemeEngine* themeEngine(); | 29 virtual blink::WebThemeEngine* themeEngine(); |
| 30 virtual blink::WebScheduler* scheduler(); |
| 29 virtual blink::WebString defaultLocale(); | 31 virtual blink::WebString defaultLocale(); |
| 30 virtual double currentTime(); | 32 virtual double currentTime(); |
| 31 virtual double monotonicallyIncreasingTime(); | 33 virtual double monotonicallyIncreasingTime(); |
| 32 virtual void cryptographicallyRandomValues( | 34 virtual void cryptographicallyRandomValues( |
| 33 unsigned char* buffer, size_t length); | 35 unsigned char* buffer, size_t length); |
| 34 virtual void setSharedTimerFiredFunction(void (*func)()); | 36 virtual void setSharedTimerFiredFunction(void (*func)()); |
| 35 virtual void setSharedTimerFireInterval(double interval_seconds); | 37 virtual void setSharedTimerFireInterval(double interval_seconds); |
| 36 virtual void stopSharedTimer(); | 38 virtual void stopSharedTimer(); |
| 37 virtual void callOnMainThread(void (*func)(void*), void* context); | 39 virtual void callOnMainThread(void (*func)(void*), void* context); |
| 38 virtual bool isThreadedCompositingEnabled(); | 40 virtual bool isThreadedCompositingEnabled(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 69 base::MessageLoop* main_loop_; | 71 base::MessageLoop* main_loop_; |
| 70 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; | 72 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; |
| 71 void (*shared_timer_func_)(); | 73 void (*shared_timer_func_)(); |
| 72 double shared_timer_fire_time_; | 74 double shared_timer_fire_time_; |
| 73 bool shared_timer_fire_time_was_set_while_suspended_; | 75 bool shared_timer_fire_time_was_set_while_suspended_; |
| 74 int shared_timer_suspended_; // counter | 76 int shared_timer_suspended_; // counter |
| 75 base::ThreadLocalStorage::Slot current_thread_slot_; | 77 base::ThreadLocalStorage::Slot current_thread_slot_; |
| 76 cc_blink::WebCompositorSupportImpl compositor_support_; | 78 cc_blink::WebCompositorSupportImpl compositor_support_; |
| 77 WebThemeEngineImpl theme_engine_; | 79 WebThemeEngineImpl theme_engine_; |
| 78 WebMimeRegistryImpl mime_registry_; | 80 WebMimeRegistryImpl mime_registry_; |
| 81 WebSchedulerImpl scheduler_; |
| 79 blink::WebScrollbarBehavior scrollbar_behavior_; | 82 blink::WebScrollbarBehavior scrollbar_behavior_; |
| 80 BlinkResourceMap blink_resource_map_; | 83 BlinkResourceMap blink_resource_map_; |
| 81 | 84 |
| 82 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); | 85 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 } // namespace html_viewer | 88 } // namespace html_viewer |
| 86 | 89 |
| 87 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 90 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |