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

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

Issue 1770493002: Remove MOJO_STATIC_CONST_MEMBER_DEFINITION. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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 | « mojo/edk/system/message_in_transit.cc ('k') | mojo/public/cpp/system/macros.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/transport_data.h" 5 #include "mojo/edk/system/transport_data.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 12 matching lines...) Expand all
23 // (|{Channel,RawChannel}::GetSerializedPlatformHandleSize()| should always 23 // (|{Channel,RawChannel}::GetSerializedPlatformHandleSize()| should always
24 // return a value which is at most this. This is only used to calculate 24 // return a value which is at most this. This is only used to calculate
25 // |TransportData::kMaxBufferSize|. This value should be a multiple of the 25 // |TransportData::kMaxBufferSize|. This value should be a multiple of the
26 // alignment in order to simplify calculations, even though the actual amount of 26 // alignment in order to simplify calculations, even though the actual amount of
27 // space needed need not be a multiple of the alignment. 27 // space needed need not be a multiple of the alignment.
28 const size_t kMaxSizePerPlatformHandle = 8; 28 const size_t kMaxSizePerPlatformHandle = 8;
29 static_assert(kMaxSizePerPlatformHandle % MessageInTransit::kMessageAlignment == 29 static_assert(kMaxSizePerPlatformHandle % MessageInTransit::kMessageAlignment ==
30 0, 30 0,
31 "kMaxSizePerPlatformHandle not a multiple of alignment"); 31 "kMaxSizePerPlatformHandle not a multiple of alignment");
32 32
33 MOJO_STATIC_CONST_MEMBER_DEFINITION const size_t 33 const size_t TransportData::kMaxSerializedDispatcherSize;
34 TransportData::kMaxSerializedDispatcherSize; 34 const size_t TransportData::kMaxSerializedDispatcherPlatformHandles;
35 MOJO_STATIC_CONST_MEMBER_DEFINITION const size_t
36 TransportData::kMaxSerializedDispatcherPlatformHandles;
37 35
38 // static 36 // static
39 size_t TransportData::GetMaxBufferSize() { 37 size_t TransportData::GetMaxBufferSize() {
40 // In additional to the header, for each attached (Mojo) handle there'll be a 38 // In additional to the header, for each attached (Mojo) handle there'll be a
41 // handle table entry and serialized dispatcher data. 39 // handle table entry and serialized dispatcher data.
42 return sizeof(Header) + 40 return sizeof(Header) +
43 GetConfiguration().max_message_num_handles * 41 GetConfiguration().max_message_num_handles *
44 (sizeof(HandleTableEntry) + kMaxSerializedDispatcherSize) + 42 (sizeof(HandleTableEntry) + kMaxSerializedDispatcherSize) +
45 GetMaxPlatformHandles() * kMaxSizePerPlatformHandle; 43 GetMaxPlatformHandles() * kMaxSizePerPlatformHandle;
46 } 44 }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 const void* source = static_cast<const char*>(buffer) + offset; 337 const void* source = static_cast<const char*>(buffer) + offset;
340 (*dispatchers)[i] = Dispatcher::TransportDataAccess::Deserialize( 338 (*dispatchers)[i] = Dispatcher::TransportDataAccess::Deserialize(
341 channel, handle_table[i].type, source, size, platform_handles.get()); 339 channel, handle_table[i].type, source, size, platform_handles.get());
342 } 340 }
343 341
344 return dispatchers; 342 return dispatchers;
345 } 343 }
346 344
347 } // namespace system 345 } // namespace system
348 } // namespace mojo 346 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_in_transit.cc ('k') | mojo/public/cpp/system/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698