Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(728)

Side by Side Diff: content/public/common/child_process_host_delegate.h

Issue 2766263009: Convert content ConnectionFilter to OnBindInterface (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "mojo/public/cpp/system/message_pipe.h"
13 14
14 namespace IPC { 15 namespace IPC {
15 class Channel; 16 class Channel;
16 } 17 }
17 18
18 namespace service_manager {
19 class InterfaceProvider;
20 }
21
22 namespace content { 19 namespace content {
23 20
24 // Interface that all users of ChildProcessHost need to provide. 21 // Interface that all users of ChildProcessHost need to provide.
25 class ChildProcessHostDelegate : public IPC::Listener { 22 class ChildProcessHostDelegate : public IPC::Listener {
26 public: 23 public:
27 ~ChildProcessHostDelegate() override {} 24 ~ChildProcessHostDelegate() override {}
28 25
29 // Delegates return true if it's ok to shut down the child process (which is 26 // Delegates return true if it's ok to shut down the child process (which is
30 // the default return value). The exception is if the host is in the middle of 27 // the default return value). The exception is if the host is in the middle of
31 // sending a request to the process, in which case the other side might think 28 // sending a request to the process, in which case the other side might think
32 // it's ok to shutdown, when really it's not. 29 // it's ok to shutdown, when really it's not.
33 CONTENT_EXPORT virtual bool CanShutdown(); 30 CONTENT_EXPORT virtual bool CanShutdown();
34 31
35 // Called when the IPC channel for the child process is initialized. 32 // Called when the IPC channel for the child process is initialized.
36 virtual void OnChannelInitialized(IPC::Channel* channel) {} 33 virtual void OnChannelInitialized(IPC::Channel* channel) {}
37 34
38 // Called when the child process unexpected closes the IPC channel. Delegates 35 // Called when the child process unexpected closes the IPC channel. Delegates
39 // would normally delete the object in this case. 36 // would normally delete the object in this case.
40 virtual void OnChildDisconnected() {} 37 virtual void OnChildDisconnected() {}
41 38
42 // Returns a reference to the child process. This can be called only after 39 // Returns a reference to the child process. This can be called only after
43 // OnProcessLaunched is called or it will be invalid and may crash. 40 // OnProcessLaunched is called or it will be invalid and may crash.
44 virtual const base::Process& GetProcess() const = 0; 41 virtual const base::Process& GetProcess() const = 0;
45 42
46 // Returns the service_manager::InterfaceProvider the process host can use to 43 // Binds an interface in the child process.
47 // bind interfaces exposed to it from the child. 44 virtual void BindInterface(const std::string& interface_name,
48 CONTENT_EXPORT virtual service_manager::InterfaceProvider* 45 mojo::ScopedMessagePipeHandle interface_pipe) {}
49 GetRemoteInterfaces();
50 }; 46 };
51 47
52 }; // namespace content 48 }; // namespace content
53 49
54 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_ 50 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/public/common/child_process_host.h ('k') | content/public/common/child_process_host_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698