| 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 "cc/blink/web_compositor_support_impl.h" |
| 13 #include "mojo/services/html_viewer/blink_resource_map.h" | 13 #include "mojo/services/html_viewer/blink_resource_map.h" |
| 14 #include "mojo/services/html_viewer/webmimeregistry_impl.h" | 14 #include "mojo/services/html_viewer/webmimeregistry_impl.h" |
| 15 #include "mojo/services/html_viewer/webscheduler_impl.h" | 15 #include "mojo/services/html_viewer/webscheduler_impl.h" |
| 16 #include "mojo/services/html_viewer/webthemeengine_impl.h" | 16 #include "mojo/services/html_viewer/webthemeengine_impl.h" |
| 17 #include "third_party/WebKit/public/platform/Platform.h" | 17 #include "third_party/WebKit/public/platform/Platform.h" |
| 18 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" | 18 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" |
| 19 | 19 |
| 20 namespace html_viewer { | 20 namespace html_viewer { |
| 21 | 21 |
| 22 class BlinkPlatformImpl : public blink::Platform { | 22 class BlinkPlatformImpl : public blink::Platform { |
| 23 public: | 23 public: |
| 24 explicit BlinkPlatformImpl(); | 24 explicit BlinkPlatformImpl(); |
| 25 virtual ~BlinkPlatformImpl(); | 25 ~BlinkPlatformImpl() override; |
| 26 | 26 |
| 27 // blink::Platform methods: | 27 // blink::Platform methods: |
| 28 virtual blink::WebMimeRegistry* mimeRegistry(); | 28 blink::WebMimeRegistry* mimeRegistry() override; |
| 29 virtual blink::WebThemeEngine* themeEngine(); | 29 blink::WebThemeEngine* themeEngine() override; |
| 30 virtual blink::WebScheduler* scheduler(); | 30 blink::WebScheduler* scheduler() override; |
| 31 virtual blink::WebString defaultLocale(); | 31 blink::WebString defaultLocale() override; |
| 32 virtual double currentTime(); | 32 double currentTime() override; |
| 33 virtual double monotonicallyIncreasingTime(); | 33 double monotonicallyIncreasingTime() override; |
| 34 virtual void cryptographicallyRandomValues( | 34 void cryptographicallyRandomValues(unsigned char* buffer, |
| 35 unsigned char* buffer, size_t length); | 35 size_t length) override; |
| 36 virtual void setSharedTimerFiredFunction(void (*func)()); | 36 void setSharedTimerFiredFunction(void (*func)()) override; |
| 37 virtual void setSharedTimerFireInterval(double interval_seconds); | 37 void setSharedTimerFireInterval(double interval_seconds) override; |
| 38 virtual void stopSharedTimer(); | 38 void stopSharedTimer() override; |
| 39 virtual void callOnMainThread(void (*func)(void*), void* context); | 39 virtual void callOnMainThread(void (*func)(void*), void* context); |
| 40 virtual bool isThreadedCompositingEnabled(); | 40 bool isThreadedCompositingEnabled() override; |
| 41 virtual blink::WebCompositorSupport* compositorSupport(); | 41 blink::WebCompositorSupport* compositorSupport() override; |
| 42 virtual blink::WebURLLoader* createURLLoader(); | 42 blink::WebURLLoader* createURLLoader() override; |
| 43 virtual blink::WebSocketHandle* createWebSocketHandle(); | 43 blink::WebSocketHandle* createWebSocketHandle() override; |
| 44 virtual blink::WebString userAgent(); | 44 blink::WebString userAgent() override; |
| 45 virtual blink::WebData parseDataURL( | 45 blink::WebData parseDataURL( |
| 46 const blink::WebURL& url, blink::WebString& mime_type, | 46 const blink::WebURL& url, blink::WebString& mime_type, |
| 47 blink::WebString& charset); | 47 blink::WebString& charset) override; |
| 48 virtual blink::WebURLError cancelledError(const blink::WebURL& url) const; | 48 bool isReservedIPAddress(const blink::WebString& host) const override; |
| 49 virtual bool isReservedIPAddress(const blink::WebString& host) const; | 49 blink::WebURLError cancelledError(const blink::WebURL& url) const override; |
| 50 virtual blink::WebThread* createThread(const char* name); | 50 blink::WebThread* createThread(const char* name) override; |
| 51 virtual blink::WebThread* currentThread(); | 51 blink::WebThread* currentThread() override; |
| 52 virtual void yieldCurrentThread(); | 52 void yieldCurrentThread() override; |
| 53 virtual blink::WebWaitableEvent* createWaitableEvent(); | 53 blink::WebWaitableEvent* createWaitableEvent() override; |
| 54 virtual blink::WebWaitableEvent* waitMultipleEvents( | 54 blink::WebWaitableEvent* waitMultipleEvents( |
| 55 const blink::WebVector<blink::WebWaitableEvent*>& events); | 55 const blink::WebVector<blink::WebWaitableEvent*>& events) override; |
| 56 virtual blink::WebScrollbarBehavior* scrollbarBehavior(); | 56 blink::WebScrollbarBehavior* scrollbarBehavior() override; |
| 57 virtual const unsigned char* getTraceCategoryEnabledFlag( | 57 const unsigned char* getTraceCategoryEnabledFlag( |
| 58 const char* category_name); | 58 const char* category_name) override; |
| 59 virtual blink::WebData loadResource(const char* name); | 59 blink::WebData loadResource(const char* name) override; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 void SuspendSharedTimer(); | 62 void SuspendSharedTimer(); |
| 63 void ResumeSharedTimer(); | 63 void ResumeSharedTimer(); |
| 64 | 64 |
| 65 void DoTimeout() { | 65 void DoTimeout() { |
| 66 if (shared_timer_func_ && !shared_timer_suspended_) | 66 if (shared_timer_func_ && !shared_timer_suspended_) |
| 67 shared_timer_func_(); | 67 shared_timer_func_(); |
| 68 } | 68 } |
| 69 | 69 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 82 WebSchedulerImpl scheduler_; | 82 WebSchedulerImpl scheduler_; |
| 83 blink::WebScrollbarBehavior scrollbar_behavior_; | 83 blink::WebScrollbarBehavior scrollbar_behavior_; |
| 84 BlinkResourceMap blink_resource_map_; | 84 BlinkResourceMap blink_resource_map_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); | 86 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace html_viewer | 89 } // namespace html_viewer |
| 90 | 90 |
| 91 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ | 91 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |