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

Unified Diff: ash/shell/content_client/shell_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
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | content/app/content_main_runner.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c5dfbbff08d6a2b8ca5e505722f73de4ec6a3f2c 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 (v8_natives_fd_.get() != -1) {
picksi 2015/06/02 11:44:37 "v8_[natives|snapshot]_fd_.get() != -1" appears a
Erik Corry Chromium.org 2015/06/02 14:29:47 Done.
+ 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
@@ -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 (v8_natives_fd_.get() == -1) {
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(v8_natives_fd_.get() != -1);
rmcilroy 2015/06/01 14:06:31 nit - please add a comment saying why its OK if v8
Erik Corry Chromium.org 2015/06/02 11:18:52 Done.
mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
#endif // V8_USE_EXTERNAL_STARTUP_DATA
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | content/app/content_main_runner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698