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

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: Fixed moar feedback from kylechar/fwang 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // must set this parameter in order for the Ozone platform implementation to 65 // must set this parameter in order for the Ozone platform implementation to
65 // be able to use Mojo. 66 // be able to use Mojo.
66 service_manager::Connector* connector = nullptr; 67 service_manager::Connector* connector = nullptr;
67 68
68 // Setting this to true indicates that the platform implementation should 69 // Setting this to true indicates that the platform implementation should
69 // operate as a single process for platforms (i.e. drm) that are usually 70 // operate as a single process for platforms (i.e. drm) that are usually
70 // split between a main and gpu specific portion. 71 // split between a main and gpu specific portion.
71 bool single_process = false; 72 bool single_process = false;
72 }; 73 };
73 74
75 static void CreateInstance();
sadrul 2017/02/08 01:49:26 Why this change?
tonikitoo 2017/02/08 02:42:34 It creates the OzonePlatform instance without doin
76
74 // Initializes the subsystems/resources necessary for the UI process (e.g. 77 // Initializes the subsystems/resources necessary for the UI process (e.g.
75 // events, etc.) 78 // events, etc.)
76 // TODO(rjkroege): Remove deprecated entry point (http://crbug.com/620934) 79 // TODO(rjkroege): Remove deprecated entry point (http://crbug.com/620934)
77 static void InitializeForUI(); 80 static void InitializeForUI();
78 81
79 // Initializes the subsystems/resources necessary for the UI process (e.g. 82 // Initializes the subsystems/resources necessary for the UI process (e.g.
80 // events) with additional properties to customize the ozone platform 83 // events) with additional properties to customize the ozone platform
81 // implementation. Ozone will not retain InitParams after returning from 84 // implementation. Ozone will not retain InitParams after returning from
82 // InitalizeForUI. 85 // InitalizeForUI.
83 static void InitializeForUI(const InitParams& args); 86 static void InitializeForUI(const InitParams& args);
(...skipping 17 matching lines...) Expand all
101 virtual ui::InputController* GetInputController() = 0; 104 virtual ui::InputController* GetInputController() = 0;
102 virtual IPC::MessageFilter* GetGpuMessageFilter(); 105 virtual IPC::MessageFilter* GetGpuMessageFilter();
103 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0; 106 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0;
104 virtual std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() = 0; 107 virtual std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() = 0;
105 virtual std::unique_ptr<PlatformWindow> CreatePlatformWindow( 108 virtual std::unique_ptr<PlatformWindow> CreatePlatformWindow(
106 PlatformWindowDelegate* delegate, 109 PlatformWindowDelegate* delegate,
107 const gfx::Rect& bounds) = 0; 110 const gfx::Rect& bounds) = 0;
108 virtual std::unique_ptr<display::NativeDisplayDelegate> 111 virtual std::unique_ptr<display::NativeDisplayDelegate>
109 CreateNativeDisplayDelegate() = 0; 112 CreateNativeDisplayDelegate() = 0;
110 113
114 // Returns the message loop type required for OzonePlatform instance that
115 // will be initialized.
116 virtual base::MessageLoop::Type GetMessageLoopTypeForGpu();
sadrul 2017/02/08 01:49:26 Mention in the comment that this is for the gpu pr
tonikitoo 2017/02/08 02:42:34 Done.
117
111 // Ozone platform implementations may also choose to expose mojo interfaces to 118 // Ozone platform implementations may also choose to expose mojo interfaces to
112 // internal functionality. Embedders wishing to take advantage of ozone mojo 119 // internal functionality. Embedders wishing to take advantage of ozone mojo
113 // implementations must invoke AddInterfaces with a valid 120 // implementations must invoke AddInterfaces with a valid
114 // service_manager::InterfaceRegistry* pointer to export all Mojo interfaces 121 // service_manager::InterfaceRegistry* pointer to export all Mojo interfaces
115 // defined within Ozone. 122 // defined within Ozone.
116 // 123 //
117 // A default do-nothing implementation is provided to permit platform 124 // A default do-nothing implementation is provided to permit platform
118 // implementations to opt out of implementing any Mojo interfaces. 125 // implementations to opt out of implementing any Mojo interfaces.
119 virtual void AddInterfaces(service_manager::InterfaceRegistry* registry); 126 virtual void AddInterfaces(service_manager::InterfaceRegistry* registry);
120 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