43 { |
43 { |
44 static WTF::HashSet<String>* supportedImageResourceMIMETypes; |
44 static WTF::HashSet<String>* supportedImageResourceMIMETypes; |
45 static WTF::HashSet<String>* supportedImageMIMETypes; |
45 static WTF::HashSet<String>* supportedImageMIMETypes; |
46 static WTF::HashSet<String>* supportedNonImageMIMETypes; |
46 static WTF::HashSet<String>* supportedNonImageMIMETypes; |
47 |
47 |
48 struct cleanupMimeTypes { |
48 void cleanupMimeTypes() |
49 ~cleanupMimeTypes() { |
49 { |
50 if( supportedImageResourceMIMETypes ) { |
50 if( supportedImageResourceMIMETypes ) { |
51 supportedImageResourceMIMETypes->clear(); |
51 supportedImageResourceMIMETypes->clear(); |
52 delete supportedImageResourceMIMETypes; |
52 delete supportedImageResourceMIMETypes; |
53 supportedImageResourceMIMETypes = 0; |
53 supportedImageResourceMIMETypes = 0; |
54 } |
54 } |
55 if( supportedImageMIMETypes ) { |
55 if( supportedImageMIMETypes ) { |
56 supportedImageMIMETypes->clear(); |
56 supportedImageMIMETypes->clear(); |
57 delete supportedImageMIMETypes; |
57 delete supportedImageMIMETypes; |
58 supportedImageMIMETypes = 0; |
58 supportedImageMIMETypes = 0; |
59 } |
59 } |
60 if( supportedNonImageMIMETypes ) { |
60 if( supportedNonImageMIMETypes ) { |
61 supportedNonImageMIMETypes->clear(); |
61 supportedNonImageMIMETypes->clear(); |
62 delete supportedNonImageMIMETypes; |
62 delete supportedNonImageMIMETypes; |
63 supportedNonImageMIMETypes = 0; |
63 supportedNonImageMIMETypes = 0; |
64 } |
64 } |
65 } |
65 } |
66 }; |
|
67 struct cleanupMimeTypes cleanMimeTypes; |
|
68 |
66 |
69 #if PLATFORM(CG) |
67 #if PLATFORM(CG) |
70 extern String getMIMETypeForUTI(const String& uti); |
68 extern String getMIMETypeForUTI(const String& uti); |
71 #endif |
69 #endif |
72 |
70 |