| 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/threading/thread_local_storage.h" | 10 #include "base/threading/thread_local_storage.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 class FlingCurveConfiguration; | 35 class FlingCurveConfiguration; |
| 36 class NotificationDispatcher; | 36 class NotificationDispatcher; |
| 37 class ThreadSafeSender; | 37 class ThreadSafeSender; |
| 38 class WebCryptoImpl; | 38 class WebCryptoImpl; |
| 39 class WebGeofencingProviderImpl; | 39 class WebGeofencingProviderImpl; |
| 40 | 40 |
| 41 class CONTENT_EXPORT BlinkPlatformImpl | 41 class CONTENT_EXPORT BlinkPlatformImpl |
| 42 : NON_EXPORTED_BASE(public blink::Platform) { | 42 : NON_EXPORTED_BASE(public blink::Platform) { |
| 43 public: | 43 public: |
| 44 BlinkPlatformImpl(); | 44 BlinkPlatformImpl(); |
| 45 explicit BlinkPlatformImpl( |
| 46 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner); |
| 45 virtual ~BlinkPlatformImpl(); | 47 virtual ~BlinkPlatformImpl(); |
| 46 | 48 |
| 47 // Platform methods (partial implementation): | 49 // Platform methods (partial implementation): |
| 48 virtual blink::WebThemeEngine* themeEngine(); | 50 virtual blink::WebThemeEngine* themeEngine(); |
| 49 virtual blink::WebFallbackThemeEngine* fallbackThemeEngine(); | 51 virtual blink::WebFallbackThemeEngine* fallbackThemeEngine(); |
| 50 virtual blink::Platform::FileHandle databaseOpenFile( | 52 virtual blink::Platform::FileHandle databaseOpenFile( |
| 51 const blink::WebString& vfs_file_name, int desired_flags); | 53 const blink::WebString& vfs_file_name, int desired_flags); |
| 52 virtual int databaseDeleteFile(const blink::WebString& vfs_file_name, | 54 virtual int databaseDeleteFile(const blink::WebString& vfs_file_name, |
| 53 bool sync_dir); | 55 bool sync_dir); |
| 54 virtual long databaseGetFileAttributes( | 56 virtual long databaseGetFileAttributes( |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 virtual void didStopWorkerRunLoop( | 157 virtual void didStopWorkerRunLoop( |
| 156 const blink::WebWorkerRunLoop& runLoop); | 158 const blink::WebWorkerRunLoop& runLoop); |
| 157 virtual blink::WebCrypto* crypto(); | 159 virtual blink::WebCrypto* crypto(); |
| 158 virtual blink::WebGeofencingProvider* geofencingProvider(); | 160 virtual blink::WebGeofencingProvider* geofencingProvider(); |
| 159 virtual blink::WebNotificationManager* notificationManager(); | 161 virtual blink::WebNotificationManager* notificationManager(); |
| 160 | 162 |
| 161 void SuspendSharedTimer(); | 163 void SuspendSharedTimer(); |
| 162 void ResumeSharedTimer(); | 164 void ResumeSharedTimer(); |
| 163 virtual void OnStartSharedTimer(base::TimeDelta delay) {} | 165 virtual void OnStartSharedTimer(base::TimeDelta delay) {} |
| 164 | 166 |
| 167 protected: |
| 168 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 169 |
| 165 private: | 170 private: |
| 166 static void DestroyCurrentThread(void*); | 171 static void DestroyCurrentThread(void*); |
| 167 | 172 |
| 168 void DoTimeout() { | 173 void DoTimeout() { |
| 169 if (shared_timer_func_ && !shared_timer_suspended_) | 174 if (shared_timer_func_ && !shared_timer_suspended_) |
| 170 shared_timer_func_(); | 175 shared_timer_func_(); |
| 171 } | 176 } |
| 172 | 177 |
| 178 void InternalInit(); |
| 179 |
| 173 WebThemeEngineImpl native_theme_engine_; | 180 WebThemeEngineImpl native_theme_engine_; |
| 174 WebFallbackThemeEngineImpl fallback_theme_engine_; | 181 WebFallbackThemeEngineImpl fallback_theme_engine_; |
| 175 base::MessageLoop* main_loop_; | |
| 176 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; | 182 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; |
| 177 void (*shared_timer_func_)(); | 183 void (*shared_timer_func_)(); |
| 178 double shared_timer_fire_time_; | 184 double shared_timer_fire_time_; |
| 179 bool shared_timer_fire_time_was_set_while_suspended_; | 185 bool shared_timer_fire_time_was_set_while_suspended_; |
| 180 int shared_timer_suspended_; // counter | 186 int shared_timer_suspended_; // counter |
| 181 base::ThreadLocalStorage::Slot current_thread_slot_; | 187 base::ThreadLocalStorage::Slot current_thread_slot_; |
| 182 WebCryptoImpl web_crypto_; | 188 WebCryptoImpl web_crypto_; |
| 183 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; | 189 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; |
| 184 | 190 |
| 185 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 191 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 186 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 192 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
| 187 }; | 193 }; |
| 188 | 194 |
| 189 } // namespace content | 195 } // namespace content |
| 190 | 196 |
| 191 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ | 197 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |