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_LOCAL_MESSAGE_PIPE_ENDPOINT_H_ | 5 #ifndef MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_ |
6 #define MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_ | 6 #define MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "mojo/public/c/system/core.h" | 10 #include "mojo/public/c/system/core.h" |
11 #include "mojo/system/message_in_transit_queue.h" | 11 #include "mojo/system/message_in_transit_queue.h" |
12 #include "mojo/system/message_pipe_endpoint.h" | 12 #include "mojo/system/message_pipe_endpoint.h" |
13 #include "mojo/system/system_impl_export.h" | 13 #include "mojo/system/system_impl_export.h" |
14 #include "mojo/system/waiter_list.h" | 14 #include "mojo/system/waiter_list.h" |
15 | 15 |
16 namespace mojo { | 16 namespace mojo { |
17 namespace system { | 17 namespace system { |
18 | 18 |
19 class MOJO_SYSTEM_IMPL_EXPORT LocalMessagePipeEndpoint | 19 class MOJO_SYSTEM_IMPL_EXPORT LocalMessagePipeEndpoint |
20 : public MessagePipeEndpoint { | 20 : public MessagePipeEndpoint { |
21 public: | 21 public: |
22 LocalMessagePipeEndpoint(); | 22 LocalMessagePipeEndpoint(); |
23 virtual ~LocalMessagePipeEndpoint(); | 23 virtual ~LocalMessagePipeEndpoint(); |
24 | 24 |
25 // |MessagePipeEndpoint| implementation: | 25 // |MessagePipeEndpoint| implementation: |
26 virtual Type GetType() const OVERRIDE; | 26 virtual Type GetType() const OVERRIDE; |
27 virtual void Close() OVERRIDE; | 27 virtual bool OnPeerClose() OVERRIDE; |
28 virtual void OnPeerClose() OVERRIDE; | |
29 virtual void EnqueueMessage(scoped_ptr<MessageInTransit> message) OVERRIDE; | 28 virtual void EnqueueMessage(scoped_ptr<MessageInTransit> message) OVERRIDE; |
30 | 29 |
31 // There's a dispatcher for |LocalMessagePipeEndpoint|s, so we have to | 30 // There's a dispatcher for |LocalMessagePipeEndpoint|s, so we have to |
32 // implement/override these: | 31 // implement/override these: |
| 32 virtual void Close() OVERRIDE; |
33 virtual void CancelAllWaiters() OVERRIDE; | 33 virtual void CancelAllWaiters() OVERRIDE; |
34 virtual MojoResult ReadMessage( | 34 virtual MojoResult ReadMessage( |
35 void* bytes, uint32_t* num_bytes, | 35 void* bytes, uint32_t* num_bytes, |
36 std::vector<scoped_refptr<Dispatcher> >* dispatchers, | 36 std::vector<scoped_refptr<Dispatcher> >* dispatchers, |
37 uint32_t* num_dispatchers, | 37 uint32_t* num_dispatchers, |
38 MojoReadMessageFlags flags) OVERRIDE; | 38 MojoReadMessageFlags flags) OVERRIDE; |
39 virtual MojoResult AddWaiter(Waiter* waiter, | 39 virtual MojoResult AddWaiter(Waiter* waiter, |
40 MojoWaitFlags flags, | 40 MojoWaitFlags flags, |
41 MojoResult wake_result) OVERRIDE; | 41 MojoResult wake_result) OVERRIDE; |
42 virtual void RemoveWaiter(Waiter* waiter) OVERRIDE; | 42 virtual void RemoveWaiter(Waiter* waiter) OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
55 MessageInTransitQueue message_queue_; | 55 MessageInTransitQueue message_queue_; |
56 WaiterList waiter_list_; | 56 WaiterList waiter_list_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(LocalMessagePipeEndpoint); | 58 DISALLOW_COPY_AND_ASSIGN(LocalMessagePipeEndpoint); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace system | 61 } // namespace system |
62 } // namespace mojo | 62 } // namespace mojo |
63 | 63 |
64 #endif // MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_ | 64 #endif // MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_ |
OLD | NEW |