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_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_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/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
418 if (!key_system.isEmpty()) { | 418 if (!key_system.isEmpty()) { |
419 // Check whether the key system is supported with the mime_type and codecs. | 419 // Check whether the key system is supported with the mime_type and codecs. |
420 | 420 |
421 // Chromium only supports ASCII parameters. | 421 // Chromium only supports ASCII parameters. |
422 if (!base::IsStringASCII(key_system)) | 422 if (!base::IsStringASCII(key_system)) |
423 return IsNotSupported; | 423 return IsNotSupported; |
424 | 424 |
425 std::string key_system_ascii = | 425 std::string key_system_ascii = |
426 GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); | 426 GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); |
427 std::vector<std::string> strict_codecs; | 427 std::vector<std::string> strict_codecs; |
428 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); | 428 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true); |
429 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix); | |
430 | 429 |
431 if (!IsSupportedKeySystemWithMediaMimeType( | 430 if (!IsSupportedKeySystemWithMediaMimeType( |
432 mime_type_ascii, strict_codecs, key_system_ascii)) { | 431 mime_type_ascii, strict_codecs, key_system_ascii)) { |
433 return IsNotSupported; | 432 return IsNotSupported; |
434 } | 433 } |
435 | 434 |
436 // Continue processing the mime_type and codecs. | 435 // Continue processing the mime_type and codecs. |
437 } | 436 } |
438 | 437 |
439 // Check list of strict codecs to see if it is supported. | 438 // Check list of strict codecs to see if it is supported. |
440 if (net::IsStrictMediaMimeType(mime_type_ascii)) { | 439 if (net::IsStrictMediaMimeType(mime_type_ascii)) { |
441 // Check if the codecs are a perfect match. | 440 // Check if the codecs are a perfect match. |
442 std::vector<std::string> strict_codecs; | 441 std::vector<std::string> strict_codecs; |
443 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false); | 442 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false); |
444 if (net::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs)) | 443 return static_cast<WebMimeRegistry::SupportsType> ( |
acolwell GONE FROM CHROMIUM
2014/06/02 21:22:42
You should add COMPILE_ASSERTS to content/public/c
amogh.bihani
2014/06/03 13:26:12
Done.
| |
445 return IsSupported; | 444 net::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs)); |
446 | |
447 // We support the container, but no codecs were specified. | |
448 if (codecs.isNull()) | |
449 return MayBeSupported; | |
450 | |
451 return IsNotSupported; | |
452 } | 445 } |
453 | 446 |
454 // If we don't recognize the codec, it's possible we support it. | 447 // If we don't recognize the codec, it's possible we support it. |
455 std::vector<std::string> parsed_codecs; | 448 std::vector<std::string> parsed_codecs; |
456 net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true); | 449 net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true); |
457 if (!net::AreSupportedMediaCodecs(parsed_codecs)) | 450 if (!net::AreSupportedMediaCodecs(parsed_codecs)) |
458 return MayBeSupported; | 451 return MayBeSupported; |
459 | 452 |
460 // Otherwise we have a perfect match. | 453 // Otherwise we have a perfect match. |
461 return IsSupported; | 454 return IsSupported; |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1200 void RendererWebKitPlatformSupportImpl::setBatteryStatusListener( | 1193 void RendererWebKitPlatformSupportImpl::setBatteryStatusListener( |
1201 blink::WebBatteryStatusListener* listener) { | 1194 blink::WebBatteryStatusListener* listener) { |
1202 if (!battery_status_dispatcher_) { | 1195 if (!battery_status_dispatcher_) { |
1203 battery_status_dispatcher_.reset( | 1196 battery_status_dispatcher_.reset( |
1204 new BatteryStatusDispatcher(RenderThreadImpl::current())); | 1197 new BatteryStatusDispatcher(RenderThreadImpl::current())); |
1205 } | 1198 } |
1206 battery_status_dispatcher_->SetListener(listener); | 1199 battery_status_dispatcher_->SetListener(listener); |
1207 } | 1200 } |
1208 | 1201 |
1209 } // namespace content | 1202 } // namespace content |
OLD | NEW |