OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "net/base/mime_util.h" | 7 #include "net/base/mime_util.h" |
8 #include "net/base/platform_mime_util.h" | 8 #include "net/base/platform_mime_util.h" |
9 | 9 |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 "text/vnd.chromium.ftp-dir", | 232 "text/vnd.chromium.ftp-dir", |
233 "text/", | 233 "text/", |
234 "image/svg+xml", // SVG is text-based XML, even though it has an image/ type | 234 "image/svg+xml", // SVG is text-based XML, even though it has an image/ type |
235 "application/xml", | 235 "application/xml", |
236 "application/xhtml+xml", | 236 "application/xhtml+xml", |
237 "application/rss+xml", | 237 "application/rss+xml", |
238 "application/atom+xml", | 238 "application/atom+xml", |
239 "application/json", | 239 "application/json", |
240 "application/x-x509-user-cert", | 240 "application/x-x509-user-cert", |
241 "multipart/x-mixed-replace" | 241 "multipart/x-mixed-replace" |
| 242 // Note: ADDING a new type here will probably render it AS HTML. This can |
| 243 // result in cross site scripting. |
242 }; | 244 }; |
| 245 COMPILE_ASSERT(arraysize(supported_non_image_types) == 16, |
| 246 supported_non_images_types_must_equal_16); |
243 | 247 |
244 // Mozilla 1.8 and WinIE 7 both accept text/javascript and text/ecmascript. | 248 // Mozilla 1.8 and WinIE 7 both accept text/javascript and text/ecmascript. |
245 // Mozilla 1.8 accepts application/javascript, application/ecmascript, and | 249 // Mozilla 1.8 accepts application/javascript, application/ecmascript, and |
246 // application/x-javascript, but WinIE 7 doesn't. | 250 // application/x-javascript, but WinIE 7 doesn't. |
247 // WinIE 7 accepts text/javascript1.1 - text/javascript1.3, text/jscript, and | 251 // WinIE 7 accepts text/javascript1.1 - text/javascript1.3, text/jscript, and |
248 // text/livescript, but Mozilla 1.8 doesn't. | 252 // text/livescript, but Mozilla 1.8 doesn't. |
249 // Mozilla 1.8 allows leading and trailing whitespace, but WinIE 7 doesn't. | 253 // Mozilla 1.8 allows leading and trailing whitespace, but WinIE 7 doesn't. |
250 // Mozilla 1.8 and WinIE 7 both accept the empty string, but neither accept a | 254 // Mozilla 1.8 and WinIE 7 both accept the empty string, but neither accept a |
251 // whitespace-only string. | 255 // whitespace-only string. |
252 // We want to accept all the values that either of these browsers accept, but | 256 // We want to accept all the values that either of these browsers accept, but |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs) { | 447 bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs) { |
444 return GetMimeUtil()->AreSupportedMediaCodecs(codecs); | 448 return GetMimeUtil()->AreSupportedMediaCodecs(codecs); |
445 } | 449 } |
446 | 450 |
447 void ParseCodecString(const std::string& codecs, | 451 void ParseCodecString(const std::string& codecs, |
448 std::vector<std::string>* codecs_out) { | 452 std::vector<std::string>* codecs_out) { |
449 GetMimeUtil()->ParseCodecString(codecs, codecs_out); | 453 GetMimeUtil()->ParseCodecString(codecs, codecs_out); |
450 } | 454 } |
451 | 455 |
452 } // namespace net | 456 } // namespace net |
OLD | NEW |