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

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..57a6b29f7a4894c87369d1fc4cf9724b28b1164b 100644
--- a/mojo/public/cpp/bindings/tests/router_test_util.cc
+++ b/mojo/public/cpp/bindings/tests/router_test_util.cc
@@ -40,22 +40,22 @@ MessageAccumulator::MessageAccumulator(MessageQueue* queue,
MessageAccumulator::~MessageAccumulator() {}
-bool MessageAccumulator::Accept(Message* message) {
+MessageReceiver::Result MessageAccumulator::Accept(Message* message) {
queue_->Push(message);
if (!closure_.is_null()) {
closure_.Run();
closure_.Reset();
}
- return true;
+ return Result::ForSuccess();
}
ResponseGenerator::ResponseGenerator() {}
-bool ResponseGenerator::Accept(Message* message) {
- return false;
+MessageReceiver::Result ResponseGenerator::Accept(Message* message) {
+ return Result::ForUnknownError();
}
-bool ResponseGenerator::AcceptWithResponder(
+MessageReceiver::Result ResponseGenerator::AcceptWithResponder(
Message* message,
MessageReceiverWithStatus* responder) {
EXPECT_TRUE(message->has_flag(internal::kMessageExpectsResponse));
@@ -65,7 +65,9 @@ bool ResponseGenerator::AcceptWithResponder(
responder);
EXPECT_TRUE(responder->IsValid());
delete responder;
- return result;
+ if (result)
+ return Result::ForSuccess();
+ return Result::ForUnknownError();
}
bool ResponseGenerator::SendResponse(uint32_t name,
@@ -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);
+ return responder->Accept(&response).Succeeded();
+
}
LazyResponseGenerator::LazyResponseGenerator(const base::Closure& closure)
@@ -87,7 +90,7 @@ LazyResponseGenerator::~LazyResponseGenerator() {
delete responder_;
}
-bool LazyResponseGenerator::AcceptWithResponder(
+MessageReceiver::Result LazyResponseGenerator::AcceptWithResponder(
Message* message,
MessageReceiverWithStatus* responder) {
name_ = message->name();
@@ -99,7 +102,7 @@ bool LazyResponseGenerator::AcceptWithResponder(
closure_.Run();
closure_.Reset();
}
- return true;
+ return Result::ForSuccess();
}
void LazyResponseGenerator::Complete(bool send_response) {

Powered by Google App Engine
This is Rietveld 408576698