| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef IPC_IPC_CHANNEL_READER_H_ | 5 #ifndef IPC_IPC_CHANNEL_READER_H_ |
| 6 #define IPC_IPC_CHANNEL_READER_H_ | 6 #define IPC_IPC_CHANNEL_READER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 // Exposed for testing purposes only. | 111 // Exposed for testing purposes only. |
| 112 ScopedVector<Message>* get_queued_messages() { return &queued_messages_; } | 112 ScopedVector<Message>* get_queued_messages() { return &queued_messages_; } |
| 113 | 113 |
| 114 // Exposed for testing purposes only. | 114 // Exposed for testing purposes only. |
| 115 virtual void DispatchMessage(Message* m); | 115 virtual void DispatchMessage(Message* m); |
| 116 | 116 |
| 117 // Get the process ID for the sender of the message. | 117 // Get the process ID for the sender of the message. |
| 118 virtual base::ProcessId GetSenderPID() = 0; | 118 virtual base::ProcessId GetSenderPID() = 0; |
| 119 | 119 |
| 120 // Whether the channel is an endpoint of attachment brokering. |
| 121 virtual bool IsAttachmentBrokerEndpoint() = 0; |
| 122 |
| 120 private: | 123 private: |
| 121 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentAlreadyBrokered); | 124 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentAlreadyBrokered); |
| 122 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentNotYetBrokered); | 125 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentNotYetBrokered); |
| 123 | 126 |
| 124 typedef std::set<BrokerableAttachment::AttachmentId> AttachmentIdSet; | 127 typedef std::set<BrokerableAttachment::AttachmentId> AttachmentIdSet; |
| 125 | 128 |
| 126 // Takes the given data received from the IPC channel, translates it into | 129 // Takes the given data received from the IPC channel, translates it into |
| 127 // Messages, and puts them in queued_messages_. | 130 // Messages, and puts them in queued_messages_. |
| 128 // As an optimization, after a message is translated, the message is | 131 // As an optimization, after a message is translated, the message is |
| 129 // immediately dispatched if able. This prevents an otherwise unnecessary deep | 132 // immediately dispatched if able. This prevents an otherwise unnecessary deep |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // set contains the AttachmentIds that are needed to unblock the message. | 171 // set contains the AttachmentIds that are needed to unblock the message. |
| 169 AttachmentIdSet blocked_ids_; | 172 AttachmentIdSet blocked_ids_; |
| 170 | 173 |
| 171 DISALLOW_COPY_AND_ASSIGN(ChannelReader); | 174 DISALLOW_COPY_AND_ASSIGN(ChannelReader); |
| 172 }; | 175 }; |
| 173 | 176 |
| 174 } // namespace internal | 177 } // namespace internal |
| 175 } // namespace IPC | 178 } // namespace IPC |
| 176 | 179 |
| 177 #endif // IPC_IPC_CHANNEL_READER_H_ | 180 #endif // IPC_IPC_CHANNEL_READER_H_ |
| OLD | NEW |