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

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2706403004: mus: Makes ~WindowTreeClient reset context factory (Closed)
Patch Set: Created 3 years, 10 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 | « ui/aura/mus/window_tree_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index 08e7b028bf1b90a4a7f6d21a9458623df8459d90..0f7351c738917443789d004d657cba9e57e89b8b 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -189,6 +189,7 @@ WindowTreeClient::WindowTreeClient(
gpu_ = ui::Gpu::Create(connector, std::move(io_task_runner));
compositor_context_factory_ =
base::MakeUnique<MusContextFactory>(gpu_.get());
+ initial_context_factory_ = Env::GetInstance()->context_factory();
Env::GetInstance()->set_context_factory(compositor_context_factory_.get());
}
}
@@ -205,6 +206,12 @@ WindowTreeClient::~WindowTreeClient() {
capture_synchronizer_.reset();
client::GetTransientWindowClient()->RemoveObserver(this);
+
+ Env* env = Env::GetInstance();
+ if (compositor_context_factory_ &&
+ env->context_factory() == compositor_context_factory_.get()) {
+ env->set_context_factory(initial_context_factory_);
+ }
}
void WindowTreeClient::ConnectViaWindowTreeFactory() {
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698