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

Unified Diff: include/v8.h

Issue 7066048: Compress sources of JS libraries in addition to the snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make decompressor class public Created 9 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 | samples/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 3ce6b876a2b2d70b0bb9399036902217ba4cb87a..8af3319f9ef0a22bcbfac476b8cdd781f601563d 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2704,6 +2704,31 @@ class StartupData {
int raw_size;
};
+
+/**
+ * A helper class for driving V8 startup data decompression. It is based on
+ * "CompressedStartupData" API functions from the V8 class. It isn't mandatory
+ * for an embedder to use this class, instead, API functions can be used
+ * directly.
+ *
+ * For an example of the class usage, see the "shell.cc" sample application.
+ */
+class V8EXPORT StartupDataDecompressor {
+ public:
+ StartupDataDecompressor();
+ virtual ~StartupDataDecompressor();
+ int Decompress();
+
+ protected:
+ virtual int DecompressData(char* raw_data,
+ int* raw_data_size,
+ const char* compressed_data,
+ int compressed_data_size) = 0;
+
+ private:
+ char** raw_data;
+};
+
/**
* Container class for static utility functions.
*/
@@ -2753,6 +2778,10 @@ class V8EXPORT V8 {
* v8::V8::SetDecompressedStartupData(compressed_data);
* ... now V8 can be initialized
* ... make sure the decompressed data stays valid until V8 shutdown
+ *
+ * A helper class StartupDataDecompressor is provided. It implements
+ * the protocol of the interaction described above, and can be used in
+ * most cases instead of calling these API functions directly.
*/
static StartupData::CompressionAlgorithm GetCompressedStartupDataAlgorithm();
static int GetCompressedStartupDataCount();
« no previous file with comments | « no previous file | samples/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698