| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 450 |
| 451 //------------------------------------------------------------------------------ | 451 //------------------------------------------------------------------------------ |
| 452 | 452 |
| 453 WebMimeRegistry::SupportsType | 453 WebMimeRegistry::SupportsType |
| 454 RendererBlinkPlatformImpl::MimeRegistry::supportsMediaMIMEType( | 454 RendererBlinkPlatformImpl::MimeRegistry::supportsMediaMIMEType( |
| 455 const WebString& mime_type, | 455 const WebString& mime_type, |
| 456 const WebString& codecs, | 456 const WebString& codecs, |
| 457 const WebString& key_system) { | 457 const WebString& key_system) { |
| 458 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); | 458 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); |
| 459 | 459 |
| 460 if (!key_system.isEmpty()) { | 460 // TODO(ddorwin): Remove reference |key_system|. https://crbug.com/249976. |
| 461 // Check whether the key system is supported with the mime_type and codecs. | 461 DCHECK(key_system.isEmpty()); |
| 462 | |
| 463 // Chromium only supports ASCII parameters. | |
| 464 if (!base::IsStringASCII(key_system)) | |
| 465 return IsNotSupported; | |
| 466 | |
| 467 std::string key_system_ascii = | |
| 468 media::GetUnprefixedKeySystemName(base::UTF16ToASCII( | |
| 469 base::StringPiece16(key_system))); | |
| 470 std::vector<std::string> codec_vector; | |
| 471 media::ParseCodecString(ToASCIIOrEmpty(codecs), &codec_vector, true); | |
| 472 | |
| 473 if (!media::PrefixedIsSupportedKeySystemWithMediaMimeType( | |
| 474 mime_type_ascii, codec_vector, key_system_ascii)) { | |
| 475 return IsNotSupported; | |
| 476 } | |
| 477 | |
| 478 // Continue processing the mime_type and codecs. | |
| 479 } | |
| 480 | 462 |
| 481 std::vector<std::string> codec_vector; | 463 std::vector<std::string> codec_vector; |
| 482 media::ParseCodecString(ToASCIIOrEmpty(codecs), &codec_vector, false); | 464 media::ParseCodecString(ToASCIIOrEmpty(codecs), &codec_vector, false); |
| 483 return static_cast<WebMimeRegistry::SupportsType>( | 465 return static_cast<WebMimeRegistry::SupportsType>( |
| 484 media::IsSupportedMediaFormat(mime_type_ascii, codec_vector)); | 466 media::IsSupportedMediaFormat(mime_type_ascii, codec_vector)); |
| 485 } | 467 } |
| 486 | 468 |
| 487 bool RendererBlinkPlatformImpl::MimeRegistry::supportsMediaSourceMIMEType( | 469 bool RendererBlinkPlatformImpl::MimeRegistry::supportsMediaSourceMIMEType( |
| 488 const blink::WebString& mime_type, | 470 const blink::WebString& mime_type, |
| 489 const WebString& codecs) { | 471 const WebString& codecs) { |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 } | 1281 } |
| 1300 | 1282 |
| 1301 //------------------------------------------------------------------------------ | 1283 //------------------------------------------------------------------------------ |
| 1302 | 1284 |
| 1303 blink::WebTrialTokenValidator* | 1285 blink::WebTrialTokenValidator* |
| 1304 RendererBlinkPlatformImpl::trialTokenValidator() { | 1286 RendererBlinkPlatformImpl::trialTokenValidator() { |
| 1305 return &trial_token_validator_; | 1287 return &trial_token_validator_; |
| 1306 } | 1288 } |
| 1307 | 1289 |
| 1308 } // namespace content | 1290 } // namespace content |
| OLD | NEW |