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

Unified Diff: gin/isolate_holder.cc

Issue 1019483002: Add support to extension_shell and ash_shell to use external V8 snapshot files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove gyp changes Created 5 years, 9 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/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

Powered by Google App Engine
This is Rietveld 408576698