Changeset 61509 in webkit


Ignore:
Timestamp:
Jun 20, 2010 1:27:58 PM (14 years ago)
Author:
andersca@apple.com
Message:

2010-06-20 Anders Carlsson <andersca@apple.com>

Reviewed by Dan Bernstein.

Change some WebPluginDabase ivars to use WebCore::String instead of NSString.
https://bugs.webkit.org/show_bug.cgi?id=40869


Re-land r61459, with extra null-checks in WebFrameLoaderClient.

  • Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost):
  • Plugins/WebBasePluginPackage.h:
  • Plugins/WebBasePluginPackage.mm: (-[WebBasePluginPackage initWithPath:]): (-[WebBasePluginPackage getPluginInfoFromPLists]): (-[WebBasePluginPackage dealloc]): (-[WebBasePluginPackage name]): (-[WebBasePluginPackage path]): (-[WebBasePluginPackage filename]): (-[WebBasePluginPackage pluginDescription]): (-[WebBasePluginPackage description]): (-[WebBasePluginPackage isJavaPlugIn]):
  • Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage getPluginInfoFromResources]): (-[WebNetscapePluginPackage _tryLoad]): (-[WebNetscapePluginPackage _unloadWithShutdown:]):
  • Plugins/WebPluginPackage.mm: (-[WebPluginPackage load]):
  • WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin):
Location:
trunk/WebKit/mac
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/mac/ChangeLog

    r61464 r61509  
     12010-06-20  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Change some WebPluginDabase ivars to use WebCore::String instead of NSString.
     6        https://bugs.webkit.org/show_bug.cgi?id=40869
     7       
     8        Re-land r61459, with extra null-checks in WebFrameLoaderClient.
     9
     10        * Plugins/Hosted/NetscapePluginHostManager.mm:
     11        (WebKit::NetscapePluginHostManager::spawnPluginHost):
     12        * Plugins/WebBasePluginPackage.h:
     13        * Plugins/WebBasePluginPackage.mm:
     14        (-[WebBasePluginPackage initWithPath:]):
     15        (-[WebBasePluginPackage getPluginInfoFromPLists]):
     16        (-[WebBasePluginPackage dealloc]):
     17        (-[WebBasePluginPackage name]):
     18        (-[WebBasePluginPackage path]):
     19        (-[WebBasePluginPackage filename]):
     20        (-[WebBasePluginPackage pluginDescription]):
     21        (-[WebBasePluginPackage description]):
     22        (-[WebBasePluginPackage isJavaPlugIn]):
     23        * Plugins/WebNetscapePluginPackage.mm:
     24        (-[WebNetscapePluginPackage getPluginInfoFromResources]):
     25        (-[WebNetscapePluginPackage _tryLoad]):
     26        (-[WebNetscapePluginPackage _unloadWithShutdown:]):
     27        * Plugins/WebPluginPackage.mm:
     28        (-[WebPluginPackage load]):
     29        * WebCoreSupport/WebFrameLoaderClient.mm:
     30        (WebFrameLoaderClient::createPlugin):
     31
    1322010-06-18  Adam Barth  <abarth@webkit.org>
    233
  • trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm

    r61464 r61509  
    157157    NSDictionary *hostProperties = [[NSDictionary alloc] initWithObjectsAndKeys:
    158158                                    visibleName, @"visibleName",
    159                                     [package path], @"bundlePath",
     159                                    (NSString *)[package path], @"bundlePath",
    160160                                    nil];
    161161   
  • trunk/WebKit/mac/Plugins/WebBasePluginPackage.h

    r61464 r61509  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
     29#import <WebCore/PluginData.h>
    2830
    2931#if ENABLE(NETSCAPE_PLUGIN_API)
     
    5557    NSMutableSet *pluginDatabases;
    5658   
    57     NSString *name;
    58     NSString *path;
    59     NSString *pluginDescription;
     59    WebCore::String name;
     60    WebCore::String path;
     61    WebCore::String pluginDescription;
    6062
    6163    NSBundle *bundle;
     
    7779- (void)unload;
    7880
    79 - (NSString *)name;
    80 - (NSString *)path;
    81 - (NSString *)filename;
    82 - (NSString *)pluginDescription;
     81- (WebCore::String)filename;
     82- (const WebCore::String&)name;
     83- (const WebCore::String&)path;
     84- (const WebCore::String&)pluginDescription;
    8385- (NSBundle *)bundle;
    8486
     
    9294- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType;
    9395
    94 - (void)setName:(NSString *)theName;
    95 - (void)setPath:(NSString *)thePath;
    96 - (void)setPluginDescription:(NSString *)description;
    9796- (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary;
    9897- (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary;
  • trunk/WebKit/mac/Plugins/WebBasePluginPackage.mm

    r61464 r61509  
    4848#import <mach-o/loader.h>
    4949
    50 
    5150#define JavaCocoaPluginIdentifier   @"com.apple.JavaPluginCocoa"
    5251#define JavaCarbonPluginIdentifier  @"com.apple.JavaAppletPlugin"
     
    5958- (NSArray *)_web_lowercaseStrings;
    6059@end;
     60
     61using namespace WebCore;
    6162
    6263@implementation WebBasePluginPackage
     
    123124        return nil;
    124125       
    125     path = [pathByResolvingSymlinksAndAliases(pluginPath) copy];
     126    path = pathByResolvingSymlinksAndAliases(pluginPath);
    126127    bundle = [[NSBundle alloc] initWithPath:path];
    127128#ifndef __ppc__
     
    234235    if (!theName)
    235236        theName = filename;
    236     [self setName:theName];
     237    name = theName;
    237238
    238239    description = [bundle objectForInfoDictionaryKey:WebPluginDescriptionKey];
    239240    if (!description)
    240241        description = filename;
    241     [self setPluginDescription:description];
     242    pluginDescription = description;
    242243
    243244    return YES;
     
    257258    [pluginDatabases release];
    258259   
    259     [name release];
    260     [path release];
    261     [pluginDescription release];
    262 
    263260    [MIMEToDescription release];
    264261    [MIMEToExtensions release];
     
    284281}
    285282
    286 - (NSString *)name
     283- (const String&)name
    287284{
    288285    return name;
    289286}
    290287
    291 - (NSString *)path
     288- (const String&)path
    292289{
    293290    return path;
    294291}
    295292
    296 - (NSString *)filename
    297 {
    298     return [path lastPathComponent];
    299 }
    300 
    301 - (NSString *)pluginDescription
     293- (String)filename
     294{
     295    return [(NSString *)path lastPathComponent];
     296}
     297
     298- (const String&)pluginDescription
    302299{
    303300    return pluginDescription;
     
    337334{
    338335    return bundle;
    339 }
    340 
    341 - (void)setName:(NSString *)theName
    342 {
    343     [name release];
    344     name = [theName retain];
    345 }
    346 
    347 - (void)setPath:(NSString *)thePath
    348 {
    349     [path release];
    350     path = [thePath retain];
    351 }
    352 
    353 - (void)setPluginDescription:(NSString *)description
    354 {
    355     [pluginDescription release];
    356     pluginDescription = [description retain];
    357336}
    358337
     
    389368{
    390369    return [NSString stringWithFormat:@"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@",
    391         name, path, [MIMEToExtensions description], [MIMEToDescription description], pluginDescription];
     370        (NSString *)name, (NSString *)path, [MIMEToExtensions description], [MIMEToDescription description], (NSString *)pluginDescription];
    392371}
    393372
     
    404383    return [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCocoaPluginIdentifier] ||
    405384        [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCarbonPluginIdentifier] ||
    406         [[path lastPathComponent] _webkit_isCaseInsensitiveEqualToString:JavaCFMPluginFilename];
     385        [(NSString *)[self filename] _webkit_isCaseInsensitiveEqualToString:JavaCFMPluginFilename];
    407386}
    408387
  • trunk/WebKit/mac/Plugins/WebNetscapePluginPackage.mm

    r61464 r61509  
    190190    if (!description)
    191191        description = filename;
    192     [self setPluginDescription:description];
     192    pluginDescription = description;
    193193   
    194194   
     
    196196    if (!theName)
    197197        theName = filename;
    198     [self setName:theName];
     198    name = theName;
    199199   
    200200    [self closeResourceFile:resRef];
     
    353353    CFAbsoluteTime duration;
    354354#endif
    355     LOG(Plugins, "%f Load timing started for: %@", start, [self name]);
     355    LOG(Plugins, "%f Load timing started for: %@", start, (NSString *)[self name]);
    356356
    357357    if (isLoaded)
     
    626626       
    627627        if (pluginFuncs.javaClass)
    628             LOG(LiveConnect, "%@:  mach-o entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass);
     628            LOG(LiveConnect, "%@:  mach-o entry point for NPP_GetJavaClass = %p", (NSString *)[self name], pluginFuncs.javaClass);
    629629        else
    630             LOG(LiveConnect, "%@:  no entry point for NPP_GetJavaClass", [self name]);
     630            LOG(LiveConnect, "%@:  no entry point for NPP_GetJavaClass", (NSString *)[self name]);
    631631
    632632#ifdef SUPPORT_CFM
     
    737737        return;
    738738   
    739     LOG(Plugins, "Unloading %@...", name);
     739    LOG(Plugins, "Unloading %@...", (NSString *)name);
    740740
    741741    // Cannot unload a plug-in package while an instance is still using it
  • trunk/WebKit/mac/Plugins/WebPluginPackage.mm

    r61464 r61509  
    9595#if !LOG_DISABLED
    9696    CFAbsoluteTime duration = CFAbsoluteTimeGetCurrent() - start;
    97     LOG(Plugins, "principalClass took %f seconds for: %@", duration, [self name]);
     97    LOG(Plugins, "principalClass took %f seconds for: %@", duration, (NSString *)[self name]);
    9898#endif
    9999    return [super load];
  • trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r58878 r61509  
    16321632            if (!pluginPageURL.protocolInHTTPFamily())
    16331633                pluginPageURL = KURL();
     1634            NSString *pluginName = pluginPackage ? (NSString *)[pluginPackage name] : nil;
     1635
    16341636            NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode
    1635                                                             contentURL:pluginURL pluginPageURL:pluginPageURL pluginName:[pluginPackage name] MIMEType:MIMEType];
     1637                                                            contentURL:pluginURL pluginPageURL:pluginPageURL pluginName:pluginName MIMEType:MIMEType];
    16361638            CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView],
    16371639                                     @selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]);
     
    17221724        WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(getWebView(m_webFrame.get()));
    17231725        if (implementations->plugInFailedWithErrorFunc) {
    1724             NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:[pluginPackage name] MIMEType:MIMEType];
     1726            NSString *pluginName = pluginPackage ? (NSString *)[pluginPackage name] : nil;
     1727            NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:pluginName MIMEType:MIMEType];
    17251728            CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView],
    17261729                                     @selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]);
Note: See TracChangeset for help on using the changeset viewer.