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

Unified Diff: runtime/bin/dartutils.h

Issue 2991393002: [standalone] Automatically decompress gzip'd resources, including sources and script snapshots. (Closed)
Patch Set: Fix case in decompression where the snapshot it smaller than the chunk size. Created 3 years, 4 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/BUILD.gn ('k') | runtime/bin/dartutils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.h
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index 135d12cbc8c70b476f41d43a4fa1a9dd28a2c920..f36aac9bf2a76283e6aece0e70c58af0d7b7d63d 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -200,21 +200,17 @@ class DartUtils {
enum MagicNumber {
kSnapshotMagicNumber,
kKernelMagicNumber,
+ kGzipMagicNumber,
kUnknownMagicNumber
};
- // static const uint8_t* GetMagicNumber(MagicNumber number);
-
- // Sniffs the specified text_buffer to see if it contains the magic number
- // representing a script snapshot. If the text_buffer is a script snapshot
- // the return value is an updated pointer to the text_buffer pointing past
- // the magic number value. The 'buffer_len' parameter is also appropriately
- // adjusted.
- static MagicNumber SniffForMagicNumber(const uint8_t** text_buffer,
- intptr_t* buffer_len);
+ // Checks if the buffer is a script snapshot, kernel file, or gzip file.
+ static MagicNumber SniffForMagicNumber(const uint8_t* text_buffer,
+ intptr_t buffer_len);
// Write a magic number to indicate a script snapshot file.
- static void WriteMagicNumber(File* file);
+ static void WriteSnapshotMagicNumber(File* file);
+ static void SkipSnapshotMagicNumber(const uint8_t** buffer, intptr_t* length);
// Global state that stores the original working directory..
static const char* original_working_directory;
« no previous file with comments | « runtime/bin/BUILD.gn ('k') | runtime/bin/dartutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698