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

Unified Diff: mojo/public/cpp/bindings/associated_binding.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_binding.h
diff --git a/mojo/public/cpp/bindings/associated_binding.h b/mojo/public/cpp/bindings/associated_binding.h
index 5c3764f5ee672b1518409cab20e80809a5ca3b2e..0a95da430e54ebb8b7d8f95fb4e669311b7fb0b4 100644
--- a/mojo/public/cpp/bindings/associated_binding.h
+++ b/mojo/public/cpp/bindings/associated_binding.h
@@ -127,15 +127,13 @@ class AssociatedBinding {
// Closes the associated interface. Puts this object into a state where it can
// be rebound.
void Close() {
- DCHECK(endpoint_client_);
endpoint_client_.reset();
}
// Similar to the method above, but also specifies a disconnect reason.
void CloseWithReason(uint32_t custom_reason, const std::string& description) {
- DCHECK(endpoint_client_);
- endpoint_client_->control_message_proxy()->SendDisconnectReason(
- custom_reason, description);
+ if (endpoint_client_)
+ endpoint_client_->CloseWithReason(custom_reason, description);
Close();
}

Powered by Google App Engine
This is Rietveld 408576698