Index: remoting/host/win/worker_process_launcher.h |
diff --git a/remoting/host/win/worker_process_launcher.h b/remoting/host/win/worker_process_launcher.h |
index 1eea8cd0775d844daea07da9ba2b0c60cfd2be28..4f3711f6e8c6d6f23abb09590e607292a9ac03cf 100644 |
--- a/remoting/host/win/worker_process_launcher.h |
+++ b/remoting/host/win/worker_process_launcher.h |
@@ -14,6 +14,7 @@ |
namespace base { |
class SingleThreadTaskRunner; |
+class TimeDelta; |
} // namespace base |
namespace IPC { |
@@ -21,6 +22,10 @@ class Listener; |
class Message; |
} // namespace IPC |
+namespace tracked_objects { |
+class Location; |
+} // namespace tracked_objects |
+ |
namespace remoting { |
class WorkerProcessIpcDelegate; |
@@ -35,6 +40,9 @@ class WorkerProcessLauncher { |
public: |
virtual ~Delegate(); |
+ // Closes the IPC channel. |
+ virtual void CloseChannel() = 0; |
+ |
// Returns PID of the worker process or 0 if it is not available. |
virtual DWORD GetProcessId() const = 0; |
@@ -68,12 +76,24 @@ class WorkerProcessLauncher { |
WorkerProcessIpcDelegate* worker_delegate); |
~WorkerProcessLauncher(); |
+ // Asks the worker process to crash and generate a dump, and closes the IPC |
+ // channel. |location| is passed to the worker so that it is on the stack in |
+ // the dump. Restarts the worker process forcefully, if it does |
+ // not exit on its own. |
+ void Crash(const tracked_objects::Location& location); |
+ |
// Sends an IPC message to the worker process. The message will be silently |
// dropped if Send() is called before Start() or after stutdown has been |
// initiated. |
void Send(IPC::Message* message); |
private: |
+ friend class WorkerProcessLauncherTest; |
+ |
+ // Hooks that allow test code to call the corresponding methods of |Core|. |
+ void ResetLaunchSuccessTimeoutForTest(); |
+ void SetKillProcessTimeoutForTest(const base::TimeDelta& timeout); |
+ |
// The actual implementation resides in WorkerProcessLauncher::Core class. |
class Core; |
scoped_refptr<Core> core_; |