| 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 "components/webcrypto/webcrypto_impl.h" |
| 13 #include "mojo/services/html_viewer/blink_resource_map.h" | 14 #include "mojo/services/html_viewer/blink_resource_map.h" |
| 14 #include "mojo/services/html_viewer/webmimeregistry_impl.h" | 15 #include "mojo/services/html_viewer/webmimeregistry_impl.h" |
| 15 #include "mojo/services/html_viewer/webnotificationmanager_impl.h" | 16 #include "mojo/services/html_viewer/webnotificationmanager_impl.h" |
| 16 #include "mojo/services/html_viewer/webscheduler_impl.h" | 17 #include "mojo/services/html_viewer/webscheduler_impl.h" |
| 17 #include "mojo/services/html_viewer/webthemeengine_impl.h" | 18 #include "mojo/services/html_viewer/webthemeengine_impl.h" |
| 18 #include "third_party/WebKit/public/platform/Platform.h" | 19 #include "third_party/WebKit/public/platform/Platform.h" |
| 19 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" | 20 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" |
| 20 | 21 |
| 21 namespace html_viewer { | 22 namespace html_viewer { |
| 22 | 23 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 virtual blink::WebWaitableEvent* waitMultipleEvents( | 56 virtual blink::WebWaitableEvent* waitMultipleEvents( |
| 56 const blink::WebVector<blink::WebWaitableEvent*>& events); | 57 const blink::WebVector<blink::WebWaitableEvent*>& events); |
| 57 virtual blink::WebScrollbarBehavior* scrollbarBehavior(); | 58 virtual blink::WebScrollbarBehavior* scrollbarBehavior(); |
| 58 virtual const unsigned char* getTraceCategoryEnabledFlag( | 59 virtual const unsigned char* getTraceCategoryEnabledFlag( |
| 59 const char* category_name); | 60 const char* category_name); |
| 60 virtual blink::WebData loadResource(const char* name); | 61 virtual blink::WebData loadResource(const char* name); |
| 61 virtual blink::WebGestureCurve* createFlingAnimationCurve( | 62 virtual blink::WebGestureCurve* createFlingAnimationCurve( |
| 62 blink::WebGestureDevice device_source, | 63 blink::WebGestureDevice device_source, |
| 63 const blink::WebFloatPoint& velocity, | 64 const blink::WebFloatPoint& velocity, |
| 64 const blink::WebSize& cumulative_scroll); | 65 const blink::WebSize& cumulative_scroll); |
| 66 virtual blink::WebCrypto* crypto(); |
| 65 virtual blink::WebNotificationManager* notificationManager(); | 67 virtual blink::WebNotificationManager* notificationManager(); |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 void SuspendSharedTimer(); | 70 void SuspendSharedTimer(); |
| 69 void ResumeSharedTimer(); | 71 void ResumeSharedTimer(); |
| 70 | 72 |
| 71 void DoTimeout() { | 73 void DoTimeout() { |
| 72 if (shared_timer_func_ && !shared_timer_suspended_) | 74 if (shared_timer_func_ && !shared_timer_suspended_) |
| 73 shared_timer_func_(); | 75 shared_timer_func_(); |
| 74 } | 76 } |
| 75 | 77 |
| 76 static void DestroyCurrentThread(void*); | 78 static void DestroyCurrentThread(void*); |
| 77 | 79 |
| 78 base::MessageLoop* main_loop_; | 80 base::MessageLoop* main_loop_; |
| 79 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; | 81 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; |
| 80 void (*shared_timer_func_)(); | 82 void (*shared_timer_func_)(); |
| 81 double shared_timer_fire_time_; | 83 double shared_timer_fire_time_; |
| 82 bool shared_timer_fire_time_was_set_while_suspended_; | 84 bool shared_timer_fire_time_was_set_while_suspended_; |
| 83 int shared_timer_suspended_; // counter | 85 int shared_timer_suspended_; // counter |
| 84 base::ThreadLocalStorage::Slot current_thread_slot_; | 86 base::ThreadLocalStorage::Slot current_thread_slot_; |
| 85 cc_blink::WebCompositorSupportImpl compositor_support_; | 87 cc_blink::WebCompositorSupportImpl compositor_support_; |
| 86 WebThemeEngineImpl theme_engine_; | 88 WebThemeEngineImpl theme_engine_; |
| 87 WebMimeRegistryImpl mime_registry_; | 89 WebMimeRegistryImpl mime_registry_; |
| 88 WebSchedulerImpl scheduler_; | 90 WebSchedulerImpl scheduler_; |
| 91 webcrypto::WebCryptoImpl web_crypto_; |
| 89 WebNotificationManagerImpl web_notification_manager_; | 92 WebNotificationManagerImpl web_notification_manager_; |
| 90 blink::WebScrollbarBehavior scrollbar_behavior_; | 93 blink::WebScrollbarBehavior scrollbar_behavior_; |
| 91 BlinkResourceMap blink_resource_map_; | 94 BlinkResourceMap blink_resource_map_; |
| 92 | 95 |
| 93 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); | 96 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 } // namespace html_viewer | 99 } // namespace html_viewer |
| 97 | 100 |
| 98 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 101 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |