| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 using extensions::ChromeContentBrowserClientExtensionsPart; | 374 using extensions::ChromeContentBrowserClientExtensionsPart; |
| 375 using extensions::Extension; | 375 using extensions::Extension; |
| 376 using extensions::InfoMap; | 376 using extensions::InfoMap; |
| 377 using extensions::Manifest; | 377 using extensions::Manifest; |
| 378 #endif | 378 #endif |
| 379 | 379 |
| 380 #if defined(ENABLE_PLUGINS) | 380 #if defined(ENABLE_PLUGINS) |
| 381 using plugins::ChromeContentBrowserClientPluginsPart; | 381 using plugins::ChromeContentBrowserClientPluginsPart; |
| 382 #endif | 382 #endif |
| 383 | 383 |
| 384 #include "media/filters/ffmpeg_video_decoder.h" |
| 385 #include "media/mojo/interfaces/video_decoder.mojom.h" |
| 386 #include "media/mojo/services/mojo_media_client.h" |
| 387 #include "media/mojo/services/mojo_video_decoder_service.h" |
| 388 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 389 |
| 384 namespace { | 390 namespace { |
| 385 | 391 |
| 392 /////////////// DEBUG ////////////////////////////////////////////////////////// |
| 393 // This MojoMediaClient is only good for one thing: creating FFmpegVideoDecoders |
| 394 class FFmpegMojoMediaClient : public media::MojoMediaClient { |
| 395 public: |
| 396 FFmpegMojoMediaClient() {} |
| 397 ~FFmpegMojoMediaClient() override {} |
| 398 |
| 399 // media::MojoMediaClient implementation: |
| 400 std::unique_ptr<media::VideoDecoder> CreateVideoDecoder( |
| 401 scoped_refptr<base::SingleThreadTaskRunner> task_runner) override { |
| 402 return base::MakeUnique<media::FFmpegVideoDecoder>(); |
| 403 } |
| 404 |
| 405 private: |
| 406 DISALLOW_COPY_AND_ASSIGN(FFmpegMojoMediaClient); |
| 407 }; |
| 408 |
| 409 static void CreateVideoDecoder(media::mojom::VideoDecoderRequest request) { |
| 410 // Note(slan): Just leak the client for now. |
| 411 mojo::MakeStrongBinding<::media::mojom::VideoDecoder>( |
| 412 base::MakeUnique<::media::MojoVideoDecoderService>( |
| 413 new FFmpegMojoMediaClient()), |
| 414 std::move(request)); |
| 415 } |
| 416 /////////////// DEBUG ////////////////////////////////////////////////////////// |
| 417 |
| 386 // Cached version of the locale so we can return the locale on the I/O | 418 // Cached version of the locale so we can return the locale on the I/O |
| 387 // thread. | 419 // thread. |
| 388 base::LazyInstance<std::string> g_io_thread_application_locale; | 420 base::LazyInstance<std::string> g_io_thread_application_locale; |
| 389 | 421 |
| 390 #if defined(ENABLE_PLUGINS) | 422 #if defined(ENABLE_PLUGINS) |
| 391 // TODO(teravest): Add renderer-side API-specific checking for these APIs so | 423 // TODO(teravest): Add renderer-side API-specific checking for these APIs so |
| 392 // that blanket permission isn't granted to all dev channel APIs for these. | 424 // that blanket permission isn't granted to all dev channel APIs for these. |
| 393 // http://crbug.com/386743 | 425 // http://crbug.com/386743 |
| 394 const char* const kPredefinedAllowedDevChannelOrigins[] = { | 426 const char* const kPredefinedAllowedDevChannelOrigins[] = { |
| 395 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see crbug.com/383937 | 427 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see crbug.com/383937 |
| (...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2931 content::RenderProcessHost* render_process_host) { | 2963 content::RenderProcessHost* render_process_host) { |
| 2932 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = | 2964 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = |
| 2933 content::BrowserThread::GetTaskRunnerForThread( | 2965 content::BrowserThread::GetTaskRunnerForThread( |
| 2934 content::BrowserThread::UI); | 2966 content::BrowserThread::UI); |
| 2935 registry->AddInterface( | 2967 registry->AddInterface( |
| 2936 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), | 2968 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), |
| 2937 ui_task_runner); | 2969 ui_task_runner); |
| 2938 registry->AddInterface( | 2970 registry->AddInterface( |
| 2939 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), | 2971 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), |
| 2940 ui_task_runner); | 2972 ui_task_runner); |
| 2973 registry->AddInterface(base::Bind(&CreateVideoDecoder)); |
| 2941 | 2974 |
| 2942 #if defined(OS_CHROMEOS) | 2975 #if defined(OS_CHROMEOS) |
| 2943 registry->AddInterface<metrics::mojom::LeakDetector>( | 2976 registry->AddInterface<metrics::mojom::LeakDetector>( |
| 2944 base::Bind(&metrics::LeakDetectorRemoteController::Create), | 2977 base::Bind(&metrics::LeakDetectorRemoteController::Create), |
| 2945 ui_task_runner); | 2978 ui_task_runner); |
| 2946 #endif | 2979 #endif |
| 2947 } | 2980 } |
| 2948 | 2981 |
| 2949 void ChromeContentBrowserClient::ExposeInterfacesToMediaService( | 2982 void ChromeContentBrowserClient::ExposeInterfacesToMediaService( |
| 2950 shell::InterfaceRegistry* registry, | 2983 shell::InterfaceRegistry* registry, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3277 if (channel <= kMaxDisableEncryptionChannel) { | 3310 if (channel <= kMaxDisableEncryptionChannel) { |
| 3278 static const char* const kWebRtcDevSwitchNames[] = { | 3311 static const char* const kWebRtcDevSwitchNames[] = { |
| 3279 switches::kDisableWebRtcEncryption, | 3312 switches::kDisableWebRtcEncryption, |
| 3280 }; | 3313 }; |
| 3281 to_command_line->CopySwitchesFrom(from_command_line, | 3314 to_command_line->CopySwitchesFrom(from_command_line, |
| 3282 kWebRtcDevSwitchNames, | 3315 kWebRtcDevSwitchNames, |
| 3283 arraysize(kWebRtcDevSwitchNames)); | 3316 arraysize(kWebRtcDevSwitchNames)); |
| 3284 } | 3317 } |
| 3285 } | 3318 } |
| 3286 #endif // defined(ENABLE_WEBRTC) | 3319 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |