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

Unified Diff: ipc/mojo/async_handle_waiter.h

Issue 929433005: WIP: A couple of more ChannelMojo speedup ideas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build and test fix Created 5 years, 10 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 | « ipc/ipc_perftest_support.cc ('k') | ipc/mojo/async_handle_waiter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/async_handle_waiter.h
diff --git a/ipc/mojo/async_handle_waiter.h b/ipc/mojo/async_handle_waiter.h
index 55acb3eb8e2ecdec369dd56420a678b2da2be810..9b0b4434024954c67398a7bfd9ac0a4aa607917f 100644
--- a/ipc/mojo/async_handle_waiter.h
+++ b/ipc/mojo/async_handle_waiter.h
@@ -27,16 +27,27 @@ class IPC_MOJO_EXPORT AsyncHandleWaiter {
public:
class Context;
- explicit AsyncHandleWaiter(base::Callback<void(MojoResult)> callback);
+ class Delegate {
+ public:
+ virtual void PipeIsReady(MojoResult result) = 0;
+ virtual void MessageWasArrived(const void* bytes, uint32_t num_bytes) = 0;
+ };
+
+ explicit AsyncHandleWaiter(Delegate* delegate);
~AsyncHandleWaiter();
+ void SetMessageCallback(MojoHandle handle);
+ void ClearMessageCallback(MojoHandle handle);
MojoResult Wait(MojoHandle handle, MojoHandleSignals signals);
private:
void InvokeCallback(MojoResult result);
+ void InvokeMessageCallback(const void* bytes, uint32_t num_bytes);
scoped_refptr<Context> context_;
- base::Callback<void(MojoResult)> callback_;
+ Delegate* delegate_;
+ base::Callback<void(MojoResult)> context_callback_;
+ base::Callback<bool(const void*, uint32_t)> context_message_callback_;
base::WeakPtrFactory<AsyncHandleWaiter> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AsyncHandleWaiter);
« no previous file with comments | « ipc/ipc_perftest_support.cc ('k') | ipc/mojo/async_handle_waiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698