Skip to content

Commit

Permalink
Revert "Use OzonePlatform::InitParams everywhere."
Browse files Browse the repository at this point in the history
This reverts commit e2c8d81.

Reason for revert: It breaks video_VideoDecodeAccelerator test on all
ChromeOS platforms.
https://bugs.chromium.org/p/chromium/issues/detail?id=744263

Original change's description:
> Use OzonePlatform::InitParams everywhere.
> 
> 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}

TBR=rjkroege@chromium.org,sky@chromium.org,kylechar@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 620934, 700142
Change-Id: I30b11889c9b42ff85e2748d6f0839d3a8de8a7ad
Reviewed-on: https://chromium-review.googlesource.com/575787
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
Commit-Queue: Hung-yu Wu <hywu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487381}
  • Loading branch information
Hung-yu Wu authored and Commit Bot committed Jul 18, 2017
1 parent fa42e41 commit 33b93bb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
4 changes: 1 addition & 3 deletions media/gpu/video_decode_accelerator_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1851,9 +1851,7 @@ class VDATestSuite : public base::TestSuite {
new media::VideoDecodeAcceleratorTestEnvironment()));

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

#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
Expand Down
6 changes: 1 addition & 5 deletions ui/aura/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,7 @@ 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::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);
ui::OzonePlatform::InitializeForUI();
gfx::ClientNativePixmapFactory::SetInstance(native_pixmap_factory_.get());
#endif
if (!ui::PlatformEventSource::GetInstance())
Expand Down
4 changes: 1 addition & 3 deletions ui/compositor/test/test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ void CompositorTestSuite::Initialize() {
gl::GLSurfaceTestSupport::InitializeOneOff();

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

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

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

Expand Down
6 changes: 6 additions & 0 deletions ui/ozone/public/ozone_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ 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: 5 additions & 0 deletions ui/ozone/public/ozone_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ 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 33b93bb

Please sign in to comment.