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

Unified Diff: third_party/mojo/src/mojo/edk/system/dispatcher.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 | « third_party/mojo/src/mojo/edk/system/core.cc ('k') | third_party/mojo/src/mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/mojo/src/mojo/edk/system/dispatcher.h
diff --git a/third_party/mojo/src/mojo/edk/system/dispatcher.h b/third_party/mojo/src/mojo/edk/system/dispatcher.h
index c069269b1a2bee1aae2eb5c94e2a20ce2857a2a6..a15bed197525ae1d6eb10c148188f0e52a4760b8 100644
--- a/third_party/mojo/src/mojo/edk/system/dispatcher.h
+++ b/third_party/mojo/src/mojo/edk/system/dispatcher.h
@@ -10,6 +10,7 @@
#include <vector>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -42,6 +43,8 @@ class TransportData;
class Awakable;
typedef std::vector<scoped_refptr<Dispatcher>> DispatcherVector;
+typedef base::Callback<bool(const void* bytes, uint32_t num_bytes)>
+ AsyncMessageCallback;
namespace test {
@@ -152,6 +155,8 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
// |*signals_state| will be set to the current handle signals state.
void RemoveAwakable(Awakable* awakable, HandleSignalsState* signals_state);
+ MojoResult SetAsyncMessageCallback(const AsyncMessageCallback& callback);
+
// A dispatcher must be put into a special state in order to be sent across a
// message pipe. Outside of tests, only |HandleTableAccess| is allowed to do
// this, since there are requirements on the handle table (see below).
@@ -274,6 +279,9 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
virtual void RemoveAwakableImplNoLock(Awakable* awakable,
HandleSignalsState* signals_state);
+ virtual MojoResult SetAsyncMessageCallbackImplNoLock(
+ const AsyncMessageCallback& callback);
+
// These implement the API used to serialize dispatchers to a |Channel|
// (described below). They will only be called on a dispatcher that's attached
// to and "owned" by a |MessageInTransit|. See the non-"impl" versions for
« no previous file with comments | « third_party/mojo/src/mojo/edk/system/core.cc ('k') | third_party/mojo/src/mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698