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

Unified Diff: ipc/ipc_channel_reader.cc

Issue 1321803003: ipc: Make sure that ChannelReader is destroyed correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_add_header4
Patch Set: Rebase against top of tree. Created 5 years, 3 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 | « ipc/ipc_channel_reader.h ('k') | ipc/ipc_channel_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_reader.cc
diff --git a/ipc/ipc_channel_reader.cc b/ipc/ipc_channel_reader.cc
index a76b7e654b30a7a575e8350774a27288da43b931..f80d75d8e1ee98ca9c58c63ed1bd2e4bd7e9c094 100644
--- a/ipc/ipc_channel_reader.cc
+++ b/ipc/ipc_channel_reader.cc
@@ -20,8 +20,7 @@ ChannelReader::ChannelReader(Listener* listener) : listener_(listener) {
}
ChannelReader::~ChannelReader() {
- if (!blocked_ids_.empty())
- StopObservingAttachmentBroker();
+ DCHECK(blocked_ids_.empty());
}
ChannelReader::DispatchState ChannelReader::ProcessIncomingMessages() {
@@ -62,6 +61,13 @@ bool ChannelReader::IsHelloMessage(const Message& m) {
m.type() == Channel::HELLO_MESSAGE_TYPE;
}
+void ChannelReader::CleanUp() {
+ if (!blocked_ids_.empty()) {
+ StopObservingAttachmentBroker();
+ blocked_ids_.clear();
+ }
+}
+
bool ChannelReader::TranslateInputData(const char* input_data,
int input_data_len) {
const char* p;
« no previous file with comments | « ipc/ipc_channel_reader.h ('k') | ipc/ipc_channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698