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

Side by Side Diff: WebCore/platform/MIMETypeRegistry.cpp

Issue 2845006: Merge 57386 - 2010-04-09 Abhishek Arya <inferno@chromium.org>... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/375/
Patch Set: Created 10 years, 6 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 | « WebCore/dom/DOMImplementation.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 "text/html", 196 "text/html",
197 "text/xml", 197 "text/xml",
198 "text/xsl", 198 "text/xsl",
199 "text/plain", 199 "text/plain",
200 "text/", 200 "text/",
201 "application/xml", 201 "application/xml",
202 "application/xhtml+xml", 202 "application/xhtml+xml",
203 "application/vnd.wap.xhtml+xml", 203 "application/vnd.wap.xhtml+xml",
204 "application/rss+xml", 204 "application/rss+xml",
205 "application/atom+xml", 205 "application/atom+xml",
206 "application/json",
206 #if ENABLE(SVG) 207 #if ENABLE(SVG)
207 "image/svg+xml", 208 "image/svg+xml",
208 #endif 209 #endif
209 #if ENABLE(FTPDIR) 210 #if ENABLE(FTPDIR)
210 "application/x-ftp-directory", 211 "application/x-ftp-directory",
211 #endif 212 #endif
212 "multipart/x-mixed-replace" 213 "multipart/x-mixed-replace"
214 // Note: ADDING a new type here will probably render it as HTML. This ca n
215 // result in cross-site scripting.
213 }; 216 };
217 COMPILE_ASSERT(sizeof(types) / sizeof(types[0]) <= 16,
218 nonimage_mime_types_must_be_less_than_or_equal_to_16);
219
214 for (size_t i = 0; i < sizeof(types)/sizeof(types[0]); ++i) 220 for (size_t i = 0; i < sizeof(types)/sizeof(types[0]); ++i)
215 supportedNonImageMIMETypes->add(types[i]); 221 supportedNonImageMIMETypes->add(types[i]);
216 222
217 ArchiveFactory::registerKnownArchiveMIMETypes(); 223 ArchiveFactory::registerKnownArchiveMIMETypes();
218 } 224 }
219 225
220 static void initializeMediaTypeMaps() 226 static void initializeMediaTypeMaps()
221 { 227 {
222 struct TypeExtensionPair { 228 struct TypeExtensionPair {
223 const char* type; 229 const char* type;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 return *supportedMediaMIMETypes; 455 return *supportedMediaMIMETypes;
450 } 456 }
451 457
452 const String& defaultMIMEType() 458 const String& defaultMIMEType()
453 { 459 {
454 DEFINE_STATIC_LOCAL(const String, defaultMIMEType, ("application/octet-strea m")); 460 DEFINE_STATIC_LOCAL(const String, defaultMIMEType, ("application/octet-strea m"));
455 return defaultMIMEType; 461 return defaultMIMEType;
456 } 462 }
457 463
458 } // namespace WebCore 464 } // namespace WebCore
OLDNEW
« no previous file with comments | « WebCore/dom/DOMImplementation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698