Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: mojo/services/html_viewer/blink_platform_impl.h

Issue 827223002: [mojo] Make HTML viewer load the blink resources from the generated pak file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/webmimeregistry_impl.h" 13 #include "mojo/services/html_viewer/webmimeregistry_impl.h"
14 #include "mojo/services/html_viewer/webthemeengine_impl.h" 14 #include "mojo/services/html_viewer/webthemeengine_impl.h"
15 #include "third_party/WebKit/public/platform/Platform.h" 15 #include "third_party/WebKit/public/platform/Platform.h"
16 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" 16 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h"
17 #include "ui/base/resource/data_pack.h"
17 18
18 namespace html_viewer { 19 namespace html_viewer {
19 20
20 class BlinkPlatformImpl : public blink::Platform { 21 class BlinkPlatformImpl : public blink::Platform {
21 public: 22 public:
22 explicit BlinkPlatformImpl(); 23 explicit BlinkPlatformImpl();
23 virtual ~BlinkPlatformImpl(); 24 virtual ~BlinkPlatformImpl();
24 25
25 // blink::Platform methods: 26 // blink::Platform methods:
26 virtual blink::WebMimeRegistry* mimeRegistry(); 27 virtual blink::WebMimeRegistry* mimeRegistry();
(...skipping 18 matching lines...) Expand all
45 virtual blink::WebURLError cancelledError(const blink::WebURL& url) const; 46 virtual blink::WebURLError cancelledError(const blink::WebURL& url) const;
46 virtual blink::WebThread* createThread(const char* name); 47 virtual blink::WebThread* createThread(const char* name);
47 virtual blink::WebThread* currentThread(); 48 virtual blink::WebThread* currentThread();
48 virtual void yieldCurrentThread(); 49 virtual void yieldCurrentThread();
49 virtual blink::WebWaitableEvent* createWaitableEvent(); 50 virtual blink::WebWaitableEvent* createWaitableEvent();
50 virtual blink::WebWaitableEvent* waitMultipleEvents( 51 virtual blink::WebWaitableEvent* waitMultipleEvents(
51 const blink::WebVector<blink::WebWaitableEvent*>& events); 52 const blink::WebVector<blink::WebWaitableEvent*>& events);
52 virtual blink::WebScrollbarBehavior* scrollbarBehavior(); 53 virtual blink::WebScrollbarBehavior* scrollbarBehavior();
53 virtual const unsigned char* getTraceCategoryEnabledFlag( 54 virtual const unsigned char* getTraceCategoryEnabledFlag(
54 const char* category_name); 55 const char* category_name);
56 virtual blink::WebData loadResource(const char* name) override;
darin (slow to review) 2015/01/10 05:12:19 nit: when overriding methods from the blink public
55 57
56 private: 58 private:
57 void SuspendSharedTimer(); 59 void SuspendSharedTimer();
58 void ResumeSharedTimer(); 60 void ResumeSharedTimer();
59 61
60 void DoTimeout() { 62 void DoTimeout() {
61 if (shared_timer_func_ && !shared_timer_suspended_) 63 if (shared_timer_func_ && !shared_timer_suspended_)
62 shared_timer_func_(); 64 shared_timer_func_();
63 } 65 }
64 66
65 static void DestroyCurrentThread(void*); 67 static void DestroyCurrentThread(void*);
66 68
67 base::MessageLoop* main_loop_; 69 base::MessageLoop* main_loop_;
68 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; 70 base::OneShotTimer<BlinkPlatformImpl> shared_timer_;
69 void (*shared_timer_func_)(); 71 void (*shared_timer_func_)();
70 double shared_timer_fire_time_; 72 double shared_timer_fire_time_;
71 bool shared_timer_fire_time_was_set_while_suspended_; 73 bool shared_timer_fire_time_was_set_while_suspended_;
72 int shared_timer_suspended_; // counter 74 int shared_timer_suspended_; // counter
73 base::ThreadLocalStorage::Slot current_thread_slot_; 75 base::ThreadLocalStorage::Slot current_thread_slot_;
74 cc_blink::WebCompositorSupportImpl compositor_support_; 76 cc_blink::WebCompositorSupportImpl compositor_support_;
75 WebThemeEngineImpl theme_engine_; 77 WebThemeEngineImpl theme_engine_;
76 WebMimeRegistryImpl mime_registry_; 78 WebMimeRegistryImpl mime_registry_;
77 blink::WebScrollbarBehavior scrollbar_behavior_; 79 blink::WebScrollbarBehavior scrollbar_behavior_;
80 ui::DataPack data_pack_;
78 81
79 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); 82 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl);
80 }; 83 };
81 84
82 } // namespace html_viewer 85 } // namespace html_viewer
83 86
84 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ 87 #endif // MOJO_SERVICES_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698