| 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 // This file defines a WatchDog thread that monitors the responsiveness of other | 5 // This file defines a WatchDog thread that monitors the responsiveness of other |
| 6 // browser threads like UI, IO, DB, FILE and CACHED threads. It also defines | 6 // browser threads like UI, IO, DB, FILE and CACHED threads. It also defines |
| 7 // ThreadWatcher class which performs health check on threads that would like to | 7 // ThreadWatcher class which performs health check on threads that would like to |
| 8 // be watched. This file also defines ThreadWatcherList class that has list of | 8 // be watched. This file also defines ThreadWatcherList class that has list of |
| 9 // all active ThreadWatcher objects. | 9 // all active ThreadWatcher objects. |
| 10 // | 10 // |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // This is set to true if thread watcher is watching. | 179 // This is set to true if thread watcher is watching. |
| 180 bool active_; | 180 bool active_; |
| 181 | 181 |
| 182 // The counter tracks least number of ping messages that will be sent to | 182 // The counter tracks least number of ping messages that will be sent to |
| 183 // watched thread before the ping-pong mechanism will go into an extended | 183 // watched thread before the ping-pong mechanism will go into an extended |
| 184 // sleep. If this value is zero, then the mechanism is in an extended sleep, | 184 // sleep. If this value is zero, then the mechanism is in an extended sleep, |
| 185 // and awaiting some observed user action before continuing. | 185 // and awaiting some observed user action before continuing. |
| 186 int ping_count_; | 186 int ping_count_; |
| 187 | 187 |
| 188 // Histogram that keeps track of response times for the watched thread. | 188 // Histogram that keeps track of response times for the watched thread. |
| 189 scoped_refptr<base::Histogram> histogram_; | 189 base::Histogram* histogram_; |
| 190 | 190 |
| 191 // We use this factory to create callback tasks for ThreadWatcher object. We | 191 // We use this factory to create callback tasks for ThreadWatcher object. We |
| 192 // use this during ping-pong messaging between WatchDog thread and watched | 192 // use this during ping-pong messaging between WatchDog thread and watched |
| 193 // thread. | 193 // thread. |
| 194 ScopedRunnableMethodFactory<ThreadWatcher> method_factory_; | 194 ScopedRunnableMethodFactory<ThreadWatcher> method_factory_; |
| 195 | 195 |
| 196 DISALLOW_COPY_AND_ASSIGN(ThreadWatcher); | 196 DISALLOW_COPY_AND_ASSIGN(ThreadWatcher); |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 // Class with a list of all active thread watchers. A thread watcher is active | 199 // Class with a list of all active thread watchers. A thread watcher is active |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 DISALLOW_COPY_AND_ASSIGN(WatchDogThread); | 320 DISALLOW_COPY_AND_ASSIGN(WatchDogThread); |
| 321 }; | 321 }; |
| 322 | 322 |
| 323 // DISABLE_RUNNABLE_METHOD_REFCOUNT is a convenience macro for disabling | 323 // DISABLE_RUNNABLE_METHOD_REFCOUNT is a convenience macro for disabling |
| 324 // refcounting of ThreadWatcher and ThreadWatcherList classes. | 324 // refcounting of ThreadWatcher and ThreadWatcherList classes. |
| 325 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcher); | 325 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcher); |
| 326 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcherList); | 326 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcherList); |
| 327 | 327 |
| 328 #endif // CHROME_BROWSER_METRICS_THREAD_WATCHER_H_ | 328 #endif // CHROME_BROWSER_METRICS_THREAD_WATCHER_H_ |
| OLD | NEW |