| 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_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/debug/stack_trace.h" |
| 12 |
| 11 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 12 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 13 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 14 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 15 #include "base/task.h" | 17 #include "base/task.h" |
| 16 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 17 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
| 18 #include "chrome/browser/automation/automation_provider_list.h" | 20 #include "chrome/browser/automation/automation_provider_list.h" |
| 19 #include "chrome/browser/background/background_mode_manager.h" | 21 #include "chrome/browser/background/background_mode_manager.h" |
| 20 #include "chrome/browser/chrome_browser_main.h" | 22 #include "chrome/browser/chrome_browser_main.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 MessageLoop::current()->PostTask( | 337 MessageLoop::current()->PostTask( |
| 336 FROM_HERE, | 338 FROM_HERE, |
| 337 NewRunnableFunction(ChromeBrowserMainPartsMac::DidEndMainMessageLoop)); | 339 NewRunnableFunction(ChromeBrowserMainPartsMac::DidEndMainMessageLoop)); |
| 338 #endif | 340 #endif |
| 339 MessageLoop::current()->Quit(); | 341 MessageLoop::current()->Quit(); |
| 340 } | 342 } |
| 341 return module_ref_count_; | 343 return module_ref_count_; |
| 342 } | 344 } |
| 343 | 345 |
| 344 void BrowserProcessImpl::EndSession() { | 346 void BrowserProcessImpl::EndSession() { |
| 347 base::debug::StackTrace().PrintBacktrace(); |
| 345 // Mark all the profiles as clean. | 348 // Mark all the profiles as clean. |
| 346 ProfileManager* pm = profile_manager(); | 349 ProfileManager* pm = profile_manager(); |
| 347 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); | 350 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); |
| 348 for (size_t i = 0; i < profiles.size(); ++i) | 351 for (size_t i = 0; i < profiles.size(); ++i) |
| 349 profiles[i]->MarkAsCleanShutdown(); | 352 profiles[i]->MarkAsCleanShutdown(); |
| 350 | 353 |
| 351 // Tell the metrics service it was cleanly shutdown. | 354 // Tell the metrics service it was cleanly shutdown. |
| 352 MetricsService* metrics = g_browser_process->metrics_service(); | 355 MetricsService* metrics = g_browser_process->metrics_service(); |
| 353 if (metrics && local_state()) { | 356 if (metrics && local_state()) { |
| 354 metrics->RecordStartOfSessionEnd(); | 357 metrics->RecordStartOfSessionEnd(); |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 } | 1162 } |
| 1160 | 1163 |
| 1161 void BrowserProcessImpl::OnAutoupdateTimer() { | 1164 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1162 if (CanAutorestartForUpdate()) { | 1165 if (CanAutorestartForUpdate()) { |
| 1163 DLOG(WARNING) << "Detected update. Restarting browser."; | 1166 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1164 RestartPersistentInstance(); | 1167 RestartPersistentInstance(); |
| 1165 } | 1168 } |
| 1166 } | 1169 } |
| 1167 | 1170 |
| 1168 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1171 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |