OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_PLATFORM_SUPPORT_IMPL_H_ | 5 #ifndef WEBKIT_PLATFORM_SUPPORT_IMPL_H_ |
6 #define WEBKIT_PLATFORM_SUPPORT_IMPL_H_ | 6 #define WEBKIT_PLATFORM_SUPPORT_IMPL_H_ |
7 | 7 |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
| 9 #include "base/threading/thread_local_storage.h" |
9 #include "base/timer.h" | 10 #include "base/timer.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport
.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport
.h" |
11 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
12 #include "webkit/glue/webthemeengine_impl_win.h" | 13 #include "webkit/glue/webthemeengine_impl_win.h" |
13 #elif defined(OS_MACOSX) | 14 #elif defined(OS_MACOSX) |
14 #include "webkit/glue/webthemeengine_impl_mac.h" | 15 #include "webkit/glue/webthemeengine_impl_mac.h" |
15 #elif defined(OS_POSIX) | 16 #elif defined(OS_POSIX) |
16 #include "webkit/glue/webthemeengine_impl_linux.h" | 17 #include "webkit/glue/webthemeengine_impl_linux.h" |
17 #endif | 18 #endif |
18 | 19 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual void suddenTerminationChanged(bool enabled) { } | 72 virtual void suddenTerminationChanged(bool enabled) { } |
72 virtual double currentTime(); | 73 virtual double currentTime(); |
73 virtual double monotonicallyIncreasingTime(); | 74 virtual double monotonicallyIncreasingTime(); |
74 virtual void cryptographicallyRandomValues( | 75 virtual void cryptographicallyRandomValues( |
75 unsigned char* buffer, size_t length); | 76 unsigned char* buffer, size_t length); |
76 virtual void setSharedTimerFiredFunction(void (*func)()); | 77 virtual void setSharedTimerFiredFunction(void (*func)()); |
77 virtual void setSharedTimerFireInterval(double interval_seconds); | 78 virtual void setSharedTimerFireInterval(double interval_seconds); |
78 virtual void stopSharedTimer(); | 79 virtual void stopSharedTimer(); |
79 virtual void callOnMainThread(void (*func)(void*), void* context); | 80 virtual void callOnMainThread(void (*func)(void*), void* context); |
80 virtual WebKit::WebThread* createThread(const char* name); | 81 virtual WebKit::WebThread* createThread(const char* name); |
| 82 virtual WebKit::WebThread* currentThread(); |
81 | 83 |
82 void SuspendSharedTimer(); | 84 void SuspendSharedTimer(); |
83 void ResumeSharedTimer(); | 85 void ResumeSharedTimer(); |
84 | 86 |
85 private: | 87 private: |
86 void DoTimeout() { | 88 void DoTimeout() { |
87 if (shared_timer_func_ && !shared_timer_suspended_) | 89 if (shared_timer_func_ && !shared_timer_suspended_) |
88 shared_timer_func_(); | 90 shared_timer_func_(); |
89 } | 91 } |
| 92 static void DestroyCurrentThread(void*); |
90 | 93 |
91 MessageLoop* main_loop_; | 94 MessageLoop* main_loop_; |
92 base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_; | 95 base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_; |
93 void (*shared_timer_func_)(); | 96 void (*shared_timer_func_)(); |
94 double shared_timer_fire_time_; | 97 double shared_timer_fire_time_; |
95 int shared_timer_suspended_; // counter | 98 int shared_timer_suspended_; // counter |
96 WebThemeEngineImpl theme_engine_; | 99 WebThemeEngineImpl theme_engine_; |
| 100 base::ThreadLocalStorage::Slot current_thread_slot_; |
97 }; | 101 }; |
98 | 102 |
99 } // namespace webkit_glue | 103 } // namespace webkit_glue |
100 | 104 |
101 #endif // WEBKIT_PLATFORM_SUPPORT_IMPL_H_ | 105 #endif // WEBKIT_PLATFORM_SUPPORT_IMPL_H_ |
OLD | NEW |