| 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 SKY_ENGINE_TESTING_PLATFORM_PLATFORM_IMPL_H_ | 5 #ifndef SKY_ENGINE_TESTING_PLATFORM_PLATFORM_IMPL_H_ |
| 6 #define SKY_ENGINE_TESTING_PLATFORM_PLATFORM_IMPL_H_ | 6 #define SKY_ENGINE_TESTING_PLATFORM_PLATFORM_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/threading/thread_local_storage.h" | 10 #include "base/threading/thread_local_storage.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 virtual double monotonicallyIncreasingTime(); | 31 virtual double monotonicallyIncreasingTime(); |
| 32 virtual void cryptographicallyRandomValues( | 32 virtual void cryptographicallyRandomValues( |
| 33 unsigned char* buffer, size_t length); | 33 unsigned char* buffer, size_t length); |
| 34 virtual void setSharedTimerFiredFunction(void (*func)()); | 34 virtual void setSharedTimerFiredFunction(void (*func)()); |
| 35 virtual void setSharedTimerFireInterval(double interval_seconds); | 35 virtual void setSharedTimerFireInterval(double interval_seconds); |
| 36 virtual void stopSharedTimer(); | 36 virtual void stopSharedTimer(); |
| 37 virtual void callOnMainThread(void (*func)(void*), void* context); | 37 virtual void callOnMainThread(void (*func)(void*), void* context); |
| 38 virtual blink::WebData parseDataURL( | 38 virtual blink::WebData parseDataURL( |
| 39 const blink::WebURL& url, blink::WebString& mime_type, | 39 const blink::WebURL& url, blink::WebString& mime_type, |
| 40 blink::WebString& charset); | 40 blink::WebString& charset); |
| 41 virtual blink::WebThread* currentThread(); | |
| 42 virtual blink::WebWaitableEvent* createWaitableEvent(); | 41 virtual blink::WebWaitableEvent* createWaitableEvent(); |
| 43 virtual blink::WebWaitableEvent* waitMultipleEvents( | 42 virtual blink::WebWaitableEvent* waitMultipleEvents( |
| 44 const blink::WebVector<blink::WebWaitableEvent*>& events); | 43 const blink::WebVector<blink::WebWaitableEvent*>& events); |
| 45 virtual blink::WebScrollbarBehavior* scrollbarBehavior(); | 44 virtual blink::WebScrollbarBehavior* scrollbarBehavior(); |
| 46 virtual const unsigned char* getTraceCategoryEnabledFlag( | 45 virtual const unsigned char* getTraceCategoryEnabledFlag( |
| 47 const char* category_name); | 46 const char* category_name); |
| 48 | 47 |
| 49 private: | 48 private: |
| 50 void SuspendSharedTimer(); | 49 void SuspendSharedTimer(); |
| 51 void ResumeSharedTimer(); | 50 void ResumeSharedTimer(); |
| 52 | 51 |
| 53 void DoTimeout() { | 52 void DoTimeout() { |
| 54 if (shared_timer_func_ && !shared_timer_suspended_) | 53 if (shared_timer_func_ && !shared_timer_suspended_) |
| 55 shared_timer_func_(); | 54 shared_timer_func_(); |
| 56 } | 55 } |
| 57 | 56 |
| 58 static void DestroyCurrentThread(void*); | |
| 59 | |
| 60 base::MessageLoop* main_loop_; | 57 base::MessageLoop* main_loop_; |
| 61 base::OneShotTimer<PlatformImpl> shared_timer_; | 58 base::OneShotTimer<PlatformImpl> shared_timer_; |
| 62 void (*shared_timer_func_)(); | 59 void (*shared_timer_func_)(); |
| 63 double shared_timer_fire_time_; | 60 double shared_timer_fire_time_; |
| 64 bool shared_timer_fire_time_was_set_while_suspended_; | 61 bool shared_timer_fire_time_was_set_while_suspended_; |
| 65 int shared_timer_suspended_; // counter | 62 int shared_timer_suspended_; // counter |
| 66 base::ThreadLocalStorage::Slot current_thread_slot_; | |
| 67 WebThemeEngineImpl theme_engine_; | 63 WebThemeEngineImpl theme_engine_; |
| 68 WebMimeRegistryImpl mime_registry_; | 64 WebMimeRegistryImpl mime_registry_; |
| 69 WebUnitTestSupportImpl unit_test_support_; | 65 WebUnitTestSupportImpl unit_test_support_; |
| 70 blink::WebScrollbarBehavior scrollbar_behavior_; | 66 blink::WebScrollbarBehavior scrollbar_behavior_; |
| 71 | 67 |
| 72 DISALLOW_COPY_AND_ASSIGN(PlatformImpl); | 68 DISALLOW_COPY_AND_ASSIGN(PlatformImpl); |
| 73 }; | 69 }; |
| 74 | 70 |
| 75 } // namespace sky | 71 } // namespace sky |
| 76 | 72 |
| 77 #endif // SKY_ENGINE_TESTING_PLATFORM_PLATFORM_IMPL_H_ | 73 #endif // SKY_ENGINE_TESTING_PLATFORM_PLATFORM_IMPL_H_ |
| OLD | NEW |