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

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

Issue 830593003: Update mojo sdk to rev 9fbbc4f0fef1187312316c0ed992342474e139f1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cherry-pick mojo 9d3b8dd17f12d20035a14737fdc38dd926890ff8 Created 5 years, 11 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/test_utils.cc ('k') | mojo/edk/system/transport_data.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 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_TRANSPORT_DATA_H_ 5 #ifndef MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_
6 #define MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ 6 #define MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 static const size_t kMaxSerializedDispatcherPlatformHandles = 2; 84 static const size_t kMaxSerializedDispatcherPlatformHandles = 2;
85 85
86 // The maximum possible size of a valid transport data buffer. 86 // The maximum possible size of a valid transport data buffer.
87 static size_t GetMaxBufferSize(); 87 static size_t GetMaxBufferSize();
88 88
89 // The maximum total number of platform handles that may be attached. 89 // The maximum total number of platform handles that may be attached.
90 static size_t GetMaxPlatformHandles(); 90 static size_t GetMaxPlatformHandles();
91 91
92 TransportData(scoped_ptr<DispatcherVector> dispatchers, Channel* channel); 92 TransportData(scoped_ptr<DispatcherVector> dispatchers, Channel* channel);
93 93
94 #if defined(OS_POSIX) 94 // This is used for users of |MessageInTransit|/|TransportData|/|RawChannel|
95 // This is a hacky POSIX-only constructor to directly attach only platform 95 // that want to simply transport data and platform handles, and not
96 // handles to a message, used by |RawChannelPosix| to split messages with too 96 // |Dispatcher|s. (|Header| will be present, and zero except for
97 // many platform handles into multiple messages. |Header| will be present, but 97 // |num_platform_handles|, and |platform_handle_table_offset| if necessary.)
98 // be zero. (No other information will be attached, and
99 // |RawChannel::GetSerializedPlatformHandleSize()| should return zero.)
100 explicit TransportData( 98 explicit TransportData(
101 embedder::ScopedPlatformHandleVectorPtr platform_handles); 99 embedder::ScopedPlatformHandleVectorPtr platform_handles);
102 #endif
103 100
104 ~TransportData(); 101 ~TransportData();
105 102
106 const void* buffer() const { return buffer_.get(); } 103 const void* buffer() const { return buffer_.get(); }
107 void* buffer() { return buffer_.get(); } 104 void* buffer() { return buffer_.get(); }
108 size_t buffer_size() const { return buffer_size_; } 105 size_t buffer_size() const { return buffer_size_; }
109 106
110 uint32_t platform_handle_table_offset() const { 107 uint32_t platform_handle_table_offset() const {
111 return header()->platform_handle_table_offset; 108 return header()->platform_handle_table_offset;
112 } 109 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 const Header* header() const { 170 const Header* header() const {
174 return reinterpret_cast<const Header*>(buffer_.get()); 171 return reinterpret_cast<const Header*>(buffer_.get());
175 } 172 }
176 173
177 size_t buffer_size_; 174 size_t buffer_size_;
178 scoped_ptr<char, base::AlignedFreeDeleter> buffer_; // Never null. 175 scoped_ptr<char, base::AlignedFreeDeleter> buffer_; // Never null.
179 176
180 // Any platform-specific handles attached to this message (for inter-process 177 // Any platform-specific handles attached to this message (for inter-process
181 // transport). The vector (if any) owns the handles that it contains (and is 178 // transport). The vector (if any) owns the handles that it contains (and is
182 // responsible for closing them). 179 // responsible for closing them).
183 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. 180 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandle|s.
184 embedder::ScopedPlatformHandleVectorPtr platform_handles_; 181 embedder::ScopedPlatformHandleVectorPtr platform_handles_;
185 182
186 DISALLOW_COPY_AND_ASSIGN(TransportData); 183 DISALLOW_COPY_AND_ASSIGN(TransportData);
187 }; 184 };
188 185
189 } // namespace system 186 } // namespace system
190 } // namespace mojo 187 } // namespace mojo
191 188
192 #endif // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ 189 #endif // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/test_utils.cc ('k') | mojo/edk/system/transport_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698