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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/attachment_broker_win.h" 5 #include "ipc/attachment_broker_win.h"
6 6
7 #include "base/process/process.h"
7 #include "ipc/attachment_broker_messages.h" 8 #include "ipc/attachment_broker_messages.h"
8 #include "ipc/brokerable_attachment.h" 9 #include "ipc/brokerable_attachment.h"
9 #include "ipc/handle_attachment_win.h" 10 #include "ipc/handle_attachment_win.h"
10 #include "ipc/ipc_sender.h" 11 #include "ipc/ipc_sender.h"
11 12
12 namespace IPC { 13 namespace IPC {
13 14
14 AttachmentBrokerWin::AttachmentBrokerWin() { 15 AttachmentBrokerWin::AttachmentBrokerWin() {
15 } 16 }
16 17
(...skipping 21 matching lines...) Expand all
38 return false; 39 return false;
39 } 40 }
40 41
41 bool AttachmentBrokerWin::GetAttachmentWithId( 42 bool AttachmentBrokerWin::GetAttachmentWithId(
42 BrokerableAttachment::AttachmentId id, 43 BrokerableAttachment::AttachmentId id,
43 BrokerableAttachment* attachment) { 44 BrokerableAttachment* attachment) {
44 // TODO(erikchen): Implement me. http://crbug.com/493414 45 // TODO(erikchen): Implement me. http://crbug.com/493414
45 return false; 46 return false;
46 } 47 }
47 48
49 bool AttachmentBrokerWin::OnMessageReceived(const Message& msg) {
50 bool handled = true;
51 IPC_BEGIN_MESSAGE_MAP(AttachmentBrokerWin, msg)
52 IPC_MESSAGE_HANDLER(AttachmentBrokerMsg_WinHandleHasBeenDuplicated,
53 OnWinHandleHasBeenDuplicated)
54 IPC_MESSAGE_UNHANDLED(handled = false)
55 IPC_END_MESSAGE_MAP()
56 return handled;
57 }
58
59 void AttachmentBrokerWin::OnWinHandleHasBeenDuplicated(
60 const IPC::internal::HandleAttachmentWin::WireFormat& wire_format) {
61 // The IPC message was intended for a different process. Ignore it.
62 if (wire_format.destination_process != base::Process::Current().Pid())
63 return;
64
65 scoped_refptr<BrokerableAttachment> attachment(
66 new IPC::internal::HandleAttachmentWin(wire_format));
67 attachments_.push_back(attachment);
68 }
69
48 } // namespace IPC 70 } // namespace IPC
OLDNEW
« 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