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

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:41:04 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit fd2c1d3f48ee06d33abfba1ffcd2ef06bdb70823
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 8 20:52:29 2003 +0000

    	- fixed 3252632 -- Registering a WebDocumentView too
    	early breaks built-in image viewing
    
    	A startup-performance optimization was breaking the case
    	where clients registered WebDocumentView types before the
    	first WebFrameView had been created. The fix is to allow
    	registering WebDocumentView types without retrieving the
    	built-in image types.
    
            Reviewed by Darin
    
            * WebView.subproj/WebFrameViewPrivate.h:
    	remove _viewTypes; expose _viewTypesAllowImageTypeOmission.
    	All callers have to specify the boolean now.
    
            * WebView.subproj/WebFrameViewPrivate.m:
            (+[WebFrameView _viewTypesAllowImageTypeOmission:]):
    	assert that the list of image types isn't nil before inserting
    	them; insert each image type only if not already present.
            (+[WebFrameView _viewClassForMIMEType:]):
    	replace _viewTypes with _viewTypesAllowImageTypeOmission
    
            * Plugins.subproj/WebPluginDatabase.m:
            (-[WebPluginDatabase init]):
    	replace _viewTypes with _viewTypesAllowImageTypeOmission
    
            * WebView.subproj/WebDataSourcePrivate.h:
    	remove _repTypes; expose _repTypesAllowImageTypeOmission.
    	All callers have to specify the boolean now.
            * WebView.subproj/WebDataSourcePrivate.m:
            (+[WebDataSource _representationClassForMIMEType:]):
    	replace _repTypes with _repTypesAllowImageTypeOmission
    
            * WebView.subproj/WebView.m:
            (+[WebView registerViewClass:representationClass:forMIMEType:]):
    	replace _viewTypes with _viewTypesAllowImageTypeOmission, and
    	replace _repTypes with _repTypesAllowImageTypeOmission
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index ef18653..63928cb 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,43 @@
+2003-05-08  John Sullivan  <sullivan at apple.com>
+
+	- fixed 3252632 -- Registering a WebDocumentView too 
+	early breaks built-in image viewing
+
+	A startup-performance optimization was breaking the case
+	where clients registered WebDocumentView types before the
+	first WebFrameView had been created. The fix is to allow
+	registering WebDocumentView types without retrieving the
+	built-in image types.
+
+        Reviewed by Darin
+
+        * WebView.subproj/WebFrameViewPrivate.h:
+	remove _viewTypes; expose _viewTypesAllowImageTypeOmission.
+	All callers have to specify the boolean now.
+
+        * WebView.subproj/WebFrameViewPrivate.m:
+        (+[WebFrameView _viewTypesAllowImageTypeOmission:]):
+	assert that the list of image types isn't nil before inserting
+	them; insert each image type only if not already present.
+        (+[WebFrameView _viewClassForMIMEType:]):
+	replace _viewTypes with _viewTypesAllowImageTypeOmission
+
+        * Plugins.subproj/WebPluginDatabase.m:
+        (-[WebPluginDatabase init]):
+	replace _viewTypes with _viewTypesAllowImageTypeOmission
+
+        * WebView.subproj/WebDataSourcePrivate.h:
+	remove _repTypes; expose _repTypesAllowImageTypeOmission.
+	All callers have to specify the boolean now.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (+[WebDataSource _representationClassForMIMEType:]):
+	replace _repTypes with _repTypesAllowImageTypeOmission
+
+        * WebView.subproj/WebView.m:
+        (+[WebView registerViewClass:representationClass:forMIMEType:]):
+	replace _viewTypes with _viewTypesAllowImageTypeOmission, and
+	replace _repTypes with _repTypesAllowImageTypeOmission
+
 2003-05-08  Darin Adler  <darin at apple.com>
 
         Reviewed by Richard.
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.m b/WebKit/Plugins.subproj/WebPluginDatabase.m
index 1c65425..13554d0 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.m
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.m
@@ -158,7 +158,7 @@ static NSArray *pluginLocations(void)
     plugins = [pluginArray copy];
 
     // Register plug-in WebDocumentViews and WebDocumentRepresentations
-    NSArray *viewTypes = [[WebFrameView _viewTypes] allKeys];
+    NSArray *viewTypes = [[WebFrameView _viewTypesAllowImageTypeOmission:NO] allKeys];
     NSArray *mimes;
     NSString *mime;
     WebBasePluginPackage *plugin;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 4bee459..39046c8 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -136,7 +136,7 @@
 - (void)_layoutChildren;
 - (void)_clearErrors;
 - (void)_setMainDocumentError:(NSError *)error;
-+ (NSMutableDictionary *)_repTypes;
++ (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
 + (Class)_representationClassForMIMEType:(NSString *)MIMEType;
 - (void)_loadIcon;
 - (void)_setIconURL:(NSURL *)URL;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 98141ac..6b8495a 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -467,17 +467,12 @@
     return repTypes;
 }
 
-+ (NSMutableDictionary *)_repTypes
-{
-    return [self _repTypesAllowImageTypeOmission:NO];
-}
-
 + (Class)_representationClassForMIMEType:(NSString *)MIMEType
 {
     // Getting the image types is slow, so don't do it until we have to.
     Class c = [[self _repTypesAllowImageTypeOmission:YES] _web_objectForMIMEType:MIMEType];
     if (c == nil) {
-        c = [[self _repTypes] _web_objectForMIMEType:MIMEType];
+        c = [[self _repTypesAllowImageTypeOmission:NO] _web_objectForMIMEType:MIMEType];
     }
     return c;
 }
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index cdbb0e1..9c15c9f 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -46,7 +46,7 @@
 - (void)_lineRight;
 - (void)_goBack;
 - (void)_goForward;
-+ (NSMutableDictionary *)_viewTypes;
++ (NSMutableDictionary *)_viewTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
 + (Class)_viewClassForMIMEType:(NSString *)MIMEType;
 + (BOOL)_canShowMIMETypeAsHTML:(NSString *)MIMEType;
 - (BOOL)_isMainFrame;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index cdbb0e1..9c15c9f 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -46,7 +46,7 @@
 - (void)_lineRight;
 - (void)_goBack;
 - (void)_goForward;
-+ (NSMutableDictionary *)_viewTypes;
++ (NSMutableDictionary *)_viewTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
 + (Class)_viewClassForMIMEType:(NSString *)MIMEType;
 + (BOOL)_canShowMIMETypeAsHTML:(NSString *)MIMEType;
 - (BOOL)_isMainFrame;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index db2acad..88fd08d 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -14,6 +14,7 @@
 
 #import <WebFoundation/WebNSDictionaryExtras.h>
 #import <WebFoundation/NSURLResponse.h>
+#import <WebFoundation/WebAssertions.h>
 
 @implementation WebFrameViewPrivate
 
@@ -268,9 +269,13 @@ static NSMutableDictionary *viewTypes;
 
     if (!addedImageTypes && !allowImageTypeOmission) {
         NSEnumerator *enumerator = [[WebImageView supportedImageMIMETypes] objectEnumerator];
+        ASSERT(enumerator != nil);
         NSString *mime;
         while ((mime = [enumerator nextObject]) != nil) {
-            [viewTypes setObject:[WebImageView class] forKey:mime];
+            // Don't clobber previously-registered user image types
+            if ([viewTypes objectForKey:mime] == nil) {
+                [viewTypes setObject:[WebImageView class] forKey:mime];
+            }
         }
         addedImageTypes = YES;
     }
@@ -284,17 +289,12 @@ static NSMutableDictionary *viewTypes;
 }
 
 
-+ (NSMutableDictionary *)_viewTypes
-{
-    return [self _viewTypesAllowImageTypeOmission:NO];
-}
-
 + (Class)_viewClassForMIMEType:(NSString *)MIMEType
 {
     // Getting the image types is slow, so don't do it until we have to.
     Class c = [[self _viewTypesAllowImageTypeOmission:YES] _web_objectForMIMEType:MIMEType];
     if (c == nil) {
-        c = [[self _viewTypes] _web_objectForMIMEType:MIMEType];
+        c = [[self _viewTypesAllowImageTypeOmission:NO] _web_objectForMIMEType:MIMEType];
     }
     return c;
 }
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 8fdfa64..c72001f 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -574,8 +574,8 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 + (void) registerViewClass:(Class)viewClass representationClass: (Class)representationClass forMIMEType:(NSString *)MIMEType
 {
-    [[WebFrameView _viewTypes] setObject:viewClass forKey:MIMEType];
-    [[WebDataSource _repTypes] setObject:representationClass forKey:MIMEType];
+    [[WebFrameView _viewTypesAllowImageTypeOmission:YES] setObject:viewClass forKey:MIMEType];
+    [[WebDataSource _repTypesAllowImageTypeOmission:YES] setObject:representationClass forKey:MIMEType];
 }
 
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list