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

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

Issue 270183002: Move IsStringUTF8/ASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more minor nit Created 6 years, 7 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
« no previous file with comments | « content/renderer/pepper/content_renderer_pepper_host_factory.cc ('k') | dbus/message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/pepper/content_renderer_pepper_host_factory.cc ('k') | dbus/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698