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

Side by Side Diff: chromecast/browser/cast_content_browser_client.cc

Issue 1408793009: media: Remove BrowserCdmFactory inferface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment for DEPS change. Created 5 years, 1 month 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/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
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
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 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
393 switches::kEnableCmaMediaPipeline)) {
394 return make_scoped_ptr(new media::CastBrowserCdmFactory());
395 }
396
397 return nullptr;
398 }
399
393 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 400 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
394 const base::CommandLine& command_line, 401 const base::CommandLine& command_line,
395 int child_process_id, 402 int child_process_id,
396 content::FileDescriptorInfo* mappings) { 403 content::FileDescriptorInfo* mappings) {
397 int crash_signal_fd = GetCrashSignalFD(command_line); 404 int crash_signal_fd = GetCrashSignalFD(command_line);
398 if (crash_signal_fd >= 0) { 405 if (crash_signal_fd >= 0) {
399 mappings->Share(kCrashDumpSignal, crash_signal_fd); 406 mappings->Share(kCrashDumpSignal, crash_signal_fd);
400 } 407 }
401 } 408 }
409
402 #endif // defined(OS_ANDROID) 410 #endif // defined(OS_ANDROID)
403 411
404 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) 412 #if defined(OS_ANDROID) && defined(VIDEO_HOLE)
405 content::ExternalVideoSurfaceContainer* 413 content::ExternalVideoSurfaceContainer*
406 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( 414 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
407 content::WebContents* web_contents) { 415 content::WebContents* web_contents) {
408 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( 416 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create(
409 web_contents); 417 web_contents);
410 } 418 }
411 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) 419 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 process_type, dumps_path, false /* upload */); 452 process_type, dumps_path, false /* upload */);
445 // StartUploaderThread() even though upload is diferred. 453 // StartUploaderThread() even though upload is diferred.
446 // Breakpad-related memory is freed in the uploader thread. 454 // Breakpad-related memory is freed in the uploader thread.
447 crash_handler->StartUploaderThread(); 455 crash_handler->StartUploaderThread();
448 return crash_handler; 456 return crash_handler;
449 } 457 }
450 #endif // !defined(OS_ANDROID) 458 #endif // !defined(OS_ANDROID)
451 459
452 } // namespace shell 460 } // namespace shell
453 } // namespace chromecast 461 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_content_browser_client.h ('k') | chromecast/browser/media/cast_browser_cdm_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698