OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_ | 5 #ifndef MOJO_EDK_SYSTEM_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_ |
6 #define MOJO_EDK_SYSTEM_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_ | 6 #define MOJO_EDK_SYSTEM_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "mojo/edk/system/channel_endpoint.h" | 12 #include "mojo/edk/system/channel_endpoint.h" |
12 #include "mojo/edk/system/data_pipe_impl.h" | 13 #include "mojo/edk/system/data_pipe_impl.h" |
13 #include "mojo/edk/system/system_impl_export.h" | 14 #include "mojo/edk/system/system_impl_export.h" |
14 #include "mojo/public/cpp/system/macros.h" | 15 #include "mojo/public/cpp/system/macros.h" |
15 | 16 |
16 namespace mojo { | 17 namespace mojo { |
17 namespace system { | 18 namespace system { |
18 | 19 |
19 // |RemoteConsumerDataPipeImpl| is a subclass that "implements" |DataPipe| for | 20 // |RemoteConsumerDataPipeImpl| is a subclass that "implements" |DataPipe| for |
20 // data pipes whose producer is local and whose consumer is remote. See | 21 // data pipes whose producer is local and whose consumer is remote. See |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void Disconnect(); | 91 void Disconnect(); |
91 | 92 |
92 // Should be valid if and only if |consumer_open()| returns true. | 93 // Should be valid if and only if |consumer_open()| returns true. |
93 scoped_refptr<ChannelEndpoint> channel_endpoint_; | 94 scoped_refptr<ChannelEndpoint> channel_endpoint_; |
94 | 95 |
95 // The number of bytes we've sent the consumer, but don't *know* have been | 96 // The number of bytes we've sent the consumer, but don't *know* have been |
96 // consumed. | 97 // consumed. |
97 size_t consumer_num_bytes_; | 98 size_t consumer_num_bytes_; |
98 | 99 |
99 // Used for two-phase writes. | 100 // Used for two-phase writes. |
100 scoped_ptr<char, base::AlignedFreeDeleter> buffer_; | 101 std::unique_ptr<char, base::AlignedFreeDeleter> buffer_; |
101 | 102 |
102 MOJO_DISALLOW_COPY_AND_ASSIGN(RemoteConsumerDataPipeImpl); | 103 MOJO_DISALLOW_COPY_AND_ASSIGN(RemoteConsumerDataPipeImpl); |
103 }; | 104 }; |
104 | 105 |
105 } // namespace system | 106 } // namespace system |
106 } // namespace mojo | 107 } // namespace mojo |
107 | 108 |
108 #endif // MOJO_EDK_SYSTEM_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_ | 109 #endif // MOJO_EDK_SYSTEM_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_ |
OLD | NEW |