| 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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // when requested by the renderer. | 43 // when requested by the renderer. |
| 44 // After that, most of the communication is directly between NaCl plugin | 44 // After that, most of the communication is directly between NaCl plugin |
| 45 // running in the renderer and NaCl processes. | 45 // running in the renderer and NaCl processes. |
| 46 class NaClProcessHost : public content::BrowserChildProcessHostDelegate { | 46 class NaClProcessHost : public content::BrowserChildProcessHostDelegate { |
| 47 public: | 47 public: |
| 48 // manifest_url: the URL of the manifest of the Native Client plugin being | 48 // manifest_url: the URL of the manifest of the Native Client plugin being |
| 49 // executed. | 49 // executed. |
| 50 // render_view_id: RenderView routing id, to control access to private APIs. | 50 // render_view_id: RenderView routing id, to control access to private APIs. |
| 51 // permission_bits: controls which interfaces the NaCl plugin can use. | 51 // permission_bits: controls which interfaces the NaCl plugin can use. |
| 52 // uses_irt: whether the launched process should use the IRT. | 52 // uses_irt: whether the launched process should use the IRT. |
| 53 // uses_nonsfi_mode: whether the program should be loaded under non-SFI mode. |
| 53 // enable_dyncode_syscalls: whether the launched process should allow dyncode | 54 // enable_dyncode_syscalls: whether the launched process should allow dyncode |
| 54 // and mmap with PROT_EXEC. | 55 // and mmap with PROT_EXEC. |
| 55 // enable_exception_handling: whether the launched process should allow | 56 // enable_exception_handling: whether the launched process should allow |
| 56 // hardware exception handling. | 57 // hardware exception handling. |
| 57 // enable_crash_throttling: whether a crash of this process contributes | 58 // enable_crash_throttling: whether a crash of this process contributes |
| 58 // to the crash throttling statistics, and also | 59 // to the crash throttling statistics, and also |
| 59 // whether this process should not start when too | 60 // whether this process should not start when too |
| 60 // many crashes have been observed. | 61 // many crashes have been observed. |
| 61 // off_the_record: was the process launched from an incognito renderer? | 62 // off_the_record: was the process launched from an incognito renderer? |
| 62 // profile_directory: is the path of current profile directory. | 63 // profile_directory: is the path of current profile directory. |
| 63 NaClProcessHost(const GURL& manifest_url, | 64 NaClProcessHost(const GURL& manifest_url, |
| 64 int render_view_id, | 65 int render_view_id, |
| 65 uint32 permission_bits, | 66 uint32 permission_bits, |
| 66 bool uses_irt, | 67 bool uses_irt, |
| 68 bool uses_nonsfi_mode, |
| 67 bool enable_dyncode_syscalls, | 69 bool enable_dyncode_syscalls, |
| 68 bool enable_exception_handling, | 70 bool enable_exception_handling, |
| 69 bool enable_crash_throttling, | 71 bool enable_crash_throttling, |
| 70 bool off_the_record, | 72 bool off_the_record, |
| 71 const base::FilePath& profile_directory); | 73 const base::FilePath& profile_directory); |
| 72 virtual ~NaClProcessHost(); | 74 virtual ~NaClProcessHost(); |
| 73 | 75 |
| 74 virtual void OnProcessCrashed(int exit_status) OVERRIDE; | 76 virtual void OnProcessCrashed(int exit_status) OVERRIDE; |
| 75 | 77 |
| 76 // Do any minimal work that must be done at browser startup. | 78 // Do any minimal work that must be done at browser startup. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 base::FilePath manifest_path_; | 195 base::FilePath manifest_path_; |
| 194 | 196 |
| 195 // Socket pairs for the NaCl process and renderer. | 197 // Socket pairs for the NaCl process and renderer. |
| 196 scoped_ptr<NaClInternal> internal_; | 198 scoped_ptr<NaClInternal> internal_; |
| 197 | 199 |
| 198 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 200 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
| 199 | 201 |
| 200 scoped_ptr<content::BrowserChildProcessHost> process_; | 202 scoped_ptr<content::BrowserChildProcessHost> process_; |
| 201 | 203 |
| 202 bool uses_irt_; | 204 bool uses_irt_; |
| 205 bool uses_nonsfi_mode_; |
| 203 | 206 |
| 204 bool enable_debug_stub_; | 207 bool enable_debug_stub_; |
| 205 bool enable_dyncode_syscalls_; | 208 bool enable_dyncode_syscalls_; |
| 206 bool enable_exception_handling_; | 209 bool enable_exception_handling_; |
| 207 bool enable_crash_throttling_; | 210 bool enable_crash_throttling_; |
| 208 | 211 |
| 209 bool off_the_record_; | 212 bool off_the_record_; |
| 210 | 213 |
| 211 const base::FilePath profile_directory_; | 214 const base::FilePath profile_directory_; |
| 212 | 215 |
| 213 // Channel proxy to terminate the NaCl-Browser PPAPI channel. | 216 // Channel proxy to terminate the NaCl-Browser PPAPI channel. |
| 214 scoped_ptr<IPC::ChannelProxy> ipc_proxy_channel_; | 217 scoped_ptr<IPC::ChannelProxy> ipc_proxy_channel_; |
| 215 // Browser host for plugin process. | 218 // Browser host for plugin process. |
| 216 scoped_ptr<content::BrowserPpapiHost> ppapi_host_; | 219 scoped_ptr<content::BrowserPpapiHost> ppapi_host_; |
| 217 | 220 |
| 218 int render_view_id_; | 221 int render_view_id_; |
| 219 | 222 |
| 220 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 223 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
| 221 }; | 224 }; |
| 222 | 225 |
| 223 } // namespace nacl | 226 } // namespace nacl |
| 224 | 227 |
| 225 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 228 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
| OLD | NEW |