| OLD | NEW |
| 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/browser/cast_content_browser_client.h" | 5 #include "chromecast/browser/cast_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // it, because CastNetworkDelegate is bound to the IO thread. | 170 // it, because CastNetworkDelegate is bound to the IO thread. |
| 171 // Subsequently, the callback must then itself be performed back here | 171 // Subsequently, the callback must then itself be performed back here |
| 172 // on the UI thread. | 172 // on the UI thread. |
| 173 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 173 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 174 content::BrowserThread::PostTaskAndReplyWithResult( | 174 content::BrowserThread::PostTaskAndReplyWithResult( |
| 175 content::BrowserThread::IO, | 175 content::BrowserThread::IO, |
| 176 FROM_HERE, | 176 FROM_HERE, |
| 177 base::Bind( | 177 base::Bind( |
| 178 &CastContentBrowserClient::SelectClientCertificateOnIOThread, | 178 &CastContentBrowserClient::SelectClientCertificateOnIOThread, |
| 179 base::Unretained(this), | 179 base::Unretained(this), |
| 180 requesting_url), | 180 requesting_url, |
| 181 render_process_id), |
| 181 callback); | 182 callback); |
| 182 } | 183 } |
| 183 | 184 |
| 184 net::X509Certificate* | 185 net::X509Certificate* |
| 185 CastContentBrowserClient::SelectClientCertificateOnIOThread( | 186 CastContentBrowserClient::SelectClientCertificateOnIOThread( |
| 186 GURL requesting_url) { | 187 GURL requesting_url, |
| 188 int render_process_id) { |
| 187 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 189 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 188 CastNetworkDelegate* network_delegate = | 190 CastNetworkDelegate* network_delegate = |
| 189 url_request_context_factory_->app_network_delegate(); | 191 url_request_context_factory_->app_network_delegate(); |
| 190 if (network_delegate->IsWhitelisted(requesting_url, false)) { | 192 if (network_delegate->IsWhitelisted(requesting_url, |
| 193 render_process_id, false)) { |
| 191 return CastNetworkDelegate::DeviceCert(); | 194 return CastNetworkDelegate::DeviceCert(); |
| 192 } else { | 195 } else { |
| 193 LOG(ERROR) << "Invalid host for client certificate request: " | 196 LOG(ERROR) << "Invalid host for client certificate request: " |
| 194 << requesting_url.host(); | 197 << requesting_url.host(); |
| 195 return NULL; | 198 return NULL; |
| 196 } | 199 } |
| 197 } | 200 } |
| 198 | 201 |
| 199 bool CastContentBrowserClient::CanCreateWindow( | 202 bool CastContentBrowserClient::CanCreateWindow( |
| 200 const GURL& opener_url, | 203 const GURL& opener_url, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 content::ExternalVideoSurfaceContainer* | 259 content::ExternalVideoSurfaceContainer* |
| 257 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 260 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
| 258 content::WebContents* web_contents) { | 261 content::WebContents* web_contents) { |
| 259 return new ExternalVideoSurfaceContainerImpl(web_contents); | 262 return new ExternalVideoSurfaceContainerImpl(web_contents); |
| 260 } | 263 } |
| 261 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) | 264 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) |
| 262 | 265 |
| 263 | 266 |
| 264 } // namespace shell | 267 } // namespace shell |
| 265 } // namespace chromecast | 268 } // namespace chromecast |
| OLD | NEW |