Index: extensions/shell/browser/shell_content_browser_client.cc |
diff --git a/extensions/shell/browser/shell_content_browser_client.cc b/extensions/shell/browser/shell_content_browser_client.cc |
index dbb7f6f733eddd2172d421fe01c1eeeddacc6e44..b978bfc27c5d59a2d4d27f574d95bdce2b6d9cbb 100644 |
--- a/extensions/shell/browser/shell_content_browser_client.cc |
+++ b/extensions/shell/browser/shell_content_browser_client.cc |
@@ -212,8 +212,12 @@ void ShellContentBrowserClient::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 |
@@ -258,7 +262,7 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
int child_process_id, |
content::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, |
@@ -267,7 +271,7 @@ void ShellContentBrowserClient::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()); |
#endif // V8_USE_EXTERNAL_STARTUP_DATA |