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/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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 // stop has been called, there's nothing left to do here. | 535 // stop has been called, there's nothing left to do here. |
536 if (g_thread_watcher_list_ || g_stopped_) | 536 if (g_thread_watcher_list_ || g_stopped_) |
537 return; | 537 return; |
538 | 538 |
539 ThreadWatcherList* thread_watcher_list = new ThreadWatcherList(); | 539 ThreadWatcherList* thread_watcher_list = new ThreadWatcherList(); |
540 CHECK(thread_watcher_list); | 540 CHECK(thread_watcher_list); |
541 | 541 |
542 // Disable ThreadWatcher in Canary channel. | 542 // Disable ThreadWatcher in Canary channel. |
543 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 543 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
544 if (channel == chrome::VersionInfo::CHANNEL_CANARY || | 544 if (channel == chrome::VersionInfo::CHANNEL_CANARY || |
| 545 channel == chrome::VersionInfo::CHANNEL_STABLE || |
545 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { | 546 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { |
546 return; | 547 return; |
547 } | 548 } |
548 | 549 |
549 const base::TimeDelta kSleepTime = | 550 const base::TimeDelta kSleepTime = |
550 base::TimeDelta::FromSeconds(kSleepSeconds); | 551 base::TimeDelta::FromSeconds(kSleepSeconds); |
551 const base::TimeDelta kUnresponsiveTime = | 552 const base::TimeDelta kUnresponsiveTime = |
552 base::TimeDelta::FromSeconds(kUnresponsiveSeconds); | 553 base::TimeDelta::FromSeconds(kUnresponsiveSeconds); |
553 | 554 |
554 StartWatching(BrowserThread::UI, "UI", kSleepTime, kUnresponsiveTime, | 555 StartWatching(BrowserThread::UI, "UI", kSleepTime, kUnresponsiveTime, |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 | 929 |
929 #if defined(OS_WIN) | 930 #if defined(OS_WIN) |
930 // On Windows XP, give twice the time for shutdown. | 931 // On Windows XP, give twice the time for shutdown. |
931 if (base::win::GetVersion() <= base::win::VERSION_XP) | 932 if (base::win::GetVersion() <= base::win::VERSION_XP) |
932 actual_duration *= 2; | 933 actual_duration *= 2; |
933 #endif | 934 #endif |
934 | 935 |
935 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); | 936 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); |
936 shutdown_watchdog_->Arm(); | 937 shutdown_watchdog_->Arm(); |
937 } | 938 } |
OLD | NEW |