Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: components/nacl/browser/nacl_process_host.h

Issue 649603004: Non-SFI NaCl: Batch-open resource files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11
10 #include "base/files/file.h" 12 #include "base/files/file.h"
11 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
12 #include "base/files/file_util_proxy.h" 14 #include "base/files/file_util_proxy.h"
13 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
14 #include "base/memory/shared_memory.h" 16 #include "base/memory/shared_memory.h"
15 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
16 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
17 #include "base/process/process.h" 19 #include "base/process/process.h"
18 #include "components/nacl/common/nacl_types.h" 20 #include "components/nacl/common/nacl_types.h"
19 #include "content/public/browser/browser_child_process_host_delegate.h" 21 #include "content/public/browser/browser_child_process_host_delegate.h"
(...skipping 22 matching lines...) Expand all
42 // channel. There will be one NaClProcessHost per NaCl process 44 // channel. There will be one NaClProcessHost per NaCl process
43 // The browser is responsible for starting the NaCl process 45 // The browser is responsible for starting the NaCl process
44 // when requested by the renderer. 46 // when requested by the renderer.
45 // After that, most of the communication is directly between NaCl plugin 47 // After that, most of the communication is directly between NaCl plugin
46 // running in the renderer and NaCl processes. 48 // running in the renderer and NaCl processes.
47 class NaClProcessHost : public content::BrowserChildProcessHostDelegate { 49 class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
48 public: 50 public:
49 // manifest_url: the URL of the manifest of the Native Client plugin being 51 // manifest_url: the URL of the manifest of the Native Client plugin being
50 // executed. 52 // executed.
51 // nexe_file: A file that corresponds to the nexe module to be loaded. 53 // nexe_file: A file that corresponds to the nexe module to be loaded.
52 // nexe_token: A cache validation token for nexe_file. 54 // nexe_token: A cache validation token for nexe_file.
Mark Seaborn 2015/03/04 05:07:30 Nit: update this comment with the extra arg
Yusuke Sato 2015/03/04 18:45:49 Done.
53 // permissions: PPAPI permissions, to control access to private APIs. 55 // permissions: PPAPI permissions, to control access to private APIs.
54 // render_view_id: RenderView routing id, to control access to private APIs. 56 // render_view_id: RenderView routing id, to control access to private APIs.
55 // permission_bits: controls which interfaces the NaCl plugin can use. 57 // permission_bits: controls which interfaces the NaCl plugin can use.
56 // uses_nonsfi_mode: whether the program should be loaded under non-SFI mode. 58 // 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? 59 // off_the_record: was the process launched from an incognito renderer?
58 // process_type: the type of NaCl process. 60 // process_type: the type of NaCl process.
59 // profile_directory: is the path of current profile directory. 61 // profile_directory: is the path of current profile directory.
60 NaClProcessHost(const GURL& manifest_url, 62 NaClProcessHost(
61 base::File nexe_file, 63 const GURL& manifest_url,
62 const NaClFileToken& nexe_token, 64 base::File nexe_file,
63 ppapi::PpapiPermissions permissions, 65 const NaClFileToken& nexe_token,
64 int render_view_id, 66 const std::vector<
65 uint32 permission_bits, 67 nacl::NaClResourceFileInfo>& prefetched_resource_files_info,
66 bool uses_nonsfi_mode, 68 ppapi::PpapiPermissions permissions,
67 bool off_the_record, 69 int render_view_id,
68 NaClAppProcessType process_type, 70 uint32 permission_bits,
69 const base::FilePath& profile_directory); 71 bool uses_nonsfi_mode,
72 bool off_the_record,
73 NaClAppProcessType process_type,
74 const base::FilePath& profile_directory);
70 ~NaClProcessHost() override; 75 ~NaClProcessHost() override;
71 76
72 void OnProcessCrashed(int exit_status) override; 77 void OnProcessCrashed(int exit_status) override;
73 78
74 // Do any minimal work that must be done at browser startup. 79 // Do any minimal work that must be done at browser startup.
75 static void EarlyStartup(); 80 static void EarlyStartup();
76 81
77 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. 82 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs.
78 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds); 83 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds);
79 84
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // created. 180 // created.
176 void OnPpapiChannelsCreated( 181 void OnPpapiChannelsCreated(
177 const IPC::ChannelHandle& browser_channel_handle, 182 const IPC::ChannelHandle& browser_channel_handle,
178 const IPC::ChannelHandle& ppapi_renderer_channel_handle, 183 const IPC::ChannelHandle& ppapi_renderer_channel_handle,
179 const IPC::ChannelHandle& trusted_renderer_channel_handle, 184 const IPC::ChannelHandle& trusted_renderer_channel_handle,
180 const IPC::ChannelHandle& manifest_service_channel_handle); 185 const IPC::ChannelHandle& manifest_service_channel_handle);
181 186
182 GURL manifest_url_; 187 GURL manifest_url_;
183 base::File nexe_file_; 188 base::File nexe_file_;
184 NaClFileToken nexe_token_; 189 NaClFileToken nexe_token_;
190 std::vector<nacl::NaClResourceFileInfo> prefetched_resource_files_info_;
185 191
186 ppapi::PpapiPermissions permissions_; 192 ppapi::PpapiPermissions permissions_;
187 193
188 #if defined(OS_WIN) 194 #if defined(OS_WIN)
189 // This field becomes true when the broker successfully launched 195 // This field becomes true when the broker successfully launched
190 // the NaCl loader. 196 // the NaCl loader.
191 bool process_launched_by_broker_; 197 bool process_launched_by_broker_;
192 #endif 198 #endif
193 // The NaClHostMessageFilter that requested this NaCl process. We use 199 // The NaClHostMessageFilter that requested this NaCl process. We use
194 // this for sending the reply once the process has started. 200 // this for sending the reply once the process has started.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 base::File socket_for_sel_ldr_; 242 base::File socket_for_sel_ldr_;
237 243
238 base::WeakPtrFactory<NaClProcessHost> weak_factory_; 244 base::WeakPtrFactory<NaClProcessHost> weak_factory_;
239 245
240 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); 246 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost);
241 }; 247 };
242 248
243 } // namespace nacl 249 } // namespace nacl
244 250
245 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ 251 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698