Skip to content
Permalink
Browse files
2010-06-21 Anders Carlsson <andersca@apple.com>
        Reviewed by Sam Weinig.

        Remove unused dictionary ivars from WebBasePluginPackage
        https://bugs.webkit.org/show_bug.cgi?id=40928

        * Plugins/WebBasePluginPackage.h:
        * Plugins/WebBasePluginPackage.mm:
        (-[WebBasePluginPackage getPluginInfoFromPLists]):
        (-[WebBasePluginPackage dealloc]):
        * Plugins/WebNetscapePluginPackage.mm:
        (-[WebNetscapePluginPackage getPluginInfoFromResources]):


Canonical link: https://commits.webkit.org/52568@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@61558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Jun 21, 2010
1 parent 86ac02a commit d6943ea52a0fd87dd368d79ca71dec3378203056
Showing 4 changed files with 16 additions and 70 deletions.
@@ -1,3 +1,17 @@
2010-06-21 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

Remove unused dictionary ivars from WebBasePluginPackage
https://bugs.webkit.org/show_bug.cgi?id=40928

* Plugins/WebBasePluginPackage.h:
* Plugins/WebBasePluginPackage.mm:
(-[WebBasePluginPackage getPluginInfoFromPLists]):
(-[WebBasePluginPackage dealloc]):
* Plugins/WebNetscapePluginPackage.mm:
(-[WebNetscapePluginPackage getPluginInfoFromResources]):

2010-06-21 Dan Bernstein <mitz@apple.com>

Build fix
@@ -64,9 +64,6 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);

CFBundleRef cfBundle;

NSDictionary *MIMEToDescription;
NSDictionary *MIMEToExtensions;

BP_CreatePluginMIMETypesPreferencesFuncPtr BP_CreatePluginMIMETypesPreferences;
}

@@ -90,12 +87,8 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
- (BOOL)supportsExtension:(const WebCore::String&)extension;
- (BOOL)supportsMIMEType:(const WebCore::String&)MIMEType;

- (NSString *)descriptionForMIMEType:(NSString *)MIMEType;
- (NSString *)MIMETypeForExtension:(const WebCore::String&)extension;

- (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary;
- (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary;

- (BOOL)isQuickTimePlugIn;
- (BOOL)isJavaPlugIn;

@@ -206,8 +206,6 @@ - (BOOL)getPluginInfoFromPLists
return NO;
}

NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary];
NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary];
NSEnumerator *keyEnumerator = [MIMETypes keyEnumerator];
NSDictionary *MIMEDictionary;
NSString *MIME, *description;
@@ -231,23 +229,15 @@ - (BOOL)getPluginInfoFromPLists
extensions = [NSArray arrayWithObject:@""];

mimeClassInfo.type = String(MIME).lower();
MIME = [MIME lowercaseString];

[MIMEToExtensionsDictionary setObject:extensions forKey:MIME];

description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey];
mimeClassInfo.desc = description;

mimeTypes.append(mimeClassInfo);
if (!description)
description = @"";

[MIMEToDescriptionDictionary setObject:description forKey:MIME];
}

[self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary];
[self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary];

NSString *filename = [self filename];

NSString *theName = [self _objectForInfoDictionaryKey:WebPluginNameKey];
@@ -276,9 +266,6 @@ - (void)dealloc
ASSERT(!pluginDatabases || [pluginDatabases count] == 0);
[pluginDatabases release];

[MIMEToDescription release];
[MIMEToExtensions release];

if (cfBundle)
CFRelease(cfBundle);

@@ -322,11 +309,6 @@ - (String)filename
return mimeTypes;
}

- (NSArray *)MIMETypes
{
return [MIMEToExtensions allKeys];
}

- (BOOL)supportsExtension:(const String&)extension
{
ASSERT(extension.lower() == extension);
@@ -353,11 +335,6 @@ - (BOOL)supportsMIMEType:(const WebCore::String&)mimeType
return NO;
}

- (NSString *)descriptionForMIMEType:(NSString *)MIMEType
{
return [MIMEToDescription objectForKey:MIMEType];
}

- (NSString *)MIMETypeForExtension:(const String&)extension
{
ASSERT(extension.lower() == extension);
@@ -373,29 +350,6 @@ - (NSString *)MIMETypeForExtension:(const String&)extension
return nil;
}

- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType
{
return [MIMEToExtensions objectForKey:MIMEType];
}

- (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary
{
[MIMEToDescription release];
MIMEToDescription = [MIMEToDescriptionDictionary retain];
}

- (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary
{
[MIMEToExtensions release];
MIMEToExtensions = [MIMEToExtensionsDictionary retain];
}

- (NSString *)description
{
return [NSString stringWithFormat:@"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@",
(NSString *)name, (NSString *)path, [MIMEToExtensions description], [MIMEToDescription description], (NSString *)pluginDescription];
}

- (BOOL)isQuickTimePlugIn
{
const String& bundleIdentifier = [self bundleIdentifier];
@@ -160,9 +160,6 @@ - (BOOL)getPluginInfoFromResources
NSArray *extensions;
unsigned i;

NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary];
NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary];

for (i=1; 1; i+=2) {
MIME = [[self stringForStringListID:MIMEListStringStringNumber
andIndex:i] lowercaseString];
@@ -177,27 +174,15 @@ - (BOOL)getPluginInfoFromResources
extensions = [extensionsList componentsSeparatedByString:@","];
for (NSUInteger j = 0; j < [extensions count]; ++j)
mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:j]);

[MIMEToExtensionsDictionary setObject:extensions forKey:MIME];
} else
// DRM and WMP claim MIMEs without extensions. Use a @"" extension in this case.
[MIMEToExtensionsDictionary setObject:[NSArray arrayWithObject:@""] forKey:MIME];
}

description = [self stringForStringListID:MIMEDescriptionStringNumber
andIndex:[MIMEToExtensionsDictionary count]];
andIndex:mimeTypes.size()];
mimeClassInfo.desc = description;

if (description)
[MIMEToDescriptionDictionary setObject:description forKey:MIME];
else
[MIMEToDescriptionDictionary setObject:@"" forKey:MIME];

mimeTypes.append(mimeClassInfo);
}

[self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary];
[self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary];

NSString *filename = [self filename];

description = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:1];

0 comments on commit d6943ea

Please sign in to comment.