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

Unified Diff: chromecast/browser/cast_content_browser_client.cc

Issue 1181953002: Load non-locale .pak files directly from the .apk on Android (rather than extracting on start-up). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@raw-paks
Patch Set: Fix content_browsertests 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 side-by-side diff with in-line comments
Download patch
Index: chromecast/browser/cast_content_browser_client.cc
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc
index f141c2a66caac5f301c9874c171107ce149b83ce..6f4f4d06d0c88d8030bd8a57bc603e719c937903 100644
--- a/chromecast/browser/cast_content_browser_client.cc
+++ b/chromecast/browser/cast_content_browser_client.cc
@@ -332,21 +332,18 @@ bool CastContentBrowserClient::CanCreateWindow(
return false;
}
+#if defined(OS_ANDROID)
void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
- content::FileDescriptorInfo* mappings) {
-#if defined(OS_ANDROID)
- const int flags_open_read = base::File::FLAG_OPEN | base::File::FLAG_READ;
- base::FilePath pak_file_path;
- CHECK(PathService::Get(FILE_CAST_PAK, &pak_file_path));
- base::File pak_file(pak_file_path, flags_open_read);
- if (!pak_file.IsValid()) {
- NOTREACHED() << "Failed to open file when creating renderer process: "
- << "cast_shell.pak";
- }
- mappings->Transfer(kAndroidPakDescriptor,
- base::ScopedFD(pak_file.TakePlatformFile()));
+ content::FileDescriptorInfo* mappings,
+ std::map<int, base::MemoryMappedFile::Region>* regions) {
+ mappings->Share(
+ kAndroidPakDescriptor,
+ base::GlobalDescriptors::GetInstance()->Get(kAndroidPakDescriptor));
+ regions->insert(std::make_pair(
+ kAndroidPakDescriptor, base::GlobalDescriptors::GetInstance()->GetRegion(
+ kAndroidPakDescriptor)));
if (breakpad::IsCrashReporterEnabled()) {
base::File minidump_file(
@@ -360,13 +357,18 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
base::ScopedFD(minidump_file.TakePlatformFile()));
}
}
+}
#else
+void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
+ const base::CommandLine& command_line,
+ int child_process_id,
+ content::FileDescriptorInfo* mappings) {
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
mappings->Share(kCrashDumpSignal, crash_signal_fd);
}
-#endif // defined(OS_ANDROID)
}
+#endif // defined(OS_ANDROID)
#if defined(OS_ANDROID) && defined(VIDEO_HOLE)
content::ExternalVideoSurfaceContainer*

Powered by Google App Engine
This is Rietveld 408576698