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

Unified Diff: mojo/public/cpp/bindings/tests/router_test_util.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/tests/router_test_util.cc
diff --git a/mojo/public/cpp/bindings/tests/router_test_util.cc b/mojo/public/cpp/bindings/tests/router_test_util.cc
index 6697a7c62ed362ac8b70c923bdf97a4e7e8d0e2c..c04cef95e112e47b2009174bc3423b3862c70c48 100644
--- a/mojo/public/cpp/bindings/tests/router_test_util.cc
+++ b/mojo/public/cpp/bindings/tests/router_test_util.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <string.h>
+#include "mojo/public/cpp/bindings/error.h"
#include "mojo/public/cpp/bindings/lib/message_builder.h"
#include "mojo/public/cpp/bindings/tests/message_queue.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,7 +41,7 @@ MessageAccumulator::MessageAccumulator(MessageQueue* queue,
MessageAccumulator::~MessageAccumulator() {}
-bool MessageAccumulator::Accept(Message* message) {
+bool MessageAccumulator::Accept(Message* message, Error* error) {
queue_->Push(message);
if (!closure_.is_null()) {
closure_.Run();
@@ -51,13 +52,14 @@ bool MessageAccumulator::Accept(Message* message) {
ResponseGenerator::ResponseGenerator() {}
-bool ResponseGenerator::Accept(Message* message) {
+bool ResponseGenerator::Accept(Message* message, Error* error) {
return false;
}
bool ResponseGenerator::AcceptWithResponder(
Message* message,
- MessageReceiverWithStatus* responder) {
+ MessageReceiverWithStatus* responder,
+ Error* error) {
EXPECT_TRUE(message->has_flag(internal::kMessageExpectsResponse));
bool result = SendResponse(message->name(), message->request_id(),
@@ -77,7 +79,8 @@ bool ResponseGenerator::SendResponse(uint32_t name,
response_string += " world!";
AllocResponseMessage(name, response_string.c_str(), request_id, &response);
- return responder->Accept(&response);
+ Error send_error;
+ return responder->Accept(&response, &send_error);
}
LazyResponseGenerator::LazyResponseGenerator(const base::Closure& closure)
@@ -89,7 +92,8 @@ LazyResponseGenerator::~LazyResponseGenerator() {
bool LazyResponseGenerator::AcceptWithResponder(
Message* message,
- MessageReceiverWithStatus* responder) {
+ MessageReceiverWithStatus* responder,
+ Error* error) {
name_ = message->name();
request_id_ = message->request_id();
request_string_ =

Powered by Google App Engine
This is Rietveld 408576698