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

Side by Side Diff: ui/aura/bench/bench_main.cc

Issue 1293013002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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
« no previous file with comments | « mandoline/ui/aura/aura_init.cc ('k') | ui/aura/demo/demo_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #if defined(USE_X11) 5 #if defined(USE_X11)
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 #endif 7 #endif
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 gfx::GLSurface::InitializeOneOff(); 302 gfx::GLSurface::InitializeOneOff();
303 303
304 // The ContextFactory must exist before any Compositors are created. 304 // The ContextFactory must exist before any Compositors are created.
305 bool context_factory_for_test = false; 305 bool context_factory_for_test = false;
306 scoped_ptr<ui::InProcessContextFactory> context_factory( 306 scoped_ptr<ui::InProcessContextFactory> context_factory(
307 new ui::InProcessContextFactory(context_factory_for_test, nullptr)); 307 new ui::InProcessContextFactory(context_factory_for_test, nullptr));
308 308
309 base::i18n::InitializeICU(); 309 base::i18n::InitializeICU();
310 310
311 base::MessageLoopForUI message_loop; 311 base::MessageLoopForUI message_loop;
312 aura::Env::CreateInstance(true); 312 scoped_ptr<aura::Env> env = aura::Env::CreateInstance();
313 aura::Env::GetInstance()->set_context_factory(context_factory.get()); 313 env->set_context_factory(context_factory.get());
314 scoped_ptr<aura::TestScreen> test_screen( 314 scoped_ptr<aura::TestScreen> test_screen(
315 aura::TestScreen::CreateFullscreen()); 315 aura::TestScreen::CreateFullscreen());
316 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); 316 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get());
317 scoped_ptr<aura::WindowTreeHost> host( 317 scoped_ptr<aura::WindowTreeHost> host(
318 test_screen->CreateHostForPrimaryDisplay()); 318 test_screen->CreateHostForPrimaryDisplay());
319 aura::client::SetCaptureClient( 319 aura::client::SetCaptureClient(
320 host->window(), 320 host->window(),
321 new aura::client::DefaultCaptureClient(host->window())); 321 new aura::client::DefaultCaptureClient(host->window()));
322 322
323 scoped_ptr<aura::client::FocusClient> focus_client( 323 scoped_ptr<aura::client::FocusClient> focus_client(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); 365 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100));
366 #endif 366 #endif
367 367
368 host->Show(); 368 host->Show();
369 base::MessageLoopForUI::current()->Run(); 369 base::MessageLoopForUI::current()->Run();
370 focus_client.reset(); 370 focus_client.reset();
371 host.reset(); 371 host.reset();
372 372
373 return 0; 373 return 0;
374 } 374 }
OLDNEW
« no previous file with comments | « mandoline/ui/aura/aura_init.cc ('k') | ui/aura/demo/demo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698