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

Unified Diff: runtime/bin/loader.h

Issue 2073173002: Use the new loader mechanism to resolve URIs and load script files in gen_snapshot. This should all… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address issues that were found while testing with the flutter engine. Created 4 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 | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/loader.h
diff --git a/runtime/bin/loader.h b/runtime/bin/loader.h
index 792ea45ec8153c16ed41120fdf96af7472e323e9..088ce2ecc39fa16f3daeddc6374749f6c7679ccb 100644
--- a/runtime/bin/loader.h
+++ b/runtime/bin/loader.h
@@ -22,6 +22,12 @@ class Loader {
static void InitForSnapshot(const char* snapshot_uri);
+ // Loads contents of the specified url.
+ static Dart_Handle LoadUrlContents(Dart_Handle url,
+ uint8_t** payload,
+ intptr_t* payload_length);
+
+
// A static tag handler that hides all usage of a loader for an isolate.
static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
Dart_Handle library,
@@ -62,6 +68,9 @@ class Loader {
IOResult* results_;
intptr_t results_length_;
intptr_t results_capacity_;
+ uint8_t* payload_;
+ intptr_t payload_length_;
+ typedef bool (*ProcessResult)(Loader* loader, IOResult* result);
intptr_t results_length() {
return *static_cast<volatile intptr_t*>(&results_length_);
@@ -82,13 +91,16 @@ class Loader {
void QueueMessage(Dart_CObject* message);
/// Blocks the caller until the loader is finished.
- void BlockUntilComplete();
+ void BlockUntilComplete(ProcessResult process_result);
+
+ /// Returns false if |result| is an error and the loader should quit.
+ static bool ProcessResultLocked(Loader* loader, IOResult* result);
/// Returns false if |result| is an error and the loader should quit.
- bool ProcessResultLocked(IOResult* result);
+ static bool ProcessUrlLoadResultLocked(Loader* loader, IOResult* result);
/// Returns false if an error occurred and the loader should quit.
- bool ProcessQueueLocked();
+ bool ProcessQueueLocked(ProcessResult process_result);
// Special inner tag handler for dart: uris.
static Dart_Handle DartColonLibraryTagHandler(Dart_LibraryTag tag,
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698