OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 10 matching lines...) Expand all Loading... |
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/browser_thread.h" | 24 #include "chrome/browser/browser_thread.h" |
25 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 25 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
26 #include "chrome/browser/first_run/first_run.h" | 26 #include "chrome/browser/first_run/first_run.h" |
27 #include "chrome/browser/jankometer.h" | 27 #include "chrome/browser/jankometer.h" |
28 #include "chrome/browser/metrics/metrics_service.h" | 28 #include "chrome/browser/metrics/metrics_service.h" |
29 #include "chrome/browser/plugin_process_host.h" | 29 #include "chrome/browser/plugin_process_host.h" |
30 #include "chrome/browser/prefs/pref_service.h" | 30 #include "chrome/browser/prefs/pref_service.h" |
31 #include "chrome/browser/profiles/profile_manager.h" | |
32 #include "chrome/browser/renderer_host/render_process_host.h" | 31 #include "chrome/browser/renderer_host/render_process_host.h" |
33 #include "chrome/browser/renderer_host/render_view_host.h" | 32 #include "chrome/browser/renderer_host/render_view_host.h" |
34 #include "chrome/browser/renderer_host/render_widget_host.h" | 33 #include "chrome/browser/renderer_host/render_widget_host.h" |
35 #include "chrome/browser/service/service_process_control_manager.h" | 34 #include "chrome/browser/service/service_process_control_manager.h" |
36 #include "chrome/common/chrome_paths.h" | 35 #include "chrome/common/chrome_paths.h" |
37 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/common/pref_names.h" | 37 #include "chrome/common/pref_names.h" |
39 #include "chrome/common/chrome_plugin_lib.h" | 38 #include "chrome/common/chrome_plugin_lib.h" |
40 #include "chrome/common/switch_utils.h" | 39 #include "chrome/common/switch_utils.h" |
41 #include "net/predictor_api.h" | 40 #include "net/predictor_api.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 127 |
129 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 128 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
130 // time to get here. If you have something that *must* happen on end session, | 129 // time to get here. If you have something that *must* happen on end session, |
131 // consider putting it in BrowserProcessImpl::EndSession. | 130 // consider putting it in BrowserProcessImpl::EndSession. |
132 DCHECK(g_browser_process); | 131 DCHECK(g_browser_process); |
133 | 132 |
134 // Notifies we are going away. | 133 // Notifies we are going away. |
135 g_browser_process->shutdown_event()->Signal(); | 134 g_browser_process->shutdown_event()->Signal(); |
136 | 135 |
137 PrefService* prefs = g_browser_process->local_state(); | 136 PrefService* prefs = g_browser_process->local_state(); |
138 ProfileManager* profile_manager = g_browser_process->profile_manager(); | |
139 PrefService* user_prefs = profile_manager->GetDefaultProfile()->GetPrefs(); | |
140 | 137 |
141 chrome_browser_net::SavePredictorStateForNextStartupAndTrim(user_prefs); | 138 chrome_browser_net::SavePredictorStateForNextStartupAndTrim(prefs); |
142 | 139 |
143 MetricsService* metrics = g_browser_process->metrics_service(); | 140 MetricsService* metrics = g_browser_process->metrics_service(); |
144 if (metrics) { | 141 if (metrics) { |
145 metrics->RecordCleanShutdown(); | 142 metrics->RecordCleanShutdown(); |
146 metrics->RecordCompletedSessionEnd(); | 143 metrics->RecordCompletedSessionEnd(); |
147 } | 144 } |
148 | 145 |
149 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 146 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
150 // Record the shutdown info so that we can put it into a histogram at next | 147 // Record the shutdown info so that we can put it into a histogram at next |
151 // startup. | 148 // startup. |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 327 |
331 bool ShuttingDownWithoutClosingBrowsers() { | 328 bool ShuttingDownWithoutClosingBrowsers() { |
332 #if defined(USE_X11) | 329 #if defined(USE_X11) |
333 if (GetShutdownType() == browser_shutdown::END_SESSION) | 330 if (GetShutdownType() == browser_shutdown::END_SESSION) |
334 return true; | 331 return true; |
335 #endif | 332 #endif |
336 return false; | 333 return false; |
337 } | 334 } |
338 | 335 |
339 } // namespace browser_shutdown | 336 } // namespace browser_shutdown |
OLD | NEW |