Changeset 61522 in webkit
- Timestamp:
- Jun 20, 2010, 7:13:00 PM (15 years ago)
- Location:
- trunk/WebKit/mac
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/mac/ChangeLog
r61519 r61522 1 2010-06-20 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Add a MimeClassInfo Vector to WebBasePluginPackage 6 https://bugs.webkit.org/show_bug.cgi?id=40896 7 8 * Plugins/WebBasePluginPackage.h: 9 * Plugins/WebBasePluginPackage.mm: 10 (-[WebBasePluginPackage getPluginInfoFromPLists]): 11 (-[WebBasePluginPackage WebCore::]): 12 * Plugins/WebNetscapePluginPackage.mm: 13 (-[WebNetscapePluginPackage getPluginInfoFromResources]): 14 * WebCoreSupport/WebPlatformStrategies.mm: 15 (WebPlatformStrategies::getPluginInfo): 16 1 17 2010-06-20 Anders Carlsson <andersca@apple.com> 2 18 -
trunk/WebKit/mac/Plugins/WebBasePluginPackage.h
r61519 r61522 61 61 WebCore::String pluginDescription; 62 62 63 Vector<WebCore::MimeClassInfo> mimeTypes; 64 63 65 CFBundleRef cfBundle; 64 66 … … 82 84 - (const WebCore::String&)path; 83 85 - (const WebCore::String&)pluginDescription; 86 87 - (const Vector<WebCore::MimeClassInfo>&)mimeTypes; 84 88 85 89 - (WebCore::String)bundleIdentifier; -
trunk/WebKit/mac/Plugins/WebBasePluginPackage.mm
r61519 r61522 221 221 continue; 222 222 223 MimeClassInfo mimeClassInfo; 224 223 225 extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings]; 226 for (NSUInteger i = 0; i < [extensions count]; ++i) 227 mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:i]); 228 224 229 if ([extensions count] == 0) 225 230 extensions = [NSArray arrayWithObject:@""]; 226 231 232 mimeClassInfo.type = String(MIME).lower(); 227 233 MIME = [MIME lowercaseString]; 228 234 … … 230 236 231 237 description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey]; 238 mimeClassInfo.desc = description; 239 240 mimeTypes.append(mimeClassInfo); 232 241 if (!description) 233 242 description = @""; … … 307 316 { 308 317 return pluginDescription; 318 } 319 320 - (const Vector<WebCore::MimeClassInfo>&)mimeTypes 321 { 322 return mimeTypes; 309 323 } 310 324 -
trunk/WebKit/mac/Plugins/WebNetscapePluginPackage.mm
r61519 r61522 44 44 #endif 45 45 46 using namespace WebCore; 47 46 48 #ifdef SUPPORT_CFM 47 49 typedef void (* FunctionPointer)(void); … … 167 169 break; 168 170 171 MimeClassInfo mimeClassInfo; 172 mimeClassInfo.type = String(MIME).lower(); 173 169 174 extensionsList = [[self stringForStringListID:MIMEListStringStringNumber andIndex:i+1] lowercaseString]; 170 175 if (extensionsList) { 171 176 extensions = [extensionsList componentsSeparatedByString:@","]; 177 for (NSUInteger j = 0; j < [extensions count]; ++j) 178 mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:j]); 179 172 180 [MIMEToExtensionsDictionary setObject:extensions forKey:MIME]; 173 181 } else … … 177 185 description = [self stringForStringListID:MIMEDescriptionStringNumber 178 186 andIndex:[MIMEToExtensionsDictionary count]]; 187 mimeClassInfo.desc = description; 188 179 189 if (description) 180 190 [MIMEToDescriptionDictionary setObject:description forKey:MIME]; 181 191 else 182 192 [MIMEToDescriptionDictionary setObject:@"" forKey:MIME]; 193 194 mimeTypes.append(mimeClassInfo); 183 195 } 184 196 -
trunk/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
r61454 r61522 72 72 pluginInfo.file = [plugin filename]; 73 73 pluginInfo.desc = [plugin pluginDescription]; 74 75 NSArray *MIMETypes = [plugin MIMETypes]; 76 for (NSUInteger i = 0; i < [MIMETypes count]; ++i) { 77 NSString *MIMEType = [MIMETypes objectAtIndex:i]; 78 79 MimeClassInfo mimeClassInfo; 80 81 mimeClassInfo.type = String(MIMEType).lower(); 82 83 NSArray *extensions = [plugin extensionsForMIMEType:MIMEType]; 84 for (NSUInteger i = 0; i < [extensions count]; ++i) { 85 NSString *extension = [extensions objectAtIndex:i]; 86 mimeClassInfo.extensions.append(extension); 87 } 88 89 mimeClassInfo.desc = [plugin descriptionForMIMEType:MIMEType]; 90 91 pluginInfo.mimes.append(mimeClassInfo); 92 } 74 pluginInfo.mimes = [plugin mimeTypes]; 93 75 94 76 plugins.append(pluginInfo);
Note:
See TracChangeset
for help on using the changeset viewer.