| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "content/public/browser/web_contents.h" | 46 #include "content/public/browser/web_contents.h" |
| 47 #include "content/public/common/content_descriptors.h" | 47 #include "content/public/common/content_descriptors.h" |
| 48 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" |
| 49 #include "content/public/common/url_constants.h" | 49 #include "content/public/common/url_constants.h" |
| 50 #include "content/public/common/web_preferences.h" | 50 #include "content/public/common/web_preferences.h" |
| 51 #include "net/ssl/ssl_cert_request_info.h" | 51 #include "net/ssl/ssl_cert_request_info.h" |
| 52 #include "net/url_request/url_request_context_getter.h" | 52 #include "net/url_request/url_request_context_getter.h" |
| 53 #include "ui/gl/gl_switches.h" | 53 #include "ui/gl/gl_switches.h" |
| 54 | 54 |
| 55 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) | 55 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) |
| 56 #include "chromecast/browser/media/cast_mojo_media_application.h" | |
| 57 #include "chromecast/browser/media/cast_mojo_media_client.h" | 56 #include "chromecast/browser/media/cast_mojo_media_client.h" |
| 57 #include "media/mojo/services/mojo_media_application.h" // nogncheck |
| 58 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS | 58 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS |
| 59 | 59 |
| 60 #if defined(OS_ANDROID) | 60 #if defined(OS_ANDROID) |
| 61 #include "components/crash/content/browser/crash_dump_manager_android.h" | 61 #include "components/crash/content/browser/crash_dump_manager_android.h" |
| 62 #include "components/external_video_surface/browser/android/external_video_surfa
ce_container_impl.h" | 62 #include "components/external_video_surface/browser/android/external_video_surfa
ce_container_impl.h" |
| 63 #else | 63 #else |
| 64 #include "chromecast/browser/media/cast_browser_cdm_factory.h" | 64 #include "chromecast/browser/media/cast_browser_cdm_factory.h" |
| 65 #endif // defined(OS_ANDROID) | 65 #endif // defined(OS_ANDROID) |
| 66 | 66 |
| 67 namespace chromecast { | 67 namespace chromecast { |
| 68 namespace shell { | 68 namespace shell { |
| 69 | 69 |
| 70 namespace { | 70 namespace { |
| 71 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) | 71 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) |
| 72 static std::unique_ptr<::shell::ShellClient> CreateCastMojoMediaApplication( | 72 static std::unique_ptr<::shell::ShellClient> CreateMojoMediaApplication( |
| 73 CastContentBrowserClient* browser_client, | 73 CastContentBrowserClient* browser_client, |
| 74 const base::Closure& quit_closure) { | 74 const base::Closure& quit_closure) { |
| 75 std::unique_ptr<media::CastMojoMediaClient> mojo_media_client( | 75 std::unique_ptr<media::CastMojoMediaClient> mojo_media_client( |
| 76 new media::CastMojoMediaClient( | 76 new media::CastMojoMediaClient( |
| 77 base::Bind(&CastContentBrowserClient::CreateMediaPipelineBackend, | 77 base::Bind(&CastContentBrowserClient::CreateMediaPipelineBackend, |
| 78 base::Unretained(browser_client)))); | 78 base::Unretained(browser_client)))); |
| 79 return std::unique_ptr<::shell::ShellClient>( | 79 return std::unique_ptr<::shell::ShellClient>( |
| 80 new media::CastMojoMediaApplication( | 80 new ::media::MojoMediaApplication(std::move(mojo_media_client), |
| 81 std::move(mojo_media_client), browser_client->GetMediaTaskRunner(), | 81 quit_closure)); |
| 82 quit_closure)); | |
| 83 } | 82 } |
| 84 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS | 83 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS |
| 85 } // namespace | 84 } // namespace |
| 86 | 85 |
| 87 CastContentBrowserClient::CastContentBrowserClient() | 86 CastContentBrowserClient::CastContentBrowserClient() |
| 88 : cast_browser_main_parts_(nullptr), | 87 : cast_browser_main_parts_(nullptr), |
| 89 url_request_context_factory_(new URLRequestContextFactory()) {} | 88 url_request_context_factory_(new URLRequestContextFactory()) {} |
| 90 | 89 |
| 91 CastContentBrowserClient::~CastContentBrowserClient() { | 90 CastContentBrowserClient::~CastContentBrowserClient() { |
| 92 content::BrowserThread::DeleteSoon( | 91 content::BrowserThread::DeleteSoon( |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 bool* no_javascript_access) { | 388 bool* no_javascript_access) { |
| 390 *no_javascript_access = true; | 389 *no_javascript_access = true; |
| 391 return false; | 390 return false; |
| 392 } | 391 } |
| 393 | 392 |
| 394 void CastContentBrowserClient::RegisterInProcessMojoApplications( | 393 void CastContentBrowserClient::RegisterInProcessMojoApplications( |
| 395 StaticMojoApplicationMap* apps) { | 394 StaticMojoApplicationMap* apps) { |
| 396 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) | 395 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) |
| 397 content::MojoApplicationInfo app_info; | 396 content::MojoApplicationInfo app_info; |
| 398 app_info.application_factory = | 397 app_info.application_factory = |
| 399 base::Bind(&CreateCastMojoMediaApplication, base::Unretained(this)); | 398 base::Bind(&CreateMojoMediaApplication, base::Unretained(this)); |
| 400 app_info.application_task_runner = GetMediaTaskRunner(); | 399 app_info.application_task_runner = GetMediaTaskRunner(); |
| 401 apps->insert(std::make_pair("mojo:media", app_info)); | 400 apps->insert(std::make_pair("mojo:media", app_info)); |
| 402 #endif | 401 #endif |
| 403 } | 402 } |
| 404 | 403 |
| 405 #if defined(OS_ANDROID) | 404 #if defined(OS_ANDROID) |
| 406 | 405 |
| 407 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 406 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 408 const base::CommandLine& command_line, | 407 const base::CommandLine& command_line, |
| 409 int child_process_id, | 408 int child_process_id, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 process_type, dumps_path, false /* upload */); | 509 process_type, dumps_path, false /* upload */); |
| 511 // StartUploaderThread() even though upload is diferred. | 510 // StartUploaderThread() even though upload is diferred. |
| 512 // Breakpad-related memory is freed in the uploader thread. | 511 // Breakpad-related memory is freed in the uploader thread. |
| 513 crash_handler->StartUploaderThread(); | 512 crash_handler->StartUploaderThread(); |
| 514 return crash_handler; | 513 return crash_handler; |
| 515 } | 514 } |
| 516 #endif // !defined(OS_ANDROID) | 515 #endif // !defined(OS_ANDROID) |
| 517 | 516 |
| 518 } // namespace shell | 517 } // namespace shell |
| 519 } // namespace chromecast | 518 } // namespace chromecast |
| OLD | NEW |