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 COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
6 #define COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 6 #define COMPONENTS_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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual blink::WebScheduler* scheduler(); | 44 virtual blink::WebScheduler* scheduler(); |
45 virtual blink::WebString defaultLocale(); | 45 virtual blink::WebString defaultLocale(); |
46 virtual blink::WebBlobRegistry* blobRegistry(); | 46 virtual blink::WebBlobRegistry* blobRegistry(); |
47 virtual double currentTime(); | 47 virtual double currentTime(); |
48 virtual double monotonicallyIncreasingTime(); | 48 virtual double monotonicallyIncreasingTime(); |
49 virtual void cryptographicallyRandomValues(unsigned char* buffer, | 49 virtual void cryptographicallyRandomValues(unsigned char* buffer, |
50 size_t length); | 50 size_t length); |
51 virtual void setSharedTimerFiredFunction(void (*func)()); | 51 virtual void setSharedTimerFiredFunction(void (*func)()); |
52 virtual void setSharedTimerFireInterval(double interval_seconds); | 52 virtual void setSharedTimerFireInterval(double interval_seconds); |
53 virtual void stopSharedTimer(); | 53 virtual void stopSharedTimer(); |
54 virtual void callOnMainThread(void (*func)(void*), void* context); | |
55 virtual bool isThreadedCompositingEnabled(); | 54 virtual bool isThreadedCompositingEnabled(); |
56 virtual blink::WebCompositorSupport* compositorSupport(); | 55 virtual blink::WebCompositorSupport* compositorSupport(); |
57 void createMessageChannel(blink::WebMessagePortChannel** channel1, | 56 void createMessageChannel(blink::WebMessagePortChannel** channel1, |
58 blink::WebMessagePortChannel** channel2) override; | 57 blink::WebMessagePortChannel** channel2) override; |
59 virtual blink::WebURLLoader* createURLLoader(); | 58 virtual blink::WebURLLoader* createURLLoader(); |
60 virtual blink::WebSocketHandle* createWebSocketHandle(); | 59 virtual blink::WebSocketHandle* createWebSocketHandle(); |
61 virtual blink::WebString userAgent(); | 60 virtual blink::WebString userAgent(); |
62 virtual blink::WebData parseDataURL( | 61 virtual blink::WebData parseDataURL( |
63 const blink::WebURL& url, blink::WebString& mime_type, | 62 const blink::WebURL& url, blink::WebString& mime_type, |
64 blink::WebString& charset); | 63 blink::WebString& charset); |
(...skipping 20 matching lines...) Expand all Loading... |
85 void SuspendSharedTimer(); | 84 void SuspendSharedTimer(); |
86 void ResumeSharedTimer(); | 85 void ResumeSharedTimer(); |
87 | 86 |
88 void DoTimeout() { | 87 void DoTimeout() { |
89 if (shared_timer_func_ && !shared_timer_suspended_) | 88 if (shared_timer_func_ && !shared_timer_suspended_) |
90 shared_timer_func_(); | 89 shared_timer_func_(); |
91 } | 90 } |
92 | 91 |
93 static void DestroyCurrentThread(void*); | 92 static void DestroyCurrentThread(void*); |
94 | 93 |
95 base::MessageLoop* main_loop_; | |
96 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; | 94 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; |
97 void (*shared_timer_func_)(); | 95 void (*shared_timer_func_)(); |
98 double shared_timer_fire_time_; | 96 double shared_timer_fire_time_; |
99 bool shared_timer_fire_time_was_set_while_suspended_; | 97 bool shared_timer_fire_time_was_set_while_suspended_; |
100 int shared_timer_suspended_; // counter | 98 int shared_timer_suspended_; // counter |
101 base::ThreadLocalStorage::Slot current_thread_slot_; | 99 base::ThreadLocalStorage::Slot current_thread_slot_; |
102 cc_blink::WebCompositorSupportImpl compositor_support_; | 100 cc_blink::WebCompositorSupportImpl compositor_support_; |
103 WebThemeEngineImpl theme_engine_; | 101 WebThemeEngineImpl theme_engine_; |
104 WebMimeRegistryImpl mime_registry_; | 102 WebMimeRegistryImpl mime_registry_; |
105 WebSchedulerImpl scheduler_; | 103 WebSchedulerImpl scheduler_; |
106 webcrypto::WebCryptoImpl web_crypto_; | 104 webcrypto::WebCryptoImpl web_crypto_; |
107 WebNotificationManagerImpl web_notification_manager_; | 105 WebNotificationManagerImpl web_notification_manager_; |
108 blink::WebScrollbarBehavior scrollbar_behavior_; | 106 blink::WebScrollbarBehavior scrollbar_behavior_; |
109 BlinkResourceMap blink_resource_map_; | 107 BlinkResourceMap blink_resource_map_; |
110 mojo::NetworkServicePtr network_service_; | 108 mojo::NetworkServicePtr network_service_; |
111 MockWebBlobRegistryImpl blob_registry_; | 109 MockWebBlobRegistryImpl blob_registry_; |
112 scoped_ptr<WebCookieJarImpl> cookie_jar_; | 110 scoped_ptr<WebCookieJarImpl> cookie_jar_; |
113 scoped_ptr<WebClipboardImpl> clipboard_; | 111 scoped_ptr<WebClipboardImpl> clipboard_; |
114 | 112 |
115 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); | 113 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); |
116 }; | 114 }; |
117 | 115 |
118 } // namespace html_viewer | 116 } // namespace html_viewer |
119 | 117 |
120 #endif // COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 118 #endif // COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
OLD | NEW |