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 #include "mojo/edk/system/shared_buffer_dispatcher.h" | 5 #include "mojo/edk/system/shared_buffer_dispatcher.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace { | 27 namespace { |
28 | 28 |
29 struct MOJO_ALIGNAS(8) SerializedSharedBufferDispatcher { | 29 struct MOJO_ALIGNAS(8) SerializedSharedBufferDispatcher { |
30 uint64_t num_bytes; | 30 uint64_t num_bytes; |
31 uint32_t platform_handle_index; | 31 uint32_t platform_handle_index; |
32 }; | 32 }; |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 // static | 36 // static |
| 37 constexpr MojoHandleRights SharedBufferDispatcher::kDefaultHandleRights; |
| 38 |
| 39 // static |
37 const MojoCreateSharedBufferOptions | 40 const MojoCreateSharedBufferOptions |
38 SharedBufferDispatcher::kDefaultCreateOptions = { | 41 SharedBufferDispatcher::kDefaultCreateOptions = { |
39 static_cast<uint32_t>(sizeof(MojoCreateSharedBufferOptions)), | 42 static_cast<uint32_t>(sizeof(MojoCreateSharedBufferOptions)), |
40 MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE}; | 43 MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE}; |
41 | 44 |
42 // static | 45 // static |
43 MojoResult SharedBufferDispatcher::ValidateCreateOptions( | 46 MojoResult SharedBufferDispatcher::ValidateCreateOptions( |
44 UserPointer<const MojoCreateSharedBufferOptions> in_options, | 47 UserPointer<const MojoCreateSharedBufferOptions> in_options, |
45 MojoCreateSharedBufferOptions* out_options) { | 48 MojoCreateSharedBufferOptions* out_options) { |
46 const MojoCreateSharedBufferOptionsFlags kKnownFlags = | 49 const MojoCreateSharedBufferOptionsFlags kKnownFlags = |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 platform_handles->push_back(std::move(platform_handle)); | 329 platform_handles->push_back(std::move(platform_handle)); |
327 *actual_size = sizeof(SerializedSharedBufferDispatcher); | 330 *actual_size = sizeof(SerializedSharedBufferDispatcher); |
328 | 331 |
329 shared_buffer_ = nullptr; | 332 shared_buffer_ = nullptr; |
330 | 333 |
331 return true; | 334 return true; |
332 } | 335 } |
333 | 336 |
334 } // namespace system | 337 } // namespace system |
335 } // namespace mojo | 338 } // namespace mojo |
OLD | NEW |