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..6d9a3303e016a1ea61316577f0ffc2d0585d7997 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 (natives_fd_exists()) { |
+ command_line->AppendSwitch(::switches::kV8NativesPassedByFD); |
+ } |
+ if (snapshot_fd_exists()) { |
+ 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 (!natives_fd_exists()) { |
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(natives_fd_exists()); |
mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get()); |
- mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get()); |
+ if (snapshot_fd_exists()) |
+ mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get()); |
#endif // V8_USE_EXTERNAL_STARTUP_DATA |
#if defined(OS_ANDROID) |