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

Side by Side Diff: ui/ozone/public/ozone_platform.h

Issue 2629983002: Fix the MessageLoop type in case more than one ozone platform is built (Closed)
Patch Set: addressed moar sadrul/kylechar's feedback Created 3 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 UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ 5 #ifndef UI_OZONE_PUBLIC_OZONE_PLATFORM_H_
6 #define UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ 6 #define UI_OZONE_PUBLIC_OZONE_PLATFORM_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/message_loop/message_loop.h"
11 #include "ui/ozone/ozone_export.h" 12 #include "ui/ozone/ozone_export.h"
12 13
13 namespace display { 14 namespace display {
14 class NativeDisplayDelegate; 15 class NativeDisplayDelegate;
15 } 16 }
16 17
17 namespace gfx { 18 namespace gfx {
18 class Rect; 19 class Rect;
19 } 20 }
20 21
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual ui::InputController* GetInputController() = 0; 102 virtual ui::InputController* GetInputController() = 0;
102 virtual IPC::MessageFilter* GetGpuMessageFilter(); 103 virtual IPC::MessageFilter* GetGpuMessageFilter();
103 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0; 104 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0;
104 virtual std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() = 0; 105 virtual std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() = 0;
105 virtual std::unique_ptr<PlatformWindow> CreatePlatformWindow( 106 virtual std::unique_ptr<PlatformWindow> CreatePlatformWindow(
106 PlatformWindowDelegate* delegate, 107 PlatformWindowDelegate* delegate,
107 const gfx::Rect& bounds) = 0; 108 const gfx::Rect& bounds) = 0;
108 virtual std::unique_ptr<display::NativeDisplayDelegate> 109 virtual std::unique_ptr<display::NativeDisplayDelegate>
109 CreateNativeDisplayDelegate() = 0; 110 CreateNativeDisplayDelegate() = 0;
110 111
112 // Returns the message loop type required for OzonePlatform instance that
113 // will be initialized.
114 virtual base::MessageLoop::Type GetMessageLoopTypeForGpu();
115
111 // Ozone platform implementations may also choose to expose mojo interfaces to 116 // Ozone platform implementations may also choose to expose mojo interfaces to
112 // internal functionality. Embedders wishing to take advantage of ozone mojo 117 // internal functionality. Embedders wishing to take advantage of ozone mojo
113 // implementations must invoke AddInterfaces with a valid 118 // implementations must invoke AddInterfaces with a valid
114 // service_manager::InterfaceRegistry* pointer to export all Mojo interfaces 119 // service_manager::InterfaceRegistry* pointer to export all Mojo interfaces
115 // defined within Ozone. 120 // defined within Ozone.
116 // 121 //
117 // A default do-nothing implementation is provided to permit platform 122 // A default do-nothing implementation is provided to permit platform
118 // implementations to opt out of implementing any Mojo interfaces. 123 // implementations to opt out of implementing any Mojo interfaces.
119 virtual void AddInterfaces(service_manager::InterfaceRegistry* registry); 124 virtual void AddInterfaces(service_manager::InterfaceRegistry* registry);
120 125
126 static void CreateInstance();
kylechar 2017/02/07 17:41:47 Please put this with the static functions, above "
tonikitoo 2017/02/07 19:36:41 Done.
127
121 private: 128 private:
122 virtual void InitializeUI() = 0; 129 virtual void InitializeUI() = 0;
123 virtual void InitializeGPU() = 0; 130 virtual void InitializeGPU() = 0;
124 virtual void InitializeUI(const InitParams& args); 131 virtual void InitializeUI(const InitParams& args);
125 virtual void InitializeGPU(const InitParams& args); 132 virtual void InitializeGPU(const InitParams& args);
126 133
127 static void CreateInstance();
128
129 static OzonePlatform* instance_; 134 static OzonePlatform* instance_;
130 135
131 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); 136 DISALLOW_COPY_AND_ASSIGN(OzonePlatform);
132 }; 137 };
133 138
134 } // namespace ui 139 } // namespace ui
135 140
136 #endif // UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ 141 #endif // UI_OZONE_PUBLIC_OZONE_PLATFORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698