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