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_MESSAGE_PIPE_ENDPOINT_H_ | 5 #ifndef MOJO_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ |
6 #define MOJO_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ | 6 #define MOJO_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // i.e., one for which there's a |MessagePipeDispatcher| (and thus a handle). | 57 // i.e., one for which there's a |MessagePipeDispatcher| (and thus a handle). |
58 // An implementation for a proxy endpoint (for which there's no dispatcher) | 58 // An implementation for a proxy endpoint (for which there's no dispatcher) |
59 // needs not override these methods, since they should never be called. | 59 // needs not override these methods, since they should never be called. |
60 // | 60 // |
61 // These methods implement the methods of the same name in |MessagePipe|, | 61 // These methods implement the methods of the same name in |MessagePipe|, |
62 // though |MessagePipe|'s implementation may have to do a little more if the | 62 // though |MessagePipe|'s implementation may have to do a little more if the |
63 // operation involves both endpoints. | 63 // operation involves both endpoints. |
64 virtual void CancelAllWaiters(); | 64 virtual void CancelAllWaiters(); |
65 virtual MojoResult ReadMessage( | 65 virtual MojoResult ReadMessage( |
66 void* bytes, uint32_t* num_bytes, | 66 void* bytes, uint32_t* num_bytes, |
67 uint32_t max_num_dispatchers, | |
68 std::vector<scoped_refptr<Dispatcher> >* dispatchers, | 67 std::vector<scoped_refptr<Dispatcher> >* dispatchers, |
| 68 uint32_t* num_dispatchers, |
69 MojoReadMessageFlags flags); | 69 MojoReadMessageFlags flags); |
70 virtual MojoResult AddWaiter(Waiter* waiter, | 70 virtual MojoResult AddWaiter(Waiter* waiter, |
71 MojoWaitFlags flags, | 71 MojoWaitFlags flags, |
72 MojoResult wake_result); | 72 MojoResult wake_result); |
73 virtual void RemoveWaiter(Waiter* waiter); | 73 virtual void RemoveWaiter(Waiter* waiter); |
74 | 74 |
75 // Implementations must override these if they represent a proxy endpoint. An | 75 // Implementations must override these if they represent a proxy endpoint. An |
76 // implementation for a local endpoint needs not override these methods, since | 76 // implementation for a local endpoint needs not override these methods, since |
77 // they should never be called. | 77 // they should never be called. |
78 virtual void Attach(scoped_refptr<Channel> channel, | 78 virtual void Attach(scoped_refptr<Channel> channel, |
79 MessageInTransit::EndpointId local_id); | 79 MessageInTransit::EndpointId local_id); |
80 // Returns false if the endpoint should be closed and destroyed, else true. | 80 // Returns false if the endpoint should be closed and destroyed, else true. |
81 virtual bool Run(MessageInTransit::EndpointId remote_id); | 81 virtual bool Run(MessageInTransit::EndpointId remote_id); |
82 | 82 |
83 protected: | 83 protected: |
84 MessagePipeEndpoint() {} | 84 MessagePipeEndpoint() {} |
85 | 85 |
86 private: | 86 private: |
87 DISALLOW_COPY_AND_ASSIGN(MessagePipeEndpoint); | 87 DISALLOW_COPY_AND_ASSIGN(MessagePipeEndpoint); |
88 }; | 88 }; |
89 | 89 |
90 } // namespace system | 90 } // namespace system |
91 } // namespace mojo | 91 } // namespace mojo |
92 | 92 |
93 #endif // MOJO_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ | 93 #endif // MOJO_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ |
OLD | NEW |