summaryrefslogtreecommitdiffstats
path: root/chrome/browser/child_process_launcher.h
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 20:23:36 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 20:23:36 +0000
commit3131a4bc3ef3b6f545b7dea6ea55d8419099b7b2 (patch)
treefef3b85252836c1afe7c354ba9a6e5766d8402ac /chrome/browser/child_process_launcher.h
parentfcc2caa7b147a296f450df1d3bbcd2bc4569093e (diff)
downloadchromium_src-3131a4bc3ef3b6f545b7dea6ea55d8419099b7b2.zip
chromium_src-3131a4bc3ef3b6f545b7dea6ea55d8419099b7b2.tar.gz
chromium_src-3131a4bc3ef3b6f545b7dea6ea55d8419099b7b2.tar.bz2
Fix race in zygote_host_linux where socket was being read from and written to on different threads.
Made ZygoteHost methods all run on PROCESS_LAUNCHER thread. PostTask in linux from UI thread to PROCESS_LAUNCHER thread for DidProcessCrash. Changed DidProcessCrash to answer via a callback, which occurs asynchronously on linux. Rework cases in nacl_host, browser_render_process_host, and child_process_host where this method was being called to fit the callback model. BUG=31737 TEST=none Review URL: http://codereview.chromium.org/1695026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_launcher.h')
-rw-r--r--chrome/browser/child_process_launcher.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/child_process_launcher.h b/chrome/browser/child_process_launcher.h
index ce1c04d..01c5d16 100644
--- a/chrome/browser/child_process_launcher.h
+++ b/chrome/browser/child_process_launcher.h
@@ -21,6 +21,11 @@ class ChildProcessLauncher {
// Will be called on the thread that the ChildProcessLauncher was
// constructed on.
virtual void OnProcessLaunched() = 0;
+
+ // Called as a response to DetermineDidProcessCrash on the thread that
+ // the ChildProcessLauncher was constructed on. This may be called
+ // during DetermineDidProcessCrash or asynchronously.
+ virtual void OnDidProcessCrashDetermined(bool did_crash) = 0;
};
// Launches the process asynchronously, calling the client when the result is
@@ -46,8 +51,10 @@ class ChildProcessLauncher {
// Getter for the process handle. Only call after the process has started.
base::ProcessHandle GetHandle();
- // Call this when the process exits to know if a process crashed or not.
- bool DidProcessCrash();
+ // Determines whether the exited process crashed or exited normally.
+ // The Client's OnDidProcessCrashDetermined method will be called with the
+ // answer.
+ void DetermineDidProcessCrash();
// Changes whether the process runs in the background or not. Only call
// this after the process has started.