| 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 // 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 void Arm(const base::TimeDelta& duration); | 507 void Arm(const base::TimeDelta& duration); |
| 508 | 508 |
| 509 // Disarms |startup_watchdog_| thread and then deletes it which stops the | 509 // Disarms |startup_watchdog_| thread and then deletes it which stops the |
| 510 // Watchdog thread. | 510 // Watchdog thread. |
| 511 void Disarm(); | 511 void Disarm(); |
| 512 | 512 |
| 513 // Disarms |g_startup_timebomb_|. | 513 // Disarms |g_startup_timebomb_|. |
| 514 static void DisarmStartupTimeBomb(); | 514 static void DisarmStartupTimeBomb(); |
| 515 | 515 |
| 516 private: | 516 private: |
| 517 // Deletes |startup_watchdog_| if it is joinable. If |startup_watchdog_| is |
| 518 // not joinable, then it will post a delayed task to try again. |
| 519 void DeleteStartupWatchdog(); |
| 520 |
| 517 // The singleton of this class. | 521 // The singleton of this class. |
| 518 static StartupTimeBomb* g_startup_timebomb_; | 522 static StartupTimeBomb* g_startup_timebomb_; |
| 519 | 523 |
| 520 // Watches for hangs during startup until it is disarm'ed. | 524 // Watches for hangs during startup until it is disarm'ed. |
| 521 base::Watchdog* startup_watchdog_; | 525 base::Watchdog* startup_watchdog_; |
| 522 | 526 |
| 523 // The |thread_id_| on which this object is constructed. | 527 // The |thread_id_| on which this object is constructed. |
| 524 const base::PlatformThreadId thread_id_; | 528 const base::PlatformThreadId thread_id_; |
| 525 | 529 |
| 526 DISALLOW_COPY_AND_ASSIGN(StartupTimeBomb); | 530 DISALLOW_COPY_AND_ASSIGN(StartupTimeBomb); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 543 // shutdown_watchdog_ watches for hangs during shutdown. | 547 // shutdown_watchdog_ watches for hangs during shutdown. |
| 544 base::Watchdog* shutdown_watchdog_; | 548 base::Watchdog* shutdown_watchdog_; |
| 545 | 549 |
| 546 // The |thread_id_| on which this object is constructed. | 550 // The |thread_id_| on which this object is constructed. |
| 547 const base::PlatformThreadId thread_id_; | 551 const base::PlatformThreadId thread_id_; |
| 548 | 552 |
| 549 DISALLOW_COPY_AND_ASSIGN(ShutdownWatcherHelper); | 553 DISALLOW_COPY_AND_ASSIGN(ShutdownWatcherHelper); |
| 550 }; | 554 }; |
| 551 | 555 |
| 552 #endif // CHROME_BROWSER_METRICS_THREAD_WATCHER_H_ | 556 #endif // CHROME_BROWSER_METRICS_THREAD_WATCHER_H_ |
| OLD | NEW |