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_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class ChildProcessHostDelegate; | 25 class ChildProcessHostDelegate; |
26 | 26 |
27 // Provides common functionality for hosting a child process and processing IPC | 27 // Provides common functionality for hosting a child process and processing IPC |
28 // messages between the host and the child process. Users are responsible | 28 // messages between the host and the child process. Users are responsible |
29 // for the actual launching and terminating of the child processes. | 29 // for the actual launching and terminating of the child processes. |
30 class CONTENT_EXPORT ChildProcessHostImpl : public ChildProcessHost, | 30 class CONTENT_EXPORT ChildProcessHostImpl : public ChildProcessHost, |
31 public IPC::Listener { | 31 public IPC::Listener { |
32 public: | 32 public: |
33 virtual ~ChildProcessHostImpl(); | 33 virtual ~ChildProcessHostImpl(); |
34 | 34 |
| 35 // This value is guaranteed to never be returned by |
| 36 // GenerateChildProcessUniqueId() below. |
| 37 static int kInvalidChildProcessId; |
| 38 |
35 // Public and static for reuse by RenderMessageFilter. | 39 // Public and static for reuse by RenderMessageFilter. |
36 static void AllocateSharedMemory( | 40 static void AllocateSharedMemory( |
37 uint32 buffer_size, base::ProcessHandle child_process, | 41 uint32 buffer_size, base::ProcessHandle child_process, |
38 base::SharedMemoryHandle* handle); | 42 base::SharedMemoryHandle* handle); |
39 | 43 |
40 // Returns a unique ID to identify a child process. On construction, this | 44 // Returns a unique ID to identify a child process. On construction, this |
41 // function will be used to generate the id_, but it is also used to generate | 45 // function will be used to generate the id_, but it is also used to generate |
42 // IDs for the RenderProcessHost, which doesn't inherit from us, and whose IDs | 46 // IDs for the RenderProcessHost, which doesn't inherit from us, and whose IDs |
43 // must be unique for all child processes. | 47 // must be unique for all child processes. |
44 // | 48 // |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // thread, we don't have a IPC::ChannelProxy and so we manage filters | 85 // thread, we don't have a IPC::ChannelProxy and so we manage filters |
82 // manually. | 86 // manually. |
83 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; | 87 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; |
84 | 88 |
85 DISALLOW_COPY_AND_ASSIGN(ChildProcessHostImpl); | 89 DISALLOW_COPY_AND_ASSIGN(ChildProcessHostImpl); |
86 }; | 90 }; |
87 | 91 |
88 } // namespace content | 92 } // namespace content |
89 | 93 |
90 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 94 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |