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

Unified Diff: mojo/system/channel.cc

Issue 231483002: Mojo: Log an error on the remote message pipe leak condition.[1] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | mojo/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel.cc
diff --git a/mojo/system/channel.cc b/mojo/system/channel.cc
index 5a7e9cd6033ceca0c308d02fd1585a7dc27ffd58..4b81fea090ae3012d363471cee9d22a20c024f10 100644
--- a/mojo/system/channel.cc
+++ b/mojo/system/channel.cc
@@ -62,8 +62,16 @@ void Channel::Shutdown() {
raw_channel_->Shutdown();
raw_channel_.reset();
- // TODO(vtl): Should I clear |local_id_to_endpoint_info_map_|? Or assert that
- // it's empty?
+ // This should not occur, but it probably mostly results in leaking;
+ // (Explicitly clearing the |local_id_to_endpoint_info_map_| would likely put
+ // things in an inconsistent state, which is worse. Note that if the map is
+ // nonempty, we probably won't be destroyed, since the endpoints have a
+ // reference to us.)
+ LOG_IF(ERROR, local_id_to_endpoint_info_map_.empty())
+ << "Channel shutting down with endpoints still attached";
+ // TODO(vtl): This currently blows up, but the fix will be nontrivial.
+ // crbug.com/360081
+ //DCHECK(local_id_to_endpoint_info_map_.empty());
}
MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint(
« no previous file with comments | « no previous file | mojo/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698