| Index: android_webview/lib/main/aw_main_delegate.cc
|
| diff --git a/android_webview/lib/main/aw_main_delegate.cc b/android_webview/lib/main/aw_main_delegate.cc
|
| index e858652aa01446a8b1e6020d9cf250b6765e0882..e0025feb9d4e1b14a59c3913136c9751388a35b5 100644
|
| --- a/android_webview/lib/main/aw_main_delegate.cc
|
| +++ b/android_webview/lib/main/aw_main_delegate.cc
|
| @@ -34,7 +34,6 @@
|
| #include "content/public/common/content_descriptors.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "gin/public/isolate_holder.h"
|
| -#include "gin/v8_initializer.h"
|
| #include "gpu/command_buffer/client/gl_in_process_context.h"
|
| #include "gpu/command_buffer/service/gpu_switches.h"
|
| #include "media/base/media_switches.h"
|
| @@ -118,19 +117,24 @@
|
| if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) {
|
| // Browser process (no type specified).
|
|
|
| - base::android::RegisterApkAssetWithGlobalDescriptors(
|
| - kV8NativesDataDescriptor32,
|
| - gin::V8Initializer::GetNativesFilePath(true).AsUTF8Unsafe());
|
| - base::android::RegisterApkAssetWithGlobalDescriptors(
|
| - kV8SnapshotDataDescriptor32,
|
| - gin::V8Initializer::GetSnapshotFilePath(true).AsUTF8Unsafe());
|
| -
|
| - base::android::RegisterApkAssetWithGlobalDescriptors(
|
| - kV8NativesDataDescriptor64,
|
| - gin::V8Initializer::GetNativesFilePath(false).AsUTF8Unsafe());
|
| - base::android::RegisterApkAssetWithGlobalDescriptors(
|
| - kV8SnapshotDataDescriptor64,
|
| - gin::V8Initializer::GetSnapshotFilePath(false).AsUTF8Unsafe());
|
| + // 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";
|
| +#else
|
| + 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));
|
| }
|
|
|
| if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) {
|
|
|