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

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

Issue 973513004: Allow data pipe producer/consumer handles to be re-sent. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: review comments Created 5 years, 9 months 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/data_pipe_impl_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 "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/aligned_memory.h" 9 #include "base/memory/aligned_memory.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Converts queued data to messages (leaves |buffer_| empty).
86 void ConvertDataToMessages(MessageInTransitQueue* message_queue);
87
88 scoped_ptr<char, base::AlignedFreeDeleter> buffer_; 85 scoped_ptr<char, base::AlignedFreeDeleter> buffer_;
89 // Circular buffer. 86 // Circular buffer.
90 size_t start_index_; 87 size_t start_index_;
91 size_t current_num_bytes_; 88 size_t current_num_bytes_;
92 89
93 DISALLOW_COPY_AND_ASSIGN(LocalDataPipeImpl); 90 DISALLOW_COPY_AND_ASSIGN(LocalDataPipeImpl);
94 }; 91 };
95 92
96 } // namespace system 93 } // namespace system
97 } // namespace mojo 94 } // namespace mojo
98 95
99 #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/data_pipe_impl_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