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

Unified Diff: content/app/content_main_runner.cc

Issue 1164483003: Allow startup with missing V8 snapshot file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add natives_fd_exists and snapshot_fd_exists instead of checking for -1 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: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 279536b09b983deec9ae5f22856e5c0bbb72f83a..2d03f427e2d08131789af90e0f2a90d14b645434 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -728,17 +728,23 @@ class ContentMainRunnerImpl : public ContentMainRunner {
#endif // !OS_ANDROID
int v8_natives_fd = g_fds->MaybeGet(kV8NativesDataDescriptor);
int v8_snapshot_fd = g_fds->MaybeGet(kV8SnapshotDataDescriptor);
- if (v8_natives_fd != -1 && v8_snapshot_fd != -1) {
- auto v8_natives_region = g_fds->GetRegion(kV8NativesDataDescriptor);
+ if (v8_snapshot_fd != -1) {
auto v8_snapshot_region = g_fds->GetRegion(kV8SnapshotDataDescriptor);
CHECK(gin::V8Initializer::LoadV8SnapshotFromFD(
- v8_natives_fd, v8_natives_region.offset, v8_natives_region.size,
v8_snapshot_fd, v8_snapshot_region.offset, v8_snapshot_region.size));
} else {
- CHECK(gin::V8Initializer::LoadV8Snapshot());
+ gin::V8Initializer::LoadV8Snapshot();
+ }
+ if (v8_natives_fd != -1) {
+ auto v8_natives_region = g_fds->GetRegion(kV8NativesDataDescriptor);
+ gin::V8Initializer::LoadV8NativesFromFD(
+ v8_natives_fd, v8_natives_region.offset, v8_natives_region.size);
+ } else {
+ gin::V8Initializer::LoadV8Natives();
}
#else
- CHECK(gin::V8Initializer::LoadV8Snapshot());
+ gin::V8Initializer::LoadV8Snapshot();
+ gin::V8Initializer::LoadV8Natives();
#endif // OS_POSIX && !OS_MACOSX
#endif // V8_USE_EXTERNAL_STARTUP_DATA

Powered by Google App Engine
This is Rietveld 408576698