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 "content/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 return IsNotSupported; | 419 return IsNotSupported; |
420 | 420 |
421 if (!key_system.isEmpty()) { | 421 if (!key_system.isEmpty()) { |
422 // Check whether the key system is supported with the mime_type and codecs. | 422 // Check whether the key system is supported with the mime_type and codecs. |
423 | 423 |
424 // Chromium only supports ASCII parameters. | 424 // Chromium only supports ASCII parameters. |
425 if (!base::IsStringASCII(key_system)) | 425 if (!base::IsStringASCII(key_system)) |
426 return IsNotSupported; | 426 return IsNotSupported; |
427 | 427 |
428 std::string key_system_ascii = | 428 std::string key_system_ascii = |
429 media::GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); | 429 media::GetUnprefixedKeySystemName(base::UTF16ToASCII( |
| 430 base::StringPiece16(key_system))); |
430 std::vector<std::string> strict_codecs; | 431 std::vector<std::string> strict_codecs; |
431 media::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true); | 432 media::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true); |
432 | 433 |
433 if (!media::PrefixedIsSupportedKeySystemWithMediaMimeType( | 434 if (!media::PrefixedIsSupportedKeySystemWithMediaMimeType( |
434 mime_type_ascii, strict_codecs, key_system_ascii)) { | 435 mime_type_ascii, strict_codecs, key_system_ascii)) { |
435 return IsNotSupported; | 436 return IsNotSupported; |
436 } | 437 } |
437 | 438 |
438 // Continue processing the mime_type and codecs. | 439 // Continue processing the mime_type and codecs. |
439 } | 440 } |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 break; | 715 break; |
715 case 8: | 716 case 8: |
716 layout = media::CHANNEL_LAYOUT_7_1; | 717 layout = media::CHANNEL_LAYOUT_7_1; |
717 break; | 718 break; |
718 default: | 719 default: |
719 layout = media::CHANNEL_LAYOUT_STEREO; | 720 layout = media::CHANNEL_LAYOUT_STEREO; |
720 } | 721 } |
721 | 722 |
722 int session_id = 0; | 723 int session_id = 0; |
723 if (input_device_id.isNull() || | 724 if (input_device_id.isNull() || |
724 !base::StringToInt(base::UTF16ToUTF8(input_device_id), &session_id)) { | 725 !base::StringToInt(base::UTF16ToUTF8( |
| 726 base::StringPiece16(input_device_id)), &session_id)) { |
725 if (input_channels > 0) | 727 if (input_channels > 0) |
726 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; | 728 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; |
727 | 729 |
728 input_channels = 0; | 730 input_channels = 0; |
729 } | 731 } |
730 | 732 |
731 media::AudioParameters params( | 733 media::AudioParameters params( |
732 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 734 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
733 layout, static_cast<int>(sample_rate), 16, buffer_size, | 735 layout, static_cast<int>(sample_rate), 16, buffer_size, |
734 media::AudioParameters::NO_EFFECTS); | 736 media::AudioParameters::NO_EFFECTS); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 //------------------------------------------------------------------------------ | 1239 //------------------------------------------------------------------------------ |
1238 | 1240 |
1239 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1241 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
1240 const blink::WebBatteryStatus& status) { | 1242 const blink::WebBatteryStatus& status) { |
1241 if (!g_test_battery_status_listener) | 1243 if (!g_test_battery_status_listener) |
1242 return; | 1244 return; |
1243 g_test_battery_status_listener->updateBatteryStatus(status); | 1245 g_test_battery_status_listener->updateBatteryStatus(status); |
1244 } | 1246 } |
1245 | 1247 |
1246 } // namespace content | 1248 } // namespace content |
OLD | NEW |