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

Unified Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 2384063005: Propagate common resources to WebView child process (Closed)
Patch Set: Created 4 years, 2 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 | « android_webview/common/aw_descriptors.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f45591858285f225af2a88a869db69bc27b5d84c..89e7792113e8465f1258d441ca10719f75447ab8 100644
--- a/android_webview/lib/main/aw_main_delegate.cc
+++ b/android_webview/lib/main/aw_main_delegate.cc
@@ -159,11 +159,18 @@ void AwMainDelegate::PreSandboxStartup() {
global_descriptors->GetRegion(kAndroidWebViewLocalePakDescriptor);
ResourceBundle::InitSharedInstanceWithPakFileRegion(base::File(pak_fd),
pak_region);
- pak_fd = global_descriptors->Get(kAndroidWebViewMainPakDescriptor);
- pak_region =
- global_descriptors->GetRegion(kAndroidWebViewMainPakDescriptor);
- ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
- base::File(pak_fd), pak_region, ui::SCALE_FACTOR_NONE);
+
+ std::pair<int, ui::ScaleFactor> extra_paks[] = {
+ {kAndroidWebViewMainPakDescriptor, ui::SCALE_FACTOR_NONE},
+ {kAndroidWebView100PercentPakDescriptor, ui::SCALE_FACTOR_100P}};
+
+ for (const auto& pak_info : extra_paks) {
+ pak_fd = global_descriptors->Get(pak_info.first);
+ pak_region = global_descriptors->GetRegion(pak_info.first);
+ ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
+ base::File(pak_fd), pak_region, pak_info.second);
+ }
+
crash_signal_fd =
global_descriptors->Get(kAndroidWebViewCrashSignalDescriptor);
}
« no previous file with comments | « android_webview/common/aw_descriptors.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698