| OLD | NEW |
| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 return g_thunks.BeginWriteData(data_pipe_producer_handle, buffer, | 95 return g_thunks.BeginWriteData(data_pipe_producer_handle, buffer, |
| 96 buffer_num_elements, flags); | 96 buffer_num_elements, flags); |
| 97 } | 97 } |
| 98 | 98 |
| 99 MojoResult MojoEndWriteData(MojoHandle data_pipe_producer_handle, | 99 MojoResult MojoEndWriteData(MojoHandle data_pipe_producer_handle, |
| 100 uint32_t num_elements_written) { | 100 uint32_t num_elements_written) { |
| 101 assert(g_thunks.EndWriteData); | 101 assert(g_thunks.EndWriteData); |
| 102 return g_thunks.EndWriteData(data_pipe_producer_handle, num_elements_written); | 102 return g_thunks.EndWriteData(data_pipe_producer_handle, num_elements_written); |
| 103 } | 103 } |
| 104 | 104 |
| 105 MojoResult MojoSetDataPipeConsumerOptions( |
| 106 MojoHandle data_pipe_consumer_handle, |
| 107 const struct MojoDataPipeConsumerOptions* options) { |
| 108 assert(g_thunks.SetDataPipeConsumerOptions); |
| 109 return g_thunks.SetDataPipeConsumerOptions(data_pipe_consumer_handle, |
| 110 options); |
| 111 } |
| 112 |
| 113 MojoResult MojoGetDataPipeConsumerOptions( |
| 114 MojoHandle data_pipe_consumer_handle, |
| 115 struct MojoDataPipeConsumerOptions* options, |
| 116 uint32_t options_num_bytes) { |
| 117 assert(g_thunks.GetDataPipeConsumerOptions); |
| 118 return g_thunks.GetDataPipeConsumerOptions(data_pipe_consumer_handle, |
| 119 options, options_num_bytes); |
| 120 } |
| 121 |
| 105 MojoResult MojoReadData(MojoHandle data_pipe_consumer_handle, | 122 MojoResult MojoReadData(MojoHandle data_pipe_consumer_handle, |
| 106 void* elements, | 123 void* elements, |
| 107 uint32_t* num_elements, | 124 uint32_t* num_elements, |
| 108 MojoReadDataFlags flags) { | 125 MojoReadDataFlags flags) { |
| 109 assert(g_thunks.ReadData); | 126 assert(g_thunks.ReadData); |
| 110 return g_thunks.ReadData(data_pipe_consumer_handle, elements, num_elements, | 127 return g_thunks.ReadData(data_pipe_consumer_handle, elements, num_elements, |
| 111 flags); | 128 flags); |
| 112 } | 129 } |
| 113 | 130 |
| 114 MojoResult MojoBeginReadData(MojoHandle data_pipe_consumer_handle, | 131 MojoResult MojoBeginReadData(MojoHandle data_pipe_consumer_handle, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 assert(g_thunks.UnmapBuffer); | 180 assert(g_thunks.UnmapBuffer); |
| 164 return g_thunks.UnmapBuffer(buffer); | 181 return g_thunks.UnmapBuffer(buffer); |
| 165 } | 182 } |
| 166 | 183 |
| 167 THUNK_EXPORT size_t | 184 THUNK_EXPORT size_t |
| 168 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) { | 185 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) { |
| 169 if (system_thunks->size >= sizeof(g_thunks)) | 186 if (system_thunks->size >= sizeof(g_thunks)) |
| 170 g_thunks = *system_thunks; | 187 g_thunks = *system_thunks; |
| 171 return sizeof(g_thunks); | 188 return sizeof(g_thunks); |
| 172 } | 189 } |
| OLD | NEW |