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 <string> |
| 11 #include <utility> |
| 12 #include <vector> |
| 13 |
10 #include "base/files/file.h" | 14 #include "base/files/file.h" |
11 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
12 #include "base/files/file_util_proxy.h" | 16 #include "base/files/file_util_proxy.h" |
13 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
14 #include "base/memory/shared_memory.h" | 18 #include "base/memory/shared_memory.h" |
15 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
16 #include "base/message_loop/message_loop.h" | 20 #include "base/message_loop/message_loop.h" |
17 #include "base/process/process.h" | 21 #include "base/process/process.h" |
18 #include "components/nacl/common/nacl_types.h" | 22 #include "components/nacl/common/nacl_types.h" |
19 #include "content/public/browser/browser_child_process_host_delegate.h" | 23 #include "content/public/browser/browser_child_process_host_delegate.h" |
(...skipping 30 matching lines...) Expand all Loading... |
50 // executed. | 54 // executed. |
51 // nexe_file: A file that corresponds to the nexe module to be loaded. | 55 // nexe_file: A file that corresponds to the nexe module to be loaded. |
52 // nexe_token: A cache validation token for nexe_file. | 56 // nexe_token: A cache validation token for nexe_file. |
53 // permissions: PPAPI permissions, to control access to private APIs. | 57 // permissions: PPAPI permissions, to control access to private APIs. |
54 // render_view_id: RenderView routing id, to control access to private APIs. | 58 // render_view_id: RenderView routing id, to control access to private APIs. |
55 // permission_bits: controls which interfaces the NaCl plugin can use. | 59 // permission_bits: controls which interfaces the NaCl plugin can use. |
56 // uses_nonsfi_mode: whether the program should be loaded under non-SFI mode. | 60 // uses_nonsfi_mode: whether the program should be loaded under non-SFI mode. |
57 // off_the_record: was the process launched from an incognito renderer? | 61 // off_the_record: was the process launched from an incognito renderer? |
58 // process_type: the type of NaCl process. | 62 // process_type: the type of NaCl process. |
59 // profile_directory: is the path of current profile directory. | 63 // profile_directory: is the path of current profile directory. |
60 NaClProcessHost(const GURL& manifest_url, | 64 NaClProcessHost( |
61 base::File nexe_file, | 65 const GURL& manifest_url, |
62 const NaClFileToken& nexe_token, | 66 base::File nexe_file, |
63 ppapi::PpapiPermissions permissions, | 67 const NaClFileToken& nexe_token, |
64 int render_view_id, | 68 const std::vector<NaClResourceFileInfo>& resource_files_info, |
65 uint32 permission_bits, | 69 ppapi::PpapiPermissions permissions, |
66 bool uses_nonsfi_mode, | 70 int render_view_id, |
67 bool off_the_record, | 71 uint32 permission_bits, |
68 NaClAppProcessType process_type, | 72 bool uses_nonsfi_mode, |
69 const base::FilePath& profile_directory); | 73 bool off_the_record, |
| 74 NaClAppProcessType process_type, |
| 75 const base::FilePath& profile_directory); |
70 ~NaClProcessHost() override; | 76 ~NaClProcessHost() override; |
71 | 77 |
72 void OnProcessCrashed(int exit_status) override; | 78 void OnProcessCrashed(int exit_status) override; |
73 | 79 |
74 // Do any minimal work that must be done at browser startup. | 80 // Do any minimal work that must be done at browser startup. |
75 static void EarlyStartup(); | 81 static void EarlyStartup(); |
76 | 82 |
77 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. | 83 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. |
78 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds); | 84 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds); |
79 | 85 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // created. | 181 // created. |
176 void OnPpapiChannelsCreated( | 182 void OnPpapiChannelsCreated( |
177 const IPC::ChannelHandle& browser_channel_handle, | 183 const IPC::ChannelHandle& browser_channel_handle, |
178 const IPC::ChannelHandle& ppapi_renderer_channel_handle, | 184 const IPC::ChannelHandle& ppapi_renderer_channel_handle, |
179 const IPC::ChannelHandle& trusted_renderer_channel_handle, | 185 const IPC::ChannelHandle& trusted_renderer_channel_handle, |
180 const IPC::ChannelHandle& manifest_service_channel_handle); | 186 const IPC::ChannelHandle& manifest_service_channel_handle); |
181 | 187 |
182 GURL manifest_url_; | 188 GURL manifest_url_; |
183 base::File nexe_file_; | 189 base::File nexe_file_; |
184 NaClFileToken nexe_token_; | 190 NaClFileToken nexe_token_; |
| 191 std::vector<NaClResourceFileInfo> resource_files_info_; |
185 | 192 |
186 ppapi::PpapiPermissions permissions_; | 193 ppapi::PpapiPermissions permissions_; |
187 | 194 |
188 #if defined(OS_WIN) | 195 #if defined(OS_WIN) |
189 // This field becomes true when the broker successfully launched | 196 // This field becomes true when the broker successfully launched |
190 // the NaCl loader. | 197 // the NaCl loader. |
191 bool process_launched_by_broker_; | 198 bool process_launched_by_broker_; |
192 #endif | 199 #endif |
193 // The NaClHostMessageFilter that requested this NaCl process. We use | 200 // The NaClHostMessageFilter that requested this NaCl process. We use |
194 // this for sending the reply once the process has started. | 201 // this for sending the reply once the process has started. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 base::File socket_for_sel_ldr_; | 243 base::File socket_for_sel_ldr_; |
237 | 244 |
238 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 245 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
239 | 246 |
240 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 247 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
241 }; | 248 }; |
242 | 249 |
243 } // namespace nacl | 250 } // namespace nacl |
244 | 251 |
245 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 252 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
OLD | NEW |