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

Unified Diff: chrome_watchdog.cc

Issue 6012007: wm: Fix FD leak in watchdog when Chrome is hanging. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/window_manager.git@master
Patch Set: fix typo in comment Created 10 years 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
« no previous file with comments | « no previous file | chrome_watchdog_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_watchdog.cc
diff --git a/chrome_watchdog.cc b/chrome_watchdog.cc
index 7363db435487d0f77418a8cf7dec98c4671b9ce6..ee9cf0973c6b9479c3f17f2680eb64cc24c2e249 100644
--- a/chrome_watchdog.cc
+++ b/chrome_watchdog.cc
@@ -112,13 +112,11 @@ void ChromeWatchdog::AbortTimeout() {
void ChromeWatchdog::HandleTimeout() {
DCHECK(has_outstanding_ping());
- registrar_->UnregisterForWindowEvents(wm_->root());
- ping_timestamp_ = 0;
- timeout_id_ = -1;
-
+ DCHECK(pinged_chrome_xid_);
Window* win = wm_->GetWindowOrDie(pinged_chrome_xid_);
- pid_t chrome_pid = static_cast<pid_t>(win->client_pid());
+ AbortTimeout();
+ pid_t chrome_pid = static_cast<pid_t>(win->client_pid());
LOG(INFO) << "Chrome window " << win->xid_str() << " didn't respond to ping; "
<< (!FLAGS_kill_chrome_if_hanging ? "(not really) " : "")
<< "sending signal " << kSignalToSend << " to PID " << chrome_pid;
@@ -128,7 +126,6 @@ void ChromeWatchdog::HandleTimeout() {
}
last_killed_pid_ = chrome_pid;
- pinged_chrome_xid_ = 0;
}
} // namespace window_manager
« no previous file with comments | « no previous file | chrome_watchdog_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698