[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:45:24 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f938ca5e1ec0c7b8bcc617b6c5c5c4c9a63ebe88
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 27 21:31:36 2002 +0000

    WebCore:
    
    	WebPlugin clean up.
    
            * kwq/KWQKConfigBase.mm:
            (KConfig::readEntry):
            * kwq/WebCoreViewFactory.h:
    
    WebKit:
    
    	Fixed: 3056559 - QT plugin doesn't load (claudius)
    	Fixed: 3042850 - Enable Java by default
    
    	Cleaned up WebPlugin and WebPluginDatabase.
    
            * Plugins.subproj/WebPlugin.h:
            * Plugins.subproj/WebPlugin.m:
            (-[WebNetscapePlugin openResourceFile]):
            (-[WebNetscapePlugin closeResourceFile:]):
            (-[WebNetscapePlugin stringForStringListID:andIndex:]):
            (-[WebNetscapePlugin getPluginInfo]):
            (-[WebNetscapePlugin initWithPath:]):
            (-[WebNetscapePlugin load]):
            (-[WebNetscapePlugin unload]):
            (-[WebNetscapePlugin MIMEToExtensionsDictionary]):
            (-[WebNetscapePlugin extensionToMIMEDictionary]):
            (-[WebNetscapePlugin MIMEToDescriptionDictionary]):
            (-[WebNetscapePlugin description]):
            * Plugins.subproj/WebPluginDatabase.h:
            * Plugins.subproj/WebPluginDatabase.m:
            (-[WebNetscapePluginDatabase pluginForMIMEType:]):
            (-[WebNetscapePluginDatabase pluginForExtension:]):
            (-[WebNetscapePluginDatabase pluginForFilename:]):
            (-[WebNetscapePluginDatabase MIMETypes]):
            (-[WebNetscapePluginDatabase init]):
            * Plugins.subproj/WebPluginView.m:
            (-[WebNetscapePluginView setDataSource:]):
            * WebCoreSupport.subproj/WebViewFactory.m:
            (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]):
            (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]):
            * WebView.subproj/WebPreferences.m:
            (+[WebPreferences load]): Enable Java by default
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2190 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 2e8f13e..700096f 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,11 @@
+2002-09-27  Chris Blumenberg  <cblu at apple.com>
+
+	WebPlugin clean up.
+
+        * kwq/KWQKConfigBase.mm:
+        (KConfig::readEntry):
+        * kwq/WebCoreViewFactory.h:
+
 2002-09-27  Richard Williamson   <rjw at apple.com>
 
         Fixed 3059237:  Visited links do not appear in a different color on yahoo.com
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 2e8f13e..700096f 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,11 @@
+2002-09-27  Chris Blumenberg  <cblu at apple.com>
+
+	WebPlugin clean up.
+
+        * kwq/KWQKConfigBase.mm:
+        (KConfig::readEntry):
+        * kwq/WebCoreViewFactory.h:
+
 2002-09-27  Richard Williamson   <rjw at apple.com>
 
         Fixed 3059237:  Visited links do not appear in a different color on yahoo.com
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 2e8f13e..700096f 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,11 @@
+2002-09-27  Chris Blumenberg  <cblu at apple.com>
+
+	WebPlugin clean up.
+
+        * kwq/KWQKConfigBase.mm:
+        (KConfig::readEntry):
+        * kwq/WebCoreViewFactory.h:
+
 2002-09-27  Richard Williamson   <rjw at apple.com>
 
         Fixed 3059237:  Visited links do not appear in a different color on yahoo.com
diff --git a/WebCore/kwq/KWQKConfigBase.mm b/WebCore/kwq/KWQKConfigBase.mm
index 1b16a4a..34f784d 100644
--- a/WebCore/kwq/KWQKConfigBase.mm
+++ b/WebCore/kwq/KWQKConfigBase.mm
@@ -76,15 +76,25 @@ QString KConfig::readEntry(const char *pKey, const QString& aDefault) const
         } else if (strcmp(pKey, "description") == 0) {
             return QString::fromNSString([plugin pluginDescription]);
         } else if (strcmp(pKey, "mime") == 0) {
-            NSArray *mimeTypes = [plugin mimeTypes];
+            NSDictionary *MIMEToExtensions =  [plugin MIMEToExtensionsDictionary];
+            NSDictionary *MIMEToDescription = [plugin MIMEToDescriptionDictionary];
+            NSArray *MIMETypes = [MIMEToExtensions allKeys], *extensions;
+            NSString *MIME, *extension;
             NSMutableString *bigMimeString = [NSMutableString string];
-            for (uint i = 0; i < [mimeTypes count]; i++) {
-                [bigMimeString appendString:[[mimeTypes objectAtIndex:i] objectAtIndex:0]]; // mime type
-                [bigMimeString appendString:@":"];
-                [bigMimeString appendString:[[mimeTypes objectAtIndex:i] objectAtIndex:1]]; // mime's extension
-                [bigMimeString appendString:@":"];
-                [bigMimeString appendString:[[mimeTypes objectAtIndex:i] objectAtIndex:2]]; // mime's description
-                [bigMimeString appendString:@";"];
+            
+            for (uint i = 0; i < [MIMETypes count]; i++) {
+                MIME = [MIMETypes objectAtIndex:i];
+                [bigMimeString appendFormat:@"%@:", MIME]; // mime type
+
+                extensions = [MIMEToExtensions objectForKey:MIME];
+                for (uint n = 0; n < [extensions count]; n++) {
+                    extension = [extensions objectAtIndex:n];
+                    [bigMimeString appendString:extension]; // mime's extension
+                    if(n < [extensions count] - 1){
+                        [bigMimeString appendString:@","];
+                    }
+                }
+                [bigMimeString appendFormat:@":%@;", [MIMEToDescription objectForKey:MIME]]; // mime's description
             }
             return QString::fromNSString(bigMimeString);
         }
diff --git a/WebCore/kwq/WebCoreViewFactory.h b/WebCore/kwq/WebCoreViewFactory.h
index 3ff1de9..ced6e87 100644
--- a/WebCore/kwq/WebCoreViewFactory.h
+++ b/WebCore/kwq/WebCoreViewFactory.h
@@ -47,6 +47,7 @@
 - (NSString *)name;
 - (NSString *)filename;
 - (NSString *)pluginDescription;
-- (NSArray *)mimeTypes; // array of NSArrays with 3 parts of MIME type in each
+- (NSDictionary *)MIMEToExtensionsDictionary;
+- (NSDictionary *)MIMEToDescriptionDictionary;
 
 @end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d2eceef..d52d394 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,38 @@
+2002-09-27  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 3056559 - QT plugin doesn't load (claudius)
+	Fixed: 3042850 - Enable Java by default
+
+	Cleaned up WebPlugin and WebPluginDatabase.
+
+        * Plugins.subproj/WebPlugin.h:
+        * Plugins.subproj/WebPlugin.m:
+        (-[WebNetscapePlugin openResourceFile]):
+        (-[WebNetscapePlugin closeResourceFile:]):
+        (-[WebNetscapePlugin stringForStringListID:andIndex:]):
+        (-[WebNetscapePlugin getPluginInfo]):
+        (-[WebNetscapePlugin initWithPath:]):
+        (-[WebNetscapePlugin load]):
+        (-[WebNetscapePlugin unload]):
+        (-[WebNetscapePlugin MIMEToExtensionsDictionary]):
+        (-[WebNetscapePlugin extensionToMIMEDictionary]):
+        (-[WebNetscapePlugin MIMEToDescriptionDictionary]):
+        (-[WebNetscapePlugin description]):
+        * Plugins.subproj/WebPluginDatabase.h:
+        * Plugins.subproj/WebPluginDatabase.m:
+        (-[WebNetscapePluginDatabase pluginForMIMEType:]):
+        (-[WebNetscapePluginDatabase pluginForExtension:]):
+        (-[WebNetscapePluginDatabase pluginForFilename:]):
+        (-[WebNetscapePluginDatabase MIMETypes]):
+        (-[WebNetscapePluginDatabase init]):
+        * Plugins.subproj/WebPluginView.m:
+        (-[WebNetscapePluginView setDataSource:]):
+        * WebCoreSupport.subproj/WebViewFactory.m:
+        (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]):
+        (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]):
+        * WebView.subproj/WebPreferences.m:
+        (+[WebPreferences load]): Enable Java by default
+
 2002-09-27  Richard Williamson   <rjw at apple.com>
 
         Fixed 3060158:  REGRESSION: iframes added to session history
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index d2eceef..d52d394 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,38 @@
+2002-09-27  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 3056559 - QT plugin doesn't load (claudius)
+	Fixed: 3042850 - Enable Java by default
+
+	Cleaned up WebPlugin and WebPluginDatabase.
+
+        * Plugins.subproj/WebPlugin.h:
+        * Plugins.subproj/WebPlugin.m:
+        (-[WebNetscapePlugin openResourceFile]):
+        (-[WebNetscapePlugin closeResourceFile:]):
+        (-[WebNetscapePlugin stringForStringListID:andIndex:]):
+        (-[WebNetscapePlugin getPluginInfo]):
+        (-[WebNetscapePlugin initWithPath:]):
+        (-[WebNetscapePlugin load]):
+        (-[WebNetscapePlugin unload]):
+        (-[WebNetscapePlugin MIMEToExtensionsDictionary]):
+        (-[WebNetscapePlugin extensionToMIMEDictionary]):
+        (-[WebNetscapePlugin MIMEToDescriptionDictionary]):
+        (-[WebNetscapePlugin description]):
+        * Plugins.subproj/WebPluginDatabase.h:
+        * Plugins.subproj/WebPluginDatabase.m:
+        (-[WebNetscapePluginDatabase pluginForMIMEType:]):
+        (-[WebNetscapePluginDatabase pluginForExtension:]):
+        (-[WebNetscapePluginDatabase pluginForFilename:]):
+        (-[WebNetscapePluginDatabase MIMETypes]):
+        (-[WebNetscapePluginDatabase init]):
+        * Plugins.subproj/WebPluginView.m:
+        (-[WebNetscapePluginView setDataSource:]):
+        * WebCoreSupport.subproj/WebViewFactory.m:
+        (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]):
+        (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]):
+        * WebView.subproj/WebPreferences.m:
+        (+[WebPreferences load]): Enable Java by default
+
 2002-09-27  Richard Williamson   <rjw at apple.com>
 
         Fixed 3060158:  REGRESSION: iframes added to session history
diff --git a/WebKit/Plugins.subproj/WebPlugin.h b/WebKit/Plugins.subproj/WebPlugin.h
index d4b95ac..6f5ea7d 100644
--- a/WebKit/Plugins.subproj/WebPlugin.h
+++ b/WebKit/Plugins.subproj/WebPlugin.h
@@ -29,15 +29,29 @@
 
 @interface WebNetscapePlugin : NSObject <WebCorePluginInfo>
 {
-    NSMutableArray *mimeTypes;
-    NSString *name, *path, *filename, *pluginDescription;
-    BOOL isLoaded, isBundle, isCFM;
+    NSMutableDictionary *MIMEToExtensions;
+    NSMutableDictionary *extensionToMIME;
+    NSMutableDictionary *MIMEToDescription;
+    
+    NSString *name;
+    NSString *path;
+    NSString *filename;
+    NSString *pluginDescription;
+
+    BOOL isLoaded;
+    BOOL isBundle;
+    BOOL isCFM;
+    
     NPPluginFuncs pluginFuncs;
     NPNetscapeFuncs browserFuncs;
+    
     uint16 pluginSize;
     uint16 pluginVersion;
+    
     CFBundleRef bundle;
-    CFragConnectionID connID; 
+    
+    CFragConnectionID connID;
+    
     SInt16 resourceRef;
     
     NPP_NewProcPtr NPP_New;
@@ -59,10 +73,10 @@
 - initWithPath:(NSString *)pluginPath;
 - (BOOL)load;
 - (void)unload;
-- (NSString *)mimeTypeForExtension:(NSString *)extension;
 - (NSString *)path;
 - (BOOL)isLoaded;
 - (NSString *)description;
+- (NSDictionary *)extensionToMIMEDictionary;
 
 - (NPP_NewProcPtr)NPP_New;
 - (NPP_DestroyProcPtr)NPP_Destroy;
diff --git a/WebKit/Plugins.subproj/WebPlugin.m b/WebKit/Plugins.subproj/WebPlugin.m
index e8304e8..7698bca 100644
--- a/WebKit/Plugins.subproj/WebPlugin.m
+++ b/WebKit/Plugins.subproj/WebPlugin.m
@@ -34,7 +34,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
 
 @implementation WebNetscapePlugin
 
-- (SInt16)_openResourceFile
+- (SInt16)openResourceFile
 {
     FSRef fref;
     OSErr err;
@@ -51,7 +51,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     }
 }
 
-- (void)_closeResourceFile:(SInt16)resRef
+- (void)closeResourceFile:(SInt16)resRef
 {
     if(isBundle){
         CFBundleCloseBundleResourceMap(bundle, resRef);
@@ -60,62 +60,71 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     }
 }
 
-- (BOOL)_getPluginInfo
+- (NSString *)stringForStringListID:(SInt16)stringListID andIndex:(SInt16)index
 {
-    Str255 theString;
-    char temp[256], description[256];
-    NSMutableArray *mime; // mime is an array containing the mime type, extension(s) and descriptions for that mime type.
-    NSString *tempString;
-    uint n, i;
+    Str255 pString;
+    char cString[256];
+        
+    GetIndString(pString, stringListID, index);
+    if (pString[0] == 0){
+        return nil;
+    }
+    
+    CopyPascalStringToC(pString, cString);
     
-    SInt16 resRef = [self _openResourceFile];
-    if(resRef == -1)
+    return [NSString stringWithCString:cString];
+}
+
+- (BOOL)getPluginInfo
+{
+    SInt16 resRef = [self openResourceFile];
+    if(resRef == -1){
         return NO;
+    }
     
     UseResFile(resRef);
     if(ResError() != noErr){
         return NO;
     }
+
+    NSString *MIME, *extension, *extensionsList, *description;
+    NSArray *extensions;
+    NSRange r;
+    uint i;
     
-    mimeTypes = [NSMutableArray arrayWithCapacity:1];
-    for(n=1, i=0; 1; n+=2, i++){
-        GetIndString(theString, 128, n);
-        if (theString[0] == 0)
+    MIMEToExtensions = [[NSMutableDictionary dictionary] retain];
+    MIMEToDescription = [[NSMutableDictionary dictionary] retain];
+    extensionToMIME = [[NSMutableDictionary dictionary] retain];
+
+    for(i=1; 1; i+=2){
+        MIME = [self stringForStringListID:128 andIndex:i];
+        if(!MIME){
             break;
-        CopyPascalStringToC(theString, temp);
-        mime = [NSMutableArray arrayWithCapacity:3];
-        [mimeTypes insertObject:mime atIndex:i];
-        
-        //FIXME: Because our JS engine poops on semi-colons, I'm removing ";version=1.3"
-        //Scott Adler is checking if semi-colons are allowed to be in mime-types
-        if(!strcmp(temp, "application/x-java-applet;version=1.3")){
-            strcpy(temp, "application/x-java-applet");
         }
-        tempString = [NSString stringWithCString:temp];
-        [mime insertObject:tempString atIndex:0]; // mime type
+
+        // FIXME: Avoid mime types with semi-colons because KJS can't properly parse them using KWQKConfigBase
+        r = [MIME rangeOfString:@";"];
+        if(r.length > 0){
+            continue;
+        }
+
+        extensionsList = [self stringForStringListID:128 andIndex:i+1];
+        extensions = [extensionsList componentsSeparatedByString:@","];
+        [MIMEToExtensions setObject:extensions forKey:MIME];
+
+        NSEnumerator *enumerator = [extensions objectEnumerator];
+        while ((extension = [enumerator nextObject]) != nil) {
+            [extensionToMIME setObject:MIME forKey:extension];
+        }
         
-        GetIndString(theString, 128, n+1);
-        CopyPascalStringToC(theString, temp);
-        tempString = [NSString stringWithCString:temp];
-        [mime insertObject:tempString atIndex:1]; // mime's extension
+        description = [self stringForStringListID:127 andIndex:[MIMEToExtensions count]];
+        [MIMEToDescription setObject:description forKey:MIME];
     }
-    for(i=1; i<=[mimeTypes count]; i++){
-        GetIndString(theString, 127, i);
-        CopyPascalStringToC(theString, temp);
-        tempString = [NSString stringWithCString:temp];
-        mime = [mimeTypes objectAtIndex:(i-1)];
-        [mime insertObject:tempString atIndex:2]; // mime's description
-    }
-    GetIndString(theString, 126, 1);
-    CopyPascalStringToC(theString, description);
-    pluginDescription = [[NSString stringWithCString:description] retain];
     
-    GetIndString(theString, 126, 2); 
-    CopyPascalStringToC(theString, temp);
-    name = [[NSString stringWithCString:temp] retain]; // plugin's name
-    [mimeTypes retain];
+    pluginDescription = [[self stringForStringListID:126 andIndex:1] retain];
+    name = [[self stringForStringListID:126 andIndex:2] retain]; // plugin's name
     
-    [self _closeResourceFile:resRef];
+    [self closeResourceFile:resRef];
     
     return YES;
 }
@@ -125,7 +134,6 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     NSFileManager *fileManager;
     NSDictionary *fileInfo;
     UInt32 type;
-    CFURLRef pluginURL;
     
     path = pluginPath;
     fileManager = [NSFileManager defaultManager];
@@ -135,20 +143,40 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     if([[fileInfo objectForKey:@"NSFileType"] isEqualToString:@"NSFileTypeRegular"]){
         type = [[fileInfo objectForKey:@"NSFileHFSTypeCode"] unsignedLongValue];
         isBundle = NO;
-    
+#ifndef __ppc__
+        return nil;
+#endif
     // bundle
     }else if([[fileInfo objectForKey:@"NSFileType"] isEqualToString:@"NSFileTypeDirectory"]){
-        pluginURL = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)pluginPath, kCFURLPOSIXPathStyle, TRUE);
+        CFURLRef pluginURL = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)pluginPath, kCFURLPOSIXPathStyle, TRUE);
         bundle = CFBundleCreate(NULL, pluginURL);
         CFRelease(pluginURL);
+        
         CFBundleGetPackageInfo(bundle, &type, NULL);
+
+        // Check if the executable is mach-o or CFM
+        NSURL *executableURL = (NSURL *)CFBundleCopyExecutableURL(bundle);
+        NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[executableURL path]];
+        [executableURL release];
+        
+        NSData *data = [executableFile readDataOfLength:8];
+        if(!memcmp([data bytes], "Joy!peff", 8)){
+            isCFM = TRUE;
+#ifndef __ppc__
+            return nil;
+#endif
+        }else{
+            isCFM = FALSE;
+        }
+        [executableFile closeFile];
+        
         isBundle = YES;
     }else{
         return nil;
     }
     
     if(type == FOUR_CHAR_CODE('BRPL') || type == FOUR_CHAR_CODE('IEPL') ){
-        if(![self _getPluginInfo]){
+        if(![self getPluginInfo]){
             return nil;
         }
     }else{
@@ -175,17 +203,6 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     }
     
     if(isBundle){
-        // Check if the executable is mach-o or CFM
-        NSBundle *tempBundle = [NSBundle bundleWithPath:path];
-        NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[tempBundle executablePath]];
-        NSData *data = [executableFile readDataOfLength:8];
-        if(!memcmp([data bytes], "Joy!peff", 8)){
-            isCFM = TRUE;
-        }else{
-            isCFM = FALSE;
-        }
-        [executableFile closeFile];
-        
         if (!CFBundleLoadExecutable(bundle)){
             return NO;
         }
@@ -231,7 +248,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     
     // Plugins (at least QT) require that you call UseResFile on the resource file before loading it.
     
-    resourceRef = [self _openResourceFile];
+    resourceRef = [self openResourceFile];
     if(resourceRef == -1)
         return NO;
     
@@ -336,7 +353,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
 {
     NPP_Shutdown();
     
-    [self _closeResourceFile:resourceRef];
+    [self closeResourceFile:resourceRef];
     
     if(isBundle){
         CFBundleUnloadExecutable(bundle);
@@ -348,20 +365,6 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     isLoaded = FALSE;
 }
 
-- (NSString *)mimeTypeForExtension:(NSString *)extension;
-{
-    uint n;
-    NSRange hasExtension;
-
-    for(n=0; n<[mimeTypes count]; n++){
-        hasExtension = [[[mimeTypes objectAtIndex:n] objectAtIndex:1] rangeOfString:extension];
-        if(hasExtension.length){
-            return [[mimeTypes objectAtIndex:n] objectAtIndex:0];
-        }
-    }
-    return nil;
-}
-
 - (NPP_SetWindowProcPtr)NPP_SetWindow{
     return NPP_SetWindow;
 }
@@ -412,8 +415,19 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
     return NPP_Print;
 }
 
-- (NSArray *)mimeTypes{
-    return mimeTypes;
+- (NSDictionary *)MIMEToExtensionsDictionary
+{
+    return MIMEToExtensions;
+}
+
+- (NSDictionary *)extensionToMIMEDictionary
+{
+    return extensionToMIME;
+}
+
+- (NSDictionary *)MIMEToDescriptionDictionary
+{
+    return MIMEToDescription;
 }
 
 - (NSString *)name{
@@ -438,7 +452,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer);
 - (NSString *)description{
     
     return [NSString stringWithFormat:@"name: %@\npath: %@\nisLoaded: %d\nmimeTypes:\n%@\npluginDescription:%@",
-        name, path, isLoaded, [mimeTypes description], pluginDescription];
+        name, path, isLoaded, [MIMEToExtensions description], [MIMEToDescription description], pluginDescription];
 }
 @end
 
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.h b/WebKit/Plugins.subproj/WebPluginDatabase.h
index 427659e..ab23904 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.h
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.h
@@ -33,10 +33,9 @@
 }
 
 + (WebNetscapePluginDatabase *)installedPlugins;
-- (WebNetscapePlugin *)pluginForMimeType:(NSString *)mimeType;
+- (WebNetscapePlugin *)pluginForMIMEType:(NSString *)mimeType;
 - (WebNetscapePlugin *)pluginForExtension:(NSString *)extension;
-- (WebNetscapePlugin *)pluginWithFilename:(NSString *)filename;
-- (NSArray *)MIMETypes;
+- (WebNetscapePlugin *)pluginForFilename:(NSString *)filename;
 - (NSArray *)plugins;
 
 @end
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.m b/WebKit/Plugins.subproj/WebPluginDatabase.m
index 7382ad3..1b461b4 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.m
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.m
@@ -44,49 +44,36 @@ static WebNetscapePluginDatabase *database = nil;
     return database;
 }
 
-// FIXME: Use a dictionary for this?
-// The first plugin with the specified mime type is returned. We may want to tie this to the defaults so that this is configurable.
-- (WebNetscapePlugin *)pluginForMimeType:(NSString *)mimeType
+// The first plugin with the specified mime type is returned.
+- (WebNetscapePlugin *)pluginForMIMEType:(NSString *)MIME
 {
-    uint i, n;
     WebNetscapePlugin *plugin;
-    NSArray *mimeArray;
+    uint i;
     
     for(i=0; i<[plugins count]; i++){      
         plugin = [plugins objectAtIndex:i];
-        mimeArray = [plugin mimeTypes];
-        for(n=0; n<[mimeArray count]; n++){
-            if([[[mimeArray objectAtIndex:n] objectAtIndex:0] isEqualToString:mimeType]){
-                return plugin;
-            }
+        if([[plugin MIMEToExtensionsDictionary] objectForKey:MIME]){
+            return plugin;
         }
     }
     return nil;
 }
 
-// FIXME: Use a dictionary for this?
 - (WebNetscapePlugin *)pluginForExtension:(NSString *)extension
 {
-    uint i, n;
     WebNetscapePlugin *plugin;
-    NSArray *mimeArray;
-    NSRange hasExtension;
+    uint i;
 
-    for(i=0; i<[plugins count]; i++){      
+    for(i=0; i<[plugins count]; i++){
         plugin = [plugins objectAtIndex:i];
-        mimeArray = [plugin mimeTypes];
-        for(n=0; n<[mimeArray count]; n++){
-            hasExtension = [[[mimeArray objectAtIndex:n] objectAtIndex:1] rangeOfString:extension];
-            if(hasExtension.length){
-                return plugin;
-            }
+        if([[plugin extensionToMIMEDictionary] objectForKey:extension]){
+            return plugin;
         }
     }
     return nil;
 }
 
-// FIXME: Use a dictionary for this?
-- (WebNetscapePlugin *)pluginWithFilename:(NSString *)filename
+- (WebNetscapePlugin *)pluginForFilename:(NSString *)filename
 {
     uint i;
     WebNetscapePlugin *plugin;
@@ -105,25 +92,21 @@ static WebNetscapePluginDatabase *database = nil;
     return plugins;
 }
 
-// FIXME: Maybe a set rather than an array?
 - (NSArray *)MIMETypes
 {
-    NSMutableArray *allHandledMIMETypes;
+    NSMutableSet *MIMETypes;
     WebNetscapePlugin *plugin;
-    NSArray *mimeArray;
-    uint i, n;
+    uint i;
         
-    allHandledMIMETypes = [NSMutableArray arrayWithCapacity:20];
+    MIMETypes = [NSMutableSet set];
     for(i=0; i<[plugins count]; i++){
         plugin = [plugins objectAtIndex:i];
-        mimeArray = [plugin mimeTypes];
-        for(n=0; n<[mimeArray count]; n++){
-            [allHandledMIMETypes addObject:[[mimeArray objectAtIndex:n] objectAtIndex:0]];
-        }
+        [MIMETypes addObjectsFromArray:[[plugin MIMEToDescriptionDictionary] allKeys]];
     }
-    return allHandledMIMETypes;
+    return [MIMETypes allObjects];
 }
 
+
 static NSArray *pluginLocations(void)
 {
     // Plug-ins are found in order of precedence.
@@ -185,7 +168,7 @@ static NSArray *pluginLocations(void)
     }
 
     plugins = [pluginArray copy];
-    
+
     // register plug-in WebDocumentViews and WebDocumentRepresentations
     NSArray *mimes = [self MIMETypes];
     for (i = 0; i < [mimes count]; i++) {
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 3037e0e..716e840 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -662,7 +662,7 @@
     webDataSource = [dataSource retain];
     
     mime = [[dataSource contentType] retain];
-    plugin = [[WebNetscapePluginDatabase installedPlugins] pluginForMimeType:mime];
+    plugin = [[WebNetscapePluginDatabase installedPlugins] pluginForMIMEType:mime];
     
     if(![plugin load])
         return;
diff --git a/WebKit/WebCoreSupport.subproj/WebViewFactory.m b/WebKit/WebCoreSupport.subproj/WebViewFactory.m
index 1a5d15c..7b44e5d 100644
--- a/WebKit/WebCoreSupport.subproj/WebViewFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebViewFactory.m
@@ -48,11 +48,11 @@
         
     if ([serviceType length]) {
         mimeType = serviceType;
-        plugin = [[WebNetscapePluginDatabase installedPlugins] pluginForMimeType:mimeType];
+        plugin = [[WebNetscapePluginDatabase installedPlugins] pluginForMIMEType:mimeType];
     } else {
         extension = [[pluginURL path] pathExtension];
         plugin = [[WebNetscapePluginDatabase installedPlugins] pluginForExtension:extension];
-        mimeType = [plugin mimeTypeForExtension:extension];
+        mimeType = [[plugin extensionToMIMEDictionary] objectForKey:extension];
     }
     
     if (plugin == nil) {
@@ -70,7 +70,7 @@
 {
     WebNetscapePlugin *plugin;
     
-    plugin = [[WebNetscapePluginDatabase installedPlugins] pluginForMimeType:@"application/x-java-applet"];
+    plugin = [[WebNetscapePluginDatabase installedPlugins] pluginForMIMEType:@"application/x-java-applet"];
     if (plugin == nil) {
         return nil;
     }
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index 3667248..b5822d3 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -97,7 +97,7 @@
         [NSNumber numberWithBool:YES],  WebKitResourceTimedLayoutEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitUserStyleSheetEnabledPreferenceKey,
         @"",                    	WebKitUserStyleSheetLocationPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitJavaEnabledPreferenceKey,
+        [NSNumber numberWithBool:YES],   WebKitJavaEnabledPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitJavaScriptEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitPluginsEnabledPreferenceKey,

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list