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

Unified Diff: mojo/public/cpp/bindings/interface_endpoint_client.h

Issue 2276043002: Support custom message filtering on Mojo binding objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 4 months 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/public/cpp/bindings/filter_chain.h ('k') | mojo/public/cpp/bindings/lib/binding_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/interface_endpoint_client.h
diff --git a/mojo/public/cpp/bindings/interface_endpoint_client.h b/mojo/public/cpp/bindings/interface_endpoint_client.h
index b0b42c1487cc944c021369b6e453f052d4cfede5..af9347ccc2397b40dab84598be0eb548795bb670 100644
--- a/mojo/public/cpp/bindings/interface_endpoint_client.h
+++ b/mojo/public/cpp/bindings/interface_endpoint_client.h
@@ -17,8 +17,8 @@
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
+#include "mojo/public/cpp/bindings/filter_chain.h"
#include "mojo/public/cpp/bindings/message.h"
-#include "mojo/public/cpp/bindings/message_filter.h"
#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
namespace mojo {
@@ -36,7 +36,7 @@ class InterfaceEndpointClient : public MessageReceiverWithResponder {
// object.
InterfaceEndpointClient(ScopedInterfaceEndpointHandle handle,
MessageReceiverWithResponderStatus* receiver,
- std::unique_ptr<MessageFilter> payload_validator,
+ std::unique_ptr<MessageReceiver> payload_validator,
bool expect_sync_requests,
scoped_refptr<base::SingleThreadTaskRunner> runner);
~InterfaceEndpointClient() override;
@@ -66,6 +66,10 @@ class InterfaceEndpointClient : public MessageReceiverWithResponder {
AssociatedGroup* associated_group();
uint32_t interface_id() const;
+ // Adds a MessageReceiver which can filter a message after validation but
+ // before dispatch.
+ void AddFilter(std::unique_ptr<MessageReceiver> filter);
+
// After this call the object is in an invalid state and shouldn't be reused.
ScopedInterfaceEndpointHandle PassHandle();
@@ -130,8 +134,8 @@ class InterfaceEndpointClient : public MessageReceiverWithResponder {
InterfaceEndpointController* controller_;
MessageReceiverWithResponderStatus* const incoming_receiver_;
- std::unique_ptr<MessageFilter> payload_validator_;
HandleIncomingMessageThunk thunk_;
+ FilterChain filters_;
AsyncResponderMap async_responders_;
SyncResponseMap sync_responses_;
« no previous file with comments | « mojo/public/cpp/bindings/filter_chain.h ('k') | mojo/public/cpp/bindings/lib/binding_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698