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 "base/threading/watchdog.h" | 5 #include "base/threading/watchdog.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 Lock lock; | 24 Lock lock; |
25 | 25 |
26 // When did we last alarm and get stuck (for a while) in a debugger? | 26 // When did we last alarm and get stuck (for a while) in a debugger? |
27 TimeTicks last_debugged_alarm_time; | 27 TimeTicks last_debugged_alarm_time; |
28 | 28 |
29 // How long did we sit on a break in the debugger? | 29 // How long did we sit on a break in the debugger? |
30 TimeDelta last_debugged_alarm_delay; | 30 TimeDelta last_debugged_alarm_delay; |
31 }; | 31 }; |
32 | 32 |
33 StaticData* GetStaticData() { | 33 StaticData* GetStaticData() { |
34 static auto static_data = new StaticData(); | 34 static auto* static_data = new StaticData(); |
35 return static_data; | 35 return static_data; |
36 } | 36 } |
37 | 37 |
38 } // namespace | 38 } // namespace |
39 | 39 |
40 // Start thread running in a Disarmed state. | 40 // Start thread running in a Disarmed state. |
41 Watchdog::Watchdog(const TimeDelta& duration, | 41 Watchdog::Watchdog(const TimeDelta& duration, |
42 const std::string& thread_watched_name, | 42 const std::string& thread_watched_name, |
43 bool enabled) | 43 bool enabled) |
44 : enabled_(enabled), | 44 : enabled_(enabled), |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 // static | 178 // static |
179 void Watchdog::ResetStaticData() { | 179 void Watchdog::ResetStaticData() { |
180 StaticData* static_data = GetStaticData(); | 180 StaticData* static_data = GetStaticData(); |
181 AutoLock lock(static_data->lock); | 181 AutoLock lock(static_data->lock); |
182 static_data->last_debugged_alarm_time = TimeTicks(); | 182 static_data->last_debugged_alarm_time = TimeTicks(); |
183 static_data->last_debugged_alarm_delay = TimeDelta(); | 183 static_data->last_debugged_alarm_delay = TimeDelta(); |
184 } | 184 } |
185 | 185 |
186 } // namespace base | 186 } // namespace base |
OLD | NEW |