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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 namespace content { | 44 namespace content { |
45 class BackgroundSyncProvider; | 45 class BackgroundSyncProvider; |
46 class FlingCurveConfiguration; | 46 class FlingCurveConfiguration; |
47 class NotificationDispatcher; | 47 class NotificationDispatcher; |
48 class PermissionDispatcher; | 48 class PermissionDispatcher; |
49 class PushDispatcher; | 49 class PushDispatcher; |
50 class ThreadSafeSender; | 50 class ThreadSafeSender; |
51 class TraceLogObserverAdapter; | 51 class TraceLogObserverAdapter; |
52 class WebCryptoImpl; | 52 class WebCryptoImpl; |
53 class WebGeofencingProviderImpl; | |
54 | 53 |
55 class CONTENT_EXPORT BlinkPlatformImpl | 54 class CONTENT_EXPORT BlinkPlatformImpl |
56 : NON_EXPORTED_BASE(public blink::Platform) { | 55 : NON_EXPORTED_BASE(public blink::Platform) { |
57 public: | 56 public: |
58 BlinkPlatformImpl(); | 57 BlinkPlatformImpl(); |
59 explicit BlinkPlatformImpl( | 58 explicit BlinkPlatformImpl( |
60 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner); | 59 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner); |
61 ~BlinkPlatformImpl() override; | 60 ~BlinkPlatformImpl() override; |
62 | 61 |
63 // Platform methods (partial implementation): | 62 // Platform methods (partial implementation): |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 const blink::WebString& value2) override; | 116 const blink::WebString& value2) override; |
118 void suddenTerminationChanged(bool enabled) override {} | 117 void suddenTerminationChanged(bool enabled) override {} |
119 blink::WebThread* compositorThread() const override; | 118 blink::WebThread* compositorThread() const override; |
120 blink::WebGestureCurve* createFlingAnimationCurve( | 119 blink::WebGestureCurve* createFlingAnimationCurve( |
121 blink::WebGestureDevice device_source, | 120 blink::WebGestureDevice device_source, |
122 const blink::WebFloatPoint& velocity, | 121 const blink::WebFloatPoint& velocity, |
123 const blink::WebSize& cumulative_scroll) override; | 122 const blink::WebSize& cumulative_scroll) override; |
124 void didStartWorkerThread() override; | 123 void didStartWorkerThread() override; |
125 void willStopWorkerThread() override; | 124 void willStopWorkerThread() override; |
126 blink::WebCrypto* crypto() override; | 125 blink::WebCrypto* crypto() override; |
127 blink::WebGeofencingProvider* geofencingProvider() override; | |
128 blink::WebNotificationManager* notificationManager() override; | 126 blink::WebNotificationManager* notificationManager() override; |
129 blink::WebPushProvider* pushProvider() override; | 127 blink::WebPushProvider* pushProvider() override; |
130 blink::WebPermissionClient* permissionClient() override; | 128 blink::WebPermissionClient* permissionClient() override; |
131 blink::WebSyncProvider* backgroundSyncProvider() override; | 129 blink::WebSyncProvider* backgroundSyncProvider() override; |
132 | 130 |
133 blink::WebString domCodeStringFromEnum(int dom_code) override; | 131 blink::WebString domCodeStringFromEnum(int dom_code) override; |
134 int domEnumFromCodeString(const blink::WebString& codeString) override; | 132 int domEnumFromCodeString(const blink::WebString& codeString) override; |
135 blink::WebString domKeyStringFromEnum(int dom_key) override; | 133 blink::WebString domKeyStringFromEnum(int dom_key) override; |
136 int domKeyEnumFromString(const blink::WebString& key_string) override; | 134 int domKeyEnumFromString(const blink::WebString& key_string) override; |
137 | 135 |
138 // This class does *not* own the compositor thread. It is the responsibility | 136 // This class does *not* own the compositor thread. It is the responsibility |
139 // of the caller to ensure that the compositor thread is cleared before it is | 137 // of the caller to ensure that the compositor thread is cleared before it is |
140 // destructed. | 138 // destructed. |
141 void SetCompositorThread(scheduler::WebThreadBase* compositor_thread); | 139 void SetCompositorThread(scheduler::WebThreadBase* compositor_thread); |
142 | 140 |
143 private: | 141 private: |
144 void InternalInit(); | 142 void InternalInit(); |
145 void WaitUntilWebThreadTLSUpdate(scheduler::WebThreadBase* thread); | 143 void WaitUntilWebThreadTLSUpdate(scheduler::WebThreadBase* thread); |
146 void UpdateWebThreadTLS(blink::WebThread* thread, base::WaitableEvent* event); | 144 void UpdateWebThreadTLS(blink::WebThread* thread, base::WaitableEvent* event); |
147 | 145 |
148 bool IsMainThread() const; | 146 bool IsMainThread() const; |
149 | 147 |
150 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 148 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
151 WebThemeEngineImpl native_theme_engine_; | 149 WebThemeEngineImpl native_theme_engine_; |
152 WebFallbackThemeEngineImpl fallback_theme_engine_; | 150 WebFallbackThemeEngineImpl fallback_theme_engine_; |
153 base::ThreadLocalStorage::Slot current_thread_slot_; | 151 base::ThreadLocalStorage::Slot current_thread_slot_; |
154 webcrypto::WebCryptoImpl web_crypto_; | 152 webcrypto::WebCryptoImpl web_crypto_; |
155 std::unique_ptr<WebGeofencingProviderImpl> geofencing_provider_; | |
156 base::ScopedPtrHashMap<blink::Platform::TraceLogEnabledStateObserver*, | 153 base::ScopedPtrHashMap<blink::Platform::TraceLogEnabledStateObserver*, |
157 std::unique_ptr<TraceLogObserverAdapter>> | 154 std::unique_ptr<TraceLogObserverAdapter>> |
158 trace_log_observers_; | 155 trace_log_observers_; |
159 | 156 |
160 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 157 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
161 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 158 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
162 scoped_refptr<PushDispatcher> push_dispatcher_; | 159 scoped_refptr<PushDispatcher> push_dispatcher_; |
163 std::unique_ptr<PermissionDispatcher> permission_client_; | 160 std::unique_ptr<PermissionDispatcher> permission_client_; |
164 std::unique_ptr<BackgroundSyncProvider> main_thread_sync_provider_; | 161 std::unique_ptr<BackgroundSyncProvider> main_thread_sync_provider_; |
165 | 162 |
166 scheduler::WebThreadBase* compositor_thread_; | 163 scheduler::WebThreadBase* compositor_thread_; |
167 }; | 164 }; |
168 | 165 |
169 } // namespace content | 166 } // namespace content |
170 | 167 |
171 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ | 168 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ |
OLD | NEW |