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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 StartWatching(BrowserThread::FILE, "FILE", kSleepTime, kUnresponsiveTime, | 583 StartWatching(BrowserThread::FILE, "FILE", kSleepTime, kUnresponsiveTime, |
584 unresponsive_threshold, crash_on_hang_thread_names, | 584 unresponsive_threshold, crash_on_hang_thread_names, |
585 live_threads_threshold); | 585 live_threads_threshold); |
586 StartWatching(BrowserThread::CACHE, "CACHE", kSleepTime, kUnresponsiveTime, | 586 StartWatching(BrowserThread::CACHE, "CACHE", kSleepTime, kUnresponsiveTime, |
587 unresponsive_threshold, crash_on_hang_thread_names, | 587 unresponsive_threshold, crash_on_hang_thread_names, |
588 live_threads_threshold); | 588 live_threads_threshold); |
589 | 589 |
590 BrowserThread::PostTask( | 590 BrowserThread::PostTask( |
591 BrowserThread::UI, | 591 BrowserThread::UI, |
592 FROM_HERE, | 592 FROM_HERE, |
593 NewRunnableFunction(StartupTimeBomb::Disarm)); | 593 base::Bind(StartupTimeBomb::Disarm)); |
594 } | 594 } |
595 | 595 |
596 // static | 596 // static |
597 void ThreadWatcherList::StartWatching( | 597 void ThreadWatcherList::StartWatching( |
598 const BrowserThread::ID& thread_id, | 598 const BrowserThread::ID& thread_id, |
599 const std::string& thread_name, | 599 const std::string& thread_name, |
600 const base::TimeDelta& sleep_time, | 600 const base::TimeDelta& sleep_time, |
601 const base::TimeDelta& unresponsive_time, | 601 const base::TimeDelta& unresponsive_time, |
602 uint32 unresponsive_threshold, | 602 uint32 unresponsive_threshold, |
603 const std::set<std::string>& crash_on_hang_thread_names, | 603 const std::set<std::string>& crash_on_hang_thread_names, |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 | 880 |
881 #if defined(OS_WIN) | 881 #if defined(OS_WIN) |
882 // On Windows XP, give twice the time for shutdown. | 882 // On Windows XP, give twice the time for shutdown. |
883 if (base::win::GetVersion() <= base::win::VERSION_XP) | 883 if (base::win::GetVersion() <= base::win::VERSION_XP) |
884 actual_duration *= 2; | 884 actual_duration *= 2; |
885 #endif | 885 #endif |
886 | 886 |
887 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); | 887 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); |
888 shutdown_watchdog_->Arm(); | 888 shutdown_watchdog_->Arm(); |
889 } | 889 } |
OLD | NEW |