Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CONTENT_COMMON_CHILD_PROCESS_HOST_H_ |
| 6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_H_ | 6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 | 13 |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include <windows.h> | 15 #include <windows.h> |
| 16 #endif // defined(OS_WIN) | 16 #endif // defined(OS_WIN) |
| 17 | 17 |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "content/common/content_notification_types.h" | 20 #include "content/common/content_notification_types.h" |
| 21 #include "content/common/content_export.h" | |
|
darin (slow to review)
2011/09/04 15:41:04
nit: "export" before "notification"
Dirk Pranke
2011/09/07 01:46:07
Done.
| |
| 21 #include "ipc/ipc_channel_proxy.h" | 22 #include "ipc/ipc_channel_proxy.h" |
| 22 | 23 |
| 23 class CommandLine; | 24 class CommandLine; |
| 24 class FilePath; | 25 class FilePath; |
| 25 | 26 |
| 26 namespace IPC { | 27 namespace IPC { |
| 27 class Message; | 28 class Message; |
| 28 } | 29 } |
| 29 | 30 |
| 30 // Provides common functionality for hosting a child process and processing IPC | 31 // Provides common functionality for hosting a child process and processing IPC |
| 31 // messages between the host and the child process. Subclasses are responsible | 32 // messages between the host and the child process. Subclasses are responsible |
| 32 // for the actual launching and terminating of the child processes. | 33 // for the actual launching and terminating of the child processes. |
| 33 class ChildProcessHost : public IPC::Channel::Listener, | 34 class CONTENT_EXPORT ChildProcessHost : public IPC::Channel::Listener, |
| 34 public IPC::Message::Sender { | 35 public IPC::Message::Sender { |
| 35 public: | 36 public: |
| 36 | 37 |
| 37 // These flags may be passed to GetChildPath in order to alter its behavior, | 38 // These flags may be passed to GetChildPath in order to alter its behavior, |
| 38 // causing it to return a child path more suited to a specific task. | 39 // causing it to return a child path more suited to a specific task. |
| 39 enum { | 40 enum { |
| 40 // No special behavior requested. | 41 // No special behavior requested. |
| 41 CHILD_NORMAL = 0, | 42 CHILD_NORMAL = 0, |
| 42 | 43 |
| 43 #if defined(OS_LINUX) | 44 #if defined(OS_LINUX) |
| 44 // Indicates that the child execed after forking may be execced from | 45 // Indicates that the child execed after forking may be execced from |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 | 150 |
| 150 // Holds all the IPC message filters. Since this object lives on the IO | 151 // Holds all the IPC message filters. Since this object lives on the IO |
| 151 // thread, we don't have a IPC::ChannelProxy and so we manage filters | 152 // thread, we don't have a IPC::ChannelProxy and so we manage filters |
| 152 // manually. | 153 // manually. |
| 153 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; | 154 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; |
| 154 | 155 |
| 155 DISALLOW_COPY_AND_ASSIGN(ChildProcessHost); | 156 DISALLOW_COPY_AND_ASSIGN(ChildProcessHost); |
| 156 }; | 157 }; |
| 157 | 158 |
| 158 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_H_ | 159 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_H_ |
| OLD | NEW |