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 <vector> | 10 #include <vector> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // render_view_id: RenderView routing id, to control access to private APIs. | 67 // render_view_id: RenderView routing id, to control access to private APIs. |
68 // permission_bits: controls which interfaces the NaCl plugin can use. | 68 // permission_bits: controls which interfaces the NaCl plugin can use. |
69 // uses_nonsfi_mode: whether the program should be loaded under non-SFI mode. | 69 // uses_nonsfi_mode: whether the program should be loaded under non-SFI mode. |
70 // off_the_record: was the process launched from an incognito renderer? | 70 // off_the_record: was the process launched from an incognito renderer? |
71 // process_type: the type of NaCl process. | 71 // process_type: the type of NaCl process. |
72 // profile_directory: is the path of current profile directory. | 72 // profile_directory: is the path of current profile directory. |
73 NaClProcessHost( | 73 NaClProcessHost( |
74 const GURL& manifest_url, | 74 const GURL& manifest_url, |
75 base::File nexe_file, | 75 base::File nexe_file, |
76 const NaClFileToken& nexe_token, | 76 const NaClFileToken& nexe_token, |
77 const std::vector< | 77 const std::vector<NaClResourcePrefetchInfo>& resource_prefetch_info_list, |
78 nacl::NaClResourceFileInfo>& prefetched_resource_files_info, | |
79 ppapi::PpapiPermissions permissions, | 78 ppapi::PpapiPermissions permissions, |
80 int render_view_id, | 79 int render_view_id, |
81 uint32 permission_bits, | 80 uint32 permission_bits, |
82 bool uses_nonsfi_mode, | 81 bool uses_nonsfi_mode, |
83 bool off_the_record, | 82 bool off_the_record, |
84 NaClAppProcessType process_type, | 83 NaClAppProcessType process_type, |
85 const base::FilePath& profile_directory); | 84 const base::FilePath& profile_directory); |
86 ~NaClProcessHost() override; | 85 ~NaClProcessHost() override; |
87 | 86 |
88 void OnProcessCrashed(int exit_status) override; | 87 void OnProcessCrashed(int exit_status) override; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void SendErrorToRenderer(const std::string& error_message); | 151 void SendErrorToRenderer(const std::string& error_message); |
153 | 152 |
154 // Sends the reply message to the renderer. Either result or | 153 // Sends the reply message to the renderer. Either result or |
155 // error message must be empty. | 154 // error message must be empty. |
156 void SendMessageToRenderer(const NaClLaunchResult& result, | 155 void SendMessageToRenderer(const NaClLaunchResult& result, |
157 const std::string& error_message); | 156 const std::string& error_message); |
158 | 157 |
159 // Sends the message to the NaCl process to load the plugin. Returns true | 158 // Sends the message to the NaCl process to load the plugin. Returns true |
160 // on success. | 159 // on success. |
161 bool StartNaClExecution(); | 160 bool StartNaClExecution(); |
162 | 161 void StartNaClExecutionAfterFileResolved( |
163 void StartNaClFileResolved( | |
164 NaClStartParams params, | 162 NaClStartParams params, |
165 const base::FilePath& file_path, | 163 scoped_ptr<base::FilePath> nexe_file_path, |
| 164 scoped_ptr<std::vector<NaClResourceFileInfo> > prefetched_resource_files, |
166 base::File nexe_file); | 165 base::File nexe_file); |
167 | 166 |
168 // Does post-process-launching tasks for starting the NaCl process once | 167 // Does post-process-launching tasks for starting the NaCl process once |
169 // we have a connection. | 168 // we have a connection. |
170 // | 169 // |
171 // Returns false on failure. | 170 // Returns false on failure. |
172 bool StartWithLaunchedProcess(); | 171 bool StartWithLaunchedProcess(); |
173 | 172 |
174 // Message handlers for validation caching. | 173 // Message handlers for validation caching. |
175 void OnQueryKnownToValidate(const std::string& signature, bool* result); | 174 void OnQueryKnownToValidate(const std::string& signature, bool* result); |
(...skipping 15 matching lines...) Expand all Loading... |
191 // created. | 190 // created. |
192 void OnPpapiChannelsCreated( | 191 void OnPpapiChannelsCreated( |
193 const IPC::ChannelHandle& browser_channel_handle, | 192 const IPC::ChannelHandle& browser_channel_handle, |
194 const IPC::ChannelHandle& ppapi_renderer_channel_handle, | 193 const IPC::ChannelHandle& ppapi_renderer_channel_handle, |
195 const IPC::ChannelHandle& trusted_renderer_channel_handle, | 194 const IPC::ChannelHandle& trusted_renderer_channel_handle, |
196 const IPC::ChannelHandle& manifest_service_channel_handle); | 195 const IPC::ChannelHandle& manifest_service_channel_handle); |
197 | 196 |
198 GURL manifest_url_; | 197 GURL manifest_url_; |
199 base::File nexe_file_; | 198 base::File nexe_file_; |
200 NaClFileToken nexe_token_; | 199 NaClFileToken nexe_token_; |
201 std::vector<nacl::NaClResourceFileInfo> prefetched_resource_files_info_; | 200 std::vector<NaClResourcePrefetchInfo> resource_prefetch_info_list_; |
202 | 201 |
203 ppapi::PpapiPermissions permissions_; | 202 ppapi::PpapiPermissions permissions_; |
204 | 203 |
205 #if defined(OS_WIN) | 204 #if defined(OS_WIN) |
206 // This field becomes true when the broker successfully launched | 205 // This field becomes true when the broker successfully launched |
207 // the NaCl loader. | 206 // the NaCl loader. |
208 bool process_launched_by_broker_; | 207 bool process_launched_by_broker_; |
209 #endif | 208 #endif |
210 // The NaClHostMessageFilter that requested this NaCl process. We use | 209 // The NaClHostMessageFilter that requested this NaCl process. We use |
211 // this for sending the reply once the process has started. | 210 // this for sending the reply once the process has started. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 base::File socket_for_sel_ldr_; | 252 base::File socket_for_sel_ldr_; |
254 | 253 |
255 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 254 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
256 | 255 |
257 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 256 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
258 }; | 257 }; |
259 | 258 |
260 } // namespace nacl | 259 } // namespace nacl |
261 | 260 |
262 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 261 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
OLD | NEW |