Index: content/app/content_main_runner.cc |
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc |
index 32dd24ef38cab7b06c639924cb01075f7c09edad..ed409c48ab68fd6543e5137ab8b08a52fe793414 100644 |
--- a/content/app/content_main_runner.cc |
+++ b/content/app/content_main_runner.cc |
@@ -43,6 +43,9 @@ |
#include "content/renderer/in_process_renderer_thread.h" |
#include "content/utility/in_process_utility_thread.h" |
#include "crypto/nss_util.h" |
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA |
+#include "gin/public/isolate_holder.h" |
+#endif // V8_USE_EXTERNAL_STARTUP_DATA |
#include "ipc/ipc_descriptors.h" |
#include "ipc/ipc_switches.h" |
#include "media/base/media.h" |
@@ -715,9 +718,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); |