| 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/metrics/thread_watcher.h" | 5 #include "chrome/browser/metrics/thread_watcher.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 | 8 |
| 9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 ShutdownWatcherHelper::~ShutdownWatcherHelper() { | 720 ShutdownWatcherHelper::~ShutdownWatcherHelper() { |
| 721 if (shutdown_watchdog_) { | 721 if (shutdown_watchdog_) { |
| 722 shutdown_watchdog_->Disarm(); | 722 shutdown_watchdog_->Disarm(); |
| 723 delete shutdown_watchdog_; | 723 delete shutdown_watchdog_; |
| 724 shutdown_watchdog_ = NULL; | 724 shutdown_watchdog_ = NULL; |
| 725 } | 725 } |
| 726 } | 726 } |
| 727 | 727 |
| 728 void ShutdownWatcherHelper::Arm(const base::TimeDelta& duration) { | 728 void ShutdownWatcherHelper::Arm(const base::TimeDelta& duration) { |
| 729 DCHECK(!shutdown_watchdog_); | 729 DCHECK(!shutdown_watchdog_); |
| 730 shutdown_watchdog_ = new ShutdownWatchDogThread(duration); | 730 base::TimeDelta actual_duration = duration; |
| 731 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 732 if (channel == chrome::VersionInfo::CHANNEL_STABLE) { |
| 733 actual_duration *= 50; |
| 734 } else if (channel == chrome::VersionInfo::CHANNEL_BETA || |
| 735 channel == chrome::VersionInfo::CHANNEL_DEV) { |
| 736 actual_duration *= 25; |
| 737 } |
| 738 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); |
| 731 shutdown_watchdog_->Arm(); | 739 shutdown_watchdog_->Arm(); |
| 732 } | 740 } |
| OLD | NEW |