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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool ShouldDispatchInputMessage(Message* msg) override { return true; } | 72 bool ShouldDispatchInputMessage(Message* msg) override { return true; } |
73 | 73 |
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; } |
| 83 |
82 AttachmentBroker* GetAttachmentBroker() override { return broker_; } | 84 AttachmentBroker* GetAttachmentBroker() override { return broker_; } |
83 | 85 |
84 // This instance takes ownership of |m|. | 86 // This instance takes ownership of |m|. |
85 void AddMessageForDispatch(Message* m) { | 87 void AddMessageForDispatch(Message* m) { |
86 get_queued_messages()->push_back(m); | 88 get_queued_messages()->push_back(m); |
87 } | 89 } |
88 | 90 |
89 Message* get_last_dispatched_message() { return last_dispatched_message_; } | 91 Message* get_last_dispatched_message() { return last_dispatched_message_; } |
90 | 92 |
91 void set_broker(AttachmentBroker* broker) { broker_ = broker; } | 93 void set_broker(AttachmentBroker* broker) { broker_ = broker; } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 reader.DispatchMessages()); | 130 reader.DispatchMessages()); |
129 EXPECT_EQ(nullptr, reader.get_last_dispatched_message()); | 131 EXPECT_EQ(nullptr, reader.get_last_dispatched_message()); |
130 | 132 |
131 broker.AddAttachment(attachment); | 133 broker.AddAttachment(attachment); |
132 EXPECT_EQ(m, reader.get_last_dispatched_message()); | 134 EXPECT_EQ(m, reader.get_last_dispatched_message()); |
133 } | 135 } |
134 | 136 |
135 } // namespace internal | 137 } // namespace internal |
136 } // namespace IPC | 138 } // namespace IPC |
137 #endif // USE_ATTACHMENT_BROKER | 139 #endif // USE_ATTACHMENT_BROKER |
OLD | NEW |