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

Unified Diff: runtime/bin/builtin_natives.cc

Issue 10532123: - Move the Timer interface to the dart:isolate library so that it (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/builtin_natives.cc
===================================================================
--- runtime/bin/builtin_natives.cc (revision 8601)
+++ runtime/bin/builtin_natives.cc (working copy)
@@ -139,17 +139,16 @@
}
-void Builtin::SetNativeResolver(Builtin::BuiltinLibraryId id) {
- Dart_Handle url;
- if (id == Builtin::kBuiltinLibrary) {
- url = Dart_NewString(DartUtils::kBuiltinLibURL);
- } else {
- ASSERT(id == Builtin::kIOLibrary);
- url = Dart_NewString(DartUtils::kIOLibURL);
- }
- Dart_Handle builtin_lib = Dart_LookupLibrary(url);
- DART_CHECK_VALID(builtin_lib);
- // Setup the native resolver for built in library functions.
- Dart_Handle result = Dart_SetNativeResolver(builtin_lib, NativeLookup);
- DART_CHECK_VALID(result);
+void Builtin::SetupIOLibrary(Dart_Handle io_lib) {
siva 2012/06/13 17:05:23 The name SetupIOLibrary seems misleading as the fu
Ivan Posva 2012/06/21 16:17:06 I imagine that we will have more than Timer being
+ Dart_Handle url = Dart_NewString(DartUtils::kIsolateLibURL);
+ DART_CHECK_VALID(url);
+ Dart_Handle isolate_lib = Dart_LookupLibrary(url);
+ DART_CHECK_VALID(isolate_lib);
+ Dart_Handle timer_closure =
+ Dart_Invoke(io_lib, Dart_NewString("_getTimerFactoryClosure"), 0, NULL);
+ Dart_Handle args[1];
+ args[0] = timer_closure;
+ DART_CHECK_VALID(Dart_Invoke(isolate_lib,
+ Dart_NewString("_setTimerFactoryClosure"),
+ 1, args));
}

Powered by Google App Engine
This is Rietveld 408576698