| 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 "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/bindings/builtin_natives.h" | 6 #include "sky/engine/bindings/builtin_natives.h" |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 static void InitDartAsync(Dart_Handle builtin_library) { | 113 static void InitDartAsync(Dart_Handle builtin_library) { |
| 114 Dart_Handle schedule_microtask = | 114 Dart_Handle schedule_microtask = |
| 115 GetClosure(builtin_library, "_getScheduleMicrotaskClosure"); | 115 GetClosure(builtin_library, "_getScheduleMicrotaskClosure"); |
| 116 Dart_Handle async_library = DartBuiltin::LookupLibrary("dart:async"); | 116 Dart_Handle async_library = DartBuiltin::LookupLibrary("dart:async"); |
| 117 Dart_Handle set_schedule_microtask = ToDart("_setScheduleImmediateClosure"); | 117 Dart_Handle set_schedule_microtask = ToDart("_setScheduleImmediateClosure"); |
| 118 DART_CHECK_VALID(Dart_Invoke(async_library, set_schedule_microtask, 1, | 118 DART_CHECK_VALID(Dart_Invoke(async_library, set_schedule_microtask, 1, |
| 119 &schedule_microtask)); | 119 &schedule_microtask)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void BuiltinNatives::Init() { | 122 void BuiltinNatives::Init() { |
| 123 Dart_Handle builtin = Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 123 Dart_Handle builtin = Builtin::GetLibrary(Builtin::kBuiltinLibrary); |
| 124 DART_CHECK_VALID(builtin); | 124 DART_CHECK_VALID(builtin); |
| 125 InitDartInternal(builtin); | 125 InitDartInternal(builtin); |
| 126 InitDartCore(builtin); | 126 InitDartCore(builtin); |
| 127 InitDartAsync(builtin); | 127 InitDartAsync(builtin); |
| 128 } | 128 } |
| 129 | 129 |
| 130 // Implementation of native functions which are used for some | 130 // Implementation of native functions which are used for some |
| 131 // test/debug functionality in standalone dart mode. | 131 // test/debug functionality in standalone dart mode. |
| 132 void Logger_PrintString(Dart_NativeArguments args) { | 132 void Logger_PrintString(Dart_NativeArguments args) { |
| 133 intptr_t length = 0; | 133 intptr_t length = 0; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 void Timer_cancel(Dart_NativeArguments args) { | 192 void Timer_cancel(Dart_NativeArguments args) { |
| 193 int64_t timer_id = 0; | 193 int64_t timer_id = 0; |
| 194 DART_CHECK_VALID(Dart_GetNativeIntegerArgument(args, 0, &timer_id)); | 194 DART_CHECK_VALID(Dart_GetNativeIntegerArgument(args, 0, &timer_id)); |
| 195 | 195 |
| 196 DOMDartState* state = DOMDartState::Current(); | 196 DOMDartState* state = DOMDartState::Current(); |
| 197 DOMTimer::removeByID(state->document(), timer_id); | 197 DOMTimer::removeByID(state->document(), timer_id); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace blink | 200 } // namespace blink |
| OLD | NEW |