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

Unified Diff: mojo/edk/system/ports/message_filter.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
Index: mojo/edk/system/ports/message_filter.h
diff --git a/mojo/edk/system/ports/message_filter.h b/mojo/edk/system/ports/message_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf8fa2196659312212666dda105b85171ab5a480
--- /dev/null
+++ b/mojo/edk/system/ports/message_filter.h
@@ -0,0 +1,29 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EDK_SYSTEM_PORTS_MESSAGE_FILTER_H_
+#define MOJO_EDK_SYSTEM_PORTS_MESSAGE_FILTER_H_
+
+namespace mojo {
+namespace edk {
+namespace ports {
+
+class Message;
+
+// An interface which can be implemented to filter port messages according to
+// arbitrary policy.
+class MessageFilter {
+ public:
+ virtual ~MessageFilter() {}
+
+ // Returns true of |message| should be accepted by whomever is applying this
+ // filter. See MessageQueue::GetNextMessage(), for example.
+ virtual bool Match(const Message& message) = 0;
+};
+
+} // namespace ports
+} // namespace edk
+} // namespace mojo
+
+#endif // MOJO_EDK_SYSTEM_PORTS_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698