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/logging.h" | 10 #include "base/logging.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
412 | 412 |
413 // Chromium only supports ASCII parameters. | 413 // Chromium only supports ASCII parameters. |
414 if (!base::IsStringASCII(key_system)) | 414 if (!base::IsStringASCII(key_system)) |
415 return IsNotSupported; | 415 return IsNotSupported; |
416 | 416 |
417 std::string key_system_ascii = | 417 std::string key_system_ascii = |
418 media::GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); | 418 media::GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); |
419 std::vector<std::string> strict_codecs; | 419 std::vector<std::string> strict_codecs; |
420 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true); | 420 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true); |
421 | 421 |
422 if (!media::IsSupportedKeySystemWithMediaMimeType( | 422 if (!media::PrefixedIsSupportedKeySystemWithMediaMimeType( |
423 mime_type_ascii, strict_codecs, key_system_ascii)) { | 423 mime_type_ascii, strict_codecs, key_system_ascii)) { |
424 return IsNotSupported; | 424 return IsNotSupported; |
425 } | 425 } |
426 | 426 |
427 // Continue processing the mime_type and codecs. | 427 // Continue processing the mime_type and codecs. |
428 } | 428 } |
429 | 429 |
430 // Check list of strict codecs to see if it is supported. | 430 // Check list of strict codecs to see if it is supported. |
431 if (net::IsStrictMediaMimeType(mime_type_ascii)) { | 431 if (net::IsStrictMediaMimeType(mime_type_ascii)) { |
432 // Check if the codecs are a perfect match. | 432 // Check if the codecs are a perfect match. |
(...skipping 22 matching lines...) Expand all Loading... | |
455 if (mime_type_ascii.empty()) | 455 if (mime_type_ascii.empty()) |
456 return false; | 456 return false; |
457 return media::StreamParserFactory::IsTypeSupported( | 457 return media::StreamParserFactory::IsTypeSupported( |
458 mime_type_ascii, parsed_codec_ids); | 458 mime_type_ascii, parsed_codec_ids); |
459 } | 459 } |
460 | 460 |
461 bool RendererBlinkPlatformImpl::MimeRegistry::supportsEncryptedMediaMIMEType( | 461 bool RendererBlinkPlatformImpl::MimeRegistry::supportsEncryptedMediaMIMEType( |
462 const WebString& key_system, | 462 const WebString& key_system, |
463 const WebString& mime_type, | 463 const WebString& mime_type, |
464 const WebString& codecs) { | 464 const WebString& codecs) { |
465 // TODO(jrummell): This method is only used by unprefixed EME, and should not | |
ddorwin
2015/02/05 00:51:23
This applies to the whole method (right?), so it s
jrummell
2015/02/05 01:04:20
Done.
| |
466 // be called when http://crbug.com/385874 is fixed. Remove this method once | |
467 // that happens. | |
468 | |
465 // Chromium only supports ASCII parameters. | 469 // Chromium only supports ASCII parameters. |
466 if (!base::IsStringASCII(key_system) || !base::IsStringASCII(mime_type) || | 470 if (!base::IsStringASCII(key_system) || !base::IsStringASCII(mime_type) || |
467 !base::IsStringASCII(codecs)) { | 471 !base::IsStringASCII(codecs)) { |
468 return false; | 472 return false; |
469 } | 473 } |
470 | 474 |
471 if (key_system.isEmpty()) | 475 if (key_system.isEmpty()) |
472 return false; | 476 return false; |
473 | 477 |
474 const std::string mime_type_ascii = base::UTF16ToASCII(mime_type); | 478 const std::string mime_type_ascii = base::UTF16ToASCII(mime_type); |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1224 //------------------------------------------------------------------------------ | 1228 //------------------------------------------------------------------------------ |
1225 | 1229 |
1226 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1230 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
1227 const blink::WebBatteryStatus& status) { | 1231 const blink::WebBatteryStatus& status) { |
1228 if (!g_test_battery_status_listener) | 1232 if (!g_test_battery_status_listener) |
1229 return; | 1233 return; |
1230 g_test_battery_status_listener->updateBatteryStatus(status); | 1234 g_test_battery_status_listener->updateBatteryStatus(status); |
1231 } | 1235 } |
1232 | 1236 |
1233 } // namespace content | 1237 } // namespace content |
OLD | NEW |