Chromium Code Reviews| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 uint32_t num_handles; | 255 uint32_t num_handles; |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 struct HandleTableEntry { | 258 struct HandleTableEntry { |
| 259 int32_t type; // From |Dispatcher::Type| (|kTypeUnknown| for "invalid"). | 259 int32_t type; // From |Dispatcher::Type| (|kTypeUnknown| for "invalid"). |
| 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. |
|
Tom Sepez
2014/04/08 00:18:22
nit: truly pedantic individuals would say "... in
| |
| 266 // there'll be a handle table entry and its serialized data. | |
| 267 static const size_t kMaxSecondaryBufferSize; | 266 static const size_t kMaxSecondaryBufferSize; |
| 268 | 267 |
| 269 // Validates the secondary buffer. Returns null on success, or a | 268 // Validates the secondary buffer. Returns null on success, or a |
| 270 // human-readable error message (meant for logging/debugging) on error. | 269 // human-readable error message (meant for logging/debugging) on error. |
| 271 static const char* ValidateSecondaryBuffer(size_t num_handles, | 270 static const char* ValidateSecondaryBuffer(size_t num_handles, |
| 272 const void* secondary_buffer, | 271 const void* secondary_buffer, |
| 273 size_t secondary_buffer_size); | 272 size_t secondary_buffer_size); |
| 274 | 273 |
| 275 const Header* header() const { | 274 const Header* header() const { |
| 276 return static_cast<const Header*>(main_buffer_); | 275 return static_cast<const Header*>(main_buffer_); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 297 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. | 296 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. |
| 298 scoped_ptr<std::vector<embedder::PlatformHandle> > platform_handles_; | 297 scoped_ptr<std::vector<embedder::PlatformHandle> > platform_handles_; |
| 299 | 298 |
| 300 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); | 299 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); |
| 301 }; | 300 }; |
| 302 | 301 |
| 303 } // namespace system | 302 } // namespace system |
| 304 } // namespace mojo | 303 } // namespace mojo |
| 305 | 304 |
| 306 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ | 305 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ |
| OLD | NEW |