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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:34:06 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0f6d41a67baad561a8023df31e1c68d1ca827481
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Apr 4 03:24:18 2003 +0000

    WebFoundation:
            Changed NSURLRequest to use an ivar to hold the primary
            part data, instead of a dictionary.  This avoids a dictionary
            lookup when accessing part data.  The dictionary lookup turns
            out to be very expensive.
    
            Reviewed by ken.
    
            * CacheLoader.subproj/NSURLRequest.m:
            (-[NSURLRequestInternal dealloc]):
            (-[NSURLRequest _partWithClass:createIfDoesNotExist:]):
            (-[NSURLRequest mutableCopyWithZone:]):
            (-[NSMutableURLRequest copyWithZone:]):
    WebKit:
            Tweaks to minimize access to the parts of a WebDataRequest
            that turn out to be slow.  Although we've changed NSURLRequest
            to be faster, it's still good to keep these tweaks.
    
            Reviewed by ken.
    
            * WebView.subproj/WebBaseResourceHandleDelegate.m:
            (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]):
            (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]):
            * WebView.subproj/WebDataProtocol.h:
            * WebView.subproj/WebDataProtocol.m:
            (-[NSURLRequest _webDataRequestExternalRequest]):
            (+[WebDataProtocol canHandleURL:]):
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource request]):
    
    Tests:
            Removed dead code.
    
            Reviewed by ken.
    
            * SnippetEditor/SnippetEditor.pbproj/project.pbxproj:
            * SnippetEditor/DataResourceRequest.h: Removed.
            * SnippetEditor/DataResourceRequest.m: Removed.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4017 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 89e01cb..52dec21 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2003-04-03  Richard Williamson   <rjw at apple.com>
+
+        Tweaks to minimize access to the parts of a WebDataRequest
+        that turn out to be slow.  Although we've changed NSURLRequest
+        to be faster, it's still good to keep these tweaks.
+        
+        Reviewed by ken.
+
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]):
+        (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]):
+        * WebView.subproj/WebDataProtocol.h:
+        * WebView.subproj/WebDataProtocol.m:
+        (-[NSURLRequest _webDataRequestExternalRequest]):
+        (+[WebDataProtocol canHandleURL:]):
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource request]):
+
 2003-04-03  Trey Matteson  <trey at apple.com>
 
 	3067928 - printing should not break lines in half
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
index cf61631..4f534c7 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
@@ -135,9 +135,9 @@
     
     [mutableRequest HTTPSetUserAgent:[controller userAgentForURL:[newRequest URL]]];
     newRequest = [mutableRequest autorelease];
-    
+
     clientRequest = [newRequest _webDataRequestExternalRequest];
-    if (!clientRequest)
+    if(!clientRequest)
         clientRequest = newRequest;
     else
         haveDataSchemeRequest = YES;
@@ -197,7 +197,7 @@
 
     // If the URL is one of our whacky applewebdata URLs that
     // fake up a substitute URL to present to the delegate.
-    if([WebDataProtocol doesURLHaveInternalDataScheme: [r URL]] != nil){
+    if([WebDataProtocol canHandleURL: [r URL]] != nil){
         NSURL *baseURL = [request _webDataRequestBaseURL];
         if (baseURL)
             [r setURL: baseURL];
diff --git a/WebKit/WebView.subproj/WebDataProtocol.h b/WebKit/WebView.subproj/WebDataProtocol.h
index c42495c..b530838 100644
--- a/WebKit/WebView.subproj/WebDataProtocol.h
+++ b/WebKit/WebView.subproj/WebDataProtocol.h
@@ -14,7 +14,6 @@
 @interface WebDataProtocol : WebProtocol
 {
 }
-+ (BOOL)doesURLHaveInternalDataScheme: (NSURL *)URL;
 @end
 
 @interface NSURLRequest (WebDataRequest)
@@ -25,5 +24,5 @@
 - (void)_webDataRequestSetEncoding:(NSString *)encoding;
 - (NSURL *)_webDataRequestBaseURL;
 - (void)_webDataRequestSetBaseURL:(NSURL *)baseURL;
-- (NSURLRequest *)_webDataRequestExternalRequest;
+- (NSMutableURLRequest *)_webDataRequestExternalRequest;
 @end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebDataProtocol.m b/WebKit/WebView.subproj/WebDataProtocol.m
index 9e1db9d..7371984 100644
--- a/WebKit/WebView.subproj/WebDataProtocol.m
+++ b/WebKit/WebView.subproj/WebDataProtocol.m
@@ -11,7 +11,7 @@
 
 NSString *WebDataProtocolScheme = @"applewebdata";
 
- at interface WebDataRequestParameters : NSObject
+ at interface WebDataRequestParameters : NSObject <NSCopying>
 {
 @public
     NSData *data;
@@ -31,15 +31,6 @@ NSString *WebDataProtocolScheme = @"applewebdata";
     return newInstance;
 }
 
--(id)mutableCopyWithZone:(NSZone *)zone
-{
-    WebDataRequestParameters *newInstance = [[WebDataRequestParameters allocWithZone:zone] init];
-    newInstance->data = [data copyWithZone:zone];
-    newInstance->encoding = [encoding copyWithZone:zone];
-    newInstance->baseURL = [baseURL copyWithZone:zone];
-    return newInstance;
-}
-
 - (void)dealloc
 {
     [data release];
@@ -107,7 +98,7 @@ NSString *WebDataProtocolScheme = @"applewebdata";
     parameters->baseURL = [baseURL retain];
 }
 
-- (NSURLRequest *)_webDataRequestExternalRequest
+- (NSMutableURLRequest *)_webDataRequestExternalRequest
 {
     WebDataRequestParameters *parameters = [WebProtocol partOfRequest:self withClass:[WebDataRequestParameters class] createIfDoesNotExist:NO];
     NSMutableURLRequest *newRequest = nil;
@@ -135,18 +126,9 @@ NSString *WebDataProtocolScheme = @"applewebdata";
     [WebProtocol registerClass: [self class]];
 }
 
-+ (BOOL)doesURLHaveInternalDataScheme: (NSURL *)URL
-{
-    return ([[URL scheme] caseInsensitiveCompare: WebDataProtocolScheme] == NSOrderedSame && [[URL path] length] == 0);
-}
-
-
 + (BOOL)canHandleURL:(NSURL *)theURL
 {
-    if ([WebDataProtocol doesURLHaveInternalDataScheme:theURL]){
-        return YES;
-    }
-    return NO;
+    return ([[theURL scheme] caseInsensitiveCompare: WebDataProtocolScheme] == NSOrderedSame);
 }
 
 + (NSURL *)canonicalURLForURL:(NSURL *)URL
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index f787db2..e4ad98a 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -75,10 +75,10 @@
 
 -(NSMutableURLRequest *)request
 {
-    NSURLRequest *clientRequest = [_private->request _webDataRequestExternalRequest];
+    NSMutableURLRequest *clientRequest = [_private->request _webDataRequestExternalRequest];
     if (!clientRequest)
         clientRequest = _private->request;
-    return _private->request;
+    return clientRequest;
 }
 
 - (NSURLResponse *)response
diff --git a/WebKit/WebView.subproj/WebLoader.m b/WebKit/WebView.subproj/WebLoader.m
index cf61631..4f534c7 100644
--- a/WebKit/WebView.subproj/WebLoader.m
+++ b/WebKit/WebView.subproj/WebLoader.m
@@ -135,9 +135,9 @@
     
     [mutableRequest HTTPSetUserAgent:[controller userAgentForURL:[newRequest URL]]];
     newRequest = [mutableRequest autorelease];
-    
+
     clientRequest = [newRequest _webDataRequestExternalRequest];
-    if (!clientRequest)
+    if(!clientRequest)
         clientRequest = newRequest;
     else
         haveDataSchemeRequest = YES;
@@ -197,7 +197,7 @@
 
     // If the URL is one of our whacky applewebdata URLs that
     // fake up a substitute URL to present to the delegate.
-    if([WebDataProtocol doesURLHaveInternalDataScheme: [r URL]] != nil){
+    if([WebDataProtocol canHandleURL: [r URL]] != nil){
         NSURL *baseURL = [request _webDataRequestBaseURL];
         if (baseURL)
             [r setURL: baseURL];
diff --git a/WebKit/WebView.subproj/WebUserAgentSpoofTable.c b/WebKit/WebView.subproj/WebUserAgentSpoofTable.c
index f18b1e6..472f74b 100644
--- a/WebKit/WebView.subproj/WebUserAgentSpoofTable.c
+++ b/WebKit/WebView.subproj/WebUserAgentSpoofTable.c
@@ -1,7 +1,7 @@
 /* ANSI-C code produced by gperf version 2.7.2 */
 /* Command-line: gperf -CEot -L ANSI-C -k '*' -N _web_findSpoofTableEntry -F ,0 WebView.subproj/WebUserAgentSpoofTable.gperf  */
 struct UserAgentSpoofTableEntry { const char *name; UserAgentStringType type; };
-/* maximum key range = 21, duplicates = 0 */
+/* maximum key range = 27, duplicates = 0 */
 
 #ifdef __GNUC__
 __inline
@@ -15,32 +15,32 @@ hash (register const char *str, register unsigned int len)
 {
   static const unsigned char asso_values[] =
     {
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27,  0,  0, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27,  0, 10,  0,
-       0,  0,  0,  0,  0,  0,  0, 27,  0,  0,
-       0,  0,  0, 27,  0,  0, 10,  0,  0,  0,
-      27,  5,  0, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-      27, 27, 27, 27, 27, 27
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36,  5,  0, 36, 36, 15,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36,  0,  0,  0,
+       0,  0, 10,  0,  0,  0, 10, 36,  0,  0,
+       0,  0,  0, 36,  0,  0,  0,  0,  5,  0,
+      36, 15,  0, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+      36, 36, 36, 36, 36, 36
     };
   register int hval = len;
 
@@ -100,35 +100,41 @@ _web_findSpoofTableEntry (register const char *str, register unsigned int len)
 {
   enum
     {
-      TOTAL_KEYWORDS = 15,
+      TOTAL_KEYWORDS = 18,
       MIN_WORD_LENGTH = 6,
       MAX_WORD_LENGTH = 20,
-      MIN_HASH_VALUE = 6,
-      MAX_HASH_VALUE = 26
+      MIN_HASH_VALUE = 9,
+      MAX_HASH_VALUE = 35
     };
 
   static const struct UserAgentSpoofTableEntry wordlist[] =
     {
-      {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-      {"nj.com", MacIE},
-      {"",0}, {"",0}, {"",0},
-      {"jaguar.com", MacIE},
+      {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
+      {"",0}, {"",0},
+      {"watch.com", MacIE},
+      {"battle.net", MacIE},
       {"porsche.com", MacIE},
       {"mazdausa.com", MacIE},
       {"hondacars.com", MacIE},
-      {"oregonlive.com", MacIE},
+      {"abcnews.go.com", WinIE},
       {"",0},
-      {"olympic.org", MacIE},
+      {"nj.com", MacIE},
       {"",0},
       {"hondaredriders.com", MacIE},
-      {"watch.com", MacIE},
-      {"",0},
+      {"oregonlive.com", MacIE},
+      {"jaguar.com", MacIE},
       {"freebsd.org", MacIE},
       {"firstusa.com", MacIE},
       {"microsoft.com", MacIE},
-      {"abcnews.go.com", WinIE},
-      {"wap.sonyericsson.com", MacIE},
-      {"bang-olufsen.com", MacIE}
+      {"pier1.com", MacIE},
+      {"",0},
+      {"olympic.org", MacIE},
+      {"",0},
+      {"disney.go.com", MacIE},
+      {"",0}, {"",0},
+      {"bang-olufsen.com", MacIE},
+      {"",0}, {"",0}, {"",0},
+      {"wap.sonyericsson.com", MacIE}
     };
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list