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_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "ipc/ipc_listener.h" | 12 #include "ipc/ipc_listener.h" |
13 | 13 |
14 namespace shell { | 14 namespace service_manager { |
15 class InterfaceProvider; | 15 class InterfaceProvider; |
16 } | 16 } |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 // Interface that all users of ChildProcessHost need to provide. | 20 // Interface that all users of ChildProcessHost need to provide. |
21 class ChildProcessHostDelegate : public IPC::Listener { | 21 class ChildProcessHostDelegate : public IPC::Listener { |
22 public: | 22 public: |
23 ~ChildProcessHostDelegate() override {} | 23 ~ChildProcessHostDelegate() override {} |
24 | 24 |
25 // Delegates return true if it's ok to shut down the child process (which is | 25 // Delegates return true if it's ok to shut down the child process (which is |
26 // the default return value). The exception is if the host is in the middle of | 26 // the default return value). The exception is if the host is in the middle of |
27 // sending a request to the process, in which case the other side might think | 27 // sending a request to the process, in which case the other side might think |
28 // it's ok to shutdown, when really it's not. | 28 // it's ok to shutdown, when really it's not. |
29 CONTENT_EXPORT virtual bool CanShutdown(); | 29 CONTENT_EXPORT virtual bool CanShutdown(); |
30 | 30 |
31 // Called when the child process unexpected closes the IPC channel. Delegates | 31 // Called when the child process unexpected closes the IPC channel. Delegates |
32 // would normally delete the object in this case. | 32 // would normally delete the object in this case. |
33 virtual void OnChildDisconnected() {} | 33 virtual void OnChildDisconnected() {} |
34 | 34 |
35 // Returns a reference to the child process. This can be called only after | 35 // Returns a reference to the child process. This can be called only after |
36 // OnProcessLaunched is called or it will be invalid and may crash. | 36 // OnProcessLaunched is called or it will be invalid and may crash. |
37 virtual const base::Process& GetProcess() const = 0; | 37 virtual const base::Process& GetProcess() const = 0; |
38 | 38 |
39 // Returns the shell::InterfaceProvider the process host can use to bind | 39 // Returns the service_manager::InterfaceProvider the process host can use to |
| 40 // bind |
40 // interfaces exposed to it from the child. | 41 // interfaces exposed to it from the child. |
41 CONTENT_EXPORT virtual shell::InterfaceProvider* GetRemoteInterfaces(); | 42 CONTENT_EXPORT virtual service_manager::InterfaceProvider* |
| 43 GetRemoteInterfaces(); |
42 }; | 44 }; |
43 | 45 |
44 }; // namespace content | 46 }; // namespace content |
45 | 47 |
46 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_ | 48 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_ |
OLD | NEW |