Index: ipc/attachment_broker_win.h |
diff --git a/ipc/attachment_broker_win.h b/ipc/attachment_broker_win.h |
index 1cf4348b68120406934172713abd6b8188a1b752..5df2c9a2395b9fcba21d7d53307db751112d7148 100644 |
--- a/ipc/attachment_broker_win.h |
+++ b/ipc/attachment_broker_win.h |
@@ -5,7 +5,12 @@ |
#ifndef IPC_ATTACHMENT_BROKER_WIN_H_ |
#define IPC_ATTACHMENT_BROKER_WIN_H_ |
+#include <vector> |
+ |
+#include "base/gtest_prod_util.h" |
+#include "base/memory/ref_counted.h" |
#include "ipc/attachment_broker.h" |
+#include "ipc/handle_attachment_win.h" |
#include "ipc/ipc_export.h" |
namespace IPC { |
@@ -29,11 +34,28 @@ class IPC_EXPORT AttachmentBrokerWin : public IPC::AttachmentBroker { |
bool GetAttachmentWithId(BrokerableAttachment::AttachmentId id, |
BrokerableAttachment* attachment) override; |
+ // IPC::Listener overrides. |
+ bool OnMessageReceived(const Message& message) override; |
+ |
// |sender_| is used to send Messages to the broker. |sender_| must live at |
// least as long as this instance. |
void set_sender(IPC::Sender* sender) { sender_ = sender; } |
private: |
+ FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerWinTest, ReceiveValidMessage); |
+ FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerWinTest, ReceiveInvalidMessage); |
+ |
+ // IPC message handlers. |
+ void OnWinHandleHasBeenDuplicated( |
+ const IPC::internal::HandleAttachmentWin::WireFormat& wire_format); |
+ |
+ // A vector of BrokerableAttachments that have been received, but not yet |
+ // consumed. |
+ // A std::vector is used instead of a std::map because this container is |
+ // expected to have few elements, for which a std::vector is expected to have |
+ // better performance. |
+ std::vector<scoped_refptr<BrokerableAttachment>> attachments_; |
+ |
// |sender_| is used to send Messages to the broker. |sender_| must live at |
// least as long as this instance. |
IPC::Sender* sender_; |