Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: mojo/edk/system/remote_consumer_data_pipe_impl.h

Issue 1483823004: EDK: Move {platform_handle,scoped_platform_handle}.* to //mojo/edk/platform. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 8 #include <memory>
9 9
10 #include "base/memory/aligned_memory.h" 10 #include "base/memory/aligned_memory.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 UserPointer<uint32_t> buffer_num_bytes) override; 55 UserPointer<uint32_t> buffer_num_bytes) override;
56 MojoResult ProducerEndWriteData(uint32_t num_bytes_written) override; 56 MojoResult ProducerEndWriteData(uint32_t num_bytes_written) override;
57 HandleSignalsState ProducerGetHandleSignalsState() const override; 57 HandleSignalsState ProducerGetHandleSignalsState() const override;
58 void ProducerStartSerialize(Channel* channel, 58 void ProducerStartSerialize(Channel* channel,
59 size_t* max_size, 59 size_t* max_size,
60 size_t* max_platform_handles) override; 60 size_t* max_platform_handles) override;
61 bool ProducerEndSerialize( 61 bool ProducerEndSerialize(
62 Channel* channel, 62 Channel* channel,
63 void* destination, 63 void* destination,
64 size_t* actual_size, 64 size_t* actual_size,
65 std::vector<embedder::ScopedPlatformHandle>* platform_handles) override; 65 std::vector<platform::ScopedPlatformHandle>* platform_handles) override;
66 void ConsumerClose() override; 66 void ConsumerClose() override;
67 MojoResult ConsumerReadData(UserPointer<void> elements, 67 MojoResult ConsumerReadData(UserPointer<void> elements,
68 UserPointer<uint32_t> num_bytes, 68 UserPointer<uint32_t> num_bytes,
69 uint32_t max_num_bytes_to_read, 69 uint32_t max_num_bytes_to_read,
70 uint32_t min_num_bytes_to_read, 70 uint32_t min_num_bytes_to_read,
71 bool peek) override; 71 bool peek) override;
72 MojoResult ConsumerDiscardData(UserPointer<uint32_t> num_bytes, 72 MojoResult ConsumerDiscardData(UserPointer<uint32_t> num_bytes,
73 uint32_t max_num_bytes_to_discard, 73 uint32_t max_num_bytes_to_discard,
74 uint32_t min_num_bytes_to_discard) override; 74 uint32_t min_num_bytes_to_discard) override;
75 MojoResult ConsumerQueryData(UserPointer<uint32_t> num_bytes) override; 75 MojoResult ConsumerQueryData(UserPointer<uint32_t> num_bytes) override;
76 MojoResult ConsumerBeginReadData( 76 MojoResult ConsumerBeginReadData(
77 UserPointer<const void*> buffer, 77 UserPointer<const void*> buffer,
78 UserPointer<uint32_t> buffer_num_bytes) override; 78 UserPointer<uint32_t> buffer_num_bytes) override;
79 MojoResult ConsumerEndReadData(uint32_t num_bytes_read) override; 79 MojoResult ConsumerEndReadData(uint32_t num_bytes_read) override;
80 HandleSignalsState ConsumerGetHandleSignalsState() const override; 80 HandleSignalsState ConsumerGetHandleSignalsState() const override;
81 void ConsumerStartSerialize(Channel* channel, 81 void ConsumerStartSerialize(Channel* channel,
82 size_t* max_size, 82 size_t* max_size,
83 size_t* max_platform_handles) override; 83 size_t* max_platform_handles) override;
84 bool ConsumerEndSerialize( 84 bool ConsumerEndSerialize(
85 Channel* channel, 85 Channel* channel,
86 void* destination, 86 void* destination,
87 size_t* actual_size, 87 size_t* actual_size,
88 std::vector<embedder::ScopedPlatformHandle>* platform_handles) override; 88 std::vector<platform::ScopedPlatformHandle>* platform_handles) override;
89 bool OnReadMessage(unsigned port, MessageInTransit* message) override; 89 bool OnReadMessage(unsigned port, MessageInTransit* message) override;
90 void OnDetachFromChannel(unsigned port) override; 90 void OnDetachFromChannel(unsigned port) override;
91 91
92 void EnsureBuffer(); 92 void EnsureBuffer();
93 void DestroyBuffer(); 93 void DestroyBuffer();
94 94
95 void Disconnect(); 95 void Disconnect();
96 96
97 // Should be valid if and only if |consumer_open()| returns true. 97 // Should be valid if and only if |consumer_open()| returns true.
98 util::RefPtr<ChannelEndpoint> channel_endpoint_; 98 util::RefPtr<ChannelEndpoint> channel_endpoint_;
99 99
100 // The number of bytes we've sent the consumer, but don't *know* have been 100 // The number of bytes we've sent the consumer, but don't *know* have been
101 // consumed. 101 // consumed.
102 size_t consumer_num_bytes_; 102 size_t consumer_num_bytes_;
103 103
104 // Used for two-phase writes. 104 // Used for two-phase writes.
105 std::unique_ptr<char, base::AlignedFreeDeleter> buffer_; 105 std::unique_ptr<char, base::AlignedFreeDeleter> buffer_;
106 // This is nearly always zero, except when the two-phase write started on a 106 // This is nearly always zero, except when the two-phase write started on a
107 // |LocalDataPipeImpl|. 107 // |LocalDataPipeImpl|.
108 size_t start_index_; 108 size_t start_index_;
109 109
110 MOJO_DISALLOW_COPY_AND_ASSIGN(RemoteConsumerDataPipeImpl); 110 MOJO_DISALLOW_COPY_AND_ASSIGN(RemoteConsumerDataPipeImpl);
111 }; 111 };
112 112
113 } // namespace system 113 } // namespace system
114 } // namespace mojo 114 } // namespace mojo
115 115
116 #endif // MOJO_EDK_SYSTEM_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_ 116 #endif // MOJO_EDK_SYSTEM_REMOTE_CONSUMER_DATA_PIPE_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/raw_channel_unittest.cc ('k') | mojo/edk/system/remote_consumer_data_pipe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698