Changeset 61525 in webkit
- Timestamp:
- Jun 20, 2010 8:20:17 PM (14 years ago)
- Location:
- trunk/WebKit/mac
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/mac/ChangeLog
r61524 r61525 1 2010-06-20 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Get rid of the old MIMETypes getter method 6 https://bugs.webkit.org/show_bug.cgi?id=40898 7 8 * Plugins/WebBasePluginPackage.h: 9 * Plugins/WebBasePluginPackage.mm: 10 (-[WebBasePluginPackage supportsExtension:]): 11 (-[WebBasePluginPackage supportsMIMEType:WebCore::]): 12 (-[WebBasePluginPackage MIMETypeForExtension:]): 13 * Plugins/WebPluginDatabase.mm: 14 (-[WebPluginDatabase refresh]): 15 (-[WebPluginDatabase _removePlugin:]): 16 1 17 2010-06-20 Anders Carlsson <andersca@apple.com> 2 18 -
trunk/WebKit/mac/Plugins/WebBasePluginPackage.h
r61523 r61525 89 89 90 90 - (BOOL)supportsExtension:(const WebCore::String&)extension; 91 - (BOOL)supportsMIMEType:(NSString *)MIMEType; 92 93 - (NSArray *)MIMETypes; 91 - (BOOL)supportsMIMEType:(const WebCore::String&)MIMEType; 94 92 95 93 - (NSString *)descriptionForMIMEType:(NSString *)MIMEType; 96 94 - (NSString *)MIMETypeForExtension:(const WebCore::String&)extension; 97 - (NSArray *)extensionsForMIMEType:(NSString *)MIMEType;98 95 99 96 - (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary; -
trunk/WebKit/mac/Plugins/WebBasePluginPackage.mm
r61523 r61525 29 29 #import <WebKit/WebBasePluginPackage.h> 30 30 31 #import <algorithm> 31 32 #import <WebCore/WebCoreObjCExtras.h> 32 33 #import <WebKit/WebKitNSStringExtras.h> … … 59 60 @end; 60 61 62 using namespace std; 61 63 using namespace WebCore; 62 64 … … 331 333 332 334 for (size_t i = 0; i < mimeTypes.size(); ++i) { 333 const MimeClassInfo& mimeClassInfo = mimeTypes[i]; 334 335 for (size_t j = 0; i < mimeClassInfo.extensions.size(); ++j) { 336 if (mimeClassInfo.extensions[j] == extension) 337 return YES; 338 } 335 const Vector<String>& extensions = mimeTypes[i].extensions; 336 337 if (find(extensions.begin(), extensions.end(), extension) != extensions.end()) 338 return YES; 339 339 } 340 340 … … 342 342 } 343 343 344 - (BOOL)supportsMIMEType:(NSString *)MIMEType 345 { 346 return [MIMEToExtensions objectForKey:MIMEType] != 0; 344 - (BOOL)supportsMIMEType:(const WebCore::String&)mimeType 345 { 346 ASSERT(mimeType.lower() == mimeType); 347 348 for (size_t i = 0; i < mimeTypes.size(); ++i) { 349 if (mimeTypes[i].type == mimeType) 350 return YES; 351 } 352 353 return NO; 347 354 } 348 355 … … 358 365 for (size_t i = 0; i < mimeTypes.size(); ++i) { 359 366 const MimeClassInfo& mimeClassInfo = mimeTypes[i]; 360 361 for (size_t j = 0; j < mimeClassInfo.extensions.size(); ++j) { 362 if (mimeClassInfo.extensions[j] == extension) 363 return mimeClassInfo.type; 364 } 367 const Vector<String>& extensions = mimeClassInfo.extensions; 368 369 if (find(extensions.begin(), extensions.end(), extension) != extensions.end()) 370 return mimeClassInfo.type; 365 371 } 366 372 -
trunk/WebKit/mac/Plugins/WebPluginDatabase.mm
r61510 r61525 46 46 #import <wtf/Assertions.h> 47 47 48 using namespace WebCore; 49 48 50 static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin); 49 51 … … 305 307 NSMutableSet *MIMETypes = [[NSMutableSet alloc] init]; 306 308 pluginEnumerator = [plugins objectEnumerator]; 307 while ((plugin = [pluginEnumerator nextObject]) != nil) 308 [MIMETypes addObjectsFromArray:[plugin MIMETypes]]; 309 while ((plugin = [pluginEnumerator nextObject])) { 310 const Vector<MimeClassInfo>& mimeTypes = [plugin mimeTypes]; 311 for (size_t i = 0; i < mimeTypes.size(); ++i) 312 [MIMETypes addObject:mimeTypes[i].type]; 313 } 309 314 310 315 // Register plug-in views and representations. … … 440 445 441 446 // Unregister plug-in's MIME type registrations 442 NSArray *MIMETypes = [plugin MIMETypes];443 for ( NSUInteger i = 0; i < [MIMETypes count]; ++i) {444 NSString *MIMEType = [MIMETypes objectAtIndex:i];447 const Vector<MimeClassInfo>& mimeTypes = [plugin mimeTypes]; 448 for (size_t i = 0; i < mimeTypes.size(); ++i) { 449 NSString *MIMEType = mimeTypes[i].type; 445 450 446 451 if ([registeredMIMETypes containsObject:MIMEType]) {
Note: See TracChangeset
for help on using the changeset viewer.