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 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE}; | 156 MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE}; |
157 | 157 |
158 *out_options = kDefaultOptions; | 158 *out_options = kDefaultOptions; |
159 if (in_options.IsNull()) | 159 if (in_options.IsNull()) |
160 return MOJO_RESULT_OK; | 160 return MOJO_RESULT_OK; |
161 | 161 |
162 UserOptionsReader<MojoDuplicateBufferHandleOptions> reader(in_options); | 162 UserOptionsReader<MojoDuplicateBufferHandleOptions> reader(in_options); |
163 if (!reader.is_valid()) | 163 if (!reader.is_valid()) |
164 return MOJO_RESULT_INVALID_ARGUMENT; | 164 return MOJO_RESULT_INVALID_ARGUMENT; |
165 | 165 |
166 if (!OPTIONS_STRUCT_HAS_MEMBER( | 166 if (!OPTIONS_STRUCT_HAS_MEMBER(MojoDuplicateBufferHandleOptions, flags, |
167 MojoDuplicateBufferHandleOptions, flags, reader)) | 167 reader)) |
168 return MOJO_RESULT_OK; | 168 return MOJO_RESULT_OK; |
169 if ((reader.options().flags & ~kKnownFlags)) | 169 if ((reader.options().flags & ~kKnownFlags)) |
170 return MOJO_RESULT_UNIMPLEMENTED; | 170 return MOJO_RESULT_UNIMPLEMENTED; |
171 out_options->flags = reader.options().flags; | 171 out_options->flags = reader.options().flags; |
172 | 172 |
173 // Checks for fields beyond |flags|: | 173 // Checks for fields beyond |flags|: |
174 | 174 |
175 // (Nothing here yet.) | 175 // (Nothing here yet.) |
176 | 176 |
177 return MOJO_RESULT_OK; | 177 return MOJO_RESULT_OK; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 platform_handles->push_back(platform_handle.release()); | 267 platform_handles->push_back(platform_handle.release()); |
268 *actual_size = sizeof(SerializedSharedBufferDispatcher); | 268 *actual_size = sizeof(SerializedSharedBufferDispatcher); |
269 | 269 |
270 shared_buffer_ = nullptr; | 270 shared_buffer_ = nullptr; |
271 | 271 |
272 return true; | 272 return true; |
273 } | 273 } |
274 | 274 |
275 } // namespace system | 275 } // namespace system |
276 } // namespace mojo | 276 } // namespace mojo |
OLD | NEW |