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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 // This method is deferred in relationship to its StopWatchingAll() | 533 // This method is deferred in relationship to its StopWatchingAll() |
534 // counterpart. If a previous initialization has already happened, or if | 534 // counterpart. If a previous initialization has already happened, or if |
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 // TODO(rtenneti): Because we don't generate crash dumps for ThreadWatcher in |
| 543 // stable channel, disable ThreadWatcher in stable and unknown channels. We |
| 544 // will also not collect histogram data in these channels until |
| 545 // http://crbug.com/426203 is fixed. |
543 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 546 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
544 if (channel == chrome::VersionInfo::CHANNEL_CANARY || | 547 if (channel == chrome::VersionInfo::CHANNEL_STABLE || |
545 channel == chrome::VersionInfo::CHANNEL_STABLE || | |
546 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { | 548 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { |
547 return; | 549 return; |
548 } | 550 } |
549 | 551 |
550 const base::TimeDelta kSleepTime = | 552 const base::TimeDelta kSleepTime = |
551 base::TimeDelta::FromSeconds(kSleepSeconds); | 553 base::TimeDelta::FromSeconds(kSleepSeconds); |
552 const base::TimeDelta kUnresponsiveTime = | 554 const base::TimeDelta kUnresponsiveTime = |
553 base::TimeDelta::FromSeconds(kUnresponsiveSeconds); | 555 base::TimeDelta::FromSeconds(kUnresponsiveSeconds); |
554 | 556 |
555 StartWatching(BrowserThread::UI, "UI", kSleepTime, kUnresponsiveTime, | 557 StartWatching(BrowserThread::UI, "UI", kSleepTime, kUnresponsiveTime, |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 | 931 |
930 #if defined(OS_WIN) | 932 #if defined(OS_WIN) |
931 // On Windows XP, give twice the time for shutdown. | 933 // On Windows XP, give twice the time for shutdown. |
932 if (base::win::GetVersion() <= base::win::VERSION_XP) | 934 if (base::win::GetVersion() <= base::win::VERSION_XP) |
933 actual_duration *= 2; | 935 actual_duration *= 2; |
934 #endif | 936 #endif |
935 | 937 |
936 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); | 938 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); |
937 shutdown_watchdog_->Arm(); | 939 shutdown_watchdog_->Arm(); |
938 } | 940 } |
OLD | NEW |