Chromium Code Reviews| Index: gin/isolate_holder.cc |
| diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc |
| index 317b5822bd8f47f773a0927d1a2b18ef6c2ebcb8..e3b5db0ed5923d4b4767dbd60649608a56e3d526 100644 |
| --- a/gin/isolate_holder.cc |
| +++ b/gin/isolate_holder.cc |
| @@ -194,6 +194,25 @@ bool IsolateHolder::LoadV8SnapshotFd(int natives_fd, |
| return MapV8Files( |
| NULL, NULL, natives_fd, snapshot_fd, natives_region, snapshot_region); |
| } |
| + |
| +// static |
| +bool IsolateHolder::MapV8FilesForChildProcesses(int* natives_fd_out, |
|
James Cook
2015/03/18 23:20:06
This function always returns true. Does it need a
rmcilroy
2015/03/19 14:41:39
Yes, this is probably better. Also changed the if'
|
| + int* 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); |
| + DCHECK(natives_data_file.IsValid()); |
| + DCHECK(snapshot_data_file.IsValid()); |
| + *natives_fd_out = natives_data_file.TakePlatformFile(); |
| + *snapshot_fd_out = snapshot_data_file.TakePlatformFile(); |
| + return true; |
| +} |
| #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| //static |