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

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: naming change Created 6 years, 4 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 720bbb82de7447cd05f7fc01aec294f7eefd608b..fb40b5c4e7b89ac6633f8e7e514156477cd332f4 100644
--- a/chromecast/shell/browser/cast_content_browser_client.cc
+++ b/chromecast/shell/browser/cast_content_browser_client.cc
@@ -5,11 +5,15 @@
#include "chromecast/shell/browser/cast_content_browser_client.h"
#include "base/command_line.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/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"
@@ -141,6 +145,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));
Yaron 2014/09/06 01:10:14 Where is the child process accessing the passed fd
gunsch 2014/09/08 19:42:23 cast_main_delegate.cc, in CastMainDelegate::Initia
Yaron 2014/09/11 06:45:17 right, thanks
+ 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

Powered by Google App Engine
This is Rietveld 408576698