OLD | NEW |
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 #ifndef MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 5 #ifndef MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ |
6 #define MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 6 #define MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 public: | 77 public: |
78 // The maximum size of a single serialized dispatcher. This must be a multiple | 78 // The maximum size of a single serialized dispatcher. This must be a multiple |
79 // of |kMessageAlignment|. | 79 // of |kMessageAlignment|. |
80 static const size_t kMaxSerializedDispatcherSize = 10000; | 80 static const size_t kMaxSerializedDispatcherSize = 10000; |
81 | 81 |
82 // The maximum number of platform handles to attach for a single serialized | 82 // The maximum number of platform handles to attach for a single serialized |
83 // dispatcher. | 83 // dispatcher. |
84 static const size_t kMaxSerializedDispatcherPlatformHandles = 2; | 84 static const size_t kMaxSerializedDispatcherPlatformHandles = 2; |
85 | 85 |
86 // The maximum possible size of a valid transport data buffer. | 86 // The maximum possible size of a valid transport data buffer. |
87 static size_t GetMaxBufferSize(); | 87 static const size_t kMaxBufferSize; |
88 | 88 |
89 // The maximum total number of platform handles that may be attached. | 89 // The maximum total number of platform handles that may be attached. |
90 static size_t GetMaxPlatformHandles(); | 90 static const size_t kMaxPlatformHandles; |
91 | 91 |
92 TransportData(scoped_ptr<DispatcherVector> dispatchers, Channel* channel); | 92 TransportData(scoped_ptr<DispatcherVector> dispatchers, Channel* channel); |
93 | 93 |
94 #if defined(OS_POSIX) | 94 #if defined(OS_POSIX) |
95 // This is a hacky POSIX-only constructor to directly attach only platform | 95 // This is a hacky POSIX-only constructor to directly attach only platform |
96 // handles to a message, used by |RawChannelPosix| to split messages with too | 96 // handles to a message, used by |RawChannelPosix| to split messages with too |
97 // many platform handles into multiple messages. |Header| will be present, but | 97 // many platform handles into multiple messages. |Header| will be present, but |
98 // be zero. (No other information will be attached, and | 98 // be zero. (No other information will be attached, and |
99 // |RawChannel::GetSerializedPlatformHandleSize()| should return zero.) | 99 // |RawChannel::GetSerializedPlatformHandleSize()| should return zero.) |
100 explicit TransportData( | 100 explicit TransportData( |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. | 183 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|. |
184 embedder::ScopedPlatformHandleVectorPtr platform_handles_; | 184 embedder::ScopedPlatformHandleVectorPtr platform_handles_; |
185 | 185 |
186 DISALLOW_COPY_AND_ASSIGN(TransportData); | 186 DISALLOW_COPY_AND_ASSIGN(TransportData); |
187 }; | 187 }; |
188 | 188 |
189 } // namespace system | 189 } // namespace system |
190 } // namespace mojo | 190 } // namespace mojo |
191 | 191 |
192 #endif // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 192 #endif // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ |
OLD | NEW |