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 <memory> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/memory/aligned_memory.h" | 13 #include "base/memory/aligned_memory.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
15 #include "mojo/edk/embedder/platform_handle.h" | 16 #include "mojo/edk/embedder/platform_handle.h" |
16 #include "mojo/edk/embedder/platform_handle_vector.h" | 17 #include "mojo/edk/embedder/platform_handle_vector.h" |
17 #include "mojo/edk/system/dispatcher.h" | 18 #include "mojo/edk/system/dispatcher.h" |
18 #include "mojo/edk/system/system_impl_export.h" | 19 #include "mojo/edk/system/system_impl_export.h" |
19 #include "mojo/public/cpp/system/macros.h" | 20 #include "mojo/public/cpp/system/macros.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 uint32_t offset; // Relative to the start of the "secondary buffer". | 168 uint32_t offset; // Relative to the start of the "secondary buffer". |
168 uint32_t size; // (Not including any padding.) | 169 uint32_t size; // (Not including any padding.) |
169 uint32_t unused; | 170 uint32_t unused; |
170 }; | 171 }; |
171 | 172 |
172 const Header* header() const { | 173 const Header* header() const { |
173 return reinterpret_cast<const Header*>(buffer_.get()); | 174 return reinterpret_cast<const Header*>(buffer_.get()); |
174 } | 175 } |
175 | 176 |
176 size_t buffer_size_; | 177 size_t buffer_size_; |
177 scoped_ptr<char, base::AlignedFreeDeleter> buffer_; // Never null. | 178 std::unique_ptr<char, base::AlignedFreeDeleter> buffer_; // Never null. |
178 | 179 |
179 // Any platform-specific handles attached to this message (for inter-process | 180 // Any platform-specific handles attached to this message (for inter-process |
180 // transport). The vector (if any) owns the handles that it contains (and is | 181 // transport). The vector (if any) owns the handles that it contains (and is |
181 // responsible for closing them). | 182 // responsible for closing them). |
182 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandle|s. | 183 // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandle|s. |
183 embedder::ScopedPlatformHandleVectorPtr platform_handles_; | 184 embedder::ScopedPlatformHandleVectorPtr platform_handles_; |
184 | 185 |
185 MOJO_DISALLOW_COPY_AND_ASSIGN(TransportData); | 186 MOJO_DISALLOW_COPY_AND_ASSIGN(TransportData); |
186 }; | 187 }; |
187 | 188 |
188 } // namespace system | 189 } // namespace system |
189 } // namespace mojo | 190 } // namespace mojo |
190 | 191 |
191 #endif // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 192 #endif // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ |
OLD | NEW |