Chromium Code Reviews| Index: mojo/public/cpp/bindings/lib/interface_ptr_internal.h |
| diff --git a/mojo/public/cpp/bindings/lib/interface_ptr_internal.h b/mojo/public/cpp/bindings/lib/interface_ptr_internal.h |
| index 041a31c8a0c8134058705775019069d19f924f6c..181706fc5dbbd9967155cfc86a2e7557e4f453ae 100644 |
| --- a/mojo/public/cpp/bindings/lib/interface_ptr_internal.h |
| +++ b/mojo/public/cpp/bindings/lib/interface_ptr_internal.h |
| @@ -7,7 +7,9 @@ |
| #include <stdio.h> |
| +#include "mojo/public/cpp/bindings/lib/message_header_validator.h" |
| #include "mojo/public/cpp/bindings/lib/router.h" |
| +#include "mojo/public/cpp/bindings/lib/validator_chain.h" |
| namespace mojo { |
| namespace internal { |
| @@ -47,7 +49,12 @@ class InterfacePtrState { |
| assert(!instance_); |
| assert(!router_); |
| - router_ = new Router(handle.Pass(), waiter); |
| + internal::ValidatorChain validators; |
|
darin (slow to review)
2014/05/12 17:28:26
nit: already in the internal namespace
yzshen1
2014/05/12 21:59:58
Done.
|
| + validators.Append(new internal::MessageHeaderValidator) |
| + .Append(new typename Interface::Client_::RequestValidator_) |
| + .Append(new typename Interface::ResponseValidator_); |
| + |
| + router_ = new Router(handle.Pass(), validators.Pass(), waiter); |
| ProxyWithStub* proxy = new ProxyWithStub(router_); |
| router_->set_incoming_receiver(&proxy->stub); |
| @@ -62,7 +69,12 @@ class InterfacePtrState { |
| // Stub for binding to state_.instance |
| // Proxy for communicating to the client on the other end of the pipe. |
| - 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); |
| ClientProxyWithStub* proxy = new ClientProxyWithStub(router_); |
| proxy->stub.set_sink(instance_); |
| router_->set_incoming_receiver(&proxy->stub); |