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

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

Issue 1865533002: Add Mojo{Set,Get}DataPipeConsumerOptions() to the standard/native system thunks. (Closed) Base URL: https://github.com/domokit/mojo.git@work786_dp_read_threshold
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | mojo/public/c/system/tests/core_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This file contains the definitions of the system functions, which are
6 // declared in various header files in mojo/public/c/system.
7
5 #include "mojo/edk/embedder/embedder_internal.h" 8 #include "mojo/edk/embedder/embedder_internal.h"
6 #include "mojo/edk/system/core.h" 9 #include "mojo/edk/system/core.h"
7 #include "mojo/public/c/system/buffer.h" 10 #include "mojo/public/c/system/buffer.h"
8 #include "mojo/public/c/system/data_pipe.h" 11 #include "mojo/public/c/system/data_pipe.h"
9 #include "mojo/public/c/system/handle.h" 12 #include "mojo/public/c/system/handle.h"
10 #include "mojo/public/c/system/message_pipe.h" 13 #include "mojo/public/c/system/message_pipe.h"
11 #include "mojo/public/c/system/time.h" 14 #include "mojo/public/c/system/time.h"
12 #include "mojo/public/c/system/wait.h" 15 #include "mojo/public/c/system/wait.h"
13 16
14 using mojo::embedder::internal::g_core; 17 using mojo::embedder::internal::g_core;
15 using mojo::system::MakeUserPointer; 18 using mojo::system::MakeUserPointer;
16 19
17 // Definitions of the system functions.
18 extern "C" { 20 extern "C" {
19 21
20 MojoTimeTicks MojoGetTimeTicksNow() { 22 MojoTimeTicks MojoGetTimeTicksNow() {
21 return g_core->GetTimeTicksNow(); 23 return g_core->GetTimeTicksNow();
22 } 24 }
23 25
24 MojoResult MojoClose(MojoHandle handle) { 26 MojoResult MojoClose(MojoHandle handle) {
25 return g_core->Close(handle); 27 return g_core->Close(handle);
26 } 28 }
27 29
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return g_core->BeginWriteData(data_pipe_producer_handle, 99 return g_core->BeginWriteData(data_pipe_producer_handle,
98 MakeUserPointer(buffer), 100 MakeUserPointer(buffer),
99 MakeUserPointer(buffer_num_elements), flags); 101 MakeUserPointer(buffer_num_elements), flags);
100 } 102 }
101 103
102 MojoResult MojoEndWriteData(MojoHandle data_pipe_producer_handle, 104 MojoResult MojoEndWriteData(MojoHandle data_pipe_producer_handle,
103 uint32_t num_elements_written) { 105 uint32_t num_elements_written) {
104 return g_core->EndWriteData(data_pipe_producer_handle, num_elements_written); 106 return g_core->EndWriteData(data_pipe_producer_handle, num_elements_written);
105 } 107 }
106 108
109 MojoResult MojoSetDataPipeConsumerOptions(
110 MojoHandle data_pipe_consumer_handle,
111 const struct MojoDataPipeConsumerOptions* options) {
112 return g_core->SetDataPipeConsumerOptions(data_pipe_consumer_handle,
113 MakeUserPointer(options));
114 }
115
116 MojoResult MojoGetDataPipeConsumerOptions(
117 MojoHandle data_pipe_consumer_handle,
118 struct MojoDataPipeConsumerOptions* options,
119 uint32_t options_num_bytes) {
120 return g_core->GetDataPipeConsumerOptions(
121 data_pipe_consumer_handle, MakeUserPointer(options), options_num_bytes);
122 }
123
107 MojoResult MojoReadData(MojoHandle data_pipe_consumer_handle, 124 MojoResult MojoReadData(MojoHandle data_pipe_consumer_handle,
108 void* elements, 125 void* elements,
109 uint32_t* num_elements, 126 uint32_t* num_elements,
110 MojoReadDataFlags flags) { 127 MojoReadDataFlags flags) {
111 return g_core->ReadData(data_pipe_consumer_handle, MakeUserPointer(elements), 128 return g_core->ReadData(data_pipe_consumer_handle, MakeUserPointer(elements),
112 MakeUserPointer(num_elements), flags); 129 MakeUserPointer(num_elements), flags);
113 } 130 }
114 131
115 MojoResult MojoBeginReadData(MojoHandle data_pipe_consumer_handle, 132 MojoResult MojoBeginReadData(MojoHandle data_pipe_consumer_handle,
116 const void** buffer, 133 const void** buffer,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 MojoMapBufferFlags flags) { 173 MojoMapBufferFlags flags) {
157 return g_core->MapBuffer(buffer_handle, offset, num_bytes, 174 return g_core->MapBuffer(buffer_handle, offset, num_bytes,
158 MakeUserPointer(buffer), flags); 175 MakeUserPointer(buffer), flags);
159 } 176 }
160 177
161 MojoResult MojoUnmapBuffer(void* buffer) { 178 MojoResult MojoUnmapBuffer(void* buffer) {
162 return g_core->UnmapBuffer(MakeUserPointer(buffer)); 179 return g_core->UnmapBuffer(MakeUserPointer(buffer));
163 } 180 }
164 181
165 } // extern "C" 182 } // extern "C"
OLDNEW
« no previous file with comments | « no previous file | mojo/public/c/system/tests/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698