Skip to content

Commit

Permalink
Use OzonePlatform::InitParams everywhere.
Browse files Browse the repository at this point in the history
Remove the deprecated function that uses default InitParams. Add the
params in the remaining callsites and set |single_process| correctly for
tests. The only exception is in aura::Env::Init() where we don't know
if it is a test.

Bug: 620934,700142
Change-Id: I5e0d61578a423dd42eca38d21ccd1568b9ce5a8b
Reviewed-on: https://chromium-review.googlesource.com/568361
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486421}
  • Loading branch information
kylechar authored and Commit Bot committed Jul 13, 2017
1 parent 0a8ba8f commit e2c8d81
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
4 changes: 3 additions & 1 deletion media/gpu/video_decode_accelerator_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,9 @@ class VDATestSuite : public base::TestSuite {
new media::VideoDecodeAcceleratorTestEnvironment()));

#if defined(USE_OZONE)
ui::OzonePlatform::InitializeForUI();
ui::OzonePlatform::InitParams params;
params.single_process = true;
ui::OzonePlatform::InitializeForUI(params);
#endif

#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
Expand Down
6 changes: 5 additions & 1 deletion ui/aura/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ void Env::Init() {
// The ozone platform can provide its own event source. So initialize the
// platform before creating the default event source. If running inside mus
// let the mus process initialize ozone instead.
ui::OzonePlatform::InitializeForUI();
ui::OzonePlatform::InitParams params;
// TODO(kylechar): |params.single_process| should be set correctly here, but
// both tests and real code both use aura::Init::CreateInstance() identically.
params.single_process = false;
ui::OzonePlatform::InitializeForUI(params);
gfx::ClientNativePixmapFactory::SetInstance(native_pixmap_factory_.get());
#endif
if (!ui::PlatformEventSource::GetInstance())
Expand Down
4 changes: 3 additions & 1 deletion ui/compositor/test/test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ void CompositorTestSuite::Initialize() {
gl::GLSurfaceTestSupport::InitializeOneOff();

#if defined(USE_OZONE)
ui::OzonePlatform::InitializeForUI();
ui::OzonePlatform::InitParams params;
params.single_process = true;
ui::OzonePlatform::InitializeForUI(params);
#endif

gfx::RegisterPathProvider();
Expand Down
4 changes: 3 additions & 1 deletion ui/ozone/demo/ozone_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ int main(int argc, char** argv) {
base::MessageLoopForUI message_loop;
base::TaskScheduler::CreateAndStartWithDefaultParams("OzoneDemo");

ui::OzonePlatform::InitializeForUI();
ui::OzonePlatform::InitParams params;
params.single_process = true;
ui::OzonePlatform::InitializeForUI(params);
ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()
->SetCurrentLayoutByName("us");

Expand Down
6 changes: 0 additions & 6 deletions ui/ozone/public/ozone_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ OzonePlatform::~OzonePlatform() {
instance_ = NULL;
}

// static
void OzonePlatform::InitializeForUI() {
const InitParams params;
OzonePlatform::InitializeForUI(params);
}

// static
void OzonePlatform::InitializeForUI(const InitParams& args) {
EnsureInstance();
Expand Down
5 changes: 0 additions & 5 deletions ui/ozone/public/ozone_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ class OZONE_EXPORT OzonePlatform {
// platform selected at runtime, e.g. ::GetMessageLoopTypeForGpu.
static OzonePlatform* EnsureInstance();

// Initializes the subsystems/resources necessary for the UI process (e.g.
// events, etc.)
// TODO(rjkroege): Remove deprecated entry point (http://crbug.com/620934)
static void InitializeForUI();

// Initializes the subsystems/resources necessary for the UI process (e.g.
// events) with additional properties to customize the ozone platform
// implementation. Ozone will not retain InitParams after returning from
Expand Down

0 comments on commit e2c8d81

Please sign in to comment.