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

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

Issue 273233002: Mojo cpp bindings: add support for validating incoming messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and rebase 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/message_header_validator.h ('k') | mojo/public/cpp/bindings/lib/router.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/message_header_validator.cc
diff --git a/mojo/public/cpp/bindings/lib/message_header_validator.cc b/mojo/public/cpp/bindings/lib/message_header_validator.cc
index a5151cfd854c9612fb701984debed877613d8fbb..1396fd1ab715dc3c685b8fe7773cf7083ebc0945 100644
--- a/mojo/public/cpp/bindings/lib/message_header_validator.cc
+++ b/mojo/public/cpp/bindings/lib/message_header_validator.cc
@@ -54,9 +54,8 @@ bool IsValidMessageHeader(const internal::MessageHeader* header) {
} // namespace
-MessageHeaderValidator::MessageHeaderValidator(MessageReceiver* next)
- : next_(next) {
- assert(next);
+MessageHeaderValidator::MessageHeaderValidator(MessageReceiver* sink)
+ : MessageFilter(sink) {
}
bool MessageHeaderValidator::Accept(Message* message) {
@@ -69,13 +68,7 @@ bool MessageHeaderValidator::Accept(Message* message) {
if (!IsValidMessageHeader(message->header()))
return false;
- return next_->Accept(message);
-}
-
-bool MessageHeaderValidator::AcceptWithResponder(Message* message,
- MessageReceiver* responder) {
- assert(false); // Not reached!
- return false;
+ return sink_->Accept(message);
}
} // namespace internal
« no previous file with comments | « mojo/public/cpp/bindings/lib/message_header_validator.h ('k') | mojo/public/cpp/bindings/lib/router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698