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

Side by Side Diff: components/html_viewer/blink_platform_impl.h

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ 5 #ifndef COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_
6 #define COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ 6 #define COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/threading/thread_local_storage.h" 13 #include "base/threading/thread_local_storage.h"
14 #include "base/timer/timer.h" 14 #include "base/timer/timer.h"
15 #include "cc/blink/web_compositor_support_impl.h" 15 #include "cc/blink/web_compositor_support_impl.h"
16 #include "components/html_viewer/mock_web_blob_registry_impl.h" 16 #include "components/html_viewer/mock_web_blob_registry_impl.h"
17 #include "components/html_viewer/web_mime_registry_impl.h" 17 #include "components/html_viewer/web_mime_registry_impl.h"
18 #include "components/html_viewer/web_notification_manager_impl.h" 18 #include "components/html_viewer/web_notification_manager_impl.h"
19 #include "components/html_viewer/web_theme_engine_impl.h" 19 #include "components/html_viewer/web_theme_engine_impl.h"
20 #include "components/webcrypto/webcrypto_impl.h" 20 #include "components/webcrypto/webcrypto_impl.h"
21 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" 21 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h"
22 #include "mojo/services/network/public/interfaces/web_socket_factory.mojom.h" 22 #include "mojo/services/network/public/interfaces/web_socket_factory.mojom.h"
23 #include "third_party/WebKit/public/platform/Platform.h" 23 #include "third_party/WebKit/public/platform/Platform.h"
24 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" 24 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h"
25 25
26 namespace mojo { 26 namespace mojo {
27 class ApplicationImpl; 27 class Shell;
28 } 28 }
29 29
30 namespace scheduler { 30 namespace scheduler {
31 class RendererScheduler; 31 class RendererScheduler;
32 class WebThreadImplForRendererScheduler; 32 class WebThreadImplForRendererScheduler;
33 } 33 }
34 34
35 namespace html_viewer { 35 namespace html_viewer {
36 36
37 class GlobalState; 37 class GlobalState;
38 class WebClipboardImpl; 38 class WebClipboardImpl;
39 class WebCookieJarImpl; 39 class WebCookieJarImpl;
40 40
41 class BlinkPlatformImpl : public blink::Platform { 41 class BlinkPlatformImpl : public blink::Platform {
42 public: 42 public:
43 // |app| may be null in tests. 43 // |shell| may be null in tests.
44 BlinkPlatformImpl(GlobalState* global_state, 44 BlinkPlatformImpl(GlobalState* global_state,
45 mojo::ApplicationImpl* app, 45 mojo::Shell* shell,
46 scheduler::RendererScheduler* renderer_scheduler); 46 scheduler::RendererScheduler* renderer_scheduler);
47 ~BlinkPlatformImpl() override; 47 ~BlinkPlatformImpl() override;
48 48
49 // blink::Platform methods: 49 // blink::Platform methods:
50 blink::WebCookieJar* cookieJar() override; 50 blink::WebCookieJar* cookieJar() override;
51 blink::WebClipboard* clipboard() override; 51 blink::WebClipboard* clipboard() override;
52 blink::WebMimeRegistry* mimeRegistry() override; 52 blink::WebMimeRegistry* mimeRegistry() override;
53 blink::WebThemeEngine* themeEngine() override; 53 blink::WebThemeEngine* themeEngine() override;
54 blink::WebString defaultLocale() override; 54 blink::WebString defaultLocale() override;
55 blink::WebBlobRegistry* blobRegistry() override; 55 blink::WebBlobRegistry* blobRegistry() override;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 const blink::WebSize& cumulative_scroll) override; 95 const blink::WebSize& cumulative_scroll) override;
96 blink::WebCrypto* crypto() override; 96 blink::WebCrypto* crypto() override;
97 blink::WebNotificationManager* notificationManager() override; 97 blink::WebNotificationManager* notificationManager() override;
98 98
99 private: 99 private:
100 void UpdateWebThreadTLS(blink::WebThread* thread); 100 void UpdateWebThreadTLS(blink::WebThread* thread);
101 101
102 static void DestroyCurrentThread(void*); 102 static void DestroyCurrentThread(void*);
103 103
104 GlobalState* global_state_; 104 GlobalState* global_state_;
105 mojo::ApplicationImpl* app_; 105 mojo::Shell* shell_;
106 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 106 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
107 scoped_ptr<blink::WebThread> main_thread_; 107 scoped_ptr<blink::WebThread> main_thread_;
108 base::ThreadLocalStorage::Slot current_thread_slot_; 108 base::ThreadLocalStorage::Slot current_thread_slot_;
109 cc_blink::WebCompositorSupportImpl compositor_support_; 109 cc_blink::WebCompositorSupportImpl compositor_support_;
110 WebThemeEngineImpl theme_engine_; 110 WebThemeEngineImpl theme_engine_;
111 WebMimeRegistryImpl mime_registry_; 111 WebMimeRegistryImpl mime_registry_;
112 webcrypto::WebCryptoImpl web_crypto_; 112 webcrypto::WebCryptoImpl web_crypto_;
113 WebNotificationManagerImpl web_notification_manager_; 113 WebNotificationManagerImpl web_notification_manager_;
114 blink::WebScrollbarBehavior scrollbar_behavior_; 114 blink::WebScrollbarBehavior scrollbar_behavior_;
115 mojo::WebSocketFactoryPtr web_socket_factory_; 115 mojo::WebSocketFactoryPtr web_socket_factory_;
116 mojo::URLLoaderFactoryPtr url_loader_factory_; 116 mojo::URLLoaderFactoryPtr url_loader_factory_;
117 MockWebBlobRegistryImpl blob_registry_; 117 MockWebBlobRegistryImpl blob_registry_;
118 scoped_ptr<WebCookieJarImpl> cookie_jar_; 118 scoped_ptr<WebCookieJarImpl> cookie_jar_;
119 scoped_ptr<WebClipboardImpl> clipboard_; 119 scoped_ptr<WebClipboardImpl> clipboard_;
120 120
121 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl); 121 DISALLOW_COPY_AND_ASSIGN(BlinkPlatformImpl);
122 }; 122 };
123 123
124 } // namespace html_viewer 124 } // namespace html_viewer
125 125
126 #endif // COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_ 126 #endif // COMPONENTS_HTML_VIEWER_BLINK_PLATFORM_IMPL_H_
OLDNEW
« no previous file with comments | « components/html_viewer/ax_provider_apptest.cc ('k') | components/html_viewer/blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698