| 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 "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "mojo/edk/system/channel_endpoint_client.h" | 11 #include "mojo/edk/system/channel_endpoint_client.h" |
| 12 #include "mojo/edk/system/message_in_transit_queue.h" | 12 #include "mojo/edk/system/message_in_transit_queue.h" |
| 13 #include "mojo/edk/system/mutex.h" | 13 #include "mojo/edk/system/mutex.h" |
| 14 #include "mojo/edk/system/system_impl_export.h" | |
| 15 #include "mojo/public/cpp/system/macros.h" | 14 #include "mojo/public/cpp/system/macros.h" |
| 16 | 15 |
| 17 struct MojoCreateDataPipeOptions; | 16 struct MojoCreateDataPipeOptions; |
| 18 | 17 |
| 19 namespace mojo { | 18 namespace mojo { |
| 20 namespace system { | 19 namespace system { |
| 21 | 20 |
| 22 class ChannelEndpoint; | 21 class ChannelEndpoint; |
| 23 class DataPipe; | 22 class DataPipe; |
| 24 class MessagePipe; | 23 class MessagePipe; |
| 25 | 24 |
| 26 // This is a simple |ChannelEndpointClient| that only receives messages. It's | 25 // This is a simple |ChannelEndpointClient| that only receives messages. It's |
| 27 // used for endpoints that are "received" by |Channel|, but not yet turned into | 26 // used for endpoints that are "received" by |Channel|, but not yet turned into |
| 28 // |MessagePipe|s or |DataPipe|s. | 27 // |MessagePipe|s or |DataPipe|s. |
| 29 class MOJO_SYSTEM_IMPL_EXPORT IncomingEndpoint final | 28 class IncomingEndpoint final : public ChannelEndpointClient { |
| 30 : public ChannelEndpointClient { | |
| 31 public: | 29 public: |
| 32 IncomingEndpoint(); | 30 IncomingEndpoint(); |
| 33 | 31 |
| 34 // Must be called before any other method. | 32 // Must be called before any other method. |
| 35 scoped_refptr<ChannelEndpoint> Init() MOJO_NOT_THREAD_SAFE; | 33 scoped_refptr<ChannelEndpoint> Init() MOJO_NOT_THREAD_SAFE; |
| 36 | 34 |
| 37 scoped_refptr<MessagePipe> ConvertToMessagePipe(); | 35 scoped_refptr<MessagePipe> ConvertToMessagePipe(); |
| 38 scoped_refptr<DataPipe> ConvertToDataPipeProducer( | 36 scoped_refptr<DataPipe> ConvertToDataPipeProducer( |
| 39 const MojoCreateDataPipeOptions& validated_options, | 37 const MojoCreateDataPipeOptions& validated_options, |
| 40 size_t consumer_num_bytes); | 38 size_t consumer_num_bytes); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 56 scoped_refptr<ChannelEndpoint> endpoint_ MOJO_GUARDED_BY(mutex_); | 54 scoped_refptr<ChannelEndpoint> endpoint_ MOJO_GUARDED_BY(mutex_); |
| 57 MessageInTransitQueue message_queue_ MOJO_GUARDED_BY(mutex_); | 55 MessageInTransitQueue message_queue_ MOJO_GUARDED_BY(mutex_); |
| 58 | 56 |
| 59 MOJO_DISALLOW_COPY_AND_ASSIGN(IncomingEndpoint); | 57 MOJO_DISALLOW_COPY_AND_ASSIGN(IncomingEndpoint); |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 } // namespace system | 60 } // namespace system |
| 63 } // namespace mojo | 61 } // namespace mojo |
| 64 | 62 |
| 65 #endif // MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_ | 63 #endif // MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_ |
| OLD | NEW |