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

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

Issue 2064903002: Mojo: Report bindings validation errors via MojoNotifyBadMessage (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/message_buffer.cc
diff --git a/mojo/public/cpp/bindings/lib/message_buffer.cc b/mojo/public/cpp/bindings/lib/message_buffer.cc
index 7a153647f8fab4f7ef7bc2ccca92fc37cc7a849e..af79cfd251354ba919f1734acf7edfea22ecadef 100644
--- a/mojo/public/cpp/bindings/lib/message_buffer.cc
+++ b/mojo/public/cpp/bindings/lib/message_buffer.cc
@@ -61,5 +61,11 @@ void* MessageBuffer::Allocate(size_t delta) {
return static_cast<void*>(start);
}
+void MessageBuffer::NotifyBadMessage(const std::string& error) {
+ DCHECK(message_.is_valid());
+ MojoResult result = mojo::NotifyBadMessage(message_.get(), error);
+ DCHECK_EQ(result, MOJO_RESULT_OK);
+}
+
} // namespace internal
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/lib/message_buffer.h ('k') | mojo/public/cpp/bindings/lib/message_header_validator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698