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

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

Issue 1090043002: Merge NaClIPCAdapter::set_resolve_file_token_callback() into the constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 8 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 | « no previous file | 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..ece964ea2802bd4e101908003fbfc82da6e2e5a0 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 an optional 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.
+ 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>;
« no previous file with comments | « no previous file | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698