OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "ipc/ipc_listener.h" | 9 #include "ipc/ipc_listener.h" |
10 | 10 |
11 namespace shell { | |
12 class InterfaceProvider; | |
13 } | |
14 | |
15 namespace content { | 11 namespace content { |
16 | 12 |
17 // Interface that all users of BrowserChildProcessHost need to provide. | 13 // Interface that all users of BrowserChildProcessHost need to provide. |
18 class CONTENT_EXPORT BrowserChildProcessHostDelegate : public IPC::Listener { | 14 class CONTENT_EXPORT BrowserChildProcessHostDelegate : public IPC::Listener { |
19 public: | 15 public: |
20 ~BrowserChildProcessHostDelegate() override {} | 16 ~BrowserChildProcessHostDelegate() override {} |
21 | 17 |
22 // Delegates return true if it's ok to shut down the child process (which is | 18 // Delegates return true if it's ok to shut down the child process (which is |
23 // the default return value). The exception is if the host is in the middle of | 19 // the default return value). The exception is if the host is in the middle of |
24 // sending a request to the process, in which case the other side might think | 20 // sending a request to the process, in which case the other side might think |
25 // it's ok to shutdown, when really it's not. | 21 // it's ok to shutdown, when really it's not. |
26 virtual bool CanShutdown(); | 22 virtual bool CanShutdown(); |
27 | 23 |
28 // Called when the process has been started. | 24 // Called when the process has been started. |
29 virtual void OnProcessLaunched() {} | 25 virtual void OnProcessLaunched() {} |
30 | 26 |
31 // Called if the process failed to launch. In this case the process never | 27 // Called if the process failed to launch. In this case the process never |
32 // started so the code here is a platform specific error code. | 28 // started so the code here is a platform specific error code. |
33 virtual void OnProcessLaunchFailed(int error_code) {} | 29 virtual void OnProcessLaunchFailed(int error_code) {} |
34 | 30 |
35 // Called if the process crashed. |exit_code| is the status returned when the | 31 // Called if the process crashed. |exit_code| is the status returned when the |
36 // process crashed (for posix, as returned from waitpid(), for Windows, as | 32 // process crashed (for posix, as returned from waitpid(), for Windows, as |
37 // returned from GetExitCodeProcess()). | 33 // returned from GetExitCodeProcess()). |
38 virtual void OnProcessCrashed(int exit_code) {} | 34 virtual void OnProcessCrashed(int exit_code) {} |
39 | |
40 // Returns the shell::InterfaceProvider the browser process can use to bind | |
41 // interfaces exposed to it from the child. | |
42 virtual shell::InterfaceProvider* GetRemoteInterfaces(); | |
43 }; | 35 }; |
44 | 36 |
45 }; // namespace content | 37 }; // namespace content |
46 | 38 |
47 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ | 39 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_DELEGATE_H_ |
OLD | NEW |