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

Side by Side Diff: ash/shell.cc

Issue 2892983002: Destroy NightLightController before PrefService (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 778
779 PowerStatus::Shutdown(); 779 PowerStatus::Shutdown();
780 780
781 // Ensure that DBusThreadManager outlives this Shell. 781 // Ensure that DBusThreadManager outlives this Shell.
782 DCHECK(chromeos::DBusThreadManager::IsInitialized()); 782 DCHECK(chromeos::DBusThreadManager::IsInitialized());
783 783
784 // Needs to happen right before |instance_| is reset. 784 // Needs to happen right before |instance_| is reset.
785 shell_port_.reset(); 785 shell_port_.reset();
786 session_controller_->RemoveObserver(this); 786 session_controller_->RemoveObserver(this);
787 wallpaper_delegate_.reset(); 787 wallpaper_delegate_.reset();
788 // NightLightController depeneds on the PrefService and must be destructed
789 // before it. crbug.com/724231.
790 night_light_controller_ = nullptr;
788 pref_service_ = nullptr; 791 pref_service_ = nullptr;
789 shell_delegate_.reset(); 792 shell_delegate_.reset();
790 793
791 DCHECK(instance_ == this); 794 DCHECK(instance_ == this);
792 instance_ = nullptr; 795 instance_ = nullptr;
793 } 796 }
794 797
795 void Shell::Init(const ShellInitParams& init_params) { 798 void Shell::Init(const ShellInitParams& init_params) {
796 const Config config = shell_port_->GetAshConfig(); 799 const Config config = shell_port_->GetAshConfig();
797 800
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 void Shell::OnPrefServiceInitialized( 1278 void Shell::OnPrefServiceInitialized(
1276 std::unique_ptr<::PrefService> pref_service) { 1279 std::unique_ptr<::PrefService> pref_service) {
1277 if (!instance_) 1280 if (!instance_)
1278 return; 1281 return;
1279 // |pref_service_| is null if can't connect to Chrome (as happens when 1282 // |pref_service_| is null if can't connect to Chrome (as happens when
1280 // running mash outside of chrome --mash and chrome isn't built). 1283 // running mash outside of chrome --mash and chrome isn't built).
1281 pref_service_ = std::move(pref_service); 1284 pref_service_ = std::move(pref_service);
1282 } 1285 }
1283 1286
1284 } // namespace ash 1287 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698