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

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

Issue 228823003: Adding check for MIME types that do not take codecs parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 6 years, 8 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
« no previous file with comments | « content/browser/media/media_canplaytype_browsertest.cc ('k') | net/base/mime_util.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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 if (!IsSupportedKeySystemWithMediaMimeType( 425 if (!IsSupportedKeySystemWithMediaMimeType(
426 mime_type_ascii, strict_codecs, key_system_ascii)) { 426 mime_type_ascii, strict_codecs, key_system_ascii)) {
427 return IsNotSupported; 427 return IsNotSupported;
428 } 428 }
429 429
430 // Continue processing the mime_type and codecs. 430 // Continue processing the mime_type and codecs.
431 } 431 }
432 432
433 // Check list of strict codecs to see if it is supported. 433 // Check list of strict codecs to see if it is supported.
434 if (net::IsStrictMediaMimeType(mime_type_ascii)) { 434 if (net::IsStrictMediaMimeType(mime_type_ascii)) {
435 // Check if the codecs are a perfect match.
436 std::vector<std::string> strict_codecs;
437 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false);
438 if (net::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs))
Ryan Sleevi 2014/04/18 01:57:41 How does this work without you also requiring to c
amogh.bihani 2014/04/21 06:10:56 I'm sorry I missed this. I did test this code. The
439 return IsSupported;
440
435 // We support the container, but no codecs were specified. 441 // We support the container, but no codecs were specified.
436 if (codecs.isNull()) 442 if (codecs.isNull())
437 return MayBeSupported; 443 return MayBeSupported;
438 444
439 // Check if the codecs are a perfect match. 445 return IsNotSupported;
440 std::vector<std::string> strict_codecs;
441 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false);
442 if (!net::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs))
443 return IsNotSupported;
444
445 // Good to go!
446 return IsSupported;
447 } 446 }
448 447
449 // If we don't recognize the codec, it's possible we support it. 448 // If we don't recognize the codec, it's possible we support it.
450 std::vector<std::string> parsed_codecs; 449 std::vector<std::string> parsed_codecs;
451 net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true); 450 net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true);
452 if (!net::AreSupportedMediaCodecs(parsed_codecs)) 451 if (!net::AreSupportedMediaCodecs(parsed_codecs))
453 return MayBeSupported; 452 return MayBeSupported;
454 453
455 // Otherwise we have a perfect match. 454 // Otherwise we have a perfect match.
456 return IsSupported; 455 return IsSupported;
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 return; 1172 return;
1174 QuotaDispatcher::ThreadSpecificInstance( 1173 QuotaDispatcher::ThreadSpecificInstance(
1175 thread_safe_sender_.get(), 1174 thread_safe_sender_.get(),
1176 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1175 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1177 storage_partition, 1176 storage_partition,
1178 static_cast<quota::StorageType>(type), 1177 static_cast<quota::StorageType>(type),
1179 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1178 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1180 } 1179 }
1181 1180
1182 } // namespace content 1181 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/media_canplaytype_browsertest.cc ('k') | net/base/mime_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698