| Index: gin/isolate_holder.cc
|
| diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
|
| index 317b5822bd8f47f773a0927d1a2b18ef6c2ebcb8..85672a2c7f64d1c6d700c423f42aae89c5716ed4 100644
|
| --- a/gin/isolate_holder.cc
|
| +++ b/gin/isolate_holder.cc
|
| @@ -194,6 +194,28 @@ bool IsolateHolder::LoadV8SnapshotFd(int natives_fd,
|
| return MapV8Files(
|
| NULL, NULL, natives_fd, snapshot_fd, natives_region, snapshot_region);
|
| }
|
| +
|
| +// static
|
| +bool IsolateHolder::OpenV8FilesForChildProcesses(
|
| + base::PlatformFile* natives_fd_out,
|
| + base::PlatformFile* snapshot_fd_out) {
|
| + base::FilePath data_path;
|
| + PathService::Get(kV8SnapshotBasePathKey, &data_path);
|
| + DCHECK(!data_path.empty());
|
| +
|
| + int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
|
| + base::FilePath natives_data_path = data_path.AppendASCII(kNativesFileName);
|
| + base::FilePath snapshot_data_path = data_path.AppendASCII(kSnapshotFileName);
|
| + base::File natives_data_file(natives_data_path, file_flags);
|
| + base::File snapshot_data_file(snapshot_data_path, file_flags);
|
| +
|
| + if (!natives_data_file.IsValid() || !snapshot_data_file.IsValid())
|
| + return false;
|
| +
|
| + *natives_fd_out = natives_data_file.TakePlatformFile();
|
| + *snapshot_fd_out = snapshot_data_file.TakePlatformFile();
|
| + return true;
|
| +}
|
| #endif // V8_USE_EXTERNAL_STARTUP_DATA
|
|
|
| //static
|
|
|