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

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

Issue 2766523002: mojo: MessageReceiver*::AcceptWithResponder() now take a unique_ptr to the responder (Closed)
Patch Set: Created 3 years, 9 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/control_message_handler.cc
diff --git a/mojo/public/cpp/bindings/lib/control_message_handler.cc b/mojo/public/cpp/bindings/lib/control_message_handler.cc
index c90aadadd43f7436248f134575ca6e1a1289e0d8..5693e30d4457ad59ee28f02150fb937cc5d80e96 100644
--- a/mojo/public/cpp/bindings/lib/control_message_handler.cc
+++ b/mojo/public/cpp/bindings/lib/control_message_handler.cc
@@ -80,19 +80,20 @@ bool ControlMessageHandler::Accept(Message* message) {
bool ControlMessageHandler::AcceptWithResponder(
Message* message,
- MessageReceiverWithStatus* responder) {
+ std::unique_ptr<MessageReceiverWithStatus> responder) {
if (!ValidateControlRequestWithResponse(message))
return false;
if (message->header()->name == interface_control::kRunMessageId)
- return Run(message, responder);
+ return Run(message, std::move(responder));
NOTREACHED();
return false;
}
-bool ControlMessageHandler::Run(Message* message,
- MessageReceiverWithStatus* responder) {
+bool ControlMessageHandler::Run(
+ Message* message,
+ std::unique_ptr<MessageReceiverWithStatus> responder) {
interface_control::internal::RunMessageParams_Data* params =
reinterpret_cast<interface_control::internal::RunMessageParams_Data*>(
message->mutable_payload());
@@ -126,7 +127,6 @@ bool ControlMessageHandler::Run(Message* message,
response_params_ptr, builder.buffer(), &response_params, &context_);
bool ok = responder->Accept(builder.message());
ALLOW_UNUSED_LOCAL(ok);
- delete responder;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698