| 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/threading/thread_local_storage.h" | 9 #include "base/threading/thread_local_storage.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 virtual blink::WebString queryLocalizedString( | 134 virtual blink::WebString queryLocalizedString( |
| 135 blink::WebLocalizedString::Name name, const blink::WebString& value); | 135 blink::WebLocalizedString::Name name, const blink::WebString& value); |
| 136 virtual blink::WebString queryLocalizedString( | 136 virtual blink::WebString queryLocalizedString( |
| 137 blink::WebLocalizedString::Name name, | 137 blink::WebLocalizedString::Name name, |
| 138 const blink::WebString& value1, const blink::WebString& value2); | 138 const blink::WebString& value1, const blink::WebString& value2); |
| 139 virtual void suddenTerminationChanged(bool enabled) { } | 139 virtual void suddenTerminationChanged(bool enabled) { } |
| 140 virtual double currentTime(); | 140 virtual double currentTime(); |
| 141 virtual double monotonicallyIncreasingTime(); | 141 virtual double monotonicallyIncreasingTime(); |
| 142 virtual void cryptographicallyRandomValues( | 142 virtual void cryptographicallyRandomValues( |
| 143 unsigned char* buffer, size_t length); | 143 unsigned char* buffer, size_t length); |
| 144 virtual void setSharedTimerFiredFunction(void (*func)()); | |
| 145 virtual void setSharedTimerFireInterval(double interval_seconds); | |
| 146 virtual void stopSharedTimer(); | |
| 147 virtual void callOnMainThread(void (*func)(void*), void* context); | 144 virtual void callOnMainThread(void (*func)(void*), void* context); |
| 148 virtual blink::WebGestureCurve* createFlingAnimationCurve( | 145 virtual blink::WebGestureCurve* createFlingAnimationCurve( |
| 149 blink::WebGestureDevice device_source, | 146 blink::WebGestureDevice device_source, |
| 150 const blink::WebFloatPoint& velocity, | 147 const blink::WebFloatPoint& velocity, |
| 151 const blink::WebSize& cumulative_scroll); | 148 const blink::WebSize& cumulative_scroll); |
| 152 virtual void didStartWorkerRunLoop(); | 149 virtual void didStartWorkerRunLoop(); |
| 153 virtual void didStopWorkerRunLoop(); | 150 virtual void didStopWorkerRunLoop(); |
| 154 virtual blink::WebCrypto* crypto(); | 151 virtual blink::WebCrypto* crypto(); |
| 155 virtual blink::WebGeofencingProvider* geofencingProvider(); | 152 virtual blink::WebGeofencingProvider* geofencingProvider(); |
| 156 virtual blink::WebBluetooth* bluetooth(); | 153 virtual blink::WebBluetooth* bluetooth(); |
| 157 virtual blink::WebNotificationManager* notificationManager(); | 154 virtual blink::WebNotificationManager* notificationManager(); |
| 158 virtual blink::WebPushProvider* pushProvider(); | 155 virtual blink::WebPushProvider* pushProvider(); |
| 159 virtual blink::WebNavigatorConnectProvider* navigatorConnectProvider(); | 156 virtual blink::WebNavigatorConnectProvider* navigatorConnectProvider(); |
| 160 | 157 |
| 161 void SuspendSharedTimer(); | |
| 162 void ResumeSharedTimer(); | |
| 163 virtual void OnStartSharedTimer(base::TimeDelta delay) {} | |
| 164 | |
| 165 WebBluetoothImpl* BluetoothImplForTesting() { return bluetooth_.get(); } | 158 WebBluetoothImpl* BluetoothImplForTesting() { return bluetooth_.get(); } |
| 166 | 159 |
| 167 virtual blink::WebString domCodeStringFromEnum(int dom_code); | 160 virtual blink::WebString domCodeStringFromEnum(int dom_code); |
| 168 virtual int domEnumFromCodeString(const blink::WebString& codeString); | 161 virtual int domEnumFromCodeString(const blink::WebString& codeString); |
| 169 | 162 |
| 170 private: | 163 private: |
| 171 void DoTimeout() { | |
| 172 if (shared_timer_func_ && !shared_timer_suspended_) | |
| 173 shared_timer_func_(); | |
| 174 } | |
| 175 | 164 |
| 176 void InternalInit(); | 165 void InternalInit(); |
| 177 void UpdateWebThreadTLS(blink::WebThread* thread); | 166 void UpdateWebThreadTLS(blink::WebThread* thread); |
| 178 | 167 |
| 179 scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread(); | 168 scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread(); |
| 180 | 169 |
| 181 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 170 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 182 WebThemeEngineImpl native_theme_engine_; | 171 WebThemeEngineImpl native_theme_engine_; |
| 183 WebFallbackThemeEngineImpl fallback_theme_engine_; | 172 WebFallbackThemeEngineImpl fallback_theme_engine_; |
| 184 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; | |
| 185 void (*shared_timer_func_)(); | |
| 186 double shared_timer_fire_time_; | |
| 187 bool shared_timer_fire_time_was_set_while_suspended_; | |
| 188 int shared_timer_suspended_; // counter | |
| 189 base::ThreadLocalStorage::Slot current_thread_slot_; | 173 base::ThreadLocalStorage::Slot current_thread_slot_; |
| 190 WebCryptoImpl web_crypto_; | 174 WebCryptoImpl web_crypto_; |
| 191 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; | 175 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; |
| 192 scoped_ptr<WebBluetoothImpl> bluetooth_; | 176 scoped_ptr<WebBluetoothImpl> bluetooth_; |
| 193 | 177 |
| 194 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 178 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 195 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 179 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
| 196 scoped_refptr<PushDispatcher> push_dispatcher_; | 180 scoped_refptr<PushDispatcher> push_dispatcher_; |
| 197 }; | 181 }; |
| 198 | 182 |
| 199 } // namespace content | 183 } // namespace content |
| 200 | 184 |
| 201 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ | 185 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |