| Index: gin/v8_initializer.h
|
| diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
|
| index 68068c4848b567a696ecaa1c028622df010fe990..d5b7ab4a13d42d3e3ee55a440c98ea56b821d36c 100644
|
| --- a/gin/v8_initializer.h
|
| +++ b/gin/v8_initializer.h
|
| @@ -6,6 +6,7 @@
|
| #define GIN_V8_INITIALIZER_H_
|
|
|
| #include "base/files/file.h"
|
| +#include "base/files/memory_mapped_file.h"
|
| #include "gin/array_buffer.h"
|
| #include "gin/gin_export.h"
|
| #include "gin/public/isolate_holder.h"
|
| @@ -16,10 +17,6 @@ namespace gin {
|
|
|
| class GIN_EXPORT V8Initializer {
|
| public:
|
| - static const int kV8SnapshotBasePathKey;
|
| - static const char kNativesFileName[];
|
| - static const char kSnapshotFileName[];
|
| -
|
| // This should be called by IsolateHolder::Initialize().
|
| static void Initialize(gin::IsolateHolder::ScriptMode mode);
|
|
|
| @@ -31,7 +28,16 @@ class GIN_EXPORT V8Initializer {
|
| const char** snapshot_data_out,
|
| int* snapshot_size_out);
|
|
|
| -#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
| +#if defined(OS_POSIX) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
| +
|
| + struct V8Files {
|
| + base::ScopedFD natives_fd;
|
| + base::ScopedFD snapshot_fd;
|
| + base::MemoryMappedFile::Region natives_region;
|
| + base::MemoryMappedFile::Region snapshot_region;
|
| + public:
|
| + bool IsLoaded() const;
|
| + };
|
|
|
| // Load V8 snapshot from user provided platform file descriptors.
|
| // The offset and size arguments, if non-zero, specify the portions
|
| @@ -48,11 +54,9 @@ class GIN_EXPORT V8Initializer {
|
| // snapshot is already loaded, false otherwise.
|
| 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);
|
| + // Opens the V8 snapshot data files and returns open file descriptors and
|
| + // file regions to these files that can be passed to child processes.
|
| + static void OpenV8FilesForChildProcesses(V8Files* files_out);
|
|
|
| #endif // V8_USE_EXTERNAL_STARTUP_DATA
|
| };
|
|
|