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

Unified Diff: components/nacl/loader/nacl_ipc_adapter.h

Issue 728113002: obsolete: SFI NaCl: Batch-open resource files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/browser/nacl_process_host.cc ('k') | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nacl_ipc_adapter.h
diff --git a/components/nacl/loader/nacl_ipc_adapter.h b/components/nacl/loader/nacl_ipc_adapter.h
index 4a0a4b77aa09899df3e3cfd66cdef01ab5bf0aab..116c239e794878e0a992225281c5980a1765da9a 100644
--- a/components/nacl/loader/nacl_ipc_adapter.h
+++ b/components/nacl/loader/nacl_ipc_adapter.h
@@ -131,6 +131,22 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>,
resolve_file_token_cb_ = cb;
}
+ typedef base::Callback<void(const IPC::Message&,
+ IPC::PlatformFileForTransit,
+ base::FilePath)> OpenResourceReplyCallback;
+
+ typedef base::Callback<bool(const IPC::Message&,
+ const std::string&, // key
+ OpenResourceReplyCallback)> OpenResourceCallback;
+
+ // Sets a callback to be invoked for intercepting open_resource IRT calls.
+ // The callback may immediately call a OpenResourceReplyCallback function to
+ // send a pre-opened resrouce descriptor to the untrusted side.
+ // OpenResourceCallback returns true when OpenResourceReplyCallback is called.
+ void set_open_resource_callback(OpenResourceCallback cb) {
+ open_resource_cb_ = cb;
+ }
+
private:
friend class base::RefCountedThreadSafe<NaClIPCAdapter>;
@@ -180,6 +196,9 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>,
void OnFileTokenResolved(const IPC::Message& orig_msg,
IPC::PlatformFileForTransit ipc_fd,
base::FilePath file_path);
+ void OnFileTokenResolvedLocked(const IPC::Message& orig_msg,
+ IPC::PlatformFileForTransit ipc_fd,
+ base::FilePath file_path);
bool RewriteMessage(const IPC::Message& msg, uint32_t type);
@@ -209,6 +228,7 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>,
scoped_refptr<base::TaskRunner> task_runner_;
ResolveFileTokenCallback resolve_file_token_cb_;
+ OpenResourceCallback open_resource_cb_;
// To be accessed inside of lock_ only.
LockedData locked_data_;
« no previous file with comments | « components/nacl/browser/nacl_process_host.cc ('k') | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698