diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 22:14:40 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 22:14:40 +0000 |
commit | 4967f792930a150b81d2cd3ca31d101cecde24e8 (patch) | |
tree | b64930d118529431fdc4530d277a3cac03114efc /content/public/browser/browser_child_process_host_delegate.h | |
parent | f0e342256f44ff6228a7bcd8fb2e221facb6368c (diff) | |
download | chromium_src-4967f792930a150b81d2cd3ca31d101cecde24e8.zip chromium_src-4967f792930a150b81d2cd3ca31d101cecde24e8.tar.gz chromium_src-4967f792930a150b81d2cd3ca31d101cecde24e8.tar.bz2 |
Add a Content API around BrowserChildProcessHost, similar to what was done with ChildProcessHost. Now classes like PluginProcessHost don't derive from it, but instead use composition.
I've also moved the iterator class into its own file in the public directory. Since classes don't derive from BrowserChildProcessHost and so can't static_cast from it, I added a template helper that does this.
BUG=98716
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=118415
Review URL: https://chromiumcodereview.appspot.com/9150017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/browser/browser_child_process_host_delegate.h')
-rw-r--r-- | content/public/browser/browser_child_process_host_delegate.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/content/public/browser/browser_child_process_host_delegate.h b/content/public/browser/browser_child_process_host_delegate.h new file mode 100644 index 0000000..e028c9a --- /dev/null +++ b/content/public/browser/browser_child_process_host_delegate.h @@ -0,0 +1,37 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ +#define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ +#pragma once + +#include "content/common/content_export.h" +#include "ipc/ipc_channel.h" + +namespace content { + +// Interface that all users of BrowserChildProcessHost need to provide. +class CONTENT_EXPORT BrowserChildProcessHostDelegate + : public IPC::Channel::Listener { + public: + virtual ~BrowserChildProcessHostDelegate() {} + + // Delegates return true if it's ok to shut down the child process (which is + // the default return value). The exception is if the host is in the middle of + // sending a request to the process, in which case the other side might think + // it's ok to shutdown, when really it's not. + virtual bool CanShutdown(); + + // Called when the process has been started. + virtual void OnProcessLaunched() {} + + // Called if the process crashed. |exit_code| is the status returned when the + // process crashed (for posix, as returned from waitpid(), for Windows, as + // returned from GetExitCodeProcess()). + virtual void OnProcessCrashed(int exit_code) {} +}; + +}; // namespace content + +#endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ |