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_EDK_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ | 5 #ifndef MOJO_EDK_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ |
6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ | 6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "mojo/edk/system/dispatcher.h" | 13 #include "mojo/edk/system/handle.h" |
14 #include "mojo/edk/system/memory.h" | 14 #include "mojo/edk/system/memory.h" |
15 #include "mojo/edk/system/message_in_transit.h" | 15 #include "mojo/edk/system/message_in_transit.h" |
16 #include "mojo/public/c/system/handle.h" | 16 #include "mojo/public/c/system/handle.h" |
17 #include "mojo/public/c/system/message_pipe.h" | 17 #include "mojo/public/c/system/message_pipe.h" |
18 #include "mojo/public/c/system/result.h" | 18 #include "mojo/public/c/system/result.h" |
19 #include "mojo/public/cpp/system/macros.h" | 19 #include "mojo/public/cpp/system/macros.h" |
20 | 20 |
21 namespace mojo { | 21 namespace mojo { |
22 namespace system { | 22 namespace system { |
23 | 23 |
(...skipping 29 matching lines...) Expand all Loading... |
53 // i.e., one for which there's a |MessagePipeDispatcher| (and thus a handle). | 53 // i.e., one for which there's a |MessagePipeDispatcher| (and thus a handle). |
54 // An implementation for a proxy endpoint (for which there's no dispatcher) | 54 // An implementation for a proxy endpoint (for which there's no dispatcher) |
55 // needs not override these methods, since they should never be called. | 55 // needs not override these methods, since they should never be called. |
56 // | 56 // |
57 // These methods implement the methods of the same name in |MessagePipe|, | 57 // These methods implement the methods of the same name in |MessagePipe|, |
58 // though |MessagePipe|'s implementation may have to do a little more if the | 58 // though |MessagePipe|'s implementation may have to do a little more if the |
59 // operation involves both endpoints. | 59 // operation involves both endpoints. |
60 virtual void CancelAllAwakables(); | 60 virtual void CancelAllAwakables(); |
61 virtual MojoResult ReadMessage(UserPointer<void> bytes, | 61 virtual MojoResult ReadMessage(UserPointer<void> bytes, |
62 UserPointer<uint32_t> num_bytes, | 62 UserPointer<uint32_t> num_bytes, |
63 DispatcherVector* dispatchers, | 63 HandleVector* handles, |
64 uint32_t* num_dispatchers, | 64 uint32_t* num_handles, |
65 MojoReadMessageFlags flags); | 65 MojoReadMessageFlags flags); |
66 virtual HandleSignalsState GetHandleSignalsState() const; | 66 virtual HandleSignalsState GetHandleSignalsState() const; |
67 virtual MojoResult AddAwakable(Awakable* awakable, | 67 virtual MojoResult AddAwakable(Awakable* awakable, |
68 MojoHandleSignals signals, | 68 MojoHandleSignals signals, |
69 uint32_t context, | 69 uint32_t context, |
70 HandleSignalsState* signals_state); | 70 HandleSignalsState* signals_state); |
71 virtual void RemoveAwakable(Awakable* awakable, | 71 virtual void RemoveAwakable(Awakable* awakable, |
72 HandleSignalsState* signals_state); | 72 HandleSignalsState* signals_state); |
73 | 73 |
74 // Implementations must override these if they represent a proxy endpoint. An | 74 // Implementations must override these if they represent a proxy endpoint. An |
75 // implementation for a local endpoint needs not override these methods, since | 75 // implementation for a local endpoint needs not override these methods, since |
76 // they should never be called. | 76 // they should never be called. |
77 virtual void Attach(ChannelEndpoint* channel_endpoint); | 77 virtual void Attach(ChannelEndpoint* channel_endpoint); |
78 | 78 |
79 protected: | 79 protected: |
80 MessagePipeEndpoint() {} | 80 MessagePipeEndpoint() {} |
81 | 81 |
82 private: | 82 private: |
83 MOJO_DISALLOW_COPY_AND_ASSIGN(MessagePipeEndpoint); | 83 MOJO_DISALLOW_COPY_AND_ASSIGN(MessagePipeEndpoint); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace system | 86 } // namespace system |
87 } // namespace mojo | 87 } // namespace mojo |
88 | 88 |
89 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ | 89 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_ENDPOINT_H_ |
OLD | NEW |