| 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 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 void BrowserProcessImpl::Observe(NotificationType type, | 535 void BrowserProcessImpl::Observe(NotificationType type, |
| 536 const NotificationSource& source, | 536 const NotificationSource& source, |
| 537 const NotificationDetails& details) { | 537 const NotificationDetails& details) { |
| 538 if (type == NotificationType::APP_TERMINATING) { | 538 if (type == NotificationType::APP_TERMINATING) { |
| 539 Profile* profile = ProfileManager::GetDefaultProfile(); | 539 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 540 if (profile) { | 540 if (profile) { |
| 541 PrefService* prefs = profile->GetPrefs(); | 541 PrefService* prefs = profile->GetPrefs(); |
| 542 if (prefs->GetBoolean(prefs::kClearPluginLSODataOnExit) && | 542 if (prefs->GetBoolean(prefs::kClearPluginLSODataOnExit) && |
| 543 local_state()->GetBoolean(prefs::kClearPluginLSODataEnabled)) { | 543 local_state()->GetBoolean(prefs::kClearPluginLSODataEnabled)) { |
| 544 plugin_data_remover_ = new PluginDataRemover(); | 544 plugin_data_remover_ = new PluginDataRemover(); |
| 545 plugin_data_remover_->StartRemoving(base::Time(), NULL); | 545 plugin_data_remover_->StartRemoving(base::Time(), true, NULL); |
| 546 } | 546 } |
| 547 } | 547 } |
| 548 } else { | 548 } else { |
| 549 NOTREACHED(); | 549 NOTREACHED(); |
| 550 } | 550 } |
| 551 } | 551 } |
| 552 | 552 |
| 553 void BrowserProcessImpl::WaitForPluginDataRemoverToFinish() { | 553 void BrowserProcessImpl::WaitForPluginDataRemoverToFinish() { |
| 554 if (!plugin_data_remover_.get() || !plugin_data_remover_->is_removing()) | 554 if (plugin_data_remover_.get()) |
| 555 return; | 555 plugin_data_remover_->WaitForPluginToExit(); |
| 556 plugin_data_remover_->set_done_task(new MessageLoop::QuitTask()); | |
| 557 base::Time start_time(base::Time::Now()); | |
| 558 MessageLoop::current()->Run(); | |
| 559 UMA_HISTOGRAM_TIMES("ClearPluginData.wait_at_shutdown", | |
| 560 base::Time::Now() - start_time); | |
| 561 } | 556 } |
| 562 | 557 |
| 563 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 558 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 564 void BrowserProcessImpl::StartAutoupdateTimer() { | 559 void BrowserProcessImpl::StartAutoupdateTimer() { |
| 565 autoupdate_timer_.Start( | 560 autoupdate_timer_.Start( |
| 566 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), | 561 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), |
| 567 this, | 562 this, |
| 568 &BrowserProcessImpl::OnAutoupdateTimer); | 563 &BrowserProcessImpl::OnAutoupdateTimer); |
| 569 } | 564 } |
| 570 #endif | 565 #endif |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 } | 915 } |
| 921 | 916 |
| 922 void BrowserProcessImpl::OnAutoupdateTimer() { | 917 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 923 if (CanAutorestartForUpdate()) { | 918 if (CanAutorestartForUpdate()) { |
| 924 DLOG(WARNING) << "Detected update. Restarting browser."; | 919 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 925 RestartPersistentInstance(); | 920 RestartPersistentInstance(); |
| 926 } | 921 } |
| 927 } | 922 } |
| 928 | 923 |
| 929 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 924 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |