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

Side by Side Diff: sky/engine/bindings2/mojo_natives.cc

Issue 919883002: Allow sky apps to be consumers of mojo services (Closed) Base URL: https://github.com/eseidel/skydart.git@master
Patch Set: cr comments Created 5 years, 10 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 | « sky/engine/bindings2/mojo_natives.h ('k') | sky/engine/bindings2/snapshot.dart » ('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 #include <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "builtin.h"
12 #include "dart/runtime/include/dart_api.h" 13 #include "dart/runtime/include/dart_api.h"
13 #include "mojo/dart/embedder/builtin.h"
14 #include "mojo/public/c/system/core.h" 14 #include "mojo/public/c/system/core.h"
15 #include "mojo/public/cpp/system/core.h" 15 #include "mojo/public/cpp/system/core.h"
16 16
17 namespace mojo { 17 namespace blink {
18 namespace dart { 18
19 #define REGISTER_FUNCTION(name, count) \
20 { "" #name, name, count },
21 #define DECLARE_FUNCTION(name, count) \
22 extern void name(Dart_NativeArguments args);
19 23
20 #define MOJO_NATIVE_LIST(V) \ 24 #define MOJO_NATIVE_LIST(V) \
21 V(MojoSharedBuffer_Create, 2) \ 25 V(MojoSharedBuffer_Create, 2) \
22 V(MojoSharedBuffer_Duplicate, 2) \ 26 V(MojoSharedBuffer_Duplicate, 2) \
23 V(MojoSharedBuffer_Map, 5) \ 27 V(MojoSharedBuffer_Map, 5) \
24 V(MojoSharedBuffer_Unmap, 1) \ 28 V(MojoSharedBuffer_Unmap, 1) \
25 V(MojoDataPipe_Create, 3) \ 29 V(MojoDataPipe_Create, 3) \
26 V(MojoDataPipe_WriteData, 4) \ 30 V(MojoDataPipe_WriteData, 4) \
27 V(MojoDataPipe_BeginWriteData, 3) \ 31 V(MojoDataPipe_BeginWriteData, 3) \
28 V(MojoDataPipe_EndWriteData, 2) \ 32 V(MojoDataPipe_EndWriteData, 2) \
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 int64_t control_handle; 795 int64_t control_handle;
792 CHECK_INTEGER_ARGUMENT(arguments, 0, &control_handle, InvalidArgument); 796 CHECK_INTEGER_ARGUMENT(arguments, 0, &control_handle, InvalidArgument);
793 mojo_control_handle = control_handle; 797 mojo_control_handle = control_handle;
794 Dart_SetIntegerReturnValue(arguments, static_cast<int64_t>(MOJO_RESULT_OK)); 798 Dart_SetIntegerReturnValue(arguments, static_cast<int64_t>(MOJO_RESULT_OK));
795 } 799 }
796 800
797 void MojoHandleWatcher_GetControlHandle(Dart_NativeArguments arguments) { 801 void MojoHandleWatcher_GetControlHandle(Dart_NativeArguments arguments) {
798 Dart_SetIntegerReturnValue(arguments, mojo_control_handle); 802 Dart_SetIntegerReturnValue(arguments, mojo_control_handle);
799 } 803 }
800 804
801 } // namespace dart 805 } // namespace blink
802 } // namespace mojo
OLDNEW
« no previous file with comments | « sky/engine/bindings2/mojo_natives.h ('k') | sky/engine/bindings2/snapshot.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698