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

Unified Diff: mojo/edk/system/ports/message_queue.h

Issue 2466993004: Remove use of std::function from Mojo internals (Closed)
Patch Set: . Created 4 years, 1 month 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 | « mojo/edk/system/ports/message_filter.h ('k') | mojo/edk/system/ports/message_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/message_queue.h
diff --git a/mojo/edk/system/ports/message_queue.h b/mojo/edk/system/ports/message_queue.h
index d90ac1ace9e9dfe0b2324e917c0253402cfab1c3..d9a47ed0a138dbda6e3b61bce5215414164cef26 100644
--- a/mojo/edk/system/ports/message_queue.h
+++ b/mojo/edk/system/ports/message_queue.h
@@ -22,6 +22,8 @@ namespace ports {
const uint64_t kInitialSequenceNum = 1;
const uint64_t kInvalidSequenceNum = std::numeric_limits<uint64_t>::max();
+class MessageFilter;
+
// An incoming message queue for a port. MessageQueue keeps track of the highest
// known sequence number and can indicate whether the next sequential message is
// available. Thus the queue enforces message ordering for the consumer without
@@ -38,9 +40,9 @@ class MessageQueue {
bool HasNextMessage() const;
- // Gives ownership of the message. The selector may be null.
- void GetNextMessageIf(std::function<bool(const Message&)> selector,
- ScopedMessage* message);
+ // Gives ownership of the message. If |filter| is non-null, the next message
+ // will only be retrieved if the filter successfully matches it.
+ void GetNextMessage(ScopedMessage* message, MessageFilter* filter);
// Takes ownership of the message. Note: Messages are ordered, so while we
// have added a message to the queue, we may still be waiting on a message
« no previous file with comments | « mojo/edk/system/ports/message_filter.h ('k') | mojo/edk/system/ports/message_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698