diff options
Diffstat (limited to 'chrome/browser/nacl_host')
-rw-r--r-- | chrome/browser/nacl_host/nacl_process_host.cc | 17 | ||||
-rw-r--r-- | chrome/browser/nacl_host/nacl_process_host.h | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index 2648b3e..0310e39 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -117,10 +117,19 @@ void NaClProcessHost::OnProcessLaunchedByBroker(base::ProcessHandle handle) { OnProcessLaunched(); } -bool NaClProcessHost::DidChildCrash() { - if (running_on_wow64_) - return base::DidProcessCrash(NULL, handle()); - return ChildProcessHost::DidChildCrash(); +void NaClProcessHost::DetermineDidChildCrash() { + // Either of these paths will lead to deleting this object in + // OnDidProcessCrashDetermined in ChildProcessHost, so they should be the + // last calls in this method. + if (running_on_wow64_) { + bool did_crash = base::DidProcessCrash(NULL, handle()); + OnDidProcessCrashDetermined(did_crash); + } else { + // Determine whether the process crashed or not. This method will invoke + // OnDidProcessCrashDetermined with the result. This may occur + // asynchronously. + ChildProcessHost::DetermineDidChildCrash(); + } } void NaClProcessHost::OnChildDied() { diff --git a/chrome/browser/nacl_host/nacl_process_host.h b/chrome/browser/nacl_host/nacl_process_host.h index 28893fc..b6c3313 100644 --- a/chrome/browser/nacl_host/nacl_process_host.h +++ b/chrome/browser/nacl_host/nacl_process_host.h @@ -36,7 +36,8 @@ class NaClProcessHost : public ChildProcessHost { void OnProcessLaunchedByBroker(base::ProcessHandle handle); protected: - virtual bool DidChildCrash(); + // Override ChildProcessHost methods. + virtual void DetermineDidChildCrash(); virtual void OnChildDied(); private: |