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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 594603003: Infrastructure for reading V8's initial snapshot from external files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Turn static variables into pointers and remove v8 init in net Created 6 years, 3 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
« no previous file with comments | « build/common.gypi ('k') | content/DEPS » ('j') | gin/isolate_holder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index e6556154ee1bca31f7a0adcc65a8c7172a3ae66b..215c20bf1937e760d54b0e7913956000e06d8a08 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2449,6 +2449,26 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
mappings->push_back(FileDescriptorInfo(kAndroidICUDataDescriptor,
FileDescriptor(icudata_file.Pass())));
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ base::FilePath v8_data_path;
+ PathService::Get(base::DIR_ANDROID_APP_DATA, &v8_data_path);
+ DCHECK(!v8_data_path.empty());
+
+ int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
+ base::FilePath v8_natives_data_path =
+ v8_data_path.AppendASCII("natives_blob.bin");
+ base::FilePath v8_snapshot_data_path =
+ v8_data_path.AppendASCII("snapshot_blob.bin");
+ base::File v8_natives_data_file(v8_natives_data_path, file_flags);
+ base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
+ DCHECK(v8_natives_data_file.IsValid());
+ DCHECK(v8_snapshot_data_file.IsValid());
+ mappings->push_back(FileDescriptorInfo(kV8NativesDataDescriptor,
+ FileDescriptor(v8_natives_data_file.Pass())));
+ mappings->push_back(FileDescriptorInfo(kV8SnapshotDataDescriptor,
+ FileDescriptor(v8_snapshot_data_file.Pass())));
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+
#else
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
« no previous file with comments | « build/common.gypi ('k') | content/DEPS » ('j') | gin/isolate_holder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698