Chromium Code Reviews| 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..25833bd7111ec4c69f6a45b647347832af8e7b04 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,16 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>, |
| virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
| virtual void OnChannelError() OVERRIDE; |
| + typedef base::Callback<void(uint64_t, // file_token_lo |
| + uint64_t, // file_token_hi |
| + base::Callback<void(IPC::PlatformFileForTransit, |
| + base::FilePath)>)> |
|
dmichael (off chromium)
2014/08/27 20:49:14
nit: Maybe a typedef for the internal one might ma
teravest
2014/09/04 22:13:30
Done.
|
| + ResolveFileTokenCallback; |
| + |
| + void set_resolve_file_token_callback(ResolveFileTokenCallback cb) { |
| + resolve_file_token_cb_ = cb; |
| + } |
|
dmichael (off chromium)
2014/08/27 20:49:14
Somewhere in here it might make sense to document
teravest
2014/09/04 22:13:30
Done.
|
| + |
| private: |
| friend class base::RefCountedThreadSafe<NaClIPCAdapter>; |
| @@ -158,6 +170,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); |
| @@ -182,6 +200,9 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>, |
| base::ConditionVariable cond_var_; |
| scoped_refptr<base::TaskRunner> task_runner_; |
| + scoped_refptr<base::TaskRunner> main_task_runner_; |
| + |
| + ResolveFileTokenCallback resolve_file_token_cb_; |
| // To be accessed inside of lock_ only. |
| LockedData locked_data_; |