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

Side by Side Diff: mojo/public/platform/native/system_thunks.c

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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/public/platform/native/system_thunks.h" 5 #include "mojo/public/platform/native/system_thunks.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 8
9 #include "mojo/public/platform/native/thunk_export.h" 9 #include "mojo/public/platform/native/thunk_export.h"
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 MojoResult MojoDuplicateBufferHandle( 137 MojoResult MojoDuplicateBufferHandle(
138 MojoHandle buffer_handle, 138 MojoHandle buffer_handle,
139 const struct MojoDuplicateBufferHandleOptions* options, 139 const struct MojoDuplicateBufferHandleOptions* options,
140 MojoHandle* new_buffer_handle) { 140 MojoHandle* new_buffer_handle) {
141 assert(g_thunks.DuplicateBufferHandle); 141 assert(g_thunks.DuplicateBufferHandle);
142 return g_thunks.DuplicateBufferHandle(buffer_handle, options, 142 return g_thunks.DuplicateBufferHandle(buffer_handle, options,
143 new_buffer_handle); 143 new_buffer_handle);
144 } 144 }
145 145
146 MojoResult MojoGetBufferInformation(MojoHandle buffer_handle,
147 struct MojoBufferInformation* info,
148 uint32_t info_num_bytes) {
149 assert(g_thunks.GetBufferInformation);
150 return g_thunks.GetBufferInformation(buffer_handle, info, info_num_bytes);
151 }
152
146 MojoResult MojoMapBuffer(MojoHandle buffer_handle, 153 MojoResult MojoMapBuffer(MojoHandle buffer_handle,
147 uint64_t offset, 154 uint64_t offset,
148 uint64_t num_bytes, 155 uint64_t num_bytes,
149 void** buffer, 156 void** buffer,
150 MojoMapBufferFlags flags) { 157 MojoMapBufferFlags flags) {
151 assert(g_thunks.MapBuffer); 158 assert(g_thunks.MapBuffer);
152 return g_thunks.MapBuffer(buffer_handle, offset, num_bytes, buffer, flags); 159 return g_thunks.MapBuffer(buffer_handle, offset, num_bytes, buffer, flags);
153 } 160 }
154 161
155 MojoResult MojoUnmapBuffer(void* buffer) { 162 MojoResult MojoUnmapBuffer(void* buffer) {
156 assert(g_thunks.UnmapBuffer); 163 assert(g_thunks.UnmapBuffer);
157 return g_thunks.UnmapBuffer(buffer); 164 return g_thunks.UnmapBuffer(buffer);
158 } 165 }
159 166
160 THUNK_EXPORT size_t 167 THUNK_EXPORT size_t
161 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) { 168 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) {
162 if (system_thunks->size >= sizeof(g_thunks)) 169 if (system_thunks->size >= sizeof(g_thunks))
163 g_thunks = *system_thunks; 170 g_thunks = *system_thunks;
164 return sizeof(g_thunks); 171 return sizeof(g_thunks);
165 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698