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

Unified Diff: mojo/public/cpp/bindings/lib/interface_impl_internal.h

Issue 273233002: Mojo cpp bindings: add support for validating incoming messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto the InterfacePtr change Created 6 years, 7 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
Index: mojo/public/cpp/bindings/lib/interface_impl_internal.h
diff --git a/mojo/public/cpp/bindings/lib/interface_impl_internal.h b/mojo/public/cpp/bindings/lib/interface_impl_internal.h
index 50fe5665360b3f6bd11950503b52311d16592eaa..2dd869ff85dde918daed281ca6d7d13b9fb0bc45 100644
--- a/mojo/public/cpp/bindings/lib/interface_impl_internal.h
+++ b/mojo/public/cpp/bindings/lib/interface_impl_internal.h
@@ -7,6 +7,8 @@
#include "mojo/public/cpp/bindings/error_handler.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
+#include "mojo/public/cpp/bindings/lib/message_header_validator.h"
+#include "mojo/public/cpp/bindings/lib/validator_chain.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
@@ -42,7 +44,12 @@ class InterfaceImplState : public ErrorHandler {
MojoAsyncWaiter* waiter) {
assert(!router_);
- router_ = new Router(handle.Pass(), waiter);
+ internal::ValidatorChain validators;
+ validators.Append(new internal::MessageHeaderValidator)
+ .Append(new typename Interface::RequestValidator_)
+ .Append(new typename Interface::Client_::ResponseValidator_);
+
+ router_ = new Router(handle.Pass(), validators.Pass(), waiter);
router_->set_incoming_receiver(&stub_);
router_->set_error_handler(this);

Powered by Google App Engine
This is Rietveld 408576698