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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 base::TimeDelta actual_duration = duration; | 730 base::TimeDelta actual_duration = duration; |
731 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 731 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
732 if (channel == chrome::VersionInfo::CHANNEL_STABLE) { | 732 if (channel == chrome::VersionInfo::CHANNEL_STABLE) { |
733 actual_duration *= 50; | 733 actual_duration *= 50; |
734 } else if (channel == chrome::VersionInfo::CHANNEL_BETA || | 734 } else if (channel == chrome::VersionInfo::CHANNEL_BETA || |
735 channel == chrome::VersionInfo::CHANNEL_DEV) { | 735 channel == chrome::VersionInfo::CHANNEL_DEV) { |
736 actual_duration *= 25; | 736 actual_duration *= 25; |
| 737 } else { |
| 738 // In Canary, for Windows XP, give twice the time for shutdown. |
| 739 #if defined(OS_WIN) |
| 740 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 741 actual_duration *= 2; |
| 742 #endif |
737 } | 743 } |
738 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); | 744 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); |
739 shutdown_watchdog_->Arm(); | 745 shutdown_watchdog_->Arm(); |
740 } | 746 } |
OLD | NEW |