| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 scoped_refptr<RundownTaskCounter> rundown_counter(new RundownTaskCounter()); | 469 scoped_refptr<RundownTaskCounter> rundown_counter(new RundownTaskCounter()); |
| 470 for (size_t i = 0; i < profiles.size(); ++i) { | 470 for (size_t i = 0; i < profiles.size(); ++i) { |
| 471 Profile* profile = profiles[i]; | 471 Profile* profile = profiles[i]; |
| 472 profile->SetExitType(Profile::EXIT_SESSION_ENDED); | 472 profile->SetExitType(Profile::EXIT_SESSION_ENDED); |
| 473 | 473 |
| 474 if (!use_broken_synchronization) | 474 if (!use_broken_synchronization) |
| 475 rundown_counter->Post(profile->GetIOTaskRunner()); | 475 rundown_counter->Post(profile->GetIOTaskRunner()); |
| 476 } | 476 } |
| 477 | 477 |
| 478 // Tell the metrics service it was cleanly shutdown. | 478 // Tell the metrics service it was cleanly shutdown. |
| 479 MetricsService* metrics = g_browser_process->metrics_service(); | 479 metrics::MetricsService* metrics = g_browser_process->metrics_service(); |
| 480 if (metrics && local_state()) { | 480 if (metrics && local_state()) { |
| 481 metrics->RecordStartOfSessionEnd(); | 481 metrics->RecordStartOfSessionEnd(); |
| 482 #if !defined(OS_CHROMEOS) | 482 #if !defined(OS_CHROMEOS) |
| 483 // MetricsService lazily writes to prefs, force it to write now. | 483 // MetricsService lazily writes to prefs, force it to write now. |
| 484 // On ChromeOS, chrome gets killed when hangs, so no need to | 484 // On ChromeOS, chrome gets killed when hangs, so no need to |
| 485 // commit metrics::prefs::kStabilitySessionEndCompleted change immediately. | 485 // commit metrics::prefs::kStabilitySessionEndCompleted change immediately. |
| 486 local_state()->CommitPendingWrite(); | 486 local_state()->CommitPendingWrite(); |
| 487 | 487 |
| 488 if (!use_broken_synchronization) | 488 if (!use_broken_synchronization) |
| 489 rundown_counter->Post(local_state_task_runner_); | 489 rundown_counter->Post(local_state_task_runner_); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 #endif | 525 #endif |
| 526 } | 526 } |
| 527 | 527 |
| 528 MetricsServicesManager* BrowserProcessImpl::GetMetricsServicesManager() { | 528 MetricsServicesManager* BrowserProcessImpl::GetMetricsServicesManager() { |
| 529 DCHECK(CalledOnValidThread()); | 529 DCHECK(CalledOnValidThread()); |
| 530 if (!metrics_services_manager_) | 530 if (!metrics_services_manager_) |
| 531 metrics_services_manager_.reset(new MetricsServicesManager(local_state())); | 531 metrics_services_manager_.reset(new MetricsServicesManager(local_state())); |
| 532 return metrics_services_manager_.get(); | 532 return metrics_services_manager_.get(); |
| 533 } | 533 } |
| 534 | 534 |
| 535 MetricsService* BrowserProcessImpl::metrics_service() { | 535 metrics::MetricsService* BrowserProcessImpl::metrics_service() { |
| 536 DCHECK(CalledOnValidThread()); | 536 DCHECK(CalledOnValidThread()); |
| 537 return GetMetricsServicesManager()->GetMetricsService(); | 537 return GetMetricsServicesManager()->GetMetricsService(); |
| 538 } | 538 } |
| 539 | 539 |
| 540 rappor::RapporService* BrowserProcessImpl::rappor_service() { | 540 rappor::RapporService* BrowserProcessImpl::rappor_service() { |
| 541 DCHECK(CalledOnValidThread()); | 541 DCHECK(CalledOnValidThread()); |
| 542 return GetMetricsServicesManager()->GetRapporService(); | 542 return GetMetricsServicesManager()->GetRapporService(); |
| 543 } | 543 } |
| 544 | 544 |
| 545 IOThread* BrowserProcessImpl::io_thread() { | 545 IOThread* BrowserProcessImpl::io_thread() { |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 } | 1205 } |
| 1206 | 1206 |
| 1207 void BrowserProcessImpl::OnAutoupdateTimer() { | 1207 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1208 if (CanAutorestartForUpdate()) { | 1208 if (CanAutorestartForUpdate()) { |
| 1209 DLOG(WARNING) << "Detected update. Restarting browser."; | 1209 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1210 RestartBackgroundInstance(); | 1210 RestartBackgroundInstance(); |
| 1211 } | 1211 } |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1214 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |