OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
16 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
17 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
20 #include "base/time.h" | 20 #include "base/time.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "chrome/browser/about_flags.h" | 22 #include "chrome/browser/about_flags.h" |
23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/first_run/upgrade_util.h" | 24 #include "chrome/browser/first_run/upgrade_util.h" |
25 #include "chrome/browser/jankometer.h" | 25 #include "chrome/browser/jankometer.h" |
26 #include "chrome/browser/metrics/metrics_service.h" | 26 #include "chrome/browser/metrics/metrics_service.h" |
| 27 #include "chrome/browser/plugin_updater.h" |
27 #include "chrome/browser/prefs/pref_service.h" | 28 #include "chrome/browser/prefs/pref_service.h" |
28 #include "chrome/browser/profiles/profile_manager.h" | 29 #include "chrome/browser/profiles/profile_manager.h" |
29 #include "chrome/browser/service/service_process_control.h" | 30 #include "chrome/browser/service/service_process_control.h" |
30 #include "chrome/browser/ui/browser_list.h" | 31 #include "chrome/browser/ui/browser_list.h" |
31 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 32 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
32 #include "chrome/common/chrome_paths.h" | 33 #include "chrome/common/chrome_paths.h" |
33 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
34 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
35 #include "chrome/common/switch_utils.h" | 36 #include "chrome/common/switch_utils.h" |
36 #include "content/browser/browser_thread.h" | 37 #include "content/browser/browser_thread.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 139 |
139 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 140 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
140 // time to get here. If you have something that *must* happen on end session, | 141 // time to get here. If you have something that *must* happen on end session, |
141 // consider putting it in BrowserProcessImpl::EndSession. | 142 // consider putting it in BrowserProcessImpl::EndSession. |
142 PrefService* prefs = g_browser_process->local_state(); | 143 PrefService* prefs = g_browser_process->local_state(); |
143 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 144 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
144 PrefService* user_prefs = profile_manager->GetDefaultProfile()->GetPrefs(); | 145 PrefService* user_prefs = profile_manager->GetDefaultProfile()->GetPrefs(); |
145 | 146 |
146 chrome_browser_net::SavePredictorStateForNextStartupAndTrim(user_prefs); | 147 chrome_browser_net::SavePredictorStateForNextStartupAndTrim(user_prefs); |
147 | 148 |
| 149 PluginUpdater::GetInstance()->Shutdown(); |
| 150 |
148 MetricsService* metrics = g_browser_process->metrics_service(); | 151 MetricsService* metrics = g_browser_process->metrics_service(); |
149 if (metrics) | 152 if (metrics) |
150 metrics->RecordCompletedSessionEnd(); | 153 metrics->RecordCompletedSessionEnd(); |
151 | 154 |
152 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 155 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
153 // Record the shutdown info so that we can put it into a histogram at next | 156 // Record the shutdown info so that we can put it into a histogram at next |
154 // startup. | 157 // startup. |
155 prefs->SetInteger(prefs::kShutdownType, shutdown_type_); | 158 prefs->SetInteger(prefs::kShutdownType, shutdown_type_); |
156 prefs->SetInteger(prefs::kShutdownNumProcesses, shutdown_num_processes_); | 159 prefs->SetInteger(prefs::kShutdownNumProcesses, shutdown_num_processes_); |
157 prefs->SetInteger(prefs::kShutdownNumProcessesSlow, | 160 prefs->SetInteger(prefs::kShutdownNumProcessesSlow, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 326 |
324 bool ShuttingDownWithoutClosingBrowsers() { | 327 bool ShuttingDownWithoutClosingBrowsers() { |
325 #if defined(USE_X11) | 328 #if defined(USE_X11) |
326 if (GetShutdownType() == browser_shutdown::END_SESSION) | 329 if (GetShutdownType() == browser_shutdown::END_SESSION) |
327 return true; | 330 return true; |
328 #endif | 331 #endif |
329 return false; | 332 return false; |
330 } | 333 } |
331 | 334 |
332 } // namespace browser_shutdown | 335 } // namespace browser_shutdown |
OLD | NEW |