 Chromium Code Reviews
 Chromium Code Reviews Issue 79243002:
  Implement scheduleImmediate for the VM.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
    
  
    Issue 79243002:
  Implement scheduleImmediate for the VM.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart| Index: runtime/bin/dartutils.cc | 
| diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc | 
| index 1c1277b274da8c0eb8bf2c20d56ad235ee34d023..93f7b10ec043e08fffdaaedf75e7664fbf32228e 100644 | 
| --- a/runtime/bin/dartutils.cc | 
| +++ b/runtime/bin/dartutils.cc | 
| @@ -27,6 +27,8 @@ const char* DartUtils::kDartExtensionScheme = "dart-ext:"; | 
| const char* DartUtils::kAsyncLibURL = "dart:async"; | 
| const char* DartUtils::kBuiltinLibURL = "dart:builtin"; | 
| const char* DartUtils::kCoreLibURL = "dart:core"; | 
| +const char* DartUtils::kIsolateLibURL = "dart:isolate"; | 
| +const char* DartUtils::kInternalLibURL = "dart:_collection-dev"; | 
| 
Ivan Posva
2013/11/27 22:08:32
The name does not match. If we are starting to use
 
floitsch
2013/11/28 19:05:54
Done.
 | 
| const char* DartUtils::kIOLibURL = "dart:io"; | 
| const char* DartUtils::kIOLibPatchURL = "dart:io-patch"; | 
| const char* DartUtils::kUriLibURL = "dart:uri"; | 
| @@ -667,8 +669,9 @@ Dart_Handle DartUtils::LoadSource(CommandLineOptions* url_mapping, | 
| Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root, | 
| Dart_Handle builtin_lib) { | 
| // Setup the internal library's 'internalPrint' function. | 
| - Dart_Handle internal_lib = | 
| - Dart_LookupLibrary(NewString("dart:_collection-dev")); | 
| + Dart_Handle url = NewString(kInternalLibURL); | 
| 
Ivan Posva
2013/11/27 22:08:32
Can you please move these lines dealing with dart:
 
floitsch
2013/11/28 19:05:54
Done.
 | 
| + DART_CHECK_VALID(url); | 
| + Dart_Handle internal_lib = Dart_LookupLibrary(url); | 
| DART_CHECK_VALID(internal_lib); | 
| Dart_Handle print = Dart_Invoke( | 
| builtin_lib, NewString("_getPrintClosure"), 0, NULL); | 
| @@ -678,7 +681,7 @@ Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root, | 
| DART_CHECK_VALID(result); | 
| // Setup the 'timer' factory. | 
| - Dart_Handle url = NewString(kAsyncLibURL); | 
| + url = NewString(kAsyncLibURL); | 
| DART_CHECK_VALID(url); | 
| Dart_Handle async_lib = Dart_LookupLibrary(url); | 
| DART_CHECK_VALID(async_lib); | 
| @@ -690,8 +693,22 @@ Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root, | 
| DART_CHECK_VALID(Dart_Invoke( | 
| async_lib, NewString("_setTimerFactoryClosure"), 1, args)); | 
| + // Setup the 'scheduleImmediate' closure. | 
| + url = NewString(kIsolateLibURL); | 
| + DART_CHECK_VALID(url); | 
| + Dart_Handle isolate_lib = Dart_LookupLibrary(url); | 
| + DART_CHECK_VALID(isolate_lib); | 
| + Dart_Handle schedule_immediate_closure = | 
| + Dart_Invoke(isolate_lib, NewString("_getIsolateScheduleImmediateClosure"), | 
| + 0, NULL); | 
| + args[0] = schedule_immediate_closure; | 
| + DART_CHECK_VALID(Dart_Invoke( | 
| + internal_lib, NewString("setScheduleImmediateClosure"), 1, args)); | 
| + | 
| // Setup the corelib 'Uri.base' getter. | 
| - Dart_Handle corelib = Dart_LookupLibrary(NewString("dart:core")); | 
| + url = NewString(kCoreLibURL); | 
| + DART_CHECK_VALID(url); | 
| + Dart_Handle corelib = Dart_LookupLibrary(url); | 
| DART_CHECK_VALID(corelib); | 
| Dart_Handle uri_base = Dart_Invoke( | 
| builtin_lib, NewString("_getUriBaseClosure"), 0, NULL); |