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

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

Issue 418423002: Pepper: Stop using SRPC for irt_open_resource(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/loader/DEPS ('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 d361995a8988da9ce4eb9529a8e2542941199da9..2948f00683525fd795db32a5081b515b3b205223 100644
--- a/components/nacl/loader/nacl_ipc_adapter.h
+++ b/components/nacl/loader/nacl_ipc_adapter.h
@@ -11,6 +11,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
@@ -20,6 +21,7 @@
#include "base/synchronization/lock.h"
#include "base/task_runner.h"
#include "ipc/ipc_listener.h"
+#include "ipc/ipc_platform_file.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/proxy/nacl_message_scanner.h"
@@ -112,6 +114,22 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>,
virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
virtual void OnChannelError() OVERRIDE;
+ typedef base::Callback<void(IPC::PlatformFileForTransit, base::FilePath)>
+ ResolveFileTokenReplyCallback;
+
+ typedef base::Callback<void(uint64_t, // file_token_lo
+ uint64_t, // file_token_hi
+ ResolveFileTokenReplyCallback)>
+ ResolveFileTokenCallback;
+
+ // Sets a callback to be invoked for resolving file tokens received from the
+ // renderer. When the file token is resolved, the
+ // ResolveFileTokenReplyCallback passed inside the ResolveFileTokenCallback
+ // will be invoked.
+ void set_resolve_file_token_callback(ResolveFileTokenCallback cb) {
+ resolve_file_token_cb_ = cb;
+ }
+
private:
friend class base::RefCountedThreadSafe<NaClIPCAdapter>;
@@ -158,6 +176,12 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>,
virtual ~NaClIPCAdapter();
+ void OnFileTokenResolved(const IPC::Message& orig_msg,
+ IPC::PlatformFileForTransit ipc_fd,
+ base::FilePath file_path);
+
+ bool RewriteMessage(const IPC::Message& msg, uint32_t type);
+
// Returns 0 if nothing is waiting.
int LockedReceive(NaClImcTypedMsgHdr* msg);
@@ -183,6 +207,8 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>,
scoped_refptr<base::TaskRunner> task_runner_;
+ ResolveFileTokenCallback resolve_file_token_cb_;
+
// To be accessed inside of lock_ only.
LockedData locked_data_;
« no previous file with comments | « components/nacl/loader/DEPS ('k') | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698