OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_INCOMING_ENDPOINT_H_ | 5 #ifndef MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_ |
6 #define MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_ | 6 #define MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "mojo/edk/system/channel_endpoint_client.h" | 10 #include "mojo/edk/system/channel_endpoint_client.h" |
11 #include "mojo/edk/system/message_in_transit_queue.h" | 11 #include "mojo/edk/system/message_in_transit_queue.h" |
12 #include "mojo/edk/system/mutex.h" | 12 #include "mojo/edk/util/mutex.h" |
13 #include "mojo/edk/util/ref_ptr.h" | 13 #include "mojo/edk/util/ref_ptr.h" |
| 14 #include "mojo/edk/util/thread_annotations.h" |
14 #include "mojo/public/cpp/system/macros.h" | 15 #include "mojo/public/cpp/system/macros.h" |
15 | 16 |
16 struct MojoCreateDataPipeOptions; | 17 struct MojoCreateDataPipeOptions; |
17 | 18 |
18 namespace mojo { | 19 namespace mojo { |
19 namespace system { | 20 namespace system { |
20 | 21 |
21 class ChannelEndpoint; | 22 class ChannelEndpoint; |
22 class DataPipe; | 23 class DataPipe; |
23 class MessagePipe; | 24 class MessagePipe; |
(...skipping 22 matching lines...) Expand all Loading... |
46 // |ChannelEndpointClient| methods: | 47 // |ChannelEndpointClient| methods: |
47 bool OnReadMessage(unsigned port, MessageInTransit* message) override; | 48 bool OnReadMessage(unsigned port, MessageInTransit* message) override; |
48 void OnDetachFromChannel(unsigned port) override; | 49 void OnDetachFromChannel(unsigned port) override; |
49 | 50 |
50 private: | 51 private: |
51 FRIEND_MAKE_REF_COUNTED(IncomingEndpoint); | 52 FRIEND_MAKE_REF_COUNTED(IncomingEndpoint); |
52 | 53 |
53 IncomingEndpoint(); | 54 IncomingEndpoint(); |
54 ~IncomingEndpoint() override; | 55 ~IncomingEndpoint() override; |
55 | 56 |
56 Mutex mutex_; | 57 util::Mutex mutex_; |
57 util::RefPtr<ChannelEndpoint> endpoint_ MOJO_GUARDED_BY(mutex_); | 58 util::RefPtr<ChannelEndpoint> endpoint_ MOJO_GUARDED_BY(mutex_); |
58 MessageInTransitQueue message_queue_ MOJO_GUARDED_BY(mutex_); | 59 MessageInTransitQueue message_queue_ MOJO_GUARDED_BY(mutex_); |
59 | 60 |
60 MOJO_DISALLOW_COPY_AND_ASSIGN(IncomingEndpoint); | 61 MOJO_DISALLOW_COPY_AND_ASSIGN(IncomingEndpoint); |
61 }; | 62 }; |
62 | 63 |
63 } // namespace system | 64 } // namespace system |
64 } // namespace mojo | 65 } // namespace mojo |
65 | 66 |
66 #endif // MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_ | 67 #endif // MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_ |
OLD | NEW |