Commit 238930bf authored by tomernic's avatar tomernic

Reviewed by Kevin Decker.

        <rdar://problem/4608487> REGRESSION: reproducible crash in +[WebCoreFrameBridge supportedImageMIMETypes]

        * Plugins/WebPluginDatabase.m:
        (+[WebPluginDatabase setAdditionalWebPlugInPaths:]):
        One might be tempted to add additionalWebPlugInPaths to the global WebPluginDatabase here.
        For backward compatibility with earlier versions of the +setAdditionalWebPlugInPaths: SPI,
        we need to save a copy of the additional paths and not cause a refresh of the plugin DB
        at this time.
        (-[WebPluginDatabase _plugInPaths]):
        Include additionalWebPlugInPaths if this is the global DB.
        (-[WebPluginDatabase refresh]):
        Call -_plugInPaths to get the modified array of paths.  This is similar to what the old code
        (before we had per-WebView plugin search paths).



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 759e3b6f
2006-06-29 Tim Omernick <timo@apple.com>
Reviewed by Kevin Decker.
<rdar://problem/4608487> REGRESSION: reproducible crash in +[WebCoreFrameBridge supportedImageMIMETypes]
* Plugins/WebPluginDatabase.m:
(+[WebPluginDatabase setAdditionalWebPlugInPaths:]):
One might be tempted to add additionalWebPlugInPaths to the global WebPluginDatabase here.
For backward compatibility with earlier versions of the +setAdditionalWebPlugInPaths: SPI,
we need to save a copy of the additional paths and not cause a refresh of the plugin DB
at this time.
(-[WebPluginDatabase _plugInPaths]):
Include additionalWebPlugInPaths if this is the global DB.
(-[WebPluginDatabase refresh]):
Call -_plugInPaths to get the modified array of paths. This is similar to what the old code
(before we had per-WebView plugin search paths).
2006-06-29 Tim Omernick <timo@apple.com>
Reviewed by John Sullivan.
......
......@@ -131,12 +131,21 @@ - (NSArray *)plugins
return [plugins allObjects];
}
static NSArray *additionalWebPlugInPaths;
+ (void)setAdditionalWebPlugInPaths:(NSArray *)additionalPaths
{
NSMutableArray *newPlugInPaths = [[self _defaultPlugInPaths] mutableCopy];
[newPlugInPaths addObjectsFromArray:additionalPaths];
[[WebPluginDatabase installedPlugins] setPlugInPaths:newPlugInPaths];
[newPlugInPaths release];
if (additionalPaths == additionalWebPlugInPaths)
return;
[additionalWebPlugInPaths release];
additionalWebPlugInPaths = [additionalPaths copy];
// One might be tempted to add additionalWebPlugInPaths to the global WebPluginDatabase here.
// For backward compatibility with earlier versions of the +setAdditionalWebPlugInPaths: SPI,
// we need to save a copy of the additional paths and not cause a refresh of the plugin DB
// at this time.
// See Radars 4608487 and 4609047.
}
- (void)setPlugInPaths:(NSArray *)newPaths
......@@ -174,9 +183,23 @@ - (void)dealloc
[super dealloc];
}
- (NSArray *)_plugInPaths
{
if (self == database && additionalWebPlugInPaths) {
// Add additionalWebPlugInPaths to the global WebPluginDatabase. We do this here for
// backward compatibility with earlier versions of the +setAdditionalWebPlugInPaths: SPI,
// which simply saved a copy of the additional paths and did not cause the plugin DB to
// refresh. See Radars 4608487 and 4609047.
NSMutableArray *modifiedPlugInPaths = [[plugInPaths mutableCopy] autorelease];
[modifiedPlugInPaths addObjectsFromArray:additionalWebPlugInPaths];
return modifiedPlugInPaths;
} else
return plugInPaths;
}
- (void)refresh
{
NSEnumerator *directoryEnumerator = [plugInPaths objectEnumerator];
NSEnumerator *directoryEnumerator = [[self _plugInPaths] objectEnumerator];
NSMutableSet *uniqueFilenames = [[NSMutableArray alloc] init];
NSFileManager *fileManager = [NSFileManager defaultManager];
NSMutableSet *newPlugins = [[NSMutableSet alloc] init];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment