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

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

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_queue.h ('k') | mojo/edk/system/ports/node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/message_queue.cc
diff --git a/mojo/edk/system/ports/message_queue.cc b/mojo/edk/system/ports/message_queue.cc
index ef2e94009897c9e0474585854899c9127ae62122..defb1b6c759670a963f5566c11f5babffc75fec0 100644
--- a/mojo/edk/system/ports/message_queue.cc
+++ b/mojo/edk/system/ports/message_queue.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "mojo/edk/system/ports/event.h"
+#include "mojo/edk/system/ports/message_filter.h"
namespace mojo {
namespace edk {
@@ -44,10 +45,9 @@ bool MessageQueue::HasNextMessage() const {
return !heap_.empty() && GetSequenceNum(heap_[0]) == next_sequence_num_;
}
-void MessageQueue::GetNextMessageIf(
- std::function<bool(const Message&)> selector,
- ScopedMessage* message) {
- if (!HasNextMessage() || (selector && !selector(*heap_[0].get()))) {
+void MessageQueue::GetNextMessage(ScopedMessage* message,
+ MessageFilter* filter) {
+ if (!HasNextMessage() || (filter && !filter->Match(*heap_[0].get()))) {
message->reset();
return;
}
« no previous file with comments | « mojo/edk/system/ports/message_queue.h ('k') | mojo/edk/system/ports/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698