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

Side by Side Diff: runtime/bin/dartutils.cc

Issue 25646004: Add Dart_PostPriority function to dart_api, and use it in runAsync to schedule immediate events in … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More cleanup Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/dartutils.h" 5 #include "bin/dartutils.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
11 #include "platform/globals.h" 11 #include "platform/globals.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 Dart_Handle async_lib = Dart_LookupLibrary(url); 676 Dart_Handle async_lib = Dart_LookupLibrary(url);
677 DART_CHECK_VALID(async_lib); 677 DART_CHECK_VALID(async_lib);
678 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); 678 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
679 Dart_Handle timer_closure = 679 Dart_Handle timer_closure =
680 Dart_Invoke(io_lib, NewString("_getTimerFactoryClosure"), 0, NULL); 680 Dart_Invoke(io_lib, NewString("_getTimerFactoryClosure"), 0, NULL);
681 Dart_Handle args[1]; 681 Dart_Handle args[1];
682 args[0] = timer_closure; 682 args[0] = timer_closure;
683 DART_CHECK_VALID(Dart_Invoke( 683 DART_CHECK_VALID(Dart_Invoke(
684 async_lib, NewString("_setTimerFactoryClosure"), 1, args)); 684 async_lib, NewString("_setTimerFactoryClosure"), 1, args));
685 685
686 Dart_Handle enqueue_immediate_closure =
687 Dart_Invoke(io_lib,
688 NewString("_getEnqueueImmediateFactoryClosure"),
689 0,
690 NULL);
691 args[0] = enqueue_immediate_closure;
692 DART_CHECK_VALID(Dart_Invoke(
693 async_lib, NewString("_setEnqueueImmediateFactoryClosure"), 1, args));
694
686 // Setup the corelib 'Uri.base' getter. 695 // Setup the corelib 'Uri.base' getter.
687 Dart_Handle uri_base = Dart_Invoke( 696 Dart_Handle uri_base = Dart_Invoke(
688 builtin_lib, NewString("_getUriBaseClosure"), 0, NULL); 697 builtin_lib, NewString("_getUriBaseClosure"), 0, NULL);
689 DART_CHECK_VALID(uri_base); 698 DART_CHECK_VALID(uri_base);
690 result = Dart_SetField(corelib, 699 result = Dart_SetField(corelib,
691 NewString("_uriBaseClosure"), 700 NewString("_uriBaseClosure"),
692 uri_base); 701 uri_base);
693 DART_CHECK_VALID(result); 702 DART_CHECK_VALID(result);
694 703
695 if (IsWindowsHost()) { 704 if (IsWindowsHost()) {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 new CObjectString(CObject::NewString(os_error->message())); 1032 new CObjectString(CObject::NewString(os_error->message()));
1024 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 1033 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
1025 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 1034 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
1026 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); 1035 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
1027 result->SetAt(2, error_message); 1036 result->SetAt(2, error_message);
1028 return result; 1037 return result;
1029 } 1038 }
1030 1039
1031 } // namespace bin 1040 } // namespace bin
1032 } // namespace dart 1041 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/common_patch.dart ('k') | runtime/include/dart_api.h » ('j') | runtime/vm/message.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698