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

Unified Diff: mojo/public/cpp/bindings/associated_interface_request.h

Issue 2649573004: Mojo bindings: merge the control messages of sending disconnect reason and notifying endpoint close… (Closed)
Patch Set: Created 3 years, 11 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/associated_interface_request.h
diff --git a/mojo/public/cpp/bindings/associated_interface_request.h b/mojo/public/cpp/bindings/associated_interface_request.h
index 361b301d38957d8eed565d4364d87e2e94920f01..08ec96845813ddd79c4cb910582eed7929c30e3f 100644
--- a/mojo/public/cpp/bindings/associated_interface_request.h
+++ b/mojo/public/cpp/bindings/associated_interface_request.h
@@ -71,25 +71,7 @@ class AssociatedInterfaceRequest {
}
void ResetWithReason(uint32_t custom_reason, const std::string& description) {
- if (!handle_.is_valid())
- return;
-
- if (!handle_.is_local()) {
- // This handle is supposed to be sent to the other end of the message
- // pipe and used there.
- NOTREACHED();
- handle_.reset();
- return;
- }
-
- InterfaceEndpointClient client(std::move(handle_), nullptr,
- base::MakeUnique<PassThroughFilter>(), false,
- base::ThreadTaskRunnerHandle::Get(), 0u);
- Message message =
- internal::ControlMessageProxy::ConstructDisconnectReasonMessage(
- custom_reason, description);
- bool result = client.Accept(&message);
- DCHECK(result);
+ handle_.ResetWithReason(custom_reason, description);
}
private:

Powered by Google App Engine
This is Rietveld 408576698