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 #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 Loading... |
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 |
OLD | NEW |