| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 return IsNotSupported; | 402 return IsNotSupported; |
| 403 | 403 |
| 404 if (!key_system.isEmpty()) { | 404 if (!key_system.isEmpty()) { |
| 405 // Check whether the key system is supported with the mime_type and codecs. | 405 // Check whether the key system is supported with the mime_type and codecs. |
| 406 | 406 |
| 407 // Chromium only supports ASCII parameters. | 407 // Chromium only supports ASCII parameters. |
| 408 if (!IsStringASCII(key_system)) | 408 if (!IsStringASCII(key_system)) |
| 409 return IsNotSupported; | 409 return IsNotSupported; |
| 410 | 410 |
| 411 std::string key_system_ascii = | 411 std::string key_system_ascii = |
| 412 GetUnprefixedKeySystemName(UTF16ToASCII(key_system)); | 412 GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); |
| 413 std::vector<std::string> strict_codecs; | 413 std::vector<std::string> strict_codecs; |
| 414 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); | 414 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); |
| 415 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix); | 415 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix); |
| 416 | 416 |
| 417 if (!IsSupportedKeySystemWithMediaMimeType( | 417 if (!IsSupportedKeySystemWithMediaMimeType( |
| 418 mime_type_ascii, strict_codecs, key_system_ascii)) { | 418 mime_type_ascii, strict_codecs, key_system_ascii)) { |
| 419 return IsNotSupported; | 419 return IsNotSupported; |
| 420 } | 420 } |
| 421 | 421 |
| 422 // Continue processing the mime_type and codecs. | 422 // Continue processing the mime_type and codecs. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 const WebString& codecs) { | 468 const WebString& codecs) { |
| 469 // Chromium only supports ASCII parameters. | 469 // Chromium only supports ASCII parameters. |
| 470 if (!IsStringASCII(key_system) || !IsStringASCII(mime_type) || | 470 if (!IsStringASCII(key_system) || !IsStringASCII(mime_type) || |
| 471 !IsStringASCII(codecs)) { | 471 !IsStringASCII(codecs)) { |
| 472 return false; | 472 return false; |
| 473 } | 473 } |
| 474 | 474 |
| 475 if (key_system.isEmpty()) | 475 if (key_system.isEmpty()) |
| 476 return false; | 476 return false; |
| 477 | 477 |
| 478 const std::string mime_type_ascii = UTF16ToASCII(mime_type); | 478 const std::string mime_type_ascii = base::UTF16ToASCII(mime_type); |
| 479 | 479 |
| 480 std::vector<std::string> codec_vector; | 480 std::vector<std::string> codec_vector; |
| 481 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); | 481 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); |
| 482 net::ParseCodecString(UTF16ToASCII(codecs), &codec_vector, strip_suffix); | 482 net::ParseCodecString(base::UTF16ToASCII(codecs), &codec_vector, |
| 483 strip_suffix); |
| 483 | 484 |
| 484 return IsSupportedKeySystemWithMediaMimeType( | 485 return IsSupportedKeySystemWithMediaMimeType( |
| 485 mime_type_ascii, codec_vector, UTF16ToASCII(key_system)); | 486 mime_type_ascii, codec_vector, base::UTF16ToASCII(key_system)); |
| 486 } | 487 } |
| 487 | 488 |
| 488 WebString | 489 WebString |
| 489 RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeForExtension( | 490 RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeForExtension( |
| 490 const WebString& file_extension) { | 491 const WebString& file_extension) { |
| 491 if (IsPluginProcess()) | 492 if (IsPluginProcess()) |
| 492 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); | 493 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); |
| 493 | 494 |
| 494 // The sandbox restricts our access to the registry, so we need to proxy | 495 // The sandbox restricts our access to the registry, so we need to proxy |
| 495 // these calls over to the browser process. | 496 // these calls over to the browser process. |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 return; | 1156 return; |
| 1156 QuotaDispatcher::ThreadSpecificInstance( | 1157 QuotaDispatcher::ThreadSpecificInstance( |
| 1157 thread_safe_sender_.get(), | 1158 thread_safe_sender_.get(), |
| 1158 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1159 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
| 1159 storage_partition, | 1160 storage_partition, |
| 1160 static_cast<quota::StorageType>(type), | 1161 static_cast<quota::StorageType>(type), |
| 1161 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1162 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 1162 } | 1163 } |
| 1163 | 1164 |
| 1164 } // namespace content | 1165 } // namespace content |
| OLD | NEW |