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

Side by Side Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 1156573008: Allow OpenApkAsset() to open resource files as well as assets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/lib/main/aw_main_delegate.h" 5 #include "android_webview/lib/main/aw_main_delegate.h"
6 6
7 #include "android_webview/browser/aw_content_browser_client.h" 7 #include "android_webview/browser/aw_content_browser_client.h"
8 #include "android_webview/browser/browser_view_renderer.h" 8 #include "android_webview/browser/browser_view_renderer.h"
9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" 9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
10 #include "android_webview/crash_reporter/aw_microdump_crash_reporter.h" 10 #include "android_webview/crash_reporter/aw_microdump_crash_reporter.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 cl->AppendSwitch(switches::kEnableAggressiveDOMStorageFlushing); 99 cl->AppendSwitch(switches::kEnableAggressiveDOMStorageFlushing);
100 100
101 // This is needed to be able to mmap the V8 snapshot and ICU data file 101 // This is needed to be able to mmap the V8 snapshot and ICU data file
102 // directly from the WebView .apk. 102 // directly from the WebView .apk.
103 // This needs to be here so that it gets to run before the code in 103 // This needs to be here so that it gets to run before the code in
104 // content_main_runner that reads these values tries to do so. 104 // content_main_runner that reads these values tries to do so.
105 // In multi-process mode this code would live in 105 // In multi-process mode this code would live in
106 // AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess. 106 // AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess.
107 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 107 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
108 #ifdef __LP64__ 108 #ifdef __LP64__
109 const char kNativesFileName[] = "natives_blob_64.bin"; 109 const char kNativesFileName[] = "assets/natives_blob_64.bin";
110 const char kSnapshotFileName[] = "snapshot_blob_64.bin"; 110 const char kSnapshotFileName[] = "assets/snapshot_blob_64.bin";
111 #else 111 #else
112 const char kNativesFileName[] = "natives_blob_32.bin"; 112 const char kNativesFileName[] = "assets/natives_blob_32.bin";
113 const char kSnapshotFileName[] = "snapshot_blob_32.bin"; 113 const char kSnapshotFileName[] = "assets/snapshot_blob_32.bin";
114 #endif // __LP64__ 114 #endif // __LP64__
115 // TODO(gsennton) we should use 115 // TODO(gsennton) we should use
116 // gin::IsolateHolder::kNativesFileName/kSnapshotFileName 116 // gin::IsolateHolder::kNativesFileName/kSnapshotFileName
117 // here when those files have arch specific names http://crbug.com/455699 117 // here when those files have arch specific names http://crbug.com/455699
118 CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( 118 CHECK(base::android::RegisterApkAssetWithGlobalDescriptors(
119 kV8NativesDataDescriptor, kNativesFileName)); 119 kV8NativesDataDescriptor, kNativesFileName));
120 CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( 120 CHECK(base::android::RegisterApkAssetWithGlobalDescriptors(
121 kV8SnapshotDataDescriptor, kSnapshotFileName)); 121 kV8SnapshotDataDescriptor, kSnapshotFileName));
122 #endif 122 #endif
123 CHECK(base::android::RegisterApkAssetWithGlobalDescriptors( 123 CHECK(base::android::RegisterApkAssetWithGlobalDescriptors(
124 kAndroidICUDataDescriptor, base::i18n::kIcuDataFileName)); 124 kAndroidICUDataDescriptor, "assets/icudtl.dat"));
125 125
126 return false; 126 return false;
127 } 127 }
128 128
129 void AwMainDelegate::PreSandboxStartup() { 129 void AwMainDelegate::PreSandboxStartup() {
130 // TODO(torne): When we have a separate renderer process, we need to handle 130 // TODO(torne): When we have a separate renderer process, we need to handle
131 // being passed open FDs for the resource paks here. 131 // being passed open FDs for the resource paks here.
132 #if defined(ARCH_CPU_ARM_FAMILY) 132 #if defined(ARCH_CPU_ARM_FAMILY)
133 // Create an instance of the CPU class to parse /proc/cpuinfo and cache 133 // Create an instance of the CPU class to parse /proc/cpuinfo and cache
134 // cpu_brand info. 134 // cpu_brand info.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 #if defined(VIDEO_HOLE) 202 #if defined(VIDEO_HOLE)
203 content::ExternalVideoSurfaceContainer* 203 content::ExternalVideoSurfaceContainer*
204 AwMainDelegate::CreateExternalVideoSurfaceContainer( 204 AwMainDelegate::CreateExternalVideoSurfaceContainer(
205 content::WebContents* web_contents) { 205 content::WebContents* web_contents) {
206 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( 206 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create(
207 web_contents); 207 web_contents);
208 } 208 }
209 #endif 209 #endif
210 210
211 } // namespace android_webview 211 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_main_parts.cc ('k') | android_webview/native/aw_media_url_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698