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 4a0a4b77aa09899df3e3cfd66cdef01ab5bf0aab..2344bdd76ee09ab235e60c29de6c8383ba22e9e8 100644 |
| --- a/components/nacl/loader/nacl_ipc_adapter.h |
| +++ b/components/nacl/loader/nacl_ipc_adapter.h |
| @@ -72,6 +72,14 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>, |
| }; |
| #pragma pack(pop) |
| + 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; |
| + |
| // Creates an adapter, using the thread associated with the given task |
| // runner for posting messages. In normal use, the task runner will post to |
| // the I/O thread of the process. |
| @@ -79,7 +87,15 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>, |
| // If you use this constructor, you MUST call ConnectChannel after the |
| // NaClIPCAdapter is constructed, or the NaClIPCAdapter's channel will not be |
| // connected. |
| - NaClIPCAdapter(const IPC::ChannelHandle& handle, base::TaskRunner* runner); |
| + // |
| + // |resolve_file_token_cb| is a callback to be invoked for resolving file |
|
Mark Seaborn
2015/04/16 20:51:21
Maybe say "optional callback"?
Yusuke Sato
2015/04/16 21:25:02
Done.
|
| + // tokens received from the renderer. When the file token is resolved, the |
| + // ResolveFileTokenReplyCallback passed inside the ResolveFileTokenCallback |
| + // will be invoked. |
| + NaClIPCAdapter( |
| + const IPC::ChannelHandle& handle, |
| + base::TaskRunner* runner, |
| + ResolveFileTokenCallback resolve_file_token_cb); |
| // Initializes with a given channel that's already created for testing |
| // purposes. This function will take ownership of the given channel. |
| @@ -115,22 +131,6 @@ class NaClIPCAdapter : public base::RefCountedThreadSafe<NaClIPCAdapter>, |
| void OnChannelConnected(int32 peer_pid) override; |
| 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>; |