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

Side by Side Diff: mojo/system/message_in_transit.h

Issue 259373003: Mojo: Minor cleanup (of message_in_transit.cc and message_pipe.*). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/channel.cc ('k') | mojo/system/message_in_transit.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_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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 // Rounds |n| up to a multiple of |kMessageAlignment|. 236 // Rounds |n| up to a multiple of |kMessageAlignment|.
237 static inline size_t RoundUpMessageAlignment(size_t n) { 237 static inline size_t RoundUpMessageAlignment(size_t n) {
238 return (n + kMessageAlignment - 1) & ~(kMessageAlignment - 1); 238 return (n + kMessageAlignment - 1) & ~(kMessageAlignment - 1);
239 } 239 }
240 240
241 private: 241 private:
242 // To allow us to make assertions about |Header| in the .cc file. 242 // To allow us to make assertions about |Header| in the .cc file.
243 struct PrivateStructForCompileAsserts; 243 struct PrivateStructForCompileAsserts;
244 244
245 // "Header" for the data. Must be a multiple of |kMessageAlignment| bytes in 245 // Header for the data (main buffer). Must be a multiple of
246 // size. Must be POD. 246 // |kMessageAlignment| bytes in size. Must be POD.
247 struct Header { 247 struct Header {
248 // Total size of the message, including the header, the message data 248 // Total size of the message, including the header, the message data
249 // ("bytes") including padding (to make it a multiple of |kMessageAlignment| 249 // ("bytes") including padding (to make it a multiple of |kMessageAlignment|
250 // bytes), and serialized handle information. Note that this may not be the 250 // bytes), and serialized handle information. Note that this may not be the
251 // correct value if dispatchers are attached but 251 // correct value if dispatchers are attached but
252 // |SerializeAndCloseDispatchers()| has not been called. 252 // |SerializeAndCloseDispatchers()| has not been called.
253 uint32_t total_size; 253 uint32_t total_size;
254 Type type; // 2 bytes. 254 Type type; // 2 bytes.
255 Subtype subtype; // 2 bytes. 255 Subtype subtype; // 2 bytes.
256 EndpointId source_id; // 4 bytes. 256 EndpointId source_id; // 4 bytes.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. 305 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|.
306 scoped_ptr<std::vector<embedder::PlatformHandle> > platform_handles_; 306 scoped_ptr<std::vector<embedder::PlatformHandle> > platform_handles_;
307 307
308 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); 308 DISALLOW_COPY_AND_ASSIGN(MessageInTransit);
309 }; 309 };
310 310
311 } // namespace system 311 } // namespace system
312 } // namespace mojo 312 } // namespace mojo
313 313
314 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ 314 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_
OLDNEW
« no previous file with comments | « mojo/system/channel.cc ('k') | mojo/system/message_in_transit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698