OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/histogram.h" | 8 #include "base/histogram.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "base/waitable_event.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/first_run.h" | 14 #include "chrome/browser/first_run.h" |
14 #include "chrome/browser/jankometer.h" | 15 #include "chrome/browser/jankometer.h" |
15 #include "chrome/browser/metrics_service.h" | 16 #include "chrome/browser/metrics_service.h" |
16 #include "chrome/browser/plugin_process_host.h" | 17 #include "chrome/browser/plugin_process_host.h" |
17 #include "chrome/browser/plugin_service.h" | 18 #include "chrome/browser/plugin_service.h" |
18 #include "chrome/browser/render_process_host.h" | 19 #include "chrome/browser/render_process_host.h" |
19 #include "chrome/browser/render_view_host.h" | 20 #include "chrome/browser/render_view_host.h" |
20 #include "chrome/browser/render_widget_host.h" | 21 #include "chrome/browser/render_widget_host.h" |
21 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return shutdown_ms_file; | 80 return shutdown_ms_file; |
80 } | 81 } |
81 | 82 |
82 void Shutdown() { | 83 void Shutdown() { |
83 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 84 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
84 // time to get here. If you have something that *must* happen on end session, | 85 // time to get here. If you have something that *must* happen on end session, |
85 // consider putting it in BrowserProcessImpl::EndSession. | 86 // consider putting it in BrowserProcessImpl::EndSession. |
86 DCHECK(g_browser_process); | 87 DCHECK(g_browser_process); |
87 | 88 |
88 // Notifies we are going away. | 89 // Notifies we are going away. |
89 ::SetEvent(g_browser_process->shutdown_event()); | 90 g_browser_process->shutdown_event()->Signal(); |
90 | 91 |
91 PluginService* plugin_service = PluginService::GetInstance(); | 92 PluginService* plugin_service = PluginService::GetInstance(); |
92 if (plugin_service) { | 93 if (plugin_service) { |
93 plugin_service->Shutdown(); | 94 plugin_service->Shutdown(); |
94 } | 95 } |
95 | 96 |
96 PrefService* prefs = g_browser_process->local_state(); | 97 PrefService* prefs = g_browser_process->local_state(); |
97 | 98 |
98 chrome_browser_net::SaveHostNamesForNextStartup(prefs); | 99 chrome_browser_net::SaveHostNamesForNextStartup(prefs); |
99 | 100 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 UMA_HISTOGRAM_TIMES(time_per.c_str(), | 183 UMA_HISTOGRAM_TIMES(time_per.c_str(), |
183 TimeDelta::FromMilliseconds(shutdown_ms / num_procs)); | 184 TimeDelta::FromMilliseconds(shutdown_ms / num_procs)); |
184 UMA_HISTOGRAM_COUNTS_100(L"Shutdown.renderers.total", num_procs); | 185 UMA_HISTOGRAM_COUNTS_100(L"Shutdown.renderers.total", num_procs); |
185 UMA_HISTOGRAM_COUNTS_100(L"Shutdown.renderers.slow", num_procs_slow); | 186 UMA_HISTOGRAM_COUNTS_100(L"Shutdown.renderers.slow", num_procs_slow); |
186 } | 187 } |
187 } | 188 } |
188 } | 189 } |
189 | 190 |
190 } // namespace browser_shutdown | 191 } // namespace browser_shutdown |
191 | 192 |
OLD | NEW |