Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5231)

Unified Diff: chrome/browser/metrics/thread_watcher.h

Issue 8728035: Disarm StartupTimeBomb when it is deleted (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/thread_watcher.h
===================================================================
--- chrome/browser/metrics/thread_watcher.h (revision 111993)
+++ chrome/browser/metrics/thread_watcher.h (working copy)
@@ -493,19 +493,32 @@
// startup.
class StartupTimeBomb {
public:
+ // This singleton is instantiated when the browser process is launched.
+ StartupTimeBomb();
+
+ // Destructor disarm's startup_watchdog_ (if it is arm'ed) so that alarm
+ // doesn't go off.
+ ~StartupTimeBomb();
+
// Constructs |startup_watchdog_| which spawns a thread and starts timer.
// |duration| specifies how long |startup_watchdog_| will wait before it
// calls alarm.
- static void Arm(const base::TimeDelta& duration);
+ void Arm(const base::TimeDelta& duration);
// Disarms |startup_watchdog_| thread and then deletes it which stops the
// Watchdog thread.
- static void Disarm();
+ void Disarm();
+ // Disarms |g_startup_timebomb_|.
+ static void DisarmStartupTimeBomb();
+
private:
// Watches for hangs during startup until it is disarm'ed.
- static base::Watchdog* startup_watchdog_;
+ base::Watchdog* startup_watchdog_;
+ // The singleton of this class.
+ static StartupTimeBomb* g_startup_timebomb_;
+
DISALLOW_COPY_AND_ASSIGN(StartupTimeBomb);
};

Powered by Google App Engine
This is Rietveld 408576698