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

Unified Diff: content/app/content_main_runner.cc

Issue 594603003: Infrastructure for reading V8's initial snapshot from external files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android tests Created 6 years, 2 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 b82a1ba36d213073fa24f47c76ce341f65fc10d2..b7553168d6f697ab7a7fe24d0f116535303a5f07 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -50,6 +50,10 @@
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+#include "gin/public/isolate_holder.h"
+#endif
+
#if defined(OS_ANDROID)
#include "content/public/common/content_descriptors.h"
#endif
@@ -717,9 +721,25 @@ class ContentMainRunnerImpl : public ContentMainRunner {
CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd));
else
CHECK(base::i18n::InitializeICU());
+
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ int v8_natives_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
+ kV8NativesDataDescriptor);
+ int v8_snapshot_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
+ kV8SnapshotDataDescriptor);
+ if (v8_natives_fd != -1 && v8_snapshot_fd != -1)
+ CHECK(gin::IsolateHolder::LoadV8SnapshotFD(v8_natives_fd,
+ v8_snapshot_fd));
+ else
+ CHECK(gin::IsolateHolder::LoadV8Snapshot());
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+
#else
CHECK(base::i18n::InitializeICU());
-#endif
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ CHECK(gin::IsolateHolder::LoadV8Snapshot());
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+#endif // OS_ANDROID
InitializeStatsTable(command_line);

Powered by Google App Engine
This is Rietveld 408576698