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

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: code review Created 6 years, 1 month 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 <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
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 scoped_ptr<base::File[]> resource_files,
65 uint32 permission_bits, 69 const std::vector<std::pair<uint64_t, uint64_t> >& resource_file_tokens,
66 bool uses_nonsfi_mode, 70 const std::vector<std::string>& resource_keys,
67 bool off_the_record, 71 ppapi::PpapiPermissions permissions,
68 NaClAppProcessType process_type, 72 int render_view_id,
69 const base::FilePath& profile_directory); 73 uint32 permission_bits,
74 bool uses_nonsfi_mode,
75 bool off_the_record,
76 NaClAppProcessType process_type,
77 const base::FilePath& profile_directory);
70 ~NaClProcessHost() override; 78 ~NaClProcessHost() override;
71 79
72 void OnProcessCrashed(int exit_status) override; 80 void OnProcessCrashed(int exit_status) override;
73 81
74 // Do any minimal work that must be done at browser startup. 82 // Do any minimal work that must be done at browser startup.
75 static void EarlyStartup(); 83 static void EarlyStartup();
76 84
77 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. 85 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs.
78 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds); 86 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds);
79 87
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 void OnPpapiChannelsCreated( 184 void OnPpapiChannelsCreated(
177 const IPC::ChannelHandle& browser_channel_handle, 185 const IPC::ChannelHandle& browser_channel_handle,
178 const IPC::ChannelHandle& ppapi_renderer_channel_handle, 186 const IPC::ChannelHandle& ppapi_renderer_channel_handle,
179 const IPC::ChannelHandle& trusted_renderer_channel_handle, 187 const IPC::ChannelHandle& trusted_renderer_channel_handle,
180 const IPC::ChannelHandle& manifest_service_channel_handle); 188 const IPC::ChannelHandle& manifest_service_channel_handle);
181 189
182 GURL manifest_url_; 190 GURL manifest_url_;
183 base::File nexe_file_; 191 base::File nexe_file_;
184 NaClFileToken nexe_token_; 192 NaClFileToken nexe_token_;
185 193
194 scoped_ptr<base::File[]> resource_files_;
195 std::vector<std::pair<uint64_t, uint64_t> > resource_file_tokens_;
196 std::vector<std::string> resource_keys_;
197
186 ppapi::PpapiPermissions permissions_; 198 ppapi::PpapiPermissions permissions_;
187 199
188 #if defined(OS_WIN) 200 #if defined(OS_WIN)
189 // This field becomes true when the broker successfully launched 201 // This field becomes true when the broker successfully launched
190 // the NaCl loader. 202 // the NaCl loader.
191 bool process_launched_by_broker_; 203 bool process_launched_by_broker_;
192 #endif 204 #endif
193 // The NaClHostMessageFilter that requested this NaCl process. We use 205 // The NaClHostMessageFilter that requested this NaCl process. We use
194 // this for sending the reply once the process has started. 206 // this for sending the reply once the process has started.
195 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter_; 207 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 base::File socket_for_sel_ldr_; 248 base::File socket_for_sel_ldr_;
237 249
238 base::WeakPtrFactory<NaClProcessHost> weak_factory_; 250 base::WeakPtrFactory<NaClProcessHost> weak_factory_;
239 251
240 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); 252 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost);
241 }; 253 };
242 254
243 } // namespace nacl 255 } // namespace nacl
244 256
245 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ 257 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698