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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Performs post-dispatch checks. Called when all input buffers are empty, | 108 // Performs post-dispatch checks. Called when all input buffers are empty, |
109 // though there could be more data ready to be read from the OS. | 109 // though there could be more data ready to be read from the OS. |
110 virtual bool DidEmptyInputBuffers() = 0; | 110 virtual bool DidEmptyInputBuffers() = 0; |
111 | 111 |
112 // Handles internal messages, like the hello message sent on channel startup. | 112 // Handles internal messages, like the hello message sent on channel startup. |
113 virtual void HandleInternalMessage(const Message& msg) = 0; | 113 virtual void HandleInternalMessage(const Message& msg) = 0; |
114 | 114 |
115 // Exposed for testing purposes only. | 115 // Exposed for testing purposes only. |
116 virtual void DispatchMessage(Message* m); | 116 virtual void DispatchMessage(Message* m); |
117 | 117 |
118 // Get the process ID for the sender of the message. | |
119 virtual base::ProcessId GetSenderPID() = 0; | |
120 | |
121 private: | 118 private: |
122 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentAlreadyBrokered); | 119 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentAlreadyBrokered); |
123 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentNotYetBrokered); | 120 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentNotYetBrokered); |
124 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, ResizeOverflowBuffer); | 121 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, ResizeOverflowBuffer); |
125 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, InvalidMessageSize); | 122 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, InvalidMessageSize); |
126 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, TrimBuffer); | 123 FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, TrimBuffer); |
127 | 124 |
128 // Takes the data received from the IPC channel and translates it into | 125 // Takes the data received from the IPC channel and translates it into |
129 // Messages. Complete messages are passed to HandleTranslatedMessage(). | 126 // Messages. Complete messages are passed to HandleTranslatedMessage(). |
130 // Returns |false| on unrecoverable error. | 127 // Returns |false| on unrecoverable error. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // of std::string::reserve() implementation. | 160 // of std::string::reserve() implementation. |
164 size_t max_input_buffer_size_; | 161 size_t max_input_buffer_size_; |
165 | 162 |
166 DISALLOW_COPY_AND_ASSIGN(ChannelReader); | 163 DISALLOW_COPY_AND_ASSIGN(ChannelReader); |
167 }; | 164 }; |
168 | 165 |
169 } // namespace internal | 166 } // namespace internal |
170 } // namespace IPC | 167 } // namespace IPC |
171 | 168 |
172 #endif // IPC_IPC_CHANNEL_READER_H_ | 169 #endif // IPC_IPC_CHANNEL_READER_H_ |
OLD | NEW |