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

Unified Diff: ipc/attachment_broker_win.cc

Issue 1205713002: Make attachment broker a subclass of IPC::Listener. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachment_broker3_listener_base
Patch Set: Update copyright date. 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/attachment_broker_win_unittest.cc » ('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 867d2712d61d56260af69405d4d2b65e5288864a..89d193c7326bc13e73c774ae9e4346daa9192518 100644
--- a/ipc/attachment_broker_win.cc
+++ b/ipc/attachment_broker_win.cc
@@ -4,6 +4,7 @@
#include "ipc/attachment_broker_win.h"
+#include "base/process/process.h"
#include "ipc/attachment_broker_messages.h"
#include "ipc/brokerable_attachment.h"
#include "ipc/handle_attachment_win.h"
@@ -45,4 +46,25 @@ bool AttachmentBrokerWin::GetAttachmentWithId(
return false;
}
+bool AttachmentBrokerWin::OnMessageReceived(const Message& msg) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(AttachmentBrokerWin, msg)
+ IPC_MESSAGE_HANDLER(AttachmentBrokerMsg_WinHandleHasBeenDuplicated,
+ OnWinHandleHasBeenDuplicated)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+void AttachmentBrokerWin::OnWinHandleHasBeenDuplicated(
+ const IPC::internal::HandleAttachmentWin::WireFormat& wire_format) {
+ // The IPC message was intended for a different process. Ignore it.
+ if (wire_format.destination_process != base::Process::Current().Pid())
+ return;
+
+ scoped_refptr<BrokerableAttachment> attachment(
+ new IPC::internal::HandleAttachmentWin(wire_format));
+ attachments_.push_back(attachment);
+}
+
} // namespace IPC
« no previous file with comments | « ipc/attachment_broker_win.h ('k') | ipc/attachment_broker_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698