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

Side by Side Diff: mojo/nacl/irt_mojo_nonsfi.cc

Issue 1323823002: Adding nonsfi content handler (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Respond to code review, git cl format Created 5 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/nacl/irt_mojo_nonsfi.h"
6
7 #include "mojo/public/c/system/functions.h"
8 #include "mojo/public/platform/nacl/mojo_irt.h"
9 #include "native_client/src/public/irt_core.h"
10
11 namespace {
12
13 MojoHandle g_mojo_handle = MOJO_HANDLE_INVALID;
14
15 MojoResult _MojoGetInitialHandle(MojoHandle* handle) {
16 *handle = g_mojo_handle;
17 return MOJO_RESULT_OK;
18 }
19
20 const struct nacl_irt_mojo kIrtMojo = {
21 MojoCreateSharedBuffer,
22 MojoDuplicateBufferHandle,
23 MojoMapBuffer,
24 MojoUnmapBuffer,
25 MojoCreateDataPipe,
26 MojoWriteData,
27 MojoBeginWriteData,
28 MojoEndWriteData,
29 MojoReadData,
30 MojoBeginReadData,
31 MojoEndReadData,
32 MojoGetTimeTicksNow,
33 MojoClose,
34 MojoWait,
35 MojoWaitMany,
36 MojoCreateMessagePipe,
37 MojoWriteMessage,
38 MojoReadMessage,
39 _MojoGetInitialHandle,
40 };
41
42 const struct nacl_irt_interface kIrtInterfaces[] = {
43 {NACL_IRT_MOJO_v0_1, &kIrtMojo, sizeof(kIrtMojo), nullptr}};
44
45 } // namespace
46
47 namespace irtNonsfi {
48
49 void MojoSetInitialHandle(MojoHandle handle) {
50 g_mojo_handle = handle;
51 }
52
53 size_t MojoIrtNonsfiQuery(const char* interface_ident,
54 void* table,
55 size_t tablesize) {
56 size_t result = nacl_irt_query_list(interface_ident, table, tablesize,
57 kIrtInterfaces, sizeof(kIrtInterfaces));
58 if (result != 0)
59 return result;
60 return nacl_irt_query_core(interface_ident, table, tablesize);
61 }
62
63 } // namespace irtNonsfi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698