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/system/core_private.h" | 5 #include "mojo/public/system/core_private.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 static mojo::CorePrivate* g_core = NULL; | 10 static mojo::CorePrivate* g_core = NULL; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void* bytes, | 58 void* bytes, |
59 uint32_t* num_bytes, | 59 uint32_t* num_bytes, |
60 MojoHandle* handles, | 60 MojoHandle* handles, |
61 uint32_t* num_handles, | 61 uint32_t* num_handles, |
62 MojoReadMessageFlags flags) { | 62 MojoReadMessageFlags flags) { |
63 assert(g_core); | 63 assert(g_core); |
64 return g_core->ReadMessage(message_pipe_handle, bytes, num_bytes, handles, | 64 return g_core->ReadMessage(message_pipe_handle, bytes, num_bytes, handles, |
65 num_handles, flags); | 65 num_handles, flags); |
66 } | 66 } |
67 | 67 |
68 MojoResult MojoCreateDataPipe(const struct MojoCreateDataPipeOptions* options, | 68 MojoResult MojoCreateDataPipe(const MojoCreateDataPipeOptions* options, |
69 MojoHandle* producer_handle, | 69 MojoHandle* data_pipe_producer_handle, |
70 MojoHandle* consumer_handle) { | 70 MojoHandle* data_pipe_consumer_handle) { |
71 assert(g_core); | 71 assert(g_core); |
72 return g_core->CreateDataPipe(options, producer_handle, consumer_handle); | 72 return g_core->CreateDataPipe(options, data_pipe_producer_handle, |
| 73 data_pipe_consumer_handle); |
73 } | 74 } |
74 | 75 |
75 MojoResult MojoWriteData(MojoHandle data_pipe_producer_handle, | 76 MojoResult MojoWriteData(MojoHandle data_pipe_producer_handle, |
76 const void* elements, | 77 const void* elements, |
77 uint32_t* num_elements, | 78 uint32_t* num_elements, |
78 MojoWriteDataFlags flags) { | 79 MojoWriteDataFlags flags) { |
79 assert(g_core); | 80 assert(g_core); |
80 return g_core->WriteData(data_pipe_producer_handle, elements, num_elements, | 81 return g_core->WriteData(data_pipe_producer_handle, elements, num_elements, |
81 flags); | 82 flags); |
82 } | 83 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 127 |
127 CorePrivate::~CorePrivate() { | 128 CorePrivate::~CorePrivate() { |
128 } | 129 } |
129 | 130 |
130 void CorePrivate::Init(CorePrivate* core) { | 131 void CorePrivate::Init(CorePrivate* core) { |
131 assert(!g_core); | 132 assert(!g_core); |
132 g_core = core; | 133 g_core = core; |
133 } | 134 } |
134 | 135 |
135 } // namespace mojo | 136 } // namespace mojo |
OLD | NEW |