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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 const WebString& key_system) { | 406 const WebString& key_system) { |
407 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); | 407 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); |
408 // Not supporting the container is a flat-out no. | 408 // Not supporting the container is a flat-out no. |
409 if (!net::IsSupportedMediaMimeType(mime_type_ascii)) | 409 if (!net::IsSupportedMediaMimeType(mime_type_ascii)) |
410 return IsNotSupported; | 410 return IsNotSupported; |
411 | 411 |
412 if (!key_system.isEmpty()) { | 412 if (!key_system.isEmpty()) { |
413 // Check whether the key system is supported with the mime_type and codecs. | 413 // Check whether the key system is supported with the mime_type and codecs. |
414 | 414 |
415 // Chromium only supports ASCII parameters. | 415 // Chromium only supports ASCII parameters. |
416 if (!IsStringASCII(key_system)) | 416 if (!base::IsStringASCII(key_system)) |
417 return IsNotSupported; | 417 return IsNotSupported; |
418 | 418 |
419 std::string key_system_ascii = | 419 std::string key_system_ascii = |
420 GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); | 420 GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); |
421 std::vector<std::string> strict_codecs; | 421 std::vector<std::string> strict_codecs; |
422 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); | 422 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); |
423 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix); | 423 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix); |
424 | 424 |
425 if (!IsSupportedKeySystemWithMediaMimeType( | 425 if (!IsSupportedKeySystemWithMediaMimeType( |
426 mime_type_ascii, strict_codecs, key_system_ascii)) { | 426 mime_type_ascii, strict_codecs, key_system_ascii)) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 return media::StreamParserFactory::IsTypeSupported( | 467 return media::StreamParserFactory::IsTypeSupported( |
468 mime_type_ascii, parsed_codec_ids); | 468 mime_type_ascii, parsed_codec_ids); |
469 } | 469 } |
470 | 470 |
471 bool | 471 bool |
472 RendererWebKitPlatformSupportImpl::MimeRegistry::supportsEncryptedMediaMIMEType( | 472 RendererWebKitPlatformSupportImpl::MimeRegistry::supportsEncryptedMediaMIMEType( |
473 const WebString& key_system, | 473 const WebString& key_system, |
474 const WebString& mime_type, | 474 const WebString& mime_type, |
475 const WebString& codecs) { | 475 const WebString& codecs) { |
476 // Chromium only supports ASCII parameters. | 476 // Chromium only supports ASCII parameters. |
477 if (!IsStringASCII(key_system) || !IsStringASCII(mime_type) || | 477 if (!base::IsStringASCII(key_system) || !base::IsStringASCII(mime_type) || |
478 !IsStringASCII(codecs)) { | 478 !base::IsStringASCII(codecs)) { |
479 return false; | 479 return false; |
480 } | 480 } |
481 | 481 |
482 if (key_system.isEmpty()) | 482 if (key_system.isEmpty()) |
483 return false; | 483 return false; |
484 | 484 |
485 const std::string mime_type_ascii = base::UTF16ToASCII(mime_type); | 485 const std::string mime_type_ascii = base::UTF16ToASCII(mime_type); |
486 | 486 |
487 std::vector<std::string> codec_vector; | 487 std::vector<std::string> codec_vector; |
488 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); | 488 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 return; | 1173 return; |
1174 QuotaDispatcher::ThreadSpecificInstance( | 1174 QuotaDispatcher::ThreadSpecificInstance( |
1175 thread_safe_sender_.get(), | 1175 thread_safe_sender_.get(), |
1176 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1176 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
1177 storage_partition, | 1177 storage_partition, |
1178 static_cast<quota::StorageType>(type), | 1178 static_cast<quota::StorageType>(type), |
1179 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1179 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
1180 } | 1180 } |
1181 | 1181 |
1182 } // namespace content | 1182 } // namespace content |
OLD | NEW |