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

Side by Side Diff: ash/mus/window_manager_application.cc

Issue 2194003002: services/ui: Have an explicit lifetime/ownership of ui::GpuService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot merge Created 4 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 | « ash/mus/window_manager_application.h ('k') | content/renderer/render_thread_impl.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "ash/mus/window_manager_application.h" 5 #include "ash/mus/window_manager_application.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/mus/accelerators/accelerator_registrar_impl.h" 10 #include "ash/mus/accelerators/accelerator_registrar_impl.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy 71 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy
72 // it early on. 72 // it early on.
73 std::set<AcceleratorRegistrarImpl*> accelerator_registrars( 73 std::set<AcceleratorRegistrarImpl*> accelerator_registrars(
74 accelerator_registrars_); 74 accelerator_registrars_);
75 for (AcceleratorRegistrarImpl* registrar : accelerator_registrars) 75 for (AcceleratorRegistrarImpl* registrar : accelerator_registrars)
76 registrar->Destroy(); 76 registrar->Destroy();
77 77
78 // Destroy the WindowManager while still valid. This way we ensure 78 // Destroy the WindowManager while still valid. This way we ensure
79 // OnWillDestroyRootWindowController() is called (if it hasn't been already). 79 // OnWillDestroyRootWindowController() is called (if it hasn't been already).
80 window_manager_.reset(); 80 window_manager_.reset();
81 81 gpu_service_.reset();
82 ShutdownComponents(); 82 ShutdownComponents();
83 } 83 }
84 84
85 void WindowManagerApplication::OnAcceleratorRegistrarDestroyed( 85 void WindowManagerApplication::OnAcceleratorRegistrarDestroyed(
86 AcceleratorRegistrarImpl* registrar) { 86 AcceleratorRegistrarImpl* registrar) {
87 accelerator_registrars_.erase(registrar); 87 accelerator_registrars_.erase(registrar);
88 } 88 }
89 89
90 void WindowManagerApplication::InitWindowManager( 90 void WindowManagerApplication::InitWindowManager(
91 ui::WindowTreeClient* window_tree_client) { 91 ui::WindowTreeClient* window_tree_client) {
92 InitializeComponents(); 92 InitializeComponents();
93 93
94 window_manager_->Init(window_tree_client); 94 window_manager_->Init(window_tree_client);
95 window_manager_->AddObserver(this); 95 window_manager_->AddObserver(this);
96 } 96 }
97 97
98 void WindowManagerApplication::OnStart(const shell::Identity& identity) { 98 void WindowManagerApplication::OnStart(const shell::Identity& identity) {
99 ui::GpuService::Initialize(connector()); 99 gpu_service_ = ui::GpuService::Initialize(connector());
100 window_manager_.reset(new WindowManager(connector())); 100 window_manager_.reset(new WindowManager(connector()));
101 101
102 aura_init_.reset(new views::AuraInit(connector(), "ash_mus_resources.pak")); 102 aura_init_.reset(new views::AuraInit(connector(), "ash_mus_resources.pak"));
103 MaterialDesignController::Initialize(); 103 MaterialDesignController::Initialize();
104 104
105 tracing_.Initialize(connector(), identity.name()); 105 tracing_.Initialize(connector(), identity.name());
106 106
107 ui::WindowTreeClient* window_tree_client = new ui::WindowTreeClient( 107 ui::WindowTreeClient* window_tree_client = new ui::WindowTreeClient(
108 window_manager_.get(), window_manager_.get(), nullptr); 108 window_manager_.get(), window_manager_.get(), nullptr);
109 window_tree_client->ConnectAsWindowManager(connector()); 109 window_tree_client->ConnectAsWindowManager(connector());
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 RootWindowController* controller) { 198 RootWindowController* controller) {
199 // TODO(msw): this isn't right, ownership should belong in WindowManager 199 // TODO(msw): this isn't right, ownership should belong in WindowManager
200 // and/or RootWindowController. But this is temporary until we get rid of 200 // and/or RootWindowController. But this is temporary until we get rid of
201 // sysui. 201 // sysui.
202 shelf_layout_.reset(); 202 shelf_layout_.reset();
203 user_window_controller_.reset(); 203 user_window_controller_.reset();
204 } 204 }
205 205
206 } // namespace mus 206 } // namespace mus
207 } // namespace ash 207 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/window_manager_application.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698