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

Side by Side Diff: net/base/mime_util.cc

Issue 218303002: Fix: canPlayType() gives false positive for */ogg and audio/x-wav (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_unittest.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 <algorithm> 5 #include <algorithm>
6 #include <iterator> 6 #include <iterator>
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 #endif 427 #endif
428 428
429 struct MediaFormatStrict { 429 struct MediaFormatStrict {
430 const char* mime_type; 430 const char* mime_type;
431 const char* codecs_list; 431 const char* codecs_list;
432 }; 432 };
433 433
434 static const MediaFormatStrict format_codec_mappings[] = { 434 static const MediaFormatStrict format_codec_mappings[] = {
435 { "video/webm", "opus,vorbis,vp8,vp8.0,vp9,vp9.0" }, 435 { "video/webm", "opus,vorbis,vp8,vp8.0,vp9,vp9.0" },
436 { "audio/webm", "opus,vorbis" }, 436 { "audio/webm", "opus,vorbis" },
437 { "audio/wav", "1" } 437 { "audio/wav", "1" },
438 { "audio/x-wav", "1" },
439 { "video/ogg", "opus,theora,vorbis" },
440 { "audio/ogg", "opus,vorbis" },
441 { "application/ogg", "opus,theora,vorbis" }
438 }; 442 };
439 443
440 MimeUtil::MimeUtil() { 444 MimeUtil::MimeUtil() {
441 InitializeMimeTypeMaps(); 445 InitializeMimeTypeMaps();
442 } 446 }
443 447
444 // static 448 // static
445 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs, 449 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs,
446 const std::vector<std::string>& codecs) { 450 const std::vector<std::string>& codecs) {
447 for (size_t i = 0; i < codecs.size(); ++i) { 451 for (size_t i = 0; i < codecs.size(); ++i) {
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 post_data->append("\r\n" + value + "\r\n"); 1028 post_data->append("\r\n" + value + "\r\n");
1025 } 1029 }
1026 1030
1027 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, 1031 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary,
1028 std::string* post_data) { 1032 std::string* post_data) {
1029 DCHECK(post_data); 1033 DCHECK(post_data);
1030 post_data->append("--" + mime_boundary + "--\r\n"); 1034 post_data->append("--" + mime_boundary + "--\r\n");
1031 } 1035 }
1032 1036
1033 } // namespace net 1037 } // namespace net
OLDNEW
« no previous file with comments | « content/browser/media/media_canplaytype_browsertest.cc ('k') | net/base/mime_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698