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 CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ | 5 #ifndef CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ |
6 #define CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ | 6 #define CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/containers/scoped_ptr_hash_map.h" | 9 #include "base/containers/scoped_ptr_hash_map.h" |
10 #include "base/threading/thread_local_storage.h" | 10 #include "base/threading/thread_local_storage.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #elif defined(OS_WIN) | 23 #elif defined(OS_WIN) |
24 #include "content/child/webthemeengine_impl_win.h" | 24 #include "content/child/webthemeengine_impl_win.h" |
25 #elif defined(OS_MACOSX) | 25 #elif defined(OS_MACOSX) |
26 #include "content/child/webthemeengine_impl_mac.h" | 26 #include "content/child/webthemeengine_impl_mac.h" |
27 #elif defined(OS_ANDROID) | 27 #elif defined(OS_ANDROID) |
28 #include "content/child/webthemeengine_impl_android.h" | 28 #include "content/child/webthemeengine_impl_android.h" |
29 #endif | 29 #endif |
30 | 30 |
31 namespace base { | 31 namespace base { |
32 class MessageLoop; | 32 class MessageLoop; |
33 class WaitableEvent; | |
34 } | |
35 | |
36 namespace scheduler { | |
37 class WebThreadBase; | |
38 } | 33 } |
39 | 34 |
40 namespace content { | 35 namespace content { |
41 class BackgroundSyncProvider; | 36 class BackgroundSyncProvider; |
42 class FlingCurveConfiguration; | 37 class FlingCurveConfiguration; |
43 class NotificationDispatcher; | 38 class NotificationDispatcher; |
44 class PermissionDispatcher; | 39 class PermissionDispatcher; |
45 class PushDispatcher; | 40 class PushDispatcher; |
46 class ThreadSafeSender; | 41 class ThreadSafeSender; |
47 class WebCryptoImpl; | 42 class WebCryptoImpl; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 blink::WebString queryLocalizedString( | 160 blink::WebString queryLocalizedString( |
166 blink::WebLocalizedString::Name name, | 161 blink::WebLocalizedString::Name name, |
167 const blink::WebString& value1, | 162 const blink::WebString& value1, |
168 const blink::WebString& value2) override; | 163 const blink::WebString& value2) override; |
169 void suddenTerminationChanged(bool enabled) override {} | 164 void suddenTerminationChanged(bool enabled) override {} |
170 double currentTimeSeconds() override; | 165 double currentTimeSeconds() override; |
171 double monotonicallyIncreasingTimeSeconds() override; | 166 double monotonicallyIncreasingTimeSeconds() override; |
172 double systemTraceTime() override; | 167 double systemTraceTime() override; |
173 void cryptographicallyRandomValues(unsigned char* buffer, | 168 void cryptographicallyRandomValues(unsigned char* buffer, |
174 size_t length) override; | 169 size_t length) override; |
175 blink::WebThread* compositorThread() const override; | |
176 blink::WebGestureCurve* createFlingAnimationCurve( | 170 blink::WebGestureCurve* createFlingAnimationCurve( |
177 blink::WebGestureDevice device_source, | 171 blink::WebGestureDevice device_source, |
178 const blink::WebFloatPoint& velocity, | 172 const blink::WebFloatPoint& velocity, |
179 const blink::WebSize& cumulative_scroll) override; | 173 const blink::WebSize& cumulative_scroll) override; |
180 void didStartWorkerRunLoop() override; | 174 void didStartWorkerRunLoop() override; |
181 void didStopWorkerRunLoop() override; | 175 void didStopWorkerRunLoop() override; |
182 blink::WebCrypto* crypto() override; | 176 blink::WebCrypto* crypto() override; |
183 blink::WebGeofencingProvider* geofencingProvider() override; | 177 blink::WebGeofencingProvider* geofencingProvider() override; |
184 blink::WebNotificationManager* notificationManager() override; | 178 blink::WebNotificationManager* notificationManager() override; |
185 blink::WebPushProvider* pushProvider() override; | 179 blink::WebPushProvider* pushProvider() override; |
186 blink::WebServicePortProvider* createServicePortProvider( | 180 blink::WebServicePortProvider* createServicePortProvider( |
187 blink::WebServicePortProviderClient*) override; | 181 blink::WebServicePortProviderClient*) override; |
188 blink::WebPermissionClient* permissionClient() override; | 182 blink::WebPermissionClient* permissionClient() override; |
189 blink::WebSyncProvider* backgroundSyncProvider() override; | 183 blink::WebSyncProvider* backgroundSyncProvider() override; |
190 | 184 |
191 blink::WebString domCodeStringFromEnum(int dom_code) override; | 185 blink::WebString domCodeStringFromEnum(int dom_code) override; |
192 int domEnumFromCodeString(const blink::WebString& codeString) override; | 186 int domEnumFromCodeString(const blink::WebString& codeString) override; |
193 blink::WebString domKeyStringFromEnum(int dom_key) override; | 187 blink::WebString domKeyStringFromEnum(int dom_key) override; |
194 int domKeyEnumFromString(const blink::WebString& key_string) override; | 188 int domKeyEnumFromString(const blink::WebString& key_string) override; |
195 | 189 |
196 scoped_ptr<scheduler::WebThreadBase> createThreadWithOptions( | |
197 const char* name, | |
198 base::Thread::Options); | |
199 | |
200 // This class does *not* own |compositor_thread|. It is the responsibility of | |
201 // the caller to ensure that the compositor thread is cleared before it is | |
202 // destructed. | |
203 void set_compositor_thread(scheduler::WebThreadBase* compositor_thread) { | |
204 compositor_thread_ = compositor_thread; | |
205 } | |
206 | |
207 private: | 190 private: |
208 void InternalInit(); | 191 void InternalInit(); |
209 void UpdateWebThreadTLS(blink::WebThread* thread, base::WaitableEvent* event); | 192 void UpdateWebThreadTLS(blink::WebThread* thread); |
210 | 193 |
211 bool IsMainThread() const; | 194 bool IsMainThread() const; |
212 | 195 |
213 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 196 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
214 WebThemeEngineImpl native_theme_engine_; | 197 WebThemeEngineImpl native_theme_engine_; |
215 WebFallbackThemeEngineImpl fallback_theme_engine_; | 198 WebFallbackThemeEngineImpl fallback_theme_engine_; |
216 base::ThreadLocalStorage::Slot current_thread_slot_; | 199 base::ThreadLocalStorage::Slot current_thread_slot_; |
217 webcrypto::WebCryptoImpl web_crypto_; | 200 webcrypto::WebCryptoImpl web_crypto_; |
218 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; | 201 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; |
219 base::ScopedPtrHashMap<blink::WebMemoryDumpProvider*, | 202 base::ScopedPtrHashMap<blink::WebMemoryDumpProvider*, |
220 scoped_ptr<WebMemoryDumpProviderAdapter>> | 203 scoped_ptr<WebMemoryDumpProviderAdapter>> |
221 memory_dump_providers_; | 204 memory_dump_providers_; |
222 | 205 |
223 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 206 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
224 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 207 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
225 scoped_refptr<PushDispatcher> push_dispatcher_; | 208 scoped_refptr<PushDispatcher> push_dispatcher_; |
226 scoped_ptr<PermissionDispatcher> permission_client_; | 209 scoped_ptr<PermissionDispatcher> permission_client_; |
227 scoped_ptr<BackgroundSyncProvider> main_thread_sync_provider_; | 210 scoped_ptr<BackgroundSyncProvider> main_thread_sync_provider_; |
228 | |
229 scheduler::WebThreadBase* compositor_thread_; | |
230 }; | 211 }; |
231 | 212 |
232 } // namespace content | 213 } // namespace content |
233 | 214 |
234 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ | 215 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ |
OLD | NEW |