OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MOJO_SYSTEM_CHANNEL_H_ | 5 #ifndef MOJO_SYSTEM_CHANNEL_H_ |
6 #define MOJO_SYSTEM_CHANNEL_H_ | 6 #define MOJO_SYSTEM_CHANNEL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 friend class base::RefCountedThreadSafe<Channel>; | 141 friend class base::RefCountedThreadSafe<Channel>; |
142 virtual ~Channel(); | 142 virtual ~Channel(); |
143 | 143 |
144 // |RawChannel::Delegate| implementation: | 144 // |RawChannel::Delegate| implementation: |
145 virtual void OnReadMessage( | 145 virtual void OnReadMessage( |
146 const MessageInTransit::View& message_view) OVERRIDE; | 146 const MessageInTransit::View& message_view) OVERRIDE; |
147 virtual void OnFatalError(FatalError fatal_error) OVERRIDE; | 147 virtual void OnFatalError(FatalError fatal_error) OVERRIDE; |
148 | 148 |
149 // Helpers for |OnReadMessage|: | 149 // Helpers for |OnReadMessage|: |
150 bool ValidateReadMessage(const MessageInTransit::View& message_view); | |
151 void OnReadMessageForDownstream(const MessageInTransit::View& message_view); | 150 void OnReadMessageForDownstream(const MessageInTransit::View& message_view); |
152 void OnReadMessageForChannel(const MessageInTransit::View& message_view); | 151 void OnReadMessageForChannel(const MessageInTransit::View& message_view); |
153 | 152 |
154 // Removes the message pipe endpoint with the given local ID, which must exist | 153 // Removes the message pipe endpoint with the given local ID, which must exist |
155 // and be a zombie, and given remote ID. Returns false on failure, in | 154 // and be a zombie, and given remote ID. Returns false on failure, in |
156 // particular if no message pipe with |local_id| is attached. | 155 // particular if no message pipe with |local_id| is attached. |
157 bool RemoveMessagePipeEndpoint(MessageInTransit::EndpointId local_id, | 156 bool RemoveMessagePipeEndpoint(MessageInTransit::EndpointId local_id, |
158 MessageInTransit::EndpointId remote_id); | 157 MessageInTransit::EndpointId remote_id); |
159 | 158 |
160 // Handles errors (e.g., invalid messages) from the remote side. | 159 // Handles errors (e.g., invalid messages) from the remote side. |
(...skipping 28 matching lines...) Expand all Loading... |
189 // be checked for existence before use. | 188 // be checked for existence before use. |
190 MessageInTransit::EndpointId next_local_id_; | 189 MessageInTransit::EndpointId next_local_id_; |
191 | 190 |
192 DISALLOW_COPY_AND_ASSIGN(Channel); | 191 DISALLOW_COPY_AND_ASSIGN(Channel); |
193 }; | 192 }; |
194 | 193 |
195 } // namespace system | 194 } // namespace system |
196 } // namespace mojo | 195 } // namespace mojo |
197 | 196 |
198 #endif // MOJO_SYSTEM_CHANNEL_H_ | 197 #endif // MOJO_SYSTEM_CHANNEL_H_ |
OLD | NEW |