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

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

Issue 163023004: Mojo: Move the header bits of MessageInTransit into a separate struct. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new version Created 6 years, 10 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
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 #include "mojo/system/message_in_transit.h" 5 #include "mojo/system/message_in_transit.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <new> 9 #include <new>
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void MessageInTransit::Destroy() { 69 void MessageInTransit::Destroy() {
70 // No need to call the destructor, since we're POD. 70 // No need to call the destructor, since we're POD.
71 base::AlignedFree(this); 71 base::AlignedFree(this);
72 } 72 }
73 73
74 MessageInTransit::MessageInTransit(uint32_t data_size, 74 MessageInTransit::MessageInTransit(uint32_t data_size,
75 Type type, 75 Type type,
76 Subtype subtype, 76 Subtype subtype,
77 uint32_t num_bytes, 77 uint32_t num_bytes,
78 uint32_t num_handles) 78 uint32_t num_handles)
79 : data_size_(data_size), 79 : header_(data_size, type, subtype, kInvalidEndpointId, kInvalidEndpointId,
80 type_(type), 80 num_bytes, num_handles) {
81 subtype_(subtype), 81 DCHECK_GE(header()->data_size, header()->num_bytes);
82 source_id_(kInvalidEndpointId),
83 destination_id_(kInvalidEndpointId),
84 num_bytes_(num_bytes),
85 num_handles_(num_handles),
86 reserved0_(0),
87 reserved1_(0) {
88 DCHECK_GE(data_size_, num_bytes_);
89 } 82 }
90 83
91 } // namespace system 84 } // namespace system
92 } // namespace mojo 85 } // namespace mojo
OLDNEW
« mojo/system/message_in_transit.h ('K') | « mojo/system/message_in_transit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698