Index: gin/public/isolate_holder.h |
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h |
index 7968b1df0ba3edd8a9978105b927a494ec4cb5ef..fb9aea8b5c5afb91df5e85cb3a3b4bc409d01a89 100644 |
--- a/gin/public/isolate_holder.h |
+++ b/gin/public/isolate_holder.h |
@@ -10,6 +10,16 @@ |
#include "gin/gin_export.h" |
#include "v8/include/v8.h" |
+namespace base { |
+ |
+// Forward declaration of PlatformFile from base/file/file.h |
+#if defined(OS_WIN) |
+typedef HANDLE PlatformFile; |
+#elif defined(OS_POSIX) |
+typedef int PlatformFile; |
+#endif |
+} |
+ |
namespace gin { |
class PerIsolateData; |
@@ -52,17 +62,26 @@ class GIN_EXPORT IsolateHolder { |
void RemoveRunMicrotasksObserver(); |
#if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
- static const int kV8SnapshotBasePathKey; |
- static const char kNativesFileName[]; |
- static const char kSnapshotFileName[]; |
- |
+ // Load the V8 snapshot data from the given file descriptors. If offset and |
+ // size are zero it will load the whole file, otherwise it will map and load |
+ // the region of the file specified by offset and size. Returns true on |
+ // success. |
static bool LoadV8SnapshotFd(int natives_fd, |
int64 natives_offset, |
int64 natives_size, |
int snapshot_fd, |
int64 snapshot_offset, |
int64 snapshot_size); |
+ |
+ // Load the V8 snapshot data from the snapshot files. Returns true on success. |
static bool LoadV8Snapshot(); |
+ |
+ // Opens the V8 snapshot data files and returns open file descriptors to these |
+ // files in |natives_fd_out| and |snapshot_fd_out|, which can be passed to |
+ // child processes. |
+ static bool OpenV8FilesForChildProcesses(base::PlatformFile* natives_fd_out, |
+ base::PlatformFile* snapshot_fd_out); |
+ |
#endif // V8_USE_EXTERNAL_STARTUP_DATA |
static void GetV8ExternalSnapshotData(const char** natives_data_out, |
int* natives_size_out, |