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

Side by Side Diff: mojo/edk/embedder/system_impl_private_entrypoints.cc

Issue 1778753002: Implement MojoGetBufferInformation(), part 3. (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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "mojo/edk/embedder/embedder_internal.h" 6 #include "mojo/edk/embedder/embedder_internal.h"
7 #include "mojo/edk/system/core.h" 7 #include "mojo/edk/system/core.h"
8 #include "mojo/edk/system/dispatcher.h" 8 #include "mojo/edk/system/dispatcher.h"
9 #include "mojo/edk/util/ref_ptr.h" 9 #include "mojo/edk/util/ref_ptr.h"
10 #include "mojo/public/c/system/buffer.h" 10 #include "mojo/public/c/system/buffer.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 MojoSystemImpl system, 235 MojoSystemImpl system,
236 MojoHandle buffer_handle, 236 MojoHandle buffer_handle,
237 const MojoDuplicateBufferHandleOptions* options, 237 const MojoDuplicateBufferHandleOptions* options,
238 MojoHandle* new_buffer_handle) { 238 MojoHandle* new_buffer_handle) {
239 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); 239 mojo::system::Core* core = static_cast<mojo::system::Core*>(system);
240 DCHECK(core); 240 DCHECK(core);
241 return core->DuplicateBufferHandle(buffer_handle, MakeUserPointer(options), 241 return core->DuplicateBufferHandle(buffer_handle, MakeUserPointer(options),
242 MakeUserPointer(new_buffer_handle)); 242 MakeUserPointer(new_buffer_handle));
243 } 243 }
244 244
245 MojoResult MojoSystemImplGetBufferInformation(MojoSystemImpl system,
246 MojoHandle buffer_handle,
247 MojoBufferInformation* info,
248 uint32_t info_num_bytes) {
249 mojo::system::Core* core = static_cast<mojo::system::Core*>(system);
250 DCHECK(core);
251 return core->GetBufferInformation(buffer_handle, MakeUserPointer(info),
252 info_num_bytes);
253 }
254
245 MojoResult MojoSystemImplMapBuffer(MojoSystemImpl system, 255 MojoResult MojoSystemImplMapBuffer(MojoSystemImpl system,
246 MojoHandle buffer_handle, 256 MojoHandle buffer_handle,
247 uint64_t offset, 257 uint64_t offset,
248 uint64_t num_bytes, 258 uint64_t num_bytes,
249 void** buffer, 259 void** buffer,
250 MojoMapBufferFlags flags) { 260 MojoMapBufferFlags flags) {
251 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); 261 mojo::system::Core* core = static_cast<mojo::system::Core*>(system);
252 DCHECK(core); 262 DCHECK(core);
253 return core->MapBuffer(buffer_handle, offset, num_bytes, 263 return core->MapBuffer(buffer_handle, offset, num_bytes,
254 MakeUserPointer(buffer), flags); 264 MakeUserPointer(buffer), flags);
255 } 265 }
256 266
257 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { 267 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) {
258 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); 268 mojo::system::Core* core = static_cast<mojo::system::Core*>(system);
259 DCHECK(core); 269 DCHECK(core);
260 return core->UnmapBuffer(MakeUserPointer(buffer)); 270 return core->UnmapBuffer(MakeUserPointer(buffer));
261 } 271 }
262 272
263 } // extern "C" 273 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698