| 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 CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ |
| 6 #define CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util_proxy.h" | 11 #include "base/files/file_util_proxy.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/process.h" | 15 #include "base/process.h" |
| 16 #include "chrome/common/nacl_types.h" | 16 #include "chrome/common/nacl_types.h" |
| 17 #include "content/public/browser/browser_child_process_host_delegate.h" | 17 #include "content/public/browser/browser_child_process_host_delegate.h" |
| 18 #include "content/public/browser/browser_child_process_host_iterator.h" | 18 #include "content/public/browser/browser_child_process_host_iterator.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "ipc/ipc_channel_handle.h" | 20 #include "ipc/ipc_channel_handle.h" |
| 21 #include "net/socket/tcp_listen_socket.h" | 21 #include "net/socket/tcp_listen_socket.h" |
| 22 #include "ppapi/shared_impl/ppapi_permissions.h" | 22 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 23 | 23 |
| 24 class ChromeRenderMessageFilter; | 24 class NaClHostMessageFilter; |
| 25 class CommandLine; | 25 class CommandLine; |
| 26 class ExtensionInfoMap; | 26 class ExtensionInfoMap; |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 class BrowserChildProcessHost; | 29 class BrowserChildProcessHost; |
| 30 class BrowserPpapiHost; | 30 class BrowserPpapiHost; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace IPC { | 33 namespace IPC { |
| 34 class ChannelProxy; | 34 class ChannelProxy; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 55 bool enable_dyncode_syscalls, | 55 bool enable_dyncode_syscalls, |
| 56 bool off_the_record, | 56 bool off_the_record, |
| 57 const base::FilePath& profile_directory); | 57 const base::FilePath& profile_directory); |
| 58 virtual ~NaClProcessHost(); | 58 virtual ~NaClProcessHost(); |
| 59 | 59 |
| 60 // Do any minimal work that must be done at browser startup. | 60 // Do any minimal work that must be done at browser startup. |
| 61 static void EarlyStartup(); | 61 static void EarlyStartup(); |
| 62 | 62 |
| 63 // Initialize the new NaCl process. Result is returned by sending ipc | 63 // Initialize the new NaCl process. Result is returned by sending ipc |
| 64 // message reply_msg. | 64 // message reply_msg. |
| 65 void Launch(ChromeRenderMessageFilter* chrome_render_message_filter, | 65 void Launch(NaClHostMessageFilter* nacl_host_message_filter, |
| 66 IPC::Message* reply_msg, | 66 IPC::Message* reply_msg, |
| 67 scoped_refptr<ExtensionInfoMap> extension_info_map); | 67 scoped_refptr<ExtensionInfoMap> extension_info_map); |
| 68 | 68 |
| 69 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 69 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
| 70 | 70 |
| 71 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 72 void OnProcessLaunchedByBroker(base::ProcessHandle handle); | 72 void OnProcessLaunchedByBroker(base::ProcessHandle handle); |
| 73 void OnDebugExceptionHandlerLaunchedByBroker(bool success); | 73 void OnDebugExceptionHandlerLaunchedByBroker(bool success); |
| 74 #endif | 74 #endif |
| 75 | 75 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // This field becomes true when the broker successfully launched | 172 // This field becomes true when the broker successfully launched |
| 173 // the NaCl loader. | 173 // the NaCl loader. |
| 174 bool process_launched_by_broker_; | 174 bool process_launched_by_broker_; |
| 175 #elif defined(OS_LINUX) | 175 #elif defined(OS_LINUX) |
| 176 bool wait_for_nacl_gdb_; | 176 bool wait_for_nacl_gdb_; |
| 177 base::MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; | 177 base::MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; |
| 178 | 178 |
| 179 class NaClGdbWatchDelegate; | 179 class NaClGdbWatchDelegate; |
| 180 scoped_ptr<NaClGdbWatchDelegate> nacl_gdb_watcher_delegate_; | 180 scoped_ptr<NaClGdbWatchDelegate> nacl_gdb_watcher_delegate_; |
| 181 #endif | 181 #endif |
| 182 // The ChromeRenderMessageFilter that requested this NaCl process. We use | 182 // The NaClHostMessageFilter that requested this NaCl process. We use |
| 183 // this for sending the reply once the process has started. | 183 // this for sending the reply once the process has started. |
| 184 scoped_refptr<ChromeRenderMessageFilter> chrome_render_message_filter_; | 184 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter_; |
| 185 | 185 |
| 186 // The reply message to send. We must always send this message when the | 186 // The reply message to send. We must always send this message when the |
| 187 // sub-process either succeeds or fails to unblock the renderer waiting for | 187 // sub-process either succeeds or fails to unblock the renderer waiting for |
| 188 // the reply. NULL when there is no reply to send. | 188 // the reply. NULL when there is no reply to send. |
| 189 IPC::Message* reply_msg_; | 189 IPC::Message* reply_msg_; |
| 190 #if defined(OS_WIN) | 190 #if defined(OS_WIN) |
| 191 bool debug_exception_handler_requested_; | 191 bool debug_exception_handler_requested_; |
| 192 scoped_ptr<IPC::Message> attach_debug_exception_handler_reply_msg_; | 192 scoped_ptr<IPC::Message> attach_debug_exception_handler_reply_msg_; |
| 193 #endif | 193 #endif |
| 194 | 194 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 220 PluginListener ipc_plugin_listener_; | 220 PluginListener ipc_plugin_listener_; |
| 221 // Browser host for plugin process. | 221 // Browser host for plugin process. |
| 222 scoped_ptr<content::BrowserPpapiHost> ppapi_host_; | 222 scoped_ptr<content::BrowserPpapiHost> ppapi_host_; |
| 223 | 223 |
| 224 int render_view_id_; | 224 int render_view_id_; |
| 225 | 225 |
| 226 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 226 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ | 229 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ |
| OLD | NEW |