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

Unified 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: Remove ipc/ and mojo/ changes following Mark's suggestion Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: components/nacl/browser/nacl_process_host.h
diff --git a/components/nacl/browser/nacl_process_host.h b/components/nacl/browser/nacl_process_host.h
index 6db28c0db5791d1db800525269f162238a6706f1..1617a127a4a5bc9529a9a80b8aa27694b658e2ba 100644
--- a/components/nacl/browser/nacl_process_host.h
+++ b/components/nacl/browser/nacl_process_host.h
@@ -7,6 +7,10 @@
#include "build/build_config.h"
+#include <string>
+#include <utility>
+#include <vector>
+
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util_proxy.h"
@@ -46,6 +50,7 @@ void* AllocateAddressSpaceASLR(base::ProcessHandle process, size_t size);
// running in the renderer and NaCl processes.
class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
public:
+ class ResourceFileInfo;
// manifest_url: the URL of the manifest of the Native Client plugin being
// executed.
// nexe_file: A file that corresponds to the nexe module to be loaded.
@@ -57,16 +62,19 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
// off_the_record: was the process launched from an incognito renderer?
// process_type: the type of NaCl process.
// profile_directory: is the path of current profile directory.
- NaClProcessHost(const GURL& manifest_url,
- base::File nexe_file,
- const NaClFileToken& nexe_token,
- ppapi::PpapiPermissions permissions,
- int render_view_id,
- uint32 permission_bits,
- bool uses_nonsfi_mode,
- bool off_the_record,
- NaClAppProcessType process_type,
- const base::FilePath& profile_directory);
+ NaClProcessHost(
+ const GURL& manifest_url,
+ base::File nexe_file,
+ const NaClFileToken& nexe_token,
+ scoped_ptr<ResourceFileInfo[]> resource_files_info,
+ size_t resource_files_info_len_,
+ ppapi::PpapiPermissions permissions,
+ int render_view_id,
+ uint32 permission_bits,
+ bool uses_nonsfi_mode,
+ bool off_the_record,
+ NaClAppProcessType process_type,
+ const base::FilePath& profile_directory);
~NaClProcessHost() override;
void OnProcessCrashed(int exit_status) override;
@@ -95,6 +103,28 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
content::BrowserChildProcessHost* process() { return process_.get(); }
content::BrowserPpapiHost* browser_ppapi_host() { return ppapi_host_.get(); }
+ class ResourceFileInfo {
hidehiko 2015/01/28 09:05:19 Let's avoid public nested class. http://google-sty
Mark Seaborn 2015/02/02 23:21:50 I agree.
Yusuke Sato 2015/02/04 02:00:28 Done.
Yusuke Sato 2015/02/04 02:00:28 Done.
+ MOVE_ONLY_TYPE_FOR_CPP_03(ResourceFileInfo, RValue);
+ public:
+ ResourceFileInfo();
+ ResourceFileInfo(base::File file,
+ const NaClFileToken& file_token,
+ const std::string& file_key);
+ ~ResourceFileInfo();
+
+ ResourceFileInfo(RValue other);
+ ResourceFileInfo& operator=(RValue other);
+
+ base::File file() { return file_.Pass(); }
hidehiko 2015/01/28 09:05:19 Releasing the ownership by getter looks confusing.
Mark Seaborn 2015/02/02 23:21:50 Indeed... Any reason not to make this a struct, an
Yusuke Sato 2015/02/04 02:00:28 Done.
Yusuke Sato 2015/02/04 02:00:28 Done.
+ const NaClFileToken& file_token() const { return file_token_; }
+ const std::string& file_key() const { return file_key_; }
+
+ private:
+ base::File file_;
+ NaClFileToken file_token_;
+ std::string file_key_;
+ };
+
private:
bool LaunchNaClGdb();
@@ -182,6 +212,8 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
GURL manifest_url_;
base::File nexe_file_;
NaClFileToken nexe_token_;
+ scoped_ptr<ResourceFileInfo[]> resource_files_info_;
+ size_t resource_files_info_len_;
ppapi::PpapiPermissions permissions_;

Powered by Google App Engine
This is Rietveld 408576698