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

Unified Diff: gin/public/isolate_holder.h

Issue 594603003: Infrastructure for reading V8's initial snapshot from external files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Ross' comments Created 6 years, 2 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
Index: gin/public/isolate_holder.h
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 29cc2083334b356d9caff02a5b75abc9bc562b49..19a8d3893604f0a0e7a47970d0ebb2230ad587a6 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -10,6 +10,10 @@
#include "gin/gin_export.h"
#include "v8/include/v8.h"
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+#include "base/files/file_path.h"
+#endif
+
namespace gin {
class PerIsolateData;
@@ -31,7 +35,9 @@ class GIN_EXPORT IsolateHolder {
~IsolateHolder();
// Should be invoked once before creating IsolateHolder instances to
- // initialize V8 and Gin.
+ // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is defined,
+ // V8's initial snapshot should be loaded (by calling LoadV8Snapshot or
+ // LoadV8SnapshotFD) before calling Initialize.
static void Initialize(ScriptMode mode,
v8::ArrayBuffer::Allocator* allocator);
@@ -49,11 +55,26 @@ class GIN_EXPORT IsolateHolder {
// thread.
void RemoveRunMicrotasksObserver();
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+#ifdef OS_ANDROID
+ static bool LoadV8SnapshotFD(int natives_fd, int snapshot_fd);
+#endif
+ static bool LoadV8Snapshot();
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+
private:
v8::Isolate* isolate_;
scoped_ptr<PerIsolateData> isolate_data_;
scoped_ptr<RunMicrotasksObserver> task_observer_;
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+
+ static bool MapV8Files(
jochen (gone - plz use gerrit) 2014/10/08 15:16:05 this method can be in an anonymous namespace in is
baixo 2014/10/14 16:36:42 Done.
+ base::FilePath* natives_path, base::FilePath* snapshot_path,
+ int natives = -1, int snapshot = -1);
+
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+
DISALLOW_COPY_AND_ASSIGN(IsolateHolder);
};

Powered by Google App Engine
This is Rietveld 408576698