Support custom message filtering on Mojo binding objects
* Replaces MessageFilter with MessageReceiver
* Updates FilterChain to always end on the sink, short-circuiting
if any "filter" (receiver) rejects along the way
* Adds a new AddFilter() interface to mojo::Binding and
mojo::AssociatedBinding, allowing users to inject MessageReceiver
filters to be run immediately before every message dispatch
BUG=612500
[email protected]
[email protected]
Review-Url: https://codereview.chromium.org/2276043002
Cr-Commit-Position: refs/heads/master@{#414197}
diff --git a/mojo/public/cpp/bindings/lib/message.cc b/mojo/public/cpp/bindings/lib/message.cc
index d99ced3..0018a03b 100644
--- a/mojo/public/cpp/bindings/lib/message.cc
+++ b/mojo/public/cpp/bindings/lib/message.cc
@@ -114,6 +114,12 @@
}
}
+PassThroughFilter::PassThroughFilter() {}
+
+PassThroughFilter::~PassThroughFilter() {}
+
+bool PassThroughFilter::Accept(Message* message) { return true; }
+
SyncMessageResponseContext::SyncMessageResponseContext()
: outer_context_(current()) {
g_tls_sync_response_context.Get().Set(this);