OLD | NEW |
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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "ipc/attachment_broker.h" | 9 #include "ipc/attachment_broker.h" |
10 #include "ipc/brokerable_attachment.h" | 10 #include "ipc/brokerable_attachment.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 bool GetNonBrokeredAttachments(Message* msg) override { return true; } | 74 bool GetNonBrokeredAttachments(Message* msg) override { return true; } |
75 | 75 |
76 bool DidEmptyInputBuffers() override { return true; } | 76 bool DidEmptyInputBuffers() override { return true; } |
77 | 77 |
78 void HandleInternalMessage(const Message& msg) override {} | 78 void HandleInternalMessage(const Message& msg) override {} |
79 | 79 |
80 void DispatchMessage(Message* m) override { last_dispatched_message_ = m; } | 80 void DispatchMessage(Message* m) override { last_dispatched_message_ = m; } |
81 | 81 |
82 base::ProcessId GetSenderPID() override { return base::kNullProcessId; } | 82 base::ProcessId GetSenderPID() override { return base::kNullProcessId; } |
83 | 83 |
| 84 bool IsAttachmentBrokerEndpoint() override { return false; } |
| 85 |
84 AttachmentBroker* GetAttachmentBroker() override { return broker_; } | 86 AttachmentBroker* GetAttachmentBroker() override { return broker_; } |
85 | 87 |
86 // This instance takes ownership of |m|. | 88 // This instance takes ownership of |m|. |
87 void AddMessageForDispatch(Message* m) { | 89 void AddMessageForDispatch(Message* m) { |
88 get_queued_messages()->push_back(m); | 90 get_queued_messages()->push_back(m); |
89 } | 91 } |
90 | 92 |
91 Message* get_last_dispatched_message() { return last_dispatched_message_; } | 93 Message* get_last_dispatched_message() { return last_dispatched_message_; } |
92 | 94 |
93 void set_broker(AttachmentBroker* broker) { broker_ = broker; } | 95 void set_broker(AttachmentBroker* broker) { broker_ = broker; } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 reader.DispatchMessages()); | 132 reader.DispatchMessages()); |
131 EXPECT_EQ(nullptr, reader.get_last_dispatched_message()); | 133 EXPECT_EQ(nullptr, reader.get_last_dispatched_message()); |
132 | 134 |
133 broker.AddAttachment(attachment); | 135 broker.AddAttachment(attachment); |
134 EXPECT_EQ(m, reader.get_last_dispatched_message()); | 136 EXPECT_EQ(m, reader.get_last_dispatched_message()); |
135 } | 137 } |
136 | 138 |
137 } // namespace internal | 139 } // namespace internal |
138 } // namespace IPC | 140 } // namespace IPC |
139 #endif // USE_ATTACHMENT_BROKER | 141 #endif // USE_ATTACHMENT_BROKER |
OLD | NEW |