Index: chromecast/shell/browser/cast_content_browser_client.cc |
diff --git a/chromecast/shell/browser/cast_content_browser_client.cc b/chromecast/shell/browser/cast_content_browser_client.cc |
index f8d897e7c279396a0c480295fa75212fe9a94ce2..919b19007df0d0bd63cd5c8d69572ac3279400fe 100644 |
--- a/chromecast/shell/browser/cast_content_browser_client.cc |
+++ b/chromecast/shell/browser/cast_content_browser_client.cc |
@@ -6,12 +6,16 @@ |
#include "base/command_line.h" |
#include "base/i18n/rtl.h" |
+#include "base/path_service.h" |
+#include "chromecast/common/cast_paths.h" |
+#include "chromecast/common/global_descriptors.h" |
#include "chromecast/shell/browser/cast_browser_context.h" |
#include "chromecast/shell/browser/cast_browser_main_parts.h" |
#include "chromecast/shell/browser/cast_browser_process.h" |
#include "chromecast/shell/browser/geolocation/cast_access_token_store.h" |
#include "chromecast/shell/browser/url_request_context_factory.h" |
#include "content/public/browser/certificate_request_result_type.h" |
+#include "content/public/browser/file_descriptor_info.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/common/content_descriptors.h" |
#include "content/public/common/content_switches.h" |
@@ -144,6 +148,19 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
const base::CommandLine& command_line, |
int child_process_id, |
std::vector<content::FileDescriptorInfo>* mappings) { |
+#if defined(OS_ANDROID) |
+ int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
+ base::FilePath pak_file; |
+ CHECK(PathService::Get(FILE_CAST_PAK, &pak_file)); |
+ base::File pak_with_flags(pak_file, flags); |
+ if (!pak_with_flags.IsValid()) { |
+ NOTREACHED() << "Failed to open file when creating renderer process: " |
+ << "cast_shell.pak"; |
+ } |
+ mappings->push_back(content::FileDescriptorInfo( |
+ kAndroidPakDescriptor, |
+ base::FileDescriptor(base::File(pak_file, flags)))); |
+#endif // defined(OS_ANDROID) |
} |
} // namespace shell |