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

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

Issue 2536323002: Mojo C++ bindings: fix [D]CHECKs in MultiplexRouter and SyncHandleRegistry. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/sync_handle_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/multiplex_router.cc
diff --git a/mojo/public/cpp/bindings/lib/multiplex_router.cc b/mojo/public/cpp/bindings/lib/multiplex_router.cc
index 5602b2a0591e6d9fc26f2f386bad76f3dab823d0..14ea64740756a9377829c23512a2eb1b7b457603 100644
--- a/mojo/public/cpp/bindings/lib/multiplex_router.cc
+++ b/mojo/public/cpp/bindings/lib/multiplex_router.cc
@@ -335,8 +335,16 @@ MultiplexRouter::~MultiplexRouter() {
// because it may remove the corresponding value from the map.
++iter;
- DCHECK(endpoint->closed());
- UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED);
+ if (!endpoint->closed()) {
+ // This happens when a NotifyPeerEndpointClosed message been received, but
+ // (1) the interface ID hasn't been used to create local endpoint handle;
+ // and (2) a NotifyEndpointClosedBeforeSent hasn't been received.
+ DCHECK(!endpoint->client());
+ DCHECK(endpoint->peer_closed());
+ UpdateEndpointStateMayRemove(endpoint, ENDPOINT_CLOSED);
+ } else {
+ UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED);
+ }
}
DCHECK(endpoints_.empty());
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/sync_handle_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698