OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 screensaver_controller_.reset(); | 762 screensaver_controller_.reset(); |
763 idle_action_warning_observer_.reset(); | 763 idle_action_warning_observer_.reset(); |
764 | 764 |
765 // Delete ContactManager while |g_browser_process| is still alive. | 765 // Delete ContactManager while |g_browser_process| is still alive. |
766 contact_manager_.reset(); | 766 contact_manager_.reset(); |
767 | 767 |
768 MagnificationManager::Shutdown(); | 768 MagnificationManager::Shutdown(); |
769 AccessibilityManager::Shutdown(); | 769 AccessibilityManager::Shutdown(); |
770 | 770 |
771 // Let the UserManager and WallpaperManager unregister itself as an observer | 771 // Let the UserManager and WallpaperManager unregister itself as an observer |
772 // of the CrosSettings singleton before it is destroyed. | 772 // of the CrosSettings singleton before it is destroyed. This also ensures |
| 773 // that the UserManager has no URLRequest pending (see |
| 774 // http://crbug.com/276659). |
773 UserManager::Get()->Shutdown(); | 775 UserManager::Get()->Shutdown(); |
774 WallpaperManager::Get()->Shutdown(); | 776 WallpaperManager::Get()->Shutdown(); |
775 | 777 |
776 // Let the AutomaticRebootManager unregister itself as an observer of several | 778 // Let the AutomaticRebootManager unregister itself as an observer of several |
777 // subsystems. | 779 // subsystems. |
778 g_browser_process->platform_part()->ShutdownAutomaticRebootManager(); | 780 g_browser_process->platform_part()->ShutdownAutomaticRebootManager(); |
779 | 781 |
780 // Clean up dependency on CrosSettings and stop pending data fetches. | 782 // Clean up dependency on CrosSettings and stop pending data fetches. |
781 KioskAppManager::Shutdown(); | 783 KioskAppManager::Shutdown(); |
782 | 784 |
| 785 // We first call PostMainMessageLoopRun and then destroy UserManager, because |
| 786 // Ash needs to be closed before UserManager is destroyed. Also, on some tests |
| 787 // MergeSessionThrottle::ShouldShowMergeSessionPage gets triggered during |
| 788 // PostMainMessageLoopRun, which also requires UserManager to live (see |
| 789 // http://crbug.com/243364). |
783 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 790 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
784 | 791 |
785 // Destroy the UserManager after ash has been destroyed and | |
786 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun run. The latter might | |
787 // trigger MergeSessionThrottle::ShouldShowMergeSessionPage, which requires | |
788 // the UserManager to exist. | |
789 UserManager::Destroy(); | 792 UserManager::Destroy(); |
790 } | 793 } |
791 | 794 |
792 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { | 795 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { |
793 // Destroy DBus services immediately after threads are stopped. | 796 // Destroy DBus services immediately after threads are stopped. |
794 dbus_services_.reset(); | 797 dbus_services_.reset(); |
795 | 798 |
796 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 799 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
797 | 800 |
798 // Destroy DeviceSettingsService after g_browser_process. | 801 // Destroy DeviceSettingsService after g_browser_process. |
799 DeviceSettingsService::Shutdown(); | 802 DeviceSettingsService::Shutdown(); |
800 } | 803 } |
801 | 804 |
802 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { | 805 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { |
803 default_pinned_apps_field_trial::SetupTrial(); | 806 default_pinned_apps_field_trial::SetupTrial(); |
804 } | 807 } |
805 | 808 |
806 } // namespace chromeos | 809 } // namespace chromeos |
OLD | NEW |