Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: trunk/src/content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 198163004: Revert 257524 "Move IsStringASCII/UTF8 to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 const WebString& key_system) { 398 const WebString& key_system) {
399 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); 399 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type);
400 // Not supporting the container is a flat-out no. 400 // Not supporting the container is a flat-out no.
401 if (!net::IsSupportedMediaMimeType(mime_type_ascii)) 401 if (!net::IsSupportedMediaMimeType(mime_type_ascii))
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 (!base::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(base::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)) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 return media::StreamParserFactory::IsTypeSupported( 460 return media::StreamParserFactory::IsTypeSupported(
461 mime_type_ascii, parsed_codec_ids); 461 mime_type_ascii, parsed_codec_ids);
462 } 462 }
463 463
464 bool 464 bool
465 RendererWebKitPlatformSupportImpl::MimeRegistry::supportsEncryptedMediaMIMEType( 465 RendererWebKitPlatformSupportImpl::MimeRegistry::supportsEncryptedMediaMIMEType(
466 const WebString& key_system, 466 const WebString& key_system,
467 const WebString& mime_type, 467 const WebString& mime_type,
468 const WebString& codecs) { 468 const WebString& codecs) {
469 // Chromium only supports ASCII parameters. 469 // Chromium only supports ASCII parameters.
470 if (!base::IsStringASCII(key_system) || !base::IsStringASCII(mime_type) || 470 if (!IsStringASCII(key_system) || !IsStringASCII(mime_type) ||
471 !base::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 = base::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);
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 return; 1156 return;
1157 QuotaDispatcher::ThreadSpecificInstance( 1157 QuotaDispatcher::ThreadSpecificInstance(
1158 thread_safe_sender_.get(), 1158 thread_safe_sender_.get(),
1159 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1159 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1160 storage_partition, 1160 storage_partition,
1161 static_cast<quota::StorageType>(type), 1161 static_cast<quota::StorageType>(type),
1162 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1162 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1163 } 1163 }
1164 1164
1165 } // namespace content 1165 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/renderer/pepper/content_renderer_pepper_host_factory.cc ('k') | trunk/src/dbus/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698