| 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 MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 5 #ifndef MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
| 6 #define MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 6 #define MOJO_SERVICES_HTML_VIEWER_BLINK_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" |
| 11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 12 #include "cc/blink/web_compositor_support_impl.h" |
| 12 #include "mojo/services/html_viewer/webmimeregistry_impl.h" | 13 #include "mojo/services/html_viewer/webmimeregistry_impl.h" |
| 13 #include "mojo/services/html_viewer/webthemeengine_impl.h" | 14 #include "mojo/services/html_viewer/webthemeengine_impl.h" |
| 14 #include "mojo/services/public/interfaces/network/network_service.mojom.h" | 15 #include "mojo/services/public/interfaces/network/network_service.mojom.h" |
| 15 #include "third_party/WebKit/public/platform/Platform.h" | 16 #include "third_party/WebKit/public/platform/Platform.h" |
| 16 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" | 17 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" |
| 17 | 18 |
| 18 namespace mojo { | 19 namespace mojo { |
| 19 class ApplicationImpl; | 20 class ApplicationImpl; |
| 20 class WebCookieJarImpl; | 21 class WebCookieJarImpl; |
| 21 | 22 |
| 22 class BlinkPlatformImpl : public blink::Platform { | 23 class BlinkPlatformImpl : public blink::Platform { |
| 23 public: | 24 public: |
| 24 explicit BlinkPlatformImpl(ApplicationImpl* app); | 25 explicit BlinkPlatformImpl(ApplicationImpl* app); |
| 25 virtual ~BlinkPlatformImpl(); | 26 virtual ~BlinkPlatformImpl(); |
| 26 | 27 |
| 27 // blink::Platform methods: | 28 // blink::Platform methods: |
| 28 virtual blink::WebCookieJar* cookieJar(); | 29 virtual blink::WebCookieJar* cookieJar(); |
| 29 virtual blink::WebMimeRegistry* mimeRegistry(); | 30 virtual blink::WebMimeRegistry* mimeRegistry(); |
| 30 virtual blink::WebThemeEngine* themeEngine(); | 31 virtual blink::WebThemeEngine* themeEngine(); |
| 31 virtual blink::WebString defaultLocale(); | 32 virtual blink::WebString defaultLocale(); |
| 32 virtual double currentTime(); | 33 virtual double currentTime(); |
| 33 virtual double monotonicallyIncreasingTime(); | 34 virtual double monotonicallyIncreasingTime(); |
| 34 virtual void cryptographicallyRandomValues( | 35 virtual void cryptographicallyRandomValues( |
| 35 unsigned char* buffer, size_t length); | 36 unsigned char* buffer, size_t length); |
| 36 virtual void setSharedTimerFiredFunction(void (*func)()); | 37 virtual void setSharedTimerFiredFunction(void (*func)()); |
| 37 virtual void setSharedTimerFireInterval(double interval_seconds); | 38 virtual void setSharedTimerFireInterval(double interval_seconds); |
| 38 virtual void stopSharedTimer(); | 39 virtual void stopSharedTimer(); |
| 39 virtual void callOnMainThread(void (*func)(void*), void* context); | 40 virtual void callOnMainThread(void (*func)(void*), void* context); |
| 41 virtual bool isThreadedCompositingEnabled(); |
| 42 virtual blink::WebCompositorSupport* compositorSupport(); |
| 40 virtual blink::WebURLLoader* createURLLoader(); | 43 virtual blink::WebURLLoader* createURLLoader(); |
| 41 virtual blink::WebSocketHandle* createWebSocketHandle(); | 44 virtual blink::WebSocketHandle* createWebSocketHandle(); |
| 42 virtual blink::WebString userAgent(); | 45 virtual blink::WebString userAgent(); |
| 43 virtual blink::WebData parseDataURL( | 46 virtual blink::WebData parseDataURL( |
| 44 const blink::WebURL& url, blink::WebString& mime_type, | 47 const blink::WebURL& url, blink::WebString& mime_type, |
| 45 blink::WebString& charset); | 48 blink::WebString& charset); |
| 46 virtual blink::WebURLError cancelledError(const blink::WebURL& url) const; | 49 virtual blink::WebURLError cancelledError(const blink::WebURL& url) const; |
| 47 virtual blink::WebThread* createThread(const char* name); | 50 virtual blink::WebThread* createThread(const char* name); |
| 48 virtual blink::WebThread* currentThread(); | 51 virtual blink::WebThread* currentThread(); |
| 49 virtual blink::WebWaitableEvent* createWaitableEvent(); | 52 virtual blink::WebWaitableEvent* createWaitableEvent(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 static void DestroyCurrentThread(void*); | 68 static void DestroyCurrentThread(void*); |
| 66 | 69 |
| 67 NetworkServicePtr network_service_; | 70 NetworkServicePtr network_service_; |
| 68 base::MessageLoop* main_loop_; | 71 base::MessageLoop* main_loop_; |
| 69 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; | 72 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; |
| 70 void (*shared_timer_func_)(); | 73 void (*shared_timer_func_)(); |
| 71 double shared_timer_fire_time_; | 74 double shared_timer_fire_time_; |
| 72 bool shared_timer_fire_time_was_set_while_suspended_; | 75 bool shared_timer_fire_time_was_set_while_suspended_; |
| 73 int shared_timer_suspended_; // counter | 76 int shared_timer_suspended_; // counter |
| 74 base::ThreadLocalStorage::Slot current_thread_slot_; | 77 base::ThreadLocalStorage::Slot current_thread_slot_; |
| 78 cc_blink::WebCompositorSupportImpl compositor_support_; |
| 75 WebThemeEngineImpl theme_engine_; | 79 WebThemeEngineImpl theme_engine_; |
| 76 scoped_ptr<WebCookieJarImpl> cookie_jar_; | 80 scoped_ptr<WebCookieJarImpl> cookie_jar_; |
| 77 WebMimeRegistryImpl mime_registry_; | 81 WebMimeRegistryImpl mime_registry_; |
| 78 blink::WebScrollbarBehavior scrollbar_behavior_; | 82 blink::WebScrollbarBehavior scrollbar_behavior_; |
| 79 | 83 |
| 80 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); | 84 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); |
| 81 }; | 85 }; |
| 82 | 86 |
| 83 } // namespace mojo | 87 } // namespace mojo |
| 84 | 88 |
| 85 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 89 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |