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

Unified Diff: runtime/include/dart_api.h

Issue 1168223002: Fix for issue 23598, add a Dart_CreateLibrarySnapshot entrypoint to the API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address code review comments Created 5 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
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 89131ff02ca6abec9cb6eb73e13d4f21a02b9f16..027b9379c8369f331d0705e69e0d02b3f84e84d6 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -1056,6 +1056,27 @@ DART_EXPORT Dart_Handle Dart_CreateScriptSnapshot(uint8_t** buffer,
intptr_t* size);
/**
+ * Creates a snapshot of the specified library loaded in the isolate.
+ *
+ * A library snapshot can be used for implementing fast startup of applications
+ * (skips tokenizing and parsing process). A Snapshot of the library
+ * can only be created before any dart code has executed.
+ *
+ * Requires there to be a current isolate which already has loaded the library.
+ *
+ * \param library A library for which the snapshot needs to be created.
+ * \param buffer Returns a pointer to a buffer containing
+ * the snapshot. This buffer is scope allocated and is only valid
+ * until the next call to Dart_ExitScope.
+ * \param size Returns the size of the buffer.
+ *
+ * \return A valid handle if no error occurs during the operation.
+ */
+DART_EXPORT Dart_Handle Dart_CreateLibrarySnapshot(Dart_Handle library,
+ uint8_t** buffer,
+ intptr_t* size);
+
+/**
* Schedules an interrupt for the specified isolate.
*
* When the isolate is interrupted, the isolate interrupt callback
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698