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

Unified Diff: ipc/handle_attachment_win.cc

Issue 1206093002: Update ChannelReader to use AttachmentBroker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachment_broker3_listener
Patch Set: Comments from tsepez. Created 5 years, 5 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/handle_attachment_win.h ('k') | ipc/ipc.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/handle_attachment_win.cc
diff --git a/ipc/handle_attachment_win.cc b/ipc/handle_attachment_win.cc
index dfce7c232e60087d8ee92a6523c8c50001bb9867..fefaff67f612c0bda5af1c3983b9159dc91fb619 100644
--- a/ipc/handle_attachment_win.cc
+++ b/ipc/handle_attachment_win.cc
@@ -14,10 +14,15 @@ HandleAttachmentWin::HandleAttachmentWin(const HANDLE& handle)
}
HandleAttachmentWin::HandleAttachmentWin(const WireFormat& wire_format)
- : BrokerableAttachment(wire_format.attachment_id),
+ : BrokerableAttachment(wire_format.attachment_id, false),
handle_(LongToHandle(wire_format.handle)) {
}
+HandleAttachmentWin::HandleAttachmentWin(
+ const BrokerableAttachment::AttachmentId& id)
+ : BrokerableAttachment(id, true), handle_(INVALID_HANDLE_VALUE) {
+}
+
HandleAttachmentWin::~HandleAttachmentWin() {
}
@@ -26,6 +31,19 @@ HandleAttachmentWin::BrokerableType HandleAttachmentWin::GetBrokerableType()
return WIN_HANDLE;
}
+void HandleAttachmentWin::PopulateWithAttachment(
+ const BrokerableAttachment* attachment) {
+ DCHECK(NeedsBrokering());
+ DCHECK(!attachment->NeedsBrokering());
+ DCHECK(GetIdentifier() == attachment->GetIdentifier());
+ DCHECK_EQ(GetBrokerableType(), attachment->GetBrokerableType());
+
+ const HandleAttachmentWin* handle_attachment =
+ static_cast<const HandleAttachmentWin*>(attachment);
+ handle_ = handle_attachment->handle_;
+ SetNeedsBrokering(false);
+}
+
HandleAttachmentWin::WireFormat HandleAttachmentWin::GetWireFormat(
const base::ProcessId& destination) const {
WireFormat format;
« no previous file with comments | « ipc/handle_attachment_win.h ('k') | ipc/ipc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698