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

Side by Side Diff: mojo/edk/system/local_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
« no previous file with comments | « mojo/edk/system/ipc_support_unittest.cc ('k') | mojo/edk/system/local_data_pipe_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_EDK_SYSTEM_LOCAL_DATA_PIPE_IMPL_H_ 5 #ifndef MOJO_EDK_SYSTEM_LOCAL_DATA_PIPE_IMPL_H_
6 #define MOJO_EDK_SYSTEM_LOCAL_DATA_PIPE_IMPL_H_ 6 #define MOJO_EDK_SYSTEM_LOCAL_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 25 matching lines...) Expand all
36 UserPointer<uint32_t> buffer_num_bytes) override; 36 UserPointer<uint32_t> buffer_num_bytes) override;
37 MojoResult ProducerEndWriteData(uint32_t num_bytes_written) override; 37 MojoResult ProducerEndWriteData(uint32_t num_bytes_written) override;
38 HandleSignalsState ProducerGetHandleSignalsState() const override; 38 HandleSignalsState ProducerGetHandleSignalsState() const override;
39 void ProducerStartSerialize(Channel* channel, 39 void ProducerStartSerialize(Channel* channel,
40 size_t* max_size, 40 size_t* max_size,
41 size_t* max_platform_handles) override; 41 size_t* max_platform_handles) override;
42 bool ProducerEndSerialize( 42 bool ProducerEndSerialize(
43 Channel* channel, 43 Channel* channel,
44 void* destination, 44 void* destination,
45 size_t* actual_size, 45 size_t* actual_size,
46 std::vector<embedder::ScopedPlatformHandle>* platform_handles) override; 46 std::vector<platform::ScopedPlatformHandle>* platform_handles) override;
47 void ConsumerClose() override; 47 void ConsumerClose() override;
48 MojoResult ConsumerReadData(UserPointer<void> elements, 48 MojoResult ConsumerReadData(UserPointer<void> elements,
49 UserPointer<uint32_t> num_bytes, 49 UserPointer<uint32_t> num_bytes,
50 uint32_t max_num_bytes_to_read, 50 uint32_t max_num_bytes_to_read,
51 uint32_t min_num_bytes_to_read, 51 uint32_t min_num_bytes_to_read,
52 bool peek) override; 52 bool peek) override;
53 MojoResult ConsumerDiscardData(UserPointer<uint32_t> num_bytes, 53 MojoResult ConsumerDiscardData(UserPointer<uint32_t> num_bytes,
54 uint32_t max_num_bytes_to_discard, 54 uint32_t max_num_bytes_to_discard,
55 uint32_t min_num_bytes_to_discard) override; 55 uint32_t min_num_bytes_to_discard) override;
56 MojoResult ConsumerQueryData(UserPointer<uint32_t> num_bytes) override; 56 MojoResult ConsumerQueryData(UserPointer<uint32_t> num_bytes) override;
57 MojoResult ConsumerBeginReadData( 57 MojoResult ConsumerBeginReadData(
58 UserPointer<const void*> buffer, 58 UserPointer<const void*> buffer,
59 UserPointer<uint32_t> buffer_num_bytes) override; 59 UserPointer<uint32_t> buffer_num_bytes) override;
60 MojoResult ConsumerEndReadData(uint32_t num_bytes_read) override; 60 MojoResult ConsumerEndReadData(uint32_t num_bytes_read) override;
61 HandleSignalsState ConsumerGetHandleSignalsState() const override; 61 HandleSignalsState ConsumerGetHandleSignalsState() const override;
62 void ConsumerStartSerialize(Channel* channel, 62 void ConsumerStartSerialize(Channel* channel,
63 size_t* max_size, 63 size_t* max_size,
64 size_t* max_platform_handles) override; 64 size_t* max_platform_handles) override;
65 bool ConsumerEndSerialize( 65 bool ConsumerEndSerialize(
66 Channel* channel, 66 Channel* channel,
67 void* destination, 67 void* destination,
68 size_t* actual_size, 68 size_t* actual_size,
69 std::vector<embedder::ScopedPlatformHandle>* platform_handles) override; 69 std::vector<platform::ScopedPlatformHandle>* platform_handles) override;
70 bool OnReadMessage(unsigned port, MessageInTransit* message) override; 70 bool OnReadMessage(unsigned port, MessageInTransit* message) override;
71 void OnDetachFromChannel(unsigned port) override; 71 void OnDetachFromChannel(unsigned port) override;
72 72
73 void EnsureBuffer(); 73 void EnsureBuffer();
74 void DestroyBuffer(); 74 void DestroyBuffer();
75 75
76 // Get the maximum (single) write/read size right now (in number of elements); 76 // Get the maximum (single) write/read size right now (in number of elements);
77 // result fits in a |uint32_t|. 77 // result fits in a |uint32_t|.
78 size_t GetMaxNumBytesToWrite(); 78 size_t GetMaxNumBytesToWrite();
79 size_t GetMaxNumBytesToRead(); 79 size_t GetMaxNumBytesToRead();
80 80
81 // Marks the given number of bytes as consumed/discarded. |num_bytes| must be 81 // Marks the given number of bytes as consumed/discarded. |num_bytes| must be
82 // no greater than |current_num_bytes_|. 82 // no greater than |current_num_bytes_|.
83 void MarkDataAsConsumed(size_t num_bytes); 83 void MarkDataAsConsumed(size_t num_bytes);
84 84
85 std::unique_ptr<char, base::AlignedFreeDeleter> buffer_; 85 std::unique_ptr<char, base::AlignedFreeDeleter> buffer_;
86 // Circular buffer. 86 // Circular buffer.
87 size_t start_index_; 87 size_t start_index_;
88 size_t current_num_bytes_; 88 size_t current_num_bytes_;
89 89
90 MOJO_DISALLOW_COPY_AND_ASSIGN(LocalDataPipeImpl); 90 MOJO_DISALLOW_COPY_AND_ASSIGN(LocalDataPipeImpl);
91 }; 91 };
92 92
93 } // namespace system 93 } // namespace system
94 } // namespace mojo 94 } // namespace mojo
95 95
96 #endif // MOJO_EDK_SYSTEM_LOCAL_DATA_PIPE_IMPL_H_ 96 #endif // MOJO_EDK_SYSTEM_LOCAL_DATA_PIPE_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/ipc_support_unittest.cc ('k') | mojo/edk/system/local_data_pipe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698