OLD | NEW |
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 "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/bind.h" | 10 #include "base/bind.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 #endif | 142 #endif |
143 | 143 |
144 // Shutdown the IPC channel to the service processes. | 144 // Shutdown the IPC channel to the service processes. |
145 ServiceProcessControl::GetInstance()->Disconnect(); | 145 ServiceProcessControl::GetInstance()->Disconnect(); |
146 | 146 |
147 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 147 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
148 // time to get here. If you have something that *must* happen on end session, | 148 // time to get here. If you have something that *must* happen on end session, |
149 // consider putting it in BrowserProcessImpl::EndSession. | 149 // consider putting it in BrowserProcessImpl::EndSession. |
150 PrefService* prefs = g_browser_process->local_state(); | 150 PrefService* prefs = g_browser_process->local_state(); |
151 | 151 |
152 MetricsService* metrics = g_browser_process->metrics_service(); | 152 metrics::MetricsService* metrics = g_browser_process->metrics_service(); |
153 if (metrics) | 153 if (metrics) |
154 metrics->RecordCompletedSessionEnd(); | 154 metrics->RecordCompletedSessionEnd(); |
155 | 155 |
156 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 156 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
157 // Record the shutdown info so that we can put it into a histogram at next | 157 // Record the shutdown info so that we can put it into a histogram at next |
158 // startup. | 158 // startup. |
159 prefs->SetInteger(prefs::kShutdownType, shutdown_type_); | 159 prefs->SetInteger(prefs::kShutdownType, shutdown_type_); |
160 prefs->SetInteger(prefs::kShutdownNumProcesses, shutdown_num_processes_); | 160 prefs->SetInteger(prefs::kShutdownNumProcesses, shutdown_num_processes_); |
161 prefs->SetInteger(prefs::kShutdownNumProcessesSlow, | 161 prefs->SetInteger(prefs::kShutdownNumProcessesSlow, |
162 shutdown_num_processes_slow_); | 162 shutdown_num_processes_slow_); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 327 |
328 void SetTryingToQuit(bool quitting) { | 328 void SetTryingToQuit(bool quitting) { |
329 g_trying_to_quit = quitting; | 329 g_trying_to_quit = quitting; |
330 } | 330 } |
331 | 331 |
332 bool IsTryingToQuit() { | 332 bool IsTryingToQuit() { |
333 return g_trying_to_quit; | 333 return g_trying_to_quit; |
334 } | 334 } |
335 | 335 |
336 } // namespace browser_shutdown | 336 } // namespace browser_shutdown |
OLD | NEW |