Chromium Code Reviews| 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 COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 5 #ifndef COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
| 6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 6 #define COMPONENTS_NACL_BROWSER_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/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/platform_file.h" | |
| 15 #include "base/process/process.h" | 16 #include "base/process/process.h" |
| 16 #include "components/nacl/common/nacl_types.h" | 17 #include "components/nacl/common/nacl_types.h" |
| 17 #include "content/public/browser/browser_child_process_host_delegate.h" | 18 #include "content/public/browser/browser_child_process_host_delegate.h" |
| 18 #include "content/public/browser/browser_child_process_host_iterator.h" | 19 #include "content/public/browser/browser_child_process_host_iterator.h" |
| 19 #include "ipc/ipc_channel_handle.h" | 20 #include "ipc/ipc_channel_handle.h" |
| 20 #include "net/socket/socket_descriptor.h" | 21 #include "net/socket/socket_descriptor.h" |
| 21 #include "ppapi/shared_impl/ppapi_permissions.h" | 22 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 53 // and mmap with PROT_EXEC. | 54 // and mmap with PROT_EXEC. |
| 54 // enable_exception_handling: whether the launched process should allow | 55 // enable_exception_handling: whether the launched process should allow |
| 55 // hardware exception handling. | 56 // hardware exception handling. |
| 56 // enable_crash_throttling: whether a crash of this process contributes | 57 // enable_crash_throttling: whether a crash of this process contributes |
| 57 // to the crash throttling statistics, and also | 58 // to the crash throttling statistics, and also |
| 58 // whether this process should not start when too | 59 // whether this process should not start when too |
| 59 // many crashes have been observed. | 60 // many crashes have been observed. |
| 60 // off_the_record: was the process launched from an incognito renderer? | 61 // off_the_record: was the process launched from an incognito renderer? |
| 61 // profile_directory: is the path of current profile directory. | 62 // profile_directory: is the path of current profile directory. |
| 62 NaClProcessHost(const GURL& manifest_url, | 63 NaClProcessHost(const GURL& manifest_url, |
| 64 base::PlatformFile nexe_file, | |
| 65 uint64_t nexe_token_lo, | |
| 66 uint64_t nexe_token_hi, | |
| 63 int render_view_id, | 67 int render_view_id, |
| 64 uint32 permission_bits, | 68 uint32 permission_bits, |
| 65 bool uses_irt, | 69 bool uses_irt, |
| 66 bool uses_nonsfi_mode, | 70 bool uses_nonsfi_mode, |
| 67 bool enable_dyncode_syscalls, | 71 bool enable_dyncode_syscalls, |
| 68 bool enable_exception_handling, | 72 bool enable_exception_handling, |
| 69 bool enable_crash_throttling, | 73 bool enable_crash_throttling, |
| 70 bool off_the_record, | 74 bool off_the_record, |
| 71 const base::FilePath& profile_directory); | 75 const base::FilePath& profile_directory); |
| 72 virtual ~NaClProcessHost(); | 76 virtual ~NaClProcessHost(); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 | 181 |
| 178 // Called when the PPAPI IPC channels to the browser/renderer have been | 182 // Called when the PPAPI IPC channels to the browser/renderer have been |
| 179 // created. | 183 // created. |
| 180 void OnPpapiChannelsCreated( | 184 void OnPpapiChannelsCreated( |
| 181 const IPC::ChannelHandle& browser_channel_handle, | 185 const IPC::ChannelHandle& browser_channel_handle, |
| 182 const IPC::ChannelHandle& ppapi_renderer_channel_handle, | 186 const IPC::ChannelHandle& ppapi_renderer_channel_handle, |
| 183 const IPC::ChannelHandle& trusted_renderer_channel_handle, | 187 const IPC::ChannelHandle& trusted_renderer_channel_handle, |
| 184 const IPC::ChannelHandle& manifest_service_channel_handle); | 188 const IPC::ChannelHandle& manifest_service_channel_handle); |
| 185 | 189 |
| 186 GURL manifest_url_; | 190 GURL manifest_url_; |
| 191 base::PlatformFile nexe_file_; | |
|
Mark Seaborn
2014/06/17 00:50:30
Should this use base::File instead of PlatformFile
hidehiko
2014/06/18 08:43:32
Done.
| |
| 192 uint64_t nexe_token_lo_; | |
| 193 uint64_t nexe_token_hi_; | |
| 194 | |
| 187 ppapi::PpapiPermissions permissions_; | 195 ppapi::PpapiPermissions permissions_; |
| 188 | 196 |
| 189 #if defined(OS_WIN) | 197 #if defined(OS_WIN) |
| 190 // This field becomes true when the broker successfully launched | 198 // This field becomes true when the broker successfully launched |
| 191 // the NaCl loader. | 199 // the NaCl loader. |
| 192 bool process_launched_by_broker_; | 200 bool process_launched_by_broker_; |
| 193 #endif | 201 #endif |
| 194 // The NaClHostMessageFilter that requested this NaCl process. We use | 202 // The NaClHostMessageFilter that requested this NaCl process. We use |
| 195 // this for sending the reply once the process has started. | 203 // this for sending the reply once the process has started. |
| 196 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter_; | 204 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 | 244 |
| 237 // Throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. | 245 // Throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. |
| 238 static unsigned keepalive_throttle_interval_milliseconds_; | 246 static unsigned keepalive_throttle_interval_milliseconds_; |
| 239 | 247 |
| 240 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 248 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
| 241 }; | 249 }; |
| 242 | 250 |
| 243 } // namespace nacl | 251 } // namespace nacl |
| 244 | 252 |
| 245 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 253 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
| OLD | NEW |