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

Unified Diff: content/app/content_main_runner.cc

Issue 1156873002: Load v8 snapshots directly from APK (and store them uncompressed) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8initializer
Patch Set: fix webview, content shell, chromecast 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 | « chromecast/chromecast.gyp ('k') | content/content_shell.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5e137aa0481ecba7b43049ae887ac1ede6428ad6 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -51,6 +51,10 @@
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
+#if defined(OS_ANDROID)
+#include "base/android/apk_assets.h"
+#endif
+
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
#include "gin/v8_initializer.h"
#endif
@@ -711,7 +715,16 @@ class ContentMainRunnerImpl : public ContentMainRunner {
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
#if defined(OS_POSIX) && !defined(OS_MACOSX)
-#if !defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+ // The fds are already mapped in the case of Android WebView.
rmcilroy 2015/05/26 09:15:14 Webview? Please update the comment. Also, where h
+ if (g_fds->MaybeGet(kV8NativesDataDescriptor) == -1) {
rmcilroy 2015/05/26 09:15:14 Please use the switches::kV8NativesPassedByFD and
+ // Map V8 data from within .apk.
+ CHECK(base::android::RegisterApkAssetWithGlobalDescriptors(
+ kV8NativesDataDescriptor, gin::V8Initializer::kNativesFileName));
+ CHECK(base::android::RegisterApkAssetWithGlobalDescriptors(
+ kV8SnapshotDataDescriptor, gin::V8Initializer::kSnapshotFileName));
+ }
+#else
// kV8NativesDataDescriptor and kV8SnapshotDataDescriptor could be shared
// with child processes via file descriptors. On Android they are set in
// ChildProcessService::InternalInitChildProcess, otherwise set them here.
@@ -725,7 +738,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
kV8SnapshotDataDescriptor,
kV8SnapshotDataDescriptor + base::GlobalDescriptors::kBaseDescriptor);
}
-#endif // !OS_ANDROID
+#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) {
« no previous file with comments | « chromecast/chromecast.gyp ('k') | content/content_shell.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698