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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 341543004: Adding embedder API function Dart_FinalizeLoading (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« runtime/include/dart_api.h ('K') | « runtime/include/dart_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 37402)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -5106,6 +5106,33 @@
}
+// Finalizes classes and invokes Dart core library function that completes
+// futures of loadLibrary calls (deferred library loading).
+DART_EXPORT Dart_Handle Dart_FinalizeLoading() {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE_SCOPE(isolate);
siva 2014/06/17 20:43:19 DARTSCOPE(isolate); so we get a new scope instead
hausner 2014/06/17 20:55:54 Done.
+ CHECK_CALLBACK_STATE(isolate);
+
+ // Finalize all classes if needed.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
+
+ const Library& corelib = Library::Handle(isolate, Library::CoreLibrary());
+ const String& function_name =
+ String::Handle(isolate, String::New("_completeDeferredLoads"));
+ const Function& function =
+ Function::Handle(isolate,
+ corelib.LookupFunctionAllowPrivate(function_name));
+ ASSERT(!function.IsNull());
+ const Array& args = Array::empty_array();
+ Dart_Handle res =
+ Api::NewHandle(isolate, DartEntry::InvokeFunction(function, args));
siva 2014/06/17 20:43:19 _completeDeferredLoads does not seem to return any
hausner 2014/06/17 20:55:54 Done.
+ return res;
+}
+
+
DART_EXPORT Dart_Handle Dart_SetNativeResolver(
Dart_Handle library,
Dart_NativeEntryResolver resolver,
« runtime/include/dart_api.h ('K') | « runtime/include/dart_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698