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

Unified Diff: ui/aura/demo/demo_main.cc

Issue 1871253002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot.merge Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/browser/headless_browser_main_parts.cc ('k') | ui/aura/env.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/demo/demo_main.cc
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index ea86753f8b31843163c46af831adb3eb1024556f..c7be4f25b53568f4caf0482dab50b801853fcc8d 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/i18n/icu_util.h"
@@ -146,8 +148,8 @@ int DemoMain() {
base::PowerMonitor power_monitor(make_scoped_ptr(
new base::PowerMonitorDeviceSource));
- aura::Env::CreateInstance(true);
- aura::Env::GetInstance()->set_context_factory(context_factory.get());
+ std::unique_ptr<aura::Env> env = aura::Env::CreateInstance();
+ env->set_context_factory(context_factory.get());
scoped_ptr<aura::TestScreen> test_screen(
aura::TestScreen::Create(gfx::Size()));
gfx::Screen::SetScreenInstance(test_screen.get());
« no previous file with comments | « headless/lib/browser/headless_browser_main_parts.cc ('k') | ui/aura/env.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698