0
|
1 |
/*
|
|
2 |
* Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved.
|
|
3 |
* Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
|
|
4 |
*
|
|
5 |
* Redistribution and use in source and binary forms, with or without
|
|
6 |
* modification, are permitted provided that the following conditions
|
|
7 |
* are met:
|
|
8 |
* 1. Redistributions of source code must retain the above copyright
|
|
9 |
* notice, this list of conditions and the following disclaimer.
|
|
10 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
11 |
* notice, this list of conditions and the following disclaimer in the
|
|
12 |
* documentation and/or other materials provided with the distribution.
|
|
13 |
*
|
|
14 |
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
|
15 |
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
17 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
|
18 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
19 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
20 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
21 |
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
22 |
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
25 |
*/
|
|
26 |
|
|
27 |
#include "config.h"
|
|
28 |
#include "MIMETypeRegistry.h"
|
|
29 |
|
|
30 |
#include "ArchiveFactory.h"
|
|
31 |
#include "MediaPlayer.h"
|
|
32 |
#include "StringHash.h"
|
|
33 |
#include <wtf/HashMap.h>
|
|
34 |
#include <wtf/HashSet.h>
|
|
35 |
#include <wtf/StdLibExtras.h>
|
|
36 |
|
|
37 |
#if PLATFORM(CG)
|
|
38 |
#include "ImageSourceCG.h"
|
|
39 |
#include <ApplicationServices/ApplicationServices.h>
|
|
40 |
#include <wtf/RetainPtr.h>
|
|
41 |
#endif
|
|
42 |
#if PLATFORM(QT)
|
|
43 |
#include <qimagereader.h>
|
|
44 |
#include <qimagewriter.h>
|
|
45 |
#endif
|
|
46 |
|
|
47 |
namespace WebCore {
|
|
48 |
|
|
49 |
static HashSet<String>* supportedImageResourceMIMETypes;
|
|
50 |
static HashSet<String>* supportedImageMIMETypes;
|
|
51 |
static HashSet<String>* supportedImageMIMETypesForEncoding;
|
|
52 |
static HashSet<String>* supportedJavaScriptMIMETypes;
|
|
53 |
static HashSet<String>* supportedNonImageMIMETypes;
|
|
54 |
static HashSet<String>* supportedMediaMIMETypes;
|
|
55 |
static HashMap<String, String, CaseFoldingHash>* mediaMIMETypeForExtensionMap;
|
|
56 |
|
|
57 |
static void initializeSupportedImageMIMETypes()
|
|
58 |
{
|
|
59 |
#if PLATFORM(CG)
|
|
60 |
RetainPtr<CFArrayRef> supportedTypes(AdoptCF, CGImageSourceCopyTypeIdentifiers());
|
|
61 |
CFIndex count = CFArrayGetCount(supportedTypes.get());
|
|
62 |
for (CFIndex i = 0; i < count; i++) {
|
|
63 |
RetainPtr<CFStringRef> supportedType(AdoptCF, reinterpret_cast<CFStringRef>(CFArrayGetValueAtIndex(supportedTypes.get(), i)));
|
|
64 |
String mimeType = MIMETypeForImageSourceType(supportedType.get());
|
|
65 |
if (!mimeType.isEmpty()) {
|
|
66 |
supportedImageMIMETypes->add(mimeType);
|
|
67 |
supportedImageResourceMIMETypes->add(mimeType);
|
|
68 |
}
|
|
69 |
}
|
|
70 |
|
|
71 |
// On Tiger and Leopard, com.microsoft.bmp doesn't have a MIME type in the registry.
|
|
72 |
supportedImageMIMETypes->add("image/bmp");
|
|
73 |
supportedImageResourceMIMETypes->add("image/bmp");
|
|
74 |
|
|
75 |
// Favicons don't have a MIME type in the registry either.
|
|
76 |
supportedImageMIMETypes->add("image/vnd.microsoft.icon");
|
|
77 |
supportedImageMIMETypes->add("image/x-icon");
|
|
78 |
supportedImageResourceMIMETypes->add("image/vnd.microsoft.icon");
|
|
79 |
supportedImageResourceMIMETypes->add("image/x-icon");
|
|
80 |
|
|
81 |
// We only get one MIME type per UTI, hence our need to add these manually
|
|
82 |
supportedImageMIMETypes->add("image/pjpeg");
|
|
83 |
supportedImageResourceMIMETypes->add("image/pjpeg");
|
|
84 |
|
|
85 |
// We don't want to try to treat all binary data as an image
|
|
86 |
supportedImageMIMETypes->remove("application/octet-stream");
|
|
87 |
supportedImageResourceMIMETypes->remove("application/octet-stream");
|
|
88 |
|
|
89 |
// Don't treat pdf/postscript as images directly
|
|
90 |
supportedImageMIMETypes->remove("application/pdf");
|
|
91 |
supportedImageMIMETypes->remove("application/postscript");
|
|
92 |
|
|
93 |
#elif PLATFORM(QT)
|
|
94 |
QList<QByteArray> formats = QImageReader::supportedImageFormats();
|
|
95 |
for (size_t i = 0; i < static_cast<size_t>(formats.size()); ++i) {
|
|
96 |
#if ENABLE(SVG)
|
|
97 |
/*
|
|
98 |
* Qt has support for SVG, but we want to use KSVG2
|
|
99 |
*/
|
|
100 |
if (formats.at(i).toLower().startsWith("svg"))
|
|
101 |
continue;
|
|
102 |
#endif
|
|
103 |
String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
|
|
104 |
supportedImageMIMETypes->add(mimeType);
|
|
105 |
supportedImageResourceMIMETypes->add(mimeType);
|
|
106 |
}
|
|
107 |
|
|
108 |
supportedImageMIMETypes->remove("application/octet-stream");
|
|
109 |
supportedImageResourceMIMETypes->remove("application/octet-stream");
|
|
110 |
#else
|
|
111 |
// assume that all implementations at least support the following standard
|
|
112 |
// image types:
|
|
113 |
static const char* types[] = {
|
|
114 |
"image/jpeg",
|
|
115 |
"image/png",
|
|
116 |
"image/gif",
|
|
117 |
"image/bmp",
|
|
118 |
"image/vnd.microsoft.icon", // ico
|
|
119 |
"image/x-icon", // ico
|
|
120 |
"image/x-xbitmap" // xbm
|
|
121 |
};
|
|
122 |
for (size_t i = 0; i < sizeof(types) / sizeof(types[0]); ++i) {
|
|
123 |
supportedImageMIMETypes->add(types[i]);
|
|
124 |
supportedImageResourceMIMETypes->add(types[i]);
|
|
125 |
}
|
|
126 |
#endif
|
|
127 |
}
|
|
128 |
|
|
129 |
static void initializeSupportedImageMIMETypesForEncoding()
|
|
130 |
{
|
|
131 |
supportedImageMIMETypesForEncoding = new HashSet<String>;
|
|
132 |
|
|
133 |
#if PLATFORM(CG)
|
|
134 |
#if PLATFORM(MAC)
|
|
135 |
RetainPtr<CFArrayRef> supportedTypes(AdoptCF, CGImageDestinationCopyTypeIdentifiers());
|
|
136 |
CFIndex count = CFArrayGetCount(supportedTypes.get());
|
|
137 |
for (CFIndex i = 0; i < count; i++) {
|
|
138 |
RetainPtr<CFStringRef> supportedType(AdoptCF, reinterpret_cast<CFStringRef>(CFArrayGetValueAtIndex(supportedTypes.get(), i)));
|
|
139 |
String mimeType = MIMETypeForImageSourceType(supportedType.get());
|
|
140 |
if (!mimeType.isEmpty())
|
|
141 |
supportedImageMIMETypesForEncoding->add(mimeType);
|
|
142 |
}
|
|
143 |
#else
|
|
144 |
// FIXME: Add Windows support for all the supported UTI's when a way to convert from MIMEType to UTI reliably is found.
|
|
145 |
// For now, only support PNG, JPEG and GIF. See <rdar://problem/6095286>.
|
|
146 |
supportedImageMIMETypesForEncoding->add("image/png");
|
|
147 |
supportedImageMIMETypesForEncoding->add("image/jpeg");
|
|
148 |
supportedImageMIMETypesForEncoding->add("image/gif");
|
|
149 |
#endif
|
|
150 |
#elif PLATFORM(QT)
|
|
151 |
QList<QByteArray> formats = QImageWriter::supportedImageFormats();
|
|
152 |
for (int i = 0; i < formats.size(); ++i) {
|
|
153 |
String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
|
|
154 |
supportedImageMIMETypesForEncoding->add(mimeType);
|
|
155 |
}
|
|
156 |
|
|
157 |
supportedImageMIMETypesForEncoding->remove("application/octet-stream");
|
|
158 |
#elif PLATFORM(CAIRO)
|
|
159 |
supportedImageMIMETypesForEncoding->add("image/png");
|
|
160 |
#endif
|
|
161 |
}
|
|
162 |
|
|
163 |
static void initializeSupportedJavaScriptMIMETypes()
|
|
164 |
{
|
|
165 |
/*
|
|
166 |
Mozilla 1.8 and WinIE 7 both accept text/javascript and text/ecmascript.
|
|
167 |
Mozilla 1.8 accepts application/javascript, application/ecmascript, and application/x-javascript, but WinIE 7 doesn't.
|
|
168 |
WinIE 7 accepts text/javascript1.1 - text/javascript1.3, text/jscript, and text/livescript, but Mozilla 1.8 doesn't.
|
|
169 |
Mozilla 1.8 allows leading and trailing whitespace, but WinIE 7 doesn't.
|
|
170 |
Mozilla 1.8 and WinIE 7 both accept the empty string, but neither accept a whitespace-only string.
|
|
171 |
We want to accept all the values that either of these browsers accept, but not other values.
|
|
172 |
*/
|
|
173 |
static const char* types[] = {
|
|
174 |
"text/javascript",
|
|
175 |
"text/ecmascript",
|
|
176 |
"application/javascript",
|
|
177 |
"application/ecmascript",
|
|
178 |
"application/x-javascript",
|
|
179 |
"text/javascript1.1",
|
|
180 |
"text/javascript1.2",
|
|
181 |
"text/javascript1.3",
|
|
182 |
"text/jscript",
|
|
183 |
"text/livescript",
|
|
184 |
};
|
|
185 |
for (size_t i = 0; i < sizeof(types) / sizeof(types[0]); ++i)
|
|
186 |
supportedJavaScriptMIMETypes->add(types[i]);
|
|
187 |
}
|
|
188 |
|
|
189 |
static void initializeSupportedNonImageMimeTypes()
|
|
190 |
{
|
|
191 |
static const char* types[] = {
|
|
192 |
#if ENABLE(WML)
|
|
193 |
"text/vnd.wap.wml",
|
|
194 |
"application/vnd.wap.wmlc",
|
|
195 |
#endif
|
|
196 |
"text/html",
|
|
197 |
"text/xml",
|
|
198 |
"text/xsl",
|
|
199 |
"text/plain",
|
|
200 |
"text/",
|
|
201 |
"application/xml",
|
|
202 |
"application/xhtml+xml",
|
|
203 |
"application/vnd.wap.xhtml+xml",
|
|
204 |
"application/rss+xml",
|
|
205 |
"application/atom+xml",
|
|
206 |
#if ENABLE(SVG)
|
|
207 |
"image/svg+xml",
|
|
208 |
#endif
|
|
209 |
#if ENABLE(FTPDIR)
|
|
210 |
"application/x-ftp-directory",
|
|
211 |
#endif
|
|
212 |
"multipart/x-mixed-replace"
|
|
213 |
};
|
|
214 |
for (size_t i = 0; i < sizeof(types)/sizeof(types[0]); ++i)
|
|
215 |
supportedNonImageMIMETypes->add(types[i]);
|
|
216 |
|
|
217 |
ArchiveFactory::registerKnownArchiveMIMETypes();
|
|
218 |
}
|
|
219 |
|
|
220 |
static void initializeMediaTypeMaps()
|
|
221 |
{
|
|
222 |
struct TypeExtensionPair {
|
|
223 |
const char* type;
|
|
224 |
const char* extension;
|
|
225 |
};
|
|
226 |
|
|
227 |
// A table of common media MIME types and file extenstions used when a platform's
|
|
228 |
// specific MIME type lookup doens't have a match for a media file extension. While some
|
|
229 |
// file extensions are claimed by multiple MIME types, this table only includes one
|
|
230 |
// for each because it is currently only used by getMediaMIMETypeForExtension. If we
|
|
231 |
// ever add a MIME type -> file extension mapping, the alternate MIME types will need
|
|
232 |
// to be added.
|
|
233 |
static const TypeExtensionPair pairs[] = {
|
|
234 |
|
|
235 |
// Ogg
|
|
236 |
{ "application/ogg", "ogg" },
|
|
237 |
{ "application/ogg", "ogx" },
|
|
238 |
{ "audio/ogg", "oga" },
|
|
239 |
{ "video/ogg", "ogv" },
|
|
240 |
|
|
241 |
// Annodex
|
|
242 |
{ "application/annodex", "anx" },
|
|
243 |
{ "audio/annodex", "axa" },
|
|
244 |
{ "video/annodex", "axv" },
|
|
245 |
{ "audio/speex", "spx" },
|
|
246 |
|
|
247 |
// MPEG
|
|
248 |
{ "audio/mpeg", "m1a" },
|
|
249 |
{ "audio/mpeg", "m2a" },
|
|
250 |
{ "audio/mpeg", "m1s" },
|
|
251 |
{ "audio/mpeg", "mpa" },
|
|
252 |
{ "video/mpeg", "mpg" },
|
|
253 |
{ "video/mpeg", "m15" },
|
|
254 |
{ "video/mpeg", "m1s" },
|
|
255 |
{ "video/mpeg", "m1v" },
|
|
256 |
{ "video/mpeg", "m75" },
|
|
257 |
{ "video/mpeg", "mpa" },
|
|
258 |
{ "video/mpeg", "mpeg" },
|
|
259 |
{ "video/mpeg", "mpm" },
|
|
260 |
{ "video/mpeg", "mpv" },
|
|
261 |
|
|
262 |
// MPEG playlist
|
|
263 |
{ "audio/x-mpegurl", "m3url" },
|
|
264 |
{ "application/x-mpegurl", "m3u8" },
|
|
265 |
|
|
266 |
// MPEG-4
|
|
267 |
{ "video/x-m4v", "m4v" },
|
|
268 |
{ "audio/x-m4a", "m4a" },
|
|
269 |
{ "audio/x-m4b", "m4b" },
|
|
270 |
{ "audio/x-m4p", "m4p" },
|
|
271 |
|
|
272 |
// MP3
|
|
273 |
{ "audio/mp3", "mp3" },
|
|
274 |
|
|
275 |
// MPEG-2
|
|
276 |
{ "video/x-mpeg2", "mp2" },
|
|
277 |
{ "video/mpeg2", "vob" },
|
|
278 |
{ "video/mpeg2", "mod" },
|
|
279 |
{ "video/m2ts", "m2ts" },
|
|
280 |
{ "video/x-m2ts", "m2t" },
|
|
281 |
{ "video/x-m2ts", "ts" },
|
|
282 |
|
|
283 |
// 3GP/3GP2
|
|
284 |
{ "audio/3gpp", "3gpp" },
|
|
285 |
{ "audio/3gpp2", "3g2" },
|
|
286 |
{ "application/x-mpeg", "amc" },
|
|
287 |
|
|
288 |
// AAC
|
|
289 |
{ "audio/aac", "aac" },
|
|
290 |
{ "audio/aac", "adts" },
|
|
291 |
{ "audio/x-aac", "m4r" },
|
|
292 |
|
|
293 |
// CoreAudio File
|
|
294 |
{ "audio/x-caf", "caf" },
|
|
295 |
{ "audio/x-gsm", "gsm" }
|
|
296 |
};
|
|
297 |
|
|
298 |
mediaMIMETypeForExtensionMap = new HashMap<String, String, CaseFoldingHash>;
|
|
299 |
const unsigned numPairs = sizeof(pairs) / sizeof(pairs[0]);
|
|
300 |
for (unsigned ndx = 0; ndx < numPairs; ++ndx)
|
|
301 |
mediaMIMETypeForExtensionMap->set(pairs[ndx].extension, pairs[ndx].type);
|
|
302 |
}
|
|
303 |
|
|
304 |
String MIMETypeRegistry::getMediaMIMETypeForExtension(const String& ext)
|
|
305 |
{
|
|
306 |
// Check with system specific implementation first.
|
|
307 |
String mimeType = getMIMETypeForExtension(ext);
|
|
308 |
if (!mimeType.isEmpty())
|
|
309 |
return mimeType;
|
|
310 |
|
|
311 |
// No match, look in the static mapping.
|
|
312 |
if (!mediaMIMETypeForExtensionMap)
|
|
313 |
initializeMediaTypeMaps();
|
|
314 |
return mediaMIMETypeForExtensionMap->get(ext);
|
|
315 |
}
|
|
316 |
|
|
317 |
static void initializeSupportedMediaMIMETypes()
|
|
318 |
{
|
|
319 |
supportedMediaMIMETypes = new HashSet<String>;
|
|
320 |
#if ENABLE(VIDEO)
|
|
321 |
MediaPlayer::getSupportedTypes(*supportedMediaMIMETypes);
|
|
322 |
#endif
|
|
323 |
}
|
|
324 |
|
|
325 |
static void initializeMIMETypeRegistry()
|
|
326 |
{
|
|
327 |
supportedJavaScriptMIMETypes = new HashSet<String>;
|
|
328 |
initializeSupportedJavaScriptMIMETypes();
|
|
329 |
|
|
330 |
supportedNonImageMIMETypes = new HashSet<String>(*supportedJavaScriptMIMETypes);
|
|
331 |
initializeSupportedNonImageMimeTypes();
|
|
332 |
|
|
333 |
supportedImageResourceMIMETypes = new HashSet<String>;
|
|
334 |
supportedImageMIMETypes = new HashSet<String>;
|
|
335 |
initializeSupportedImageMIMETypes();
|
|
336 |
}
|
|
337 |
|
|
338 |
String MIMETypeRegistry::getMIMETypeForPath(const String& path)
|
|
339 |
{
|
|
340 |
int pos = path.reverseFind('.');
|
|
341 |
if (pos >= 0) {
|
|
342 |
String extension = path.substring(pos + 1);
|
|
343 |
String result = getMIMETypeForExtension(extension);
|
|
344 |
if (result.length())
|
|
345 |
return result;
|
|
346 |
}
|
|
347 |
return "application/octet-stream";
|
|
348 |
}
|
|
349 |
|
|
350 |
bool MIMETypeRegistry::isSupportedImageMIMEType(const String& mimeType)
|
|
351 |
{
|
|
352 |
if (mimeType.isEmpty())
|
|
353 |
return false;
|
|
354 |
if (!supportedImageMIMETypes)
|
|
355 |
initializeMIMETypeRegistry();
|
|
356 |
return supportedImageMIMETypes->contains(mimeType);
|
|
357 |
}
|
|
358 |
|
|
359 |
bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType)
|
|
360 |
{
|
|
361 |
if (mimeType.isEmpty())
|
|
362 |
return false;
|
|
363 |
if (!supportedImageResourceMIMETypes)
|
|
364 |
initializeMIMETypeRegistry();
|
|
365 |
return supportedImageResourceMIMETypes->contains(mimeType);
|
|
366 |
}
|
|
367 |
|
|
368 |
bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeType)
|
|
369 |
{
|
|
370 |
if (mimeType.isEmpty())
|
|
371 |
return false;
|
|
372 |
if (!supportedImageMIMETypesForEncoding)
|
|
373 |
initializeSupportedImageMIMETypesForEncoding();
|
|
374 |
return supportedImageMIMETypesForEncoding->contains(mimeType);
|
|
375 |
}
|
|
376 |
|
|
377 |
bool MIMETypeRegistry::isSupportedJavaScriptMIMEType(const String& mimeType)
|
|
378 |
{
|
|
379 |
if (mimeType.isEmpty())
|
|
380 |
return false;
|
|
381 |
if (!supportedJavaScriptMIMETypes)
|
|
382 |
initializeMIMETypeRegistry();
|
|
383 |
return supportedJavaScriptMIMETypes->contains(mimeType);
|
|
384 |
}
|
|
385 |
|
|
386 |
bool MIMETypeRegistry::isSupportedNonImageMIMEType(const String& mimeType)
|
|
387 |
{
|
|
388 |
if (mimeType.isEmpty())
|
|
389 |
return false;
|
|
390 |
if (!supportedNonImageMIMETypes)
|
|
391 |
initializeMIMETypeRegistry();
|
|
392 |
return supportedNonImageMIMETypes->contains(mimeType);
|
|
393 |
}
|
|
394 |
|
|
395 |
bool MIMETypeRegistry::isSupportedMediaMIMEType(const String& mimeType)
|
|
396 |
{
|
|
397 |
if (mimeType.isEmpty())
|
|
398 |
return false;
|
|
399 |
if (!supportedMediaMIMETypes)
|
|
400 |
initializeSupportedMediaMIMETypes();
|
|
401 |
return supportedMediaMIMETypes->contains(mimeType);
|
|
402 |
}
|
|
403 |
|
|
404 |
bool MIMETypeRegistry::isJavaAppletMIMEType(const String& mimeType)
|
|
405 |
{
|
|
406 |
// Since this set is very limited and is likely to remain so we won't bother with the overhead
|
|
407 |
// of using a hash set.
|
|
408 |
// Any of the MIME types below may be followed by any number of specific versions of the JVM,
|
|
409 |
// which is why we use startsWith()
|
|
410 |
return mimeType.startsWith("application/x-java-applet", false)
|
|
411 |
|| mimeType.startsWith("application/x-java-bean", false)
|
|
412 |
|| mimeType.startsWith("application/x-java-vm", false);
|
|
413 |
}
|
|
414 |
|
|
415 |
HashSet<String>& MIMETypeRegistry::getSupportedImageMIMETypes()
|
|
416 |
{
|
|
417 |
if (!supportedImageMIMETypes)
|
|
418 |
initializeMIMETypeRegistry();
|
|
419 |
return *supportedImageMIMETypes;
|
|
420 |
}
|
|
421 |
|
|
422 |
HashSet<String>& MIMETypeRegistry::getSupportedImageResourceMIMETypes()
|
|
423 |
{
|
|
424 |
if (!supportedImageResourceMIMETypes)
|
|
425 |
initializeMIMETypeRegistry();
|
|
426 |
return *supportedImageResourceMIMETypes;
|
|
427 |
}
|
|
428 |
|
|
429 |
HashSet<String>& MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
|
|
430 |
{
|
|
431 |
if (!supportedImageMIMETypesForEncoding)
|
|
432 |
initializeSupportedImageMIMETypesForEncoding();
|
|
433 |
return *supportedImageMIMETypesForEncoding;
|
|
434 |
}
|
|
435 |
|
|
436 |
HashSet<String>& MIMETypeRegistry::getSupportedNonImageMIMETypes()
|
|
437 |
{
|
|
438 |
if (!supportedNonImageMIMETypes)
|
|
439 |
initializeMIMETypeRegistry();
|
|
440 |
return *supportedNonImageMIMETypes;
|
|
441 |
}
|
|
442 |
|
|
443 |
HashSet<String>& MIMETypeRegistry::getSupportedMediaMIMETypes()
|
|
444 |
{
|
|
445 |
if (!supportedMediaMIMETypes)
|
|
446 |
initializeSupportedMediaMIMETypes();
|
|
447 |
return *supportedMediaMIMETypes;
|
|
448 |
}
|
|
449 |
|
|
450 |
const String& defaultMIMEType()
|
|
451 |
{
|
|
452 |
DEFINE_STATIC_LOCAL(const String, defaultMIMEType, ("application/octet-stream"));
|
|
453 |
return defaultMIMEType;
|
|
454 |
}
|
|
455 |
|
|
456 |
} // namespace WebCore
|