| 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 "base/threading/thread_restrictions.h" | 5 #include "base/threading/thread_restrictions.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #include "chrome/browser/metrics/metrics_service.h" | 7 #include "chrome/browser/metrics/metrics_service.h" |
| 8 #include "chrome/browser/metrics/thread_watcher.h" | 8 #include "chrome/browser/metrics/thread_watcher.h" |
| 9 #include "content/common/notification_service.h" | 9 #include "content/common/notification_service.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 const base::TimeDelta& sleep_time, | 21 const base::TimeDelta& sleep_time, |
| 22 const base::TimeDelta& unresponsive_time) | 22 const base::TimeDelta& unresponsive_time) |
| 23 : thread_id_(thread_id), | 23 : thread_id_(thread_id), |
| 24 thread_name_(thread_name), | 24 thread_name_(thread_name), |
| 25 sleep_time_(sleep_time), | 25 sleep_time_(sleep_time), |
| 26 unresponsive_time_(unresponsive_time), | 26 unresponsive_time_(unresponsive_time), |
| 27 ping_time_(base::TimeTicks::Now()), | 27 ping_time_(base::TimeTicks::Now()), |
| 28 ping_sequence_number_(0), | 28 ping_sequence_number_(0), |
| 29 active_(false), | 29 active_(false), |
| 30 ping_count_(kPingCount), | 30 ping_count_(kPingCount), |
| 31 histogram_(NULL), |
| 31 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { | 32 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { |
| 32 Initialize(); | 33 Initialize(); |
| 33 } | 34 } |
| 34 | 35 |
| 35 ThreadWatcher::~ThreadWatcher() {} | 36 ThreadWatcher::~ThreadWatcher() {} |
| 36 | 37 |
| 37 // static | 38 // static |
| 38 void ThreadWatcher::StartWatching(const BrowserThread::ID& thread_id, | 39 void ThreadWatcher::StartWatching(const BrowserThread::ID& thread_id, |
| 39 const std::string& thread_name, | 40 const std::string& thread_name, |
| 40 const base::TimeDelta& sleep_time, | 41 const base::TimeDelta& sleep_time, |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 watchdog_thread_ = NULL; | 421 watchdog_thread_ = NULL; |
| 421 } | 422 } |
| 422 | 423 |
| 423 void WatchDogThread::CleanUpAfterMessageLoopDestruction() { | 424 void WatchDogThread::CleanUpAfterMessageLoopDestruction() { |
| 424 #if defined(OS_WIN) | 425 #if defined(OS_WIN) |
| 425 // Closes the COM library on the current thread. CoInitialize must | 426 // Closes the COM library on the current thread. CoInitialize must |
| 426 // be balanced by a corresponding call to CoUninitialize. | 427 // be balanced by a corresponding call to CoUninitialize. |
| 427 CoUninitialize(); | 428 CoUninitialize(); |
| 428 #endif | 429 #endif |
| 429 } | 430 } |
| OLD | NEW |