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

Unified Diff: mojo/public/cpp/bindings/lib/router.cc

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/lib/router.h ('k') | mojo/public/cpp/bindings/message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/router.cc
diff --git a/mojo/public/cpp/bindings/lib/router.cc b/mojo/public/cpp/bindings/lib/router.cc
index 7c610eeff571f0d3111d35ebaa3413e6908823c4..5d5db54caa13981a0f96b1f9d0b12826b5963513 100644
--- a/mojo/public/cpp/bindings/lib/router.cc
+++ b/mojo/public/cpp/bindings/lib/router.cc
@@ -133,13 +133,17 @@ Router::Router(ScopedMessagePipeHandle message_pipe,
filters_.SetSink(&thunk_);
if (expects_sync_requests)
connector_.AllowWokenUpBySyncWatchOnSameThread();
- connector_.set_incoming_receiver(filters_.GetHead());
+ connector_.set_incoming_receiver(&filters_);
connector_.set_connection_error_handler(
base::Bind(&Router::OnConnectionError, base::Unretained(this)));
}
Router::~Router() {}
+void Router::AddFilter(std::unique_ptr<MessageReceiver> filter) {
+ filters_.Append(std::move(filter));
+}
+
bool Router::Accept(Message* message) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!message->has_flag(Message::kFlagExpectsResponse));
« no previous file with comments | « mojo/public/cpp/bindings/lib/router.h ('k') | mojo/public/cpp/bindings/message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698