OLD | NEW |
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_SYSTEM_MESSAGE_IN_TRANSIT_H_ | 5 #ifndef MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ |
6 #define MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ | 6 #define MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 uint32_t offset; // Relative to the start of the secondary buffer. | 260 uint32_t offset; // Relative to the start of the secondary buffer. |
261 uint32_t size; // (Not including any padding.) | 261 uint32_t size; // (Not including any padding.) |
262 uint32_t unused; | 262 uint32_t unused; |
263 }; | 263 }; |
264 | 264 |
265 // The maximum possible size of a valid secondary buffer: for each handle, | 265 // The maximum possible size of a valid secondary buffer: for each handle, |
266 // there'll be a handle table entry and its serialized data. | 266 // there'll be a handle table entry and its serialized data. |
267 static const size_t kMaxSecondaryBufferSize; | 267 static const size_t kMaxSecondaryBufferSize; |
268 | 268 |
269 // Validates the secondary buffer. Returns null on success, or a | 269 // Validates the secondary buffer. Returns null on success, or a |
270 // human-readable error message on error. | 270 // human-readable error message (meant for logging/debugging) on error. |
271 static const char* ValidateSecondaryBuffer(size_t num_handles, | 271 static const char* ValidateSecondaryBuffer(size_t num_handles, |
272 const void* secondary_buffer, | 272 const void* secondary_buffer, |
273 size_t secondary_buffer_size); | 273 size_t secondary_buffer_size); |
274 | 274 |
275 const Header* header() const { | 275 const Header* header() const { |
276 return static_cast<const Header*>(main_buffer_); | 276 return static_cast<const Header*>(main_buffer_); |
277 } | 277 } |
278 Header* header() { return static_cast<Header*>(main_buffer_); } | 278 Header* header() { return static_cast<Header*>(main_buffer_); } |
279 | 279 |
280 void UpdateTotalSize(); | 280 void UpdateTotalSize(); |
(...skipping 16 matching lines...) Expand all Loading... |
297 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. | 297 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. |
298 scoped_ptr<std::vector<embedder::PlatformHandle> > platform_handles_; | 298 scoped_ptr<std::vector<embedder::PlatformHandle> > platform_handles_; |
299 | 299 |
300 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); | 300 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); |
301 }; | 301 }; |
302 | 302 |
303 } // namespace system | 303 } // namespace system |
304 } // namespace mojo | 304 } // namespace mojo |
305 | 305 |
306 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ | 306 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ |
OLD | NEW |