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

Unified Diff: chromecast/shell/browser/cast_content_browser_client.cc

Issue 490603002: Chromecast: initial checkin of Android-based cast shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added android DEPS (git cl presubmit doesn't check Java DEPS?) Created 6 years, 3 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/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
« no previous file with comments | « chromecast/shell/browser/cast_browser_main_parts.cc ('k') | chromecast/shell/browser/cast_http_user_agent_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698