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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #if !defined(OS_ANDROID) | 83 #if !defined(OS_ANDROID) |
84 scoped_ptr<::media::AudioManagerFactory> | 84 scoped_ptr<::media::AudioManagerFactory> |
85 CastContentBrowserClient::CreateAudioManagerFactory() { | 85 CastContentBrowserClient::CreateAudioManagerFactory() { |
86 return make_scoped_ptr(new media::CastAudioManagerFactory()); | 86 return make_scoped_ptr(new media::CastAudioManagerFactory()); |
87 } | 87 } |
88 | 88 |
89 scoped_refptr<media::CmaMediaPipelineClient> | 89 scoped_refptr<media::CmaMediaPipelineClient> |
90 CastContentBrowserClient::CreateCmaMediaPipelineClient() { | 90 CastContentBrowserClient::CreateCmaMediaPipelineClient() { |
91 return make_scoped_refptr(new media::CmaMediaPipelineClient()); | 91 return make_scoped_refptr(new media::CmaMediaPipelineClient()); |
92 } | 92 } |
93 | |
94 scoped_ptr<::media::BrowserCdmFactory> | |
95 CastContentBrowserClient::CreateBrowserCdmFactory() { | |
96 return make_scoped_ptr(new media::CastBrowserCdmFactory()); | |
97 } | |
98 #endif // OS_ANDROID | 93 #endif // OS_ANDROID |
99 | 94 |
100 void CastContentBrowserClient::ProcessExiting() { | 95 void CastContentBrowserClient::ProcessExiting() { |
101 // Finalize CastMediaShlib on media thread to ensure it's not accessed | 96 // Finalize CastMediaShlib on media thread to ensure it's not accessed |
102 // after Finalize. | 97 // after Finalize. |
103 media::MediaMessageLoop::GetTaskRunner()->PostTask( | 98 media::MediaMessageLoop::GetTaskRunner()->PostTask( |
104 FROM_HERE, base::Bind(&media::CastMediaShlib::Finalize)); | 99 FROM_HERE, base::Bind(&media::CastMediaShlib::Finalize)); |
105 } | 100 } |
106 | 101 |
107 void CastContentBrowserClient::SetMetricsClientId( | 102 void CastContentBrowserClient::SetMetricsClientId( |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 352 |
358 void CastContentBrowserClient::RegisterUnsandboxedOutOfProcessMojoApplications( | 353 void CastContentBrowserClient::RegisterUnsandboxedOutOfProcessMojoApplications( |
359 std::map<GURL, base::string16>* apps) { | 354 std::map<GURL, base::string16>* apps) { |
360 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) | 355 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) |
361 apps->insert(std::make_pair(GURL("mojo:media"), | 356 apps->insert(std::make_pair(GURL("mojo:media"), |
362 base::ASCIIToUTF16("Media App"))); | 357 base::ASCIIToUTF16("Media App"))); |
363 #endif | 358 #endif |
364 } | 359 } |
365 | 360 |
366 #if defined(OS_ANDROID) | 361 #if defined(OS_ANDROID) |
| 362 |
367 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 363 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
368 const base::CommandLine& command_line, | 364 const base::CommandLine& command_line, |
369 int child_process_id, | 365 int child_process_id, |
370 content::FileDescriptorInfo* mappings, | 366 content::FileDescriptorInfo* mappings, |
371 std::map<int, base::MemoryMappedFile::Region>* regions) { | 367 std::map<int, base::MemoryMappedFile::Region>* regions) { |
372 mappings->Share( | 368 mappings->Share( |
373 kAndroidPakDescriptor, | 369 kAndroidPakDescriptor, |
374 base::GlobalDescriptors::GetInstance()->Get(kAndroidPakDescriptor)); | 370 base::GlobalDescriptors::GetInstance()->Get(kAndroidPakDescriptor)); |
375 regions->insert(std::make_pair( | 371 regions->insert(std::make_pair( |
376 kAndroidPakDescriptor, base::GlobalDescriptors::GetInstance()->GetRegion( | 372 kAndroidPakDescriptor, base::GlobalDescriptors::GetInstance()->GetRegion( |
377 kAndroidPakDescriptor))); | 373 kAndroidPakDescriptor))); |
378 | 374 |
379 if (breakpad::IsCrashReporterEnabled()) { | 375 if (breakpad::IsCrashReporterEnabled()) { |
380 base::File minidump_file( | 376 base::File minidump_file( |
381 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( | 377 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( |
382 child_process_id)); | 378 child_process_id)); |
383 if (!minidump_file.IsValid()) { | 379 if (!minidump_file.IsValid()) { |
384 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | 380 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " |
385 << "be disabled for this process."; | 381 << "be disabled for this process."; |
386 } else { | 382 } else { |
387 mappings->Transfer(kAndroidMinidumpDescriptor, | 383 mappings->Transfer(kAndroidMinidumpDescriptor, |
388 base::ScopedFD(minidump_file.TakePlatformFile())); | 384 base::ScopedFD(minidump_file.TakePlatformFile())); |
389 } | 385 } |
390 } | 386 } |
391 } | 387 } |
| 388 |
392 #else | 389 #else |
| 390 |
| 391 scoped_ptr<::media::CdmFactory> CastContentBrowserClient::CreateCdmFactory() { |
| 392 return make_scoped_ptr(new media::CastBrowserCdmFactory()); |
| 393 } |
| 394 |
393 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 395 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
394 const base::CommandLine& command_line, | 396 const base::CommandLine& command_line, |
395 int child_process_id, | 397 int child_process_id, |
396 content::FileDescriptorInfo* mappings) { | 398 content::FileDescriptorInfo* mappings) { |
397 int crash_signal_fd = GetCrashSignalFD(command_line); | 399 int crash_signal_fd = GetCrashSignalFD(command_line); |
398 if (crash_signal_fd >= 0) { | 400 if (crash_signal_fd >= 0) { |
399 mappings->Share(kCrashDumpSignal, crash_signal_fd); | 401 mappings->Share(kCrashDumpSignal, crash_signal_fd); |
400 } | 402 } |
401 } | 403 } |
| 404 |
402 #endif // defined(OS_ANDROID) | 405 #endif // defined(OS_ANDROID) |
403 | 406 |
404 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) | 407 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) |
405 content::ExternalVideoSurfaceContainer* | 408 content::ExternalVideoSurfaceContainer* |
406 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 409 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
407 content::WebContents* web_contents) { | 410 content::WebContents* web_contents) { |
408 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( | 411 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( |
409 web_contents); | 412 web_contents); |
410 } | 413 } |
411 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) | 414 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 process_type, dumps_path, false /* upload */); | 447 process_type, dumps_path, false /* upload */); |
445 // StartUploaderThread() even though upload is diferred. | 448 // StartUploaderThread() even though upload is diferred. |
446 // Breakpad-related memory is freed in the uploader thread. | 449 // Breakpad-related memory is freed in the uploader thread. |
447 crash_handler->StartUploaderThread(); | 450 crash_handler->StartUploaderThread(); |
448 return crash_handler; | 451 return crash_handler; |
449 } | 452 } |
450 #endif // !defined(OS_ANDROID) | 453 #endif // !defined(OS_ANDROID) |
451 | 454 |
452 } // namespace shell | 455 } // namespace shell |
453 } // namespace chromecast | 456 } // namespace chromecast |
OLD | NEW |