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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1164483003: Allow startup with missing V8 snapshot file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: 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 e07ea7aa1525c34b4ffab0b1a833072daa79498a..b5c3a6d895d2f2fa7dad9f924237355d0a1ca581 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1229,8 +1229,12 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (process_type != switches::kZygoteProcess) {
- command_line->AppendSwitch(::switches::kV8NativesPassedByFD);
- command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD);
+ if (v8_natives_fd_.get() != -1) {
+ command_line->AppendSwitch(::switches::kV8NativesPassedByFD);
+ }
+ if (v8_snapshot_fd_.get() != -1) {
+ command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD);
+ }
}
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#endif // OS_POSIX && !OS_MACOSX
@@ -2225,7 +2229,7 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
int child_process_id,
FileDescriptorInfo* mappings) {
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
- if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) {
+ if (v8_natives_fd_.get() == -1) {
int v8_natives_fd = -1;
int v8_snapshot_fd = -1;
if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd,
@@ -2234,9 +2238,10 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
v8_snapshot_fd_.reset(v8_snapshot_fd);
}
}
- DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1);
+ DCHECK(v8_natives_fd_.get() != -1);
mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
- mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
+ if (v8_snapshot_fd_.get() != -1)
+ mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#if defined(OS_ANDROID)

Powered by Google App Engine
This is Rietveld 408576698