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

Unified Diff: chrome/test/base/view_event_test_platform_part_default.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
Index: chrome/test/base/view_event_test_platform_part_default.cc
diff --git a/chrome/test/base/view_event_test_platform_part_default.cc b/chrome/test/base/view_event_test_platform_part_default.cc
index 8a3de63a9f4fa8cf1565b08acc24b39ebf826d70..5832e11932ad6402618adb4e73836ad630cd7737 100644
--- a/chrome/test/base/view_event_test_platform_part_default.cc
+++ b/chrome/test/base/view_event_test_platform_part_default.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/macros.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/test/base/view_event_test_platform_part.h"
@@ -19,14 +21,14 @@ class ViewEventTestPlatformPartDefault : public ViewEventTestPlatformPart {
#if defined(USE_AURA)
screen_.reset(views::CreateDesktopScreen());
gfx::Screen::SetScreenInstance(screen_.get());
- aura::Env::CreateInstance(true);
- aura::Env::GetInstance()->set_context_factory(context_factory);
+ env_ = aura::Env::CreateInstance();
+ env_->set_context_factory(context_factory);
#endif
}
~ViewEventTestPlatformPartDefault() override {
#if defined(USE_AURA)
- aura::Env::DeleteInstance();
+ env_.reset();
gfx::Screen::SetScreenInstance(nullptr);
#endif
}
@@ -35,7 +37,8 @@ class ViewEventTestPlatformPartDefault : public ViewEventTestPlatformPart {
gfx::NativeWindow GetContext() override { return NULL; }
private:
- scoped_ptr<gfx::Screen> screen_;
+ std::unique_ptr<gfx::Screen> screen_;
+ std::unique_ptr<aura::Env> env_;
DISALLOW_COPY_AND_ASSIGN(ViewEventTestPlatformPartDefault);
};
« no previous file with comments | « chrome/test/base/view_event_test_platform_part_chromeos.cc ('k') | chromecast/browser/cast_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698