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

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

Issue 2043713004: Mojo: Add NotifyBadMessage API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/connector.cc
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc
index 9f1037ceae81b09ef3948d6532b7f1cec9a524ff..a8104c24fcb82c9ad70d8ff993a777112f72f05c 100644
--- a/mojo/public/cpp/bindings/lib/connector.cc
+++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -266,9 +266,10 @@ bool Connector::ReadSingleMessage(MojoResult* read_result) {
const MojoResult rv = ReadMessage(message_pipe_.get(), &message);
*read_result = rv;
- if (rv == MOJO_RESULT_OK) {
- receiver_result =
- incoming_receiver_ && incoming_receiver_->Accept(&message);
+ if (rv == MOJO_RESULT_OK && incoming_receiver_) {
+ receiver_result = incoming_receiver_->Accept(&message);
+ if (!receiver_result)
+ message.NotifyBadMessage();
}
if (!weak_self)

Powered by Google App Engine
This is Rietveld 408576698