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

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

Issue 1549703002: Suppress erronous TSAN errors in new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert change to enable new EDK by default Created 4 years, 12 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
« no previous file with comments | « build/sanitizers/tsan_suppressions.cc ('k') | mojo/edk/system/raw_channel.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 #include "mojo/edk/system/message_in_transit.h" 5 #include "mojo/edk/system/message_in_transit.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 #include <ostream> 10 #include <ostream>
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Update the sizes in the message header. 159 // Update the sizes in the message header.
160 UpdateTotalSize(); 160 UpdateTotalSize();
161 } 161 }
162 162
163 void MessageInTransit::ConstructorHelper(Type type, 163 void MessageInTransit::ConstructorHelper(Type type,
164 uint32_t num_bytes) { 164 uint32_t num_bytes) {
165 DCHECK_LE(num_bytes, GetConfiguration().max_message_num_bytes); 165 DCHECK_LE(num_bytes, GetConfiguration().max_message_num_bytes);
166 166
167 // |total_size| is updated below, from the other values. 167 // |total_size| is updated below, from the other values.
168 header()->type = type; 168 header()->type = type;
169 header()->unusedforalignment = 0;
169 header()->num_bytes = num_bytes; 170 header()->num_bytes = num_bytes;
170 header()->unused = 0; 171 header()->unused = 0;
171 header()->route_id = 0; 172 header()->route_id = 0;
172 // Note: If dispatchers are subsequently attached, then |total_size| will have 173 // Note: If dispatchers are subsequently attached, then |total_size| will have
173 // to be adjusted. 174 // to be adjusted.
174 UpdateTotalSize(); 175 UpdateTotalSize();
175 } 176 }
176 177
177 void MessageInTransit::UpdateTotalSize() { 178 void MessageInTransit::UpdateTotalSize() {
178 DCHECK_EQ(main_buffer_size_ % kMessageAlignment, 0u); 179 DCHECK_EQ(main_buffer_size_ % kMessageAlignment, 0u);
179 header()->total_size = static_cast<uint32_t>(main_buffer_size_); 180 header()->total_size = static_cast<uint32_t>(main_buffer_size_);
180 if (transport_data_) { 181 if (transport_data_) {
181 header()->total_size += 182 header()->total_size +=
182 static_cast<uint32_t>(transport_data_->buffer_size()); 183 static_cast<uint32_t>(transport_data_->buffer_size());
183 } 184 }
184 } 185 }
185 186
186 } // namespace edk 187 } // namespace edk
187 } // namespace mojo 188 } // namespace mojo
OLDNEW
« no previous file with comments | « build/sanitizers/tsan_suppressions.cc ('k') | mojo/edk/system/raw_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698