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

Unified Diff: mojo/edk/system/ports/node.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/node.h ('k') | mojo/edk/system/ports/ports_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/node.cc
diff --git a/mojo/edk/system/ports/node.cc b/mojo/edk/system/ports/node.cc
index 93bb7c38b727ce0a6fd56d967b561b3409f052d8..186e8aaad95795f6f608555a0d7c16d17a73db40 100644
--- a/mojo/edk/system/ports/node.cc
+++ b/mojo/edk/system/ports/node.cc
@@ -263,16 +263,12 @@ int Node::GetStatus(const PortRef& port_ref, PortStatus* port_status) {
return OK;
}
-int Node::GetMessage(const PortRef& port_ref, ScopedMessage* message) {
- return GetMessageIf(port_ref, nullptr, message);
-}
-
-int Node::GetMessageIf(const PortRef& port_ref,
- std::function<bool(const Message&)> selector,
- ScopedMessage* message) {
+int Node::GetMessage(const PortRef& port_ref,
+ ScopedMessage* message,
+ MessageFilter* filter) {
*message = nullptr;
- DVLOG(4) << "GetMessageIf for " << port_ref.name() << "@" << name_;
+ DVLOG(4) << "GetMessage for " << port_ref.name() << "@" << name_;
Port* port = port_ref.port();
{
@@ -288,7 +284,7 @@ int Node::GetMessageIf(const PortRef& port_ref,
if (!CanAcceptMoreMessages(port))
return ERROR_PORT_PEER_CLOSED;
- port->message_queue.GetNextMessageIf(std::move(selector), message);
+ port->message_queue.GetNextMessage(message, filter);
}
// Allow referenced ports to trigger PortStatusChanged calls.
@@ -994,7 +990,7 @@ int Node::AcceptPort(const PortName& port_name,
<< port->last_sequence_num_to_receive << "]";
// A newly accepted port is not signalable until the message referencing the
- // new port finds its way to the consumer (see GetMessageIf).
+ // new port finds its way to the consumer (see GetMessage).
port->message_queue.set_signalable(false);
int rv = AddPortWithName(port_name, port);
@@ -1176,7 +1172,7 @@ int Node::ForwardMessages_Locked(const LockedPort& port,
for (;;) {
ScopedMessage message;
- port->message_queue.GetNextMessageIf(nullptr, &message);
+ port->message_queue.GetNextMessage(&message, nullptr);
if (!message)
break;
« no previous file with comments | « mojo/edk/system/ports/node.h ('k') | mojo/edk/system/ports/ports_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698