summaryrefslogtreecommitdiffstats
path: root/content/app/content_main_runner.cc
diff options
context:
space:
mode:
authormkosiba <mkosiba@chromium.org>2015-01-09 05:10:22 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-09 13:11:05 +0000
commit3c766cc321a77febd8cf726436e22ab385f8ac1b (patch)
tree69f80a3088b48f0cd108a179f30adcc315b862b2 /content/app/content_main_runner.cc
parentc5feb0407d876d63c4db686e0b7c8b8f2b73bf6e (diff)
downloadchromium_src-3c766cc321a77febd8cf726436e22ab385f8ac1b.zip
chromium_src-3c766cc321a77febd8cf726436e22ab385f8ac1b.tar.gz
chromium_src-3c766cc321a77febd8cf726436e22ab385f8ac1b.tar.bz2
mmap V8 snapshot and ICU data file in the android_webview
This makes it possible to mmap the V8 snapshot and ICU data file directly from the WebView APK. Doing so makes it possible to remove the android_webview_telemetry_build flag which in turns means we can build the WebView with the same set of flags that Chrome on Android uses. BUG=442338 Review URL: https://codereview.chromium.org/812393002 Cr-Commit-Position: refs/heads/master@{#310765}
Diffstat (limited to 'content/app/content_main_runner.cc')
-rw-r--r--content/app/content_main_runner.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 2da7dc1..8795067 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -716,10 +716,14 @@ class ContentMainRunnerImpl : public ContentMainRunner {
#if defined(OS_ANDROID)
int icudata_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
kAndroidICUDataDescriptor);
- if (icudata_fd != -1)
- CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd));
- else
+ if (icudata_fd != -1) {
+ auto icudata_region = base::GlobalDescriptors::GetInstance()->GetRegion(
+ kAndroidICUDataDescriptor);
+ CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd,
+ icudata_region));
+ } else {
CHECK(base::i18n::InitializeICU());
+ }
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
int v8_natives_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
@@ -727,8 +731,15 @@ class ContentMainRunnerImpl : public ContentMainRunner {
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));
+ auto v8_natives_region =
+ base::GlobalDescriptors::GetInstance()->GetRegion(
+ kV8NativesDataDescriptor);
+ auto v8_snapshot_region =
+ base::GlobalDescriptors::GetInstance()->GetRegion(
+ kV8SnapshotDataDescriptor);
+ CHECK(gin::IsolateHolder::LoadV8SnapshotFd(
+ 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::IsolateHolder::LoadV8Snapshot());
}