OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/watchdog.h" | 5 #include "base/watchdog.h" |
6 | 6 |
7 #include "base/platform_thread.h" | 7 #include "base/platform_thread.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 | 9 |
| 10 using base::TimeDelta; |
| 11 using base::TimeTicks; |
| 12 |
10 //------------------------------------------------------------------------------ | 13 //------------------------------------------------------------------------------ |
11 // Public API methods. | 14 // Public API methods. |
12 | 15 |
13 // Start thread running in a Disarmed state. | 16 // Start thread running in a Disarmed state. |
14 Watchdog::Watchdog(const TimeDelta& duration, | 17 Watchdog::Watchdog(const TimeDelta& duration, |
15 const std::wstring& thread_watched_name, | 18 const std::wstring& thread_watched_name, |
16 bool enabled) | 19 bool enabled) |
17 : lock_(), | 20 : lock_(), |
18 condition_variable_(&lock_), | 21 condition_variable_(&lock_), |
19 state_(DISARMED), | 22 state_(DISARMED), |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 PlatformThread::SetName(name.c_str()); | 141 PlatformThread::SetName(name.c_str()); |
139 DLOG(INFO) << "Watchdog active: " << name; | 142 DLOG(INFO) << "Watchdog active: " << name; |
140 } | 143 } |
141 | 144 |
142 // static | 145 // static |
143 Lock Watchdog::static_lock_; // Lock for access of static data... | 146 Lock Watchdog::static_lock_; // Lock for access of static data... |
144 // static | 147 // static |
145 TimeTicks Watchdog::last_debugged_alarm_time_ = TimeTicks(); | 148 TimeTicks Watchdog::last_debugged_alarm_time_ = TimeTicks(); |
146 // static | 149 // static |
147 TimeDelta Watchdog::last_debugged_alarm_delay_; | 150 TimeDelta Watchdog::last_debugged_alarm_delay_; |
148 | |
OLD | NEW |