aura: Require explicit ownership of the Env instance.
Notable changes:
. Change aura::Env::CreateInstance() to return a std::unique_ptr<> to the aura::Env
instance, so that there's a clear owner of the instance, and random code can no
longer destroy it.
. Make aura::Env::CreateInstance() fail if more than one instance is attempted to be
created.
. Remove the boolean parameter to aura::Env::CreateInstance(), since that is no longer
necessary, and always create a PlatformEventSource instance (if one hasn't already
been created).
. BrowserMainLoop takes care of creating/destroying the aura::Env instance. So the
various BrowserMainParts implementations no longer need to do that.
BUG=601983
Review URL: https://codereview.chromium.org/1871253002
Cr-Commit-Position: refs/heads/master@{#386502}
diff --git a/ash/test/test_suite.cc b/ash/test/test_suite.cc
index c4f6c03..e323b1f3 100644
--- a/ash/test/test_suite.cc
+++ b/ash/test/test_suite.cc
@@ -72,11 +72,11 @@
rb.AddDataPackFromPath(ash_test_resources_200, ui::SCALE_FACTOR_200P);
base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
- aura::Env::CreateInstance(true);
+ env_ = aura::Env::CreateInstance();
}
void AuraShellTestSuite::Shutdown() {
- aura::Env::DeleteInstance();
+ env_.reset();
ui::ResourceBundle::CleanupSharedInstance();
#if defined(OS_WIN)
com_initializer_.reset();