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_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 MetricsService* metrics = g_browser_process->metrics_service(); | 482 MetricsService* metrics = g_browser_process->metrics_service(); |
483 if (metrics && local_state()) { | 483 if (metrics && local_state()) { |
484 metrics->RecordStartOfSessionEnd(); | 484 metrics->RecordStartOfSessionEnd(); |
485 #if !defined(OS_CHROMEOS) | 485 #if !defined(OS_CHROMEOS) |
486 // MetricsService lazily writes to prefs, force it to write now. | 486 // MetricsService lazily writes to prefs, force it to write now. |
487 // On ChromeOS, chrome gets killed when hangs, so no need to | 487 // On ChromeOS, chrome gets killed when hangs, so no need to |
488 // commit metrics::prefs::kStabilitySessionEndCompleted change immediately. | 488 // commit metrics::prefs::kStabilitySessionEndCompleted change immediately. |
489 local_state()->CommitPendingWrite(); | 489 local_state()->CommitPendingWrite(); |
490 | 490 |
491 if (!use_broken_synchronization) | 491 if (!use_broken_synchronization) |
492 rundown_counter->Post(local_state_task_runner_); | 492 rundown_counter->Post(local_state_task_runner_.get()); |
493 #endif | 493 #endif |
494 } | 494 } |
495 | 495 |
496 // http://crbug.com/125207 | 496 // http://crbug.com/125207 |
497 base::ThreadRestrictions::ScopedAllowWait allow_wait; | 497 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
498 | 498 |
499 // We must write that the profile and metrics service shutdown cleanly, | 499 // We must write that the profile and metrics service shutdown cleanly, |
500 // otherwise on startup we'll think we crashed. So we block until done and | 500 // otherwise on startup we'll think we crashed. So we block until done and |
501 // then proceed with normal shutdown. | 501 // then proceed with normal shutdown. |
502 // | 502 // |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 } | 1212 } |
1213 | 1213 |
1214 void BrowserProcessImpl::OnAutoupdateTimer() { | 1214 void BrowserProcessImpl::OnAutoupdateTimer() { |
1215 if (CanAutorestartForUpdate()) { | 1215 if (CanAutorestartForUpdate()) { |
1216 DLOG(WARNING) << "Detected update. Restarting browser."; | 1216 DLOG(WARNING) << "Detected update. Restarting browser."; |
1217 RestartBackgroundInstance(); | 1217 RestartBackgroundInstance(); |
1218 } | 1218 } |
1219 } | 1219 } |
1220 | 1220 |
1221 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1221 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |