Chromium Code Reviews| Index: ash/shell/content_client/shell_content_browser_client.cc |
| diff --git a/ash/shell/content_client/shell_content_browser_client.cc b/ash/shell/content_client/shell_content_browser_client.cc |
| index 51b0107d5ad9f1b8a532e3793655f9a506b1f193..518a6959ad5f7f71e927748ead15d556e990fd9c 100644 |
| --- a/ash/shell/content_client/shell_content_browser_client.cc |
| +++ b/ash/shell/content_client/shell_content_browser_client.cc |
| @@ -51,8 +51,12 @@ void ShellContentBrowserClient::AppendExtraCommandLineSwitches( |
| std::string process_type = |
| command_line->GetSwitchValueASCII(switches::kProcessType); |
| if (process_type != switches::kZygoteProcess) { |
| - command_line->AppendSwitch(::switches::kV8NativesPassedByFD); |
| - command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD); |
| + if (natives_fd_exists()) { |
|
rmcilroy
2015/06/02 15:20:27
Just DCHECK(natives_fd_exists() here since it shou
Erik Corry Chromium.org
2015/06/04 11:40:40
Unfortunately this is also used for the GPU proces
rmcilroy
2015/06/04 14:03:59
I'm not sure this is to do with the gpu process -
|
| + 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 |
| @@ -64,7 +68,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 (!natives_fd_exists()) { |
| int v8_natives_fd = -1; |
| int v8_snapshot_fd = -1; |
| if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd, |
| @@ -73,7 +77,7 @@ void ShellContentBrowserClient::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()); |
| #endif // V8_USE_EXTERNAL_STARTUP_DATA |