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 <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ipc/attachment_broker.h" | 10 #include "ipc/attachment_broker.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 BrokerableType GetBrokerableType() const override { return WIN_HANDLE; } | 35 BrokerableType GetBrokerableType() const override { return WIN_HANDLE; } |
36 | 36 |
37 private: | 37 private: |
38 ~MockAttachment() override {} | 38 ~MockAttachment() override {} |
39 }; | 39 }; |
40 | 40 |
41 class MockAttachmentBroker : public AttachmentBroker { | 41 class MockAttachmentBroker : public AttachmentBroker { |
42 public: | 42 public: |
43 typedef std::set<scoped_refptr<BrokerableAttachment>> AttachmentSet; | 43 typedef std::set<scoped_refptr<BrokerableAttachment>> AttachmentSet; |
44 | 44 |
45 bool SendAttachmentToProcess(BrokerableAttachment* attachment, | 45 bool SendAttachmentToProcess( |
46 base::ProcessId destination_process) override { | 46 const scoped_refptr<BrokerableAttachment>& attachment, |
| 47 base::ProcessId destination_process) override { |
47 return false; | 48 return false; |
48 } | 49 } |
49 | 50 |
50 bool OnMessageReceived(const Message& message) override { return false; } | 51 bool OnMessageReceived(const Message& message) override { return false; } |
51 | 52 |
52 void AddAttachment(scoped_refptr<BrokerableAttachment> attachment) { | 53 void AddAttachment(scoped_refptr<BrokerableAttachment> attachment) { |
53 get_attachments()->push_back(attachment); | 54 get_attachments()->push_back(attachment); |
54 NotifyObservers(attachment->GetIdentifier()); | 55 NotifyObservers(attachment->GetIdentifier()); |
55 } | 56 } |
56 }; | 57 }; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 header.payload_size = std::numeric_limits<int32_t>::max(); | 187 header.payload_size = std::numeric_limits<int32_t>::max(); |
187 EXPECT_FALSE(reader.TranslateInputData( | 188 EXPECT_FALSE(reader.TranslateInputData( |
188 reinterpret_cast<const char*>(&header), sizeof(header))); | 189 reinterpret_cast<const char*>(&header), sizeof(header))); |
189 EXPECT_LE(reader.input_overflow_buf_.capacity(), capacity_before); | 190 EXPECT_LE(reader.input_overflow_buf_.capacity(), capacity_before); |
190 } | 191 } |
191 | 192 |
192 #endif // !USE_ATTACHMENT_BROKER | 193 #endif // !USE_ATTACHMENT_BROKER |
193 | 194 |
194 } // namespace internal | 195 } // namespace internal |
195 } // namespace IPC | 196 } // namespace IPC |
OLD | NEW |