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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/shell/browser/cast_content_browser_client.h" 5 #include "chromecast/shell/browser/cast_content_browser_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h"
9 #include "chromecast/common/cast_paths.h"
10 #include "chromecast/common/global_descriptors.h"
8 #include "chromecast/shell/browser/cast_browser_context.h" 11 #include "chromecast/shell/browser/cast_browser_context.h"
9 #include "chromecast/shell/browser/cast_browser_main_parts.h" 12 #include "chromecast/shell/browser/cast_browser_main_parts.h"
10 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h" 13 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h"
11 #include "chromecast/shell/browser/url_request_context_factory.h" 14 #include "chromecast/shell/browser/url_request_context_factory.h"
12 #include "content/public/browser/certificate_request_result_type.h" 15 #include "content/public/browser/certificate_request_result_type.h"
16 #include "content/public/browser/file_descriptor_info.h"
13 #include "content/public/browser/render_process_host.h" 17 #include "content/public/browser/render_process_host.h"
14 #include "content/public/common/content_descriptors.h" 18 #include "content/public/common/content_descriptors.h"
15 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
16 #include "content/public/common/url_constants.h" 20 #include "content/public/common/url_constants.h"
17 #include "content/public/common/web_preferences.h" 21 #include "content/public/common/web_preferences.h"
18 22
19 namespace chromecast { 23 namespace chromecast {
20 namespace shell { 24 namespace shell {
21 25
22 CastContentBrowserClient::CastContentBrowserClient() 26 CastContentBrowserClient::CastContentBrowserClient()
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 int opener_id, 138 int opener_id,
135 bool* no_javascript_access) { 139 bool* no_javascript_access) {
136 *no_javascript_access = true; 140 *no_javascript_access = true;
137 return false; 141 return false;
138 } 142 }
139 143
140 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 144 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
141 const base::CommandLine& command_line, 145 const base::CommandLine& command_line,
142 int child_process_id, 146 int child_process_id,
143 std::vector<content::FileDescriptorInfo>* mappings) { 147 std::vector<content::FileDescriptorInfo>* mappings) {
148 #if defined(OS_ANDROID)
149 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
150 base::FilePath pak_file;
151 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
152 base::File pak_with_flags(pak_file, flags);
153 if (!pak_with_flags.IsValid()) {
154 NOTREACHED() << "Failed to open file when creating renderer process: "
155 << "cast_shell.pak";
156 }
157 mappings->push_back(content::FileDescriptorInfo(
158 kAndroidPakDescriptor,
159 base::FileDescriptor(base::File(pak_file, flags))));
160 #endif // defined(OS_ANDROID)
144 } 161 }
145 162
146 } // namespace shell 163 } // namespace shell
147 } // namespace chromecast 164 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698