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

Unified Diff: content/gpu/gpu_watchdog_thread.h

Issue 1980263002: GPU Watchdog to check I/O before terminating GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback Created 4 years, 7 months 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: content/gpu/gpu_watchdog_thread.h
diff --git a/content/gpu/gpu_watchdog_thread.h b/content/gpu/gpu_watchdog_thread.h
index c8e00952b26bf8e6c6fe717b02d054bc12574dc9..0861adfdc4112d1a4e92aadb513404d52e95322b 100644
--- a/content/gpu/gpu_watchdog_thread.h
+++ b/content/gpu/gpu_watchdog_thread.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_GPU_GPU_WATCHDOG_THREAD_H_
#define CONTENT_GPU_GPU_WATCHDOG_THREAD_H_
+#include "base/files/file.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -74,6 +75,7 @@ class GpuWatchdogThread : public base::Thread,
void OnAcknowledge();
void OnCheck(bool after_suspend);
+ void BeginTerminating();
void DeliberatelyTerminateToRecoverFromHang();
#if defined(USE_X11)
void SetupXServer();
@@ -127,6 +129,12 @@ class GpuWatchdogThread : public base::Thread,
base::Time check_time_;
base::TimeTicks check_timeticks_;
+ // Writing to this temp file is used as an additional step before crashing the
+ // process. That should help to distinguish true hangs from the cases when the
+ // watched thread is running slow being blocked on hard faults or other I/O.
+ base::File temp_file_for_io_checking_;
+ base::TimeDelta io_check_duration_;
+
#if defined(OS_CHROMEOS)
FILE* tty_file_;
#endif

Powered by Google App Engine
This is Rietveld 408576698