OLD | NEW |
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" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 static void SetNullReturn(Dart_NativeArguments arguments) { | 83 static void SetNullReturn(Dart_NativeArguments arguments) { |
84 Dart_SetReturnValue(arguments, Dart_Null()); | 84 Dart_SetReturnValue(arguments, Dart_Null()); |
85 } | 85 } |
86 | 86 |
87 static void SetInvalidArgumentReturn(Dart_NativeArguments arguments) { | 87 static void SetInvalidArgumentReturn(Dart_NativeArguments arguments) { |
88 Dart_SetIntegerReturnValue( | 88 Dart_SetIntegerReturnValue( |
89 arguments, static_cast<int64_t>(MOJO_RESULT_INVALID_ARGUMENT)); | 89 arguments, static_cast<int64_t>(MOJO_RESULT_INVALID_ARGUMENT)); |
90 } | 90 } |
91 | 91 |
92 static Dart_Handle MojoLib() { | 92 static Dart_Handle MojoLib() { |
93 Dart_Handle core_lib_name = Dart_NewStringFromCString("dart:mojo_core"); | 93 Dart_Handle core_lib_name = Dart_NewStringFromCString("mojo:core"); |
94 return Dart_LookupLibrary(core_lib_name); | 94 return Dart_LookupLibrary(core_lib_name); |
95 } | 95 } |
96 | 96 |
97 static Dart_Handle SignalsStateToDart(Dart_Handle klass, | 97 static Dart_Handle SignalsStateToDart(Dart_Handle klass, |
98 const MojoHandleSignalsState& state) { | 98 const MojoHandleSignalsState& state) { |
99 Dart_Handle arg1 = Dart_NewInteger(state.satisfied_signals); | 99 Dart_Handle arg1 = Dart_NewInteger(state.satisfied_signals); |
100 Dart_Handle arg2 = Dart_NewInteger(state.satisfiable_signals); | 100 Dart_Handle arg2 = Dart_NewInteger(state.satisfiable_signals); |
101 Dart_Handle args[] = {arg1, arg2}; | 101 Dart_Handle args[] = {arg1, arg2}; |
102 return Dart_New(klass, Dart_Null(), 2, args); | 102 return Dart_New(klass, Dart_Null(), 2, args); |
103 } | 103 } |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 mojo_control_handle = control_handle; | 793 mojo_control_handle = control_handle; |
794 Dart_SetIntegerReturnValue(arguments, static_cast<int64_t>(MOJO_RESULT_OK)); | 794 Dart_SetIntegerReturnValue(arguments, static_cast<int64_t>(MOJO_RESULT_OK)); |
795 } | 795 } |
796 | 796 |
797 void MojoHandleWatcher_GetControlHandle(Dart_NativeArguments arguments) { | 797 void MojoHandleWatcher_GetControlHandle(Dart_NativeArguments arguments) { |
798 Dart_SetIntegerReturnValue(arguments, mojo_control_handle); | 798 Dart_SetIntegerReturnValue(arguments, mojo_control_handle); |
799 } | 799 } |
800 | 800 |
801 } // namespace dart | 801 } // namespace dart |
802 } // namespace mojo | 802 } // namespace mojo |
OLD | NEW |