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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 blink::WebLocalizedString::Name name, const blink::WebString& value); | 149 blink::WebLocalizedString::Name name, const blink::WebString& value); |
150 virtual blink::WebString queryLocalizedString( | 150 virtual blink::WebString queryLocalizedString( |
151 blink::WebLocalizedString::Name name, | 151 blink::WebLocalizedString::Name name, |
152 const blink::WebString& value1, const blink::WebString& value2); | 152 const blink::WebString& value1, const blink::WebString& value2); |
153 virtual void suddenTerminationChanged(bool enabled) { } | 153 virtual void suddenTerminationChanged(bool enabled) { } |
154 virtual double currentTime(); | 154 virtual double currentTime(); |
155 virtual double monotonicallyIncreasingTime(); | 155 virtual double monotonicallyIncreasingTime(); |
156 virtual double systemTraceTime(); | 156 virtual double systemTraceTime(); |
157 virtual void cryptographicallyRandomValues( | 157 virtual void cryptographicallyRandomValues( |
158 unsigned char* buffer, size_t length); | 158 unsigned char* buffer, size_t length); |
159 virtual void setSharedTimerFiredFunction(void (*func)()); | |
160 virtual void setSharedTimerFireInterval(double interval_seconds); | |
161 virtual void stopSharedTimer(); | |
162 virtual blink::WebGestureCurve* createFlingAnimationCurve( | 159 virtual blink::WebGestureCurve* createFlingAnimationCurve( |
163 blink::WebGestureDevice device_source, | 160 blink::WebGestureDevice device_source, |
164 const blink::WebFloatPoint& velocity, | 161 const blink::WebFloatPoint& velocity, |
165 const blink::WebSize& cumulative_scroll); | 162 const blink::WebSize& cumulative_scroll); |
166 virtual void didStartWorkerRunLoop(); | 163 virtual void didStartWorkerRunLoop(); |
167 virtual void didStopWorkerRunLoop(); | 164 virtual void didStopWorkerRunLoop(); |
168 virtual blink::WebCrypto* crypto(); | 165 virtual blink::WebCrypto* crypto(); |
169 virtual blink::WebGeofencingProvider* geofencingProvider(); | 166 virtual blink::WebGeofencingProvider* geofencingProvider(); |
170 virtual blink::WebBluetooth* bluetooth(); | 167 virtual blink::WebBluetooth* bluetooth(); |
171 virtual blink::WebNotificationManager* notificationManager(); | 168 virtual blink::WebNotificationManager* notificationManager(); |
172 virtual blink::WebPushProvider* pushProvider(); | 169 virtual blink::WebPushProvider* pushProvider(); |
173 virtual blink::WebNavigatorConnectProvider* navigatorConnectProvider(); | 170 virtual blink::WebNavigatorConnectProvider* navigatorConnectProvider(); |
174 virtual blink::WebPermissionClient* permissionClient(); | 171 virtual blink::WebPermissionClient* permissionClient(); |
175 virtual blink::WebSyncProvider* backgroundSyncProvider(); | 172 virtual blink::WebSyncProvider* backgroundSyncProvider(); |
176 | 173 |
177 void SuspendSharedTimer(); | |
178 void ResumeSharedTimer(); | |
179 virtual void OnStartSharedTimer(base::TimeDelta delay) {} | |
180 | |
181 virtual blink::WebString domCodeStringFromEnum(int dom_code); | 174 virtual blink::WebString domCodeStringFromEnum(int dom_code); |
182 virtual int domEnumFromCodeString(const blink::WebString& codeString); | 175 virtual int domEnumFromCodeString(const blink::WebString& codeString); |
183 | 176 |
184 private: | 177 private: |
185 void DoTimeout() { | |
186 if (shared_timer_func_ && !shared_timer_suspended_) | |
187 shared_timer_func_(); | |
188 } | |
189 | |
190 void InternalInit(); | 178 void InternalInit(); |
191 void UpdateWebThreadTLS(blink::WebThread* thread); | 179 void UpdateWebThreadTLS(blink::WebThread* thread); |
192 | 180 |
193 bool IsMainThread() const; | 181 bool IsMainThread() const; |
194 | 182 |
195 scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread(); | 183 scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread(); |
196 | 184 |
197 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 185 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
198 WebThemeEngineImpl native_theme_engine_; | 186 WebThemeEngineImpl native_theme_engine_; |
199 WebFallbackThemeEngineImpl fallback_theme_engine_; | 187 WebFallbackThemeEngineImpl fallback_theme_engine_; |
200 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; | |
201 void (*shared_timer_func_)(); | |
202 double shared_timer_fire_time_; | |
203 bool shared_timer_fire_time_was_set_while_suspended_; | |
204 int shared_timer_suspended_; // counter | |
205 base::ThreadLocalStorage::Slot current_thread_slot_; | 188 base::ThreadLocalStorage::Slot current_thread_slot_; |
206 webcrypto::WebCryptoImpl web_crypto_; | 189 webcrypto::WebCryptoImpl web_crypto_; |
207 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; | 190 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; |
208 scoped_ptr<WebBluetoothImpl> bluetooth_; | 191 scoped_ptr<WebBluetoothImpl> bluetooth_; |
209 base::ScopedPtrHashMap<blink::WebMemoryDumpProvider*, | 192 base::ScopedPtrHashMap<blink::WebMemoryDumpProvider*, |
210 scoped_ptr<WebMemoryDumpProviderAdapter>> | 193 scoped_ptr<WebMemoryDumpProviderAdapter>> |
211 memory_dump_providers_; | 194 memory_dump_providers_; |
212 | 195 |
213 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 196 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
214 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 197 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
215 scoped_refptr<PushDispatcher> push_dispatcher_; | 198 scoped_refptr<PushDispatcher> push_dispatcher_; |
216 scoped_ptr<PermissionDispatcher> permission_client_; | 199 scoped_ptr<PermissionDispatcher> permission_client_; |
217 scoped_ptr<BackgroundSyncProvider> sync_provider_; | 200 scoped_ptr<BackgroundSyncProvider> sync_provider_; |
218 }; | 201 }; |
219 | 202 |
220 } // namespace content | 203 } // namespace content |
221 | 204 |
222 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ | 205 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ |
OLD | NEW |