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

Unified Diff: ipc/attachment_broker_win.cc

Issue 1188923003: Stub in more IPC attachment brokering functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase properly. 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/attachment_broker_win.h ('k') | ipc/brokerable_attachment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/attachment_broker_win.cc
diff --git a/ipc/attachment_broker_win.cc b/ipc/attachment_broker_win.cc
index caf80b8f488d03981bc86593542c3d74d6159fca..867d2712d61d56260af69405d4d2b65e5288864a 100644
--- a/ipc/attachment_broker_win.cc
+++ b/ipc/attachment_broker_win.cc
@@ -4,6 +4,11 @@
#include "ipc/attachment_broker_win.h"
+#include "ipc/attachment_broker_messages.h"
+#include "ipc/brokerable_attachment.h"
+#include "ipc/handle_attachment_win.h"
+#include "ipc/ipc_sender.h"
+
namespace IPC {
AttachmentBrokerWin::AttachmentBrokerWin() {
@@ -18,10 +23,19 @@ void AttachmentBrokerWin::OnReceiveDuplicatedHandle(
// TODO(erikchen): Implement me. http://crbug.com/493414
}
-void AttachmentBrokerWin::SendAttachmentToProcess(
- BrokerableAttachment* attachment,
+bool AttachmentBrokerWin::SendAttachmentToProcess(
+ const BrokerableAttachment* attachment,
base::ProcessId destination_process) {
- // TODO(erikchen): Implement me. http://crbug.com/493414
+ switch (attachment->GetBrokerableType()) {
+ case BrokerableAttachment::WIN_HANDLE:
+ const internal::HandleAttachmentWin* handle_attachment =
+ static_cast<const internal::HandleAttachmentWin*>(attachment);
+ internal::HandleAttachmentWin::WireFormat format =
+ handle_attachment->GetWireFormat(destination_process);
+ return sender_->Send(
+ new AttachmentBrokerMsg_DuplicateWinHandle(format));
+ }
+ return false;
}
bool AttachmentBrokerWin::GetAttachmentWithId(
« no previous file with comments | « ipc/attachment_broker_win.h ('k') | ipc/brokerable_attachment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698