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

Unified Diff: ipc/ipc_channel_win.cc

Issue 1286883003: Revert of IPC: Add attachment brokering support to the message header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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_win.h ('k') | ipc/ipc_message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_win.cc
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index 36a42c4d454180021a93b521950caca34890d3e0..1442f7fab7b095392510dbe6509c618c49cbffbc 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -53,7 +53,6 @@
}
ChannelWin::~ChannelWin() {
- CleanUp();
Close();
}
@@ -75,9 +74,9 @@
}
while (!output_queue_.empty()) {
- OutputElement* element = output_queue_.front();
+ Message* m = output_queue_.front();
output_queue_.pop();
- delete element;
+ delete m;
}
}
@@ -124,19 +123,7 @@
message->TraceMessageBegin();
// |output_queue_| takes ownership of |message|.
- OutputElement* element = new OutputElement(message);
- output_queue_.push(element);
-
-#if USE_ATTACHMENT_BROKER
- if (message->HasBrokerableAttachments()) {
- // |output_queue_| takes ownership of |ids.buffer|.
- Message::SerializedAttachmentIds ids =
- message->SerializedIdsOfBrokerableAttachments();
- OutputElement* new_element = new OutputElement(ids.buffer, ids.size);
- output_queue_.push(new_element);
- }
-#endif
-
+ output_queue_.push(message);
// ensure waiting to write
if (!waiting_connect_) {
if (!output_state_.is_pending) {
@@ -373,8 +360,7 @@
return false;
}
- OutputElement* element = new OutputElement(m.release());
- output_queue_.push(element);
+ output_queue_.push(m.release());
return true;
}
@@ -464,9 +450,9 @@
}
// Message was sent.
CHECK(!output_queue_.empty());
- OutputElement* element = output_queue_.front();
+ Message* m = output_queue_.front();
output_queue_.pop();
- delete element;
+ delete m;
}
if (output_queue_.empty())
@@ -476,21 +462,20 @@
return false;
// Write to pipe...
- OutputElement* element = output_queue_.front();
- DCHECK(element->size() <= INT_MAX);
- BOOL ok = WriteFile(pipe_.Get(), element->data(),
- static_cast<uint32>(element->size()), NULL,
+ Message* m = output_queue_.front();
+ DCHECK(m->size() <= INT_MAX);
+ BOOL ok = WriteFile(pipe_.Get(),
+ m->data(),
+ static_cast<uint32>(m->size()),
+ NULL,
&output_state_.context.overlapped);
if (!ok) {
DWORD write_error = GetLastError();
if (write_error == ERROR_IO_PENDING) {
output_state_.is_pending = true;
- const Message* m = element->get_message();
- if (m) {
- DVLOG(2) << "sent pending message @" << m << " on channel @" << this
- << " with type " << m->type();
- }
+ DVLOG(2) << "sent pending message @" << m << " on channel @" << this
+ << " with type " << m->type();
return true;
}
@@ -498,11 +483,8 @@
return false;
}
- const Message* m = element->get_message();
- if (m) {
- DVLOG(2) << "sent message @" << m << " on channel @" << this
- << " with type " << m->type();
- }
+ DVLOG(2) << "sent message @" << m << " on channel @" << this
+ << " with type " << m->type();
output_state_.is_pending = true;
return true;
« no previous file with comments | « ipc/ipc_channel_win.h ('k') | ipc/ipc_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698