diff options
author | mnaganov <mnaganov@chromium.org> | 2015-08-25 10:20:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-25 17:21:13 +0000 |
commit | d6920a68b6d5d7bf4705945539f6fceaf0fe570f (patch) | |
tree | d2f96d4da7f0f78ea3b5bc9303f4e64c6f6e9795 /android_webview/lib | |
parent | 113baae9c6a26518fdde8273652ba73981940d84 (diff) | |
download | chromium_src-d6920a68b6d5d7bf4705945539f6fceaf0fe570f.zip chromium_src-d6920a68b6d5d7bf4705945539f6fceaf0fe570f.tar.gz chromium_src-d6920a68b6d5d7bf4705945539f6fceaf0fe570f.tar.bz2 |
[Android WebView] Make loading of V8 data compatible with child services
1. Check for the process type when registering apk assets.
2. Fix Gin V8 initializer to allow retrieving of fd & region of
the mapped V8 files inside child_process_launcher.
3. There is no need to map icudtl specifically from WebView code since
http://crrev.com/335261
BUG=522205
Review URL: https://codereview.chromium.org/1301003002
Cr-Commit-Position: refs/heads/master@{#345362}
Diffstat (limited to 'android_webview/lib')
-rw-r--r-- | android_webview/lib/main/aw_main_delegate.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/android_webview/lib/main/aw_main_delegate.cc b/android_webview/lib/main/aw_main_delegate.cc index 9f86163..ee52b20 100644 --- a/android_webview/lib/main/aw_main_delegate.cc +++ b/android_webview/lib/main/aw_main_delegate.cc @@ -113,28 +113,28 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) { // https://crbug.com/521319 cl->AppendSwitch(switches::kDisablePresentationAPI); - // This is needed to be able to mmap the V8 snapshot and ICU data file - // directly from the WebView .apk. - // This needs to be here so that it gets to run before the code in - // content_main_runner that reads these values tries to do so. - // In multi-process mode this code would live in - // AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess. + if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) { + // Browser process (no type specified). + + // This code is needed to be able to mmap the V8 snapshot directly from + // the WebView .apk using architecture-specific names. + // This needs to be here so that it gets to run before the code in + // content_main_runner that reads these values tries to do so. #ifdef __LP64__ - const char kNativesFileName[] = "assets/natives_blob_64.bin"; - const char kSnapshotFileName[] = "assets/snapshot_blob_64.bin"; + const char kNativesFileName[] = "assets/natives_blob_64.bin"; + const char kSnapshotFileName[] = "assets/snapshot_blob_64.bin"; #else - const char kNativesFileName[] = "assets/natives_blob_32.bin"; - const char kSnapshotFileName[] = "assets/snapshot_blob_32.bin"; + const char kNativesFileName[] = "assets/natives_blob_32.bin"; + const char kSnapshotFileName[] = "assets/snapshot_blob_32.bin"; #endif // __LP64__ - // TODO(gsennton) we should use - // gin::IsolateHolder::kNativesFileName/kSnapshotFileName - // here when those files have arch specific names http://crbug.com/455699 - CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( - kV8NativesDataDescriptor, kNativesFileName)); - CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( - kV8SnapshotDataDescriptor, kSnapshotFileName)); - CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( - kAndroidICUDataDescriptor, "assets/icudtl.dat")); + // TODO(gsennton) we should use + // gin::IsolateHolder::kNativesFileName/kSnapshotFileName + // here when those files have arch specific names http://crbug.com/455699 + CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( + kV8NativesDataDescriptor, kNativesFileName)); + CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( + kV8SnapshotDataDescriptor, kSnapshotFileName)); + } return false; } |