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

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:33:11 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e57d65622e55052094215737fad9fbb294807065
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Apr 2 00:21:10 2003 +0000

    Tests:
    
            Reviewed by Darin
    
    	NSURLConnectionDelegate is no longer a formal protocol.
    
            * PDFBundle/PDFView.m:
    
    WebFoundation:
    
            Reviewed by Darin
    
    	NSURLConnectionDelegate is no longer a formal protocol. Added support
    	to do dynamic checking of delegate object to see if that object
    	implements the NSURLConnectionDelegate category methods.
    
            NSURLConnection no longer has a loadWithDelegate: method. Loads
            start implicitly at init time. Changed code since we no longer
    	send willSendRequest:redirectResponse: callbacks for initial loads.
    
    	Updated comments in NSURLConnection.h so they match API approved versions.
    
    	Tweaked callback flag names so that they match the callback names themselves.
    
            * CacheLoader.subproj/NSURLConnection.h:
            * CacheLoader.subproj/NSURLConnection.m:
            (+[NSURLConnection connectionWithRequest:delegate:]):
            (-[NSURLConnection initWithRequest:delegate:]):
            (-[NSURLConnection _sendCallbacks]):
            (-[NSURLConnection _postWillSendRequestCallback]):
            (-[NSURLConnection _postDidReceiveResponseCallback]):
            (-[NSURLConnection _postDidReceiveDataCallback]):
            (-[NSURLConnection _postDidFinishLoadingCallback]):
            (-[NSURLConnection _postDidFailLoadingCallback]):
            (-[NSURLConnection _sendWillSendRequestCallback]):
            (-[NSURLConnection schedule]):
            (-[NSURLConnection _beginLoad]):
            (-[NSURLConnectionInternal prepareCallbacks]):
            * CacheLoader.subproj/WebSynchronousDelegate.h:
            * CacheLoader.subproj/WebSynchronousDelegate.m:
            (-[WebSynchronousDelegate run:]):
    
    WebKit:
    
            Reviewed by Darin
    
            NSURLConnectionDelegate is no longer a formal protocol.
    
            NSURLConnection no longer has a loadWithDelegate: method. Loads
            start implicitly at init time. Some clients have been updated
            to call the willSendRequest:redirectResponse: callback manually
            since this callback is no longer sent for initial loads.
    
            * Downloads.subproj/WebDownload.m:
            (-[WebDownload initWithRequest:]):
            (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]):
            (-[WebDownload loadWithDelegate:]):
            * Misc.subproj/WebIconLoader.h:
            * Misc.subproj/WebIconLoader.m:
            (-[WebIconLoader startLoading]):
            * WebView.subproj/WebBaseResourceHandleDelegate.h:
            * WebView.subproj/WebBaseResourceHandleDelegate.m:
            (-[WebBaseResourceHandleDelegate loadWithRequest:]):
            * WebView.subproj/WebMainResourceClient.h:
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient loadWithRequest:]):
            (-[WebResourceDelegateProxy setDelegate:]):
    
    WebBrowser:
    
            Reviewed by Darin
    
    	NSURLConnectionDelegate is no longer a formal protocol.
    
    	NSURLConnection no longer has a loadWithDelegate: method. Loads
    	start implicitly at init time.
    
            * BugReportController.h:
            * BugReportController.m:
            (-[BugReportController sendBugReportToAppleWithScreenShot:source:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3992 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 2a2c925..b357f48 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2003-04-01  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Darin
+
+        NSURLConnectionDelegate is no longer a formal protocol.
+
+        NSURLConnection no longer has a loadWithDelegate: method. Loads
+        start implicitly at init time. Some clients have been updated
+        to call the willSendRequest:redirectResponse: callback manually
+        since this callback is no longer sent for initial loads.
+
+        * Downloads.subproj/WebDownload.m:
+        (-[WebDownload initWithRequest:]):
+        (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]):
+        (-[WebDownload loadWithDelegate:]):
+        * Misc.subproj/WebIconLoader.h:
+        * Misc.subproj/WebIconLoader.m:
+        (-[WebIconLoader startLoading]):
+        * WebView.subproj/WebBaseResourceHandleDelegate.h:
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (-[WebBaseResourceHandleDelegate loadWithRequest:]):
+        * WebView.subproj/WebMainResourceClient.h:
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient loadWithRequest:]):
+        (-[WebResourceDelegateProxy setDelegate:]):
+
 2003-04-01  Darin Adler  <darin at apple.com>
 
         Reviewed by John.
diff --git a/WebKit/Downloads.subproj/WebDownload.m b/WebKit/Downloads.subproj/WebDownload.m
index deb1dc6..331811b 100644
--- a/WebKit/Downloads.subproj/WebDownload.m
+++ b/WebKit/Downloads.subproj/WebDownload.m
@@ -168,12 +168,6 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
     _private = [[WebDownloadPrivate alloc] init];
     _private->request = [request retain];
     
-    _private->connection = [[NSURLConnection alloc] initWithRequest:request];
-    if (!_private->connection) {
-        [self release];
-        return nil;
-    }
-
     return self;
 }
 
@@ -193,7 +187,7 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
     _private->response = [response retain];
     _private->proxy = 	 [proxy retain];
     [self _setDelegate:delegate];
-    [_private->proxy setDelegate:(id <NSURLConnectionDelegate>)self];
+    [_private->proxy setDelegate:self];
 
     // Replay the delegate methods that would be called in the standalone download case.
     if ([_private->delegate respondsToSelector:@selector(download:didStartFromRequest:)]) {
@@ -209,12 +203,7 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
                 [self _setRequest:request];
                 [self _setResponse:nil];
                 [_private->connection release];
-                _private->connection = [[NSURLConnection alloc] initWithRequest:request];
-                if (!_private->connection) {
-                    [self release];
-                    return nil;
-                }
-                [_private->connection loadWithDelegate:(id <NSURLConnectionDelegate>)self];
+                _private->connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
                 [self _downloadStarted];
             }
             return self;
@@ -250,13 +239,16 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
 - (void)loadWithDelegate:(id)delegate
 {
     if (!_private->isDownloading) {
-        [self _downloadStarted];
-        
         [self _setDelegate:delegate];
-        [_private->connection loadWithDelegate:(id <NSURLConnectionDelegate>)self];
+        // send this synthetic delegate callback since clients expect it, and
+        // we no longer send the callback from within NSURLConnection for
+        // initial requests.
+        NSURLRequest *request = [self connection:nil willSendRequest:_private->request redirectResponse:nil];
+        _private->connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
+        [self _downloadStarted];
         
         if ([_private->delegate respondsToSelector:@selector(download:didStartFromRequest:)]) {
-            [_private->delegate download:self didStartFromRequest:_private->request];
+            [_private->delegate download:self didStartFromRequest:request];
         }
     }
 }
diff --git a/WebKit/Misc.subproj/WebIconLoader.h b/WebKit/Misc.subproj/WebIconLoader.h
index 154e84f..d726ff7 100644
--- a/WebKit/Misc.subproj/WebIconLoader.h
+++ b/WebKit/Misc.subproj/WebIconLoader.h
@@ -8,12 +8,11 @@
 #import <Cocoa/Cocoa.h>
 
 @class WebIconLoaderPrivate;
- at protocol NSURLConnectionDelegate;
 
 /*!
     @class WebIconLoader
 */
- at interface WebIconLoader : NSObject <NSURLConnectionDelegate>
+ at interface WebIconLoader : NSObject
 {
     WebIconLoaderPrivate *_private;
 }
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
index 29e9d91..6f5de17 100644
--- a/WebKit/Misc.subproj/WebIconLoader.m
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -85,10 +85,12 @@
         return;
     }
     
-    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:_private->URL];
-    _private->handle = [[NSURLConnection alloc] initWithRequest:request];
-    [_private->handle loadWithDelegate:self];
-    [request release];
+    // send this synthetic delegate callback since clients expect it, and
+    // we no longer send the callback from within NSURLConnection for
+    // initial requests.
+    NSURLRequest *request = [NSURLRequest requestWithURL:_private->URL];
+    request = [self connection:nil willSendRequest:request redirectResponse:nil];
+    _private->handle = [[NSURLConnection alloc] initWithRequest:request delegate:self];
 }
 
 - (void)stopLoading
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
index 40c18e0..4cbd74d 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
@@ -14,9 +14,7 @@
 @class NSURLRequest;
 @class NSURLResponse;
 
- at protocol NSURLConnectionDelegate;
-
- at interface WebBaseResourceHandleDelegate : NSObject <NSURLConnectionDelegate>
+ at interface WebBaseResourceHandleDelegate : NSObject
 {
 @protected
     WebDataSource *dataSource;
@@ -36,9 +34,6 @@
 
 - (BOOL)loadWithRequest:(NSURLRequest *)request;
 
-// this method exists only to be subclassed, don't call it directly
-- (void)startLoading:(NSURLRequest *)r;
-
 - (void)setDataSource:(WebDataSource *)d;
 - (WebDataSource *)dataSource;
 
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
index 920e807..af6bcef 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
@@ -64,25 +64,16 @@
     [super dealloc];
 }
 
-- (void)startLoading:(NSURLRequest *)r
-{
-    [connection loadWithDelegate:self];
-}
-
 - (BOOL)loadWithRequest:(NSURLRequest *)r
 {
     ASSERT(connection == nil);
     
-    connection = [[NSURLConnection alloc] initWithRequest:r];
-    if (!connection) {
-        return NO;
-    }
+    r = [self connection:connection willSendRequest:r redirectResponse:nil];
+    connection = [[NSURLConnection alloc] initWithRequest:r delegate:self];
     if (defersCallbacks) {
         [connection setDefersCallbacks:YES];
     }
 
-    [self startLoading:r];
-
     return YES;
 }
 
diff --git a/WebKit/WebView.subproj/WebLoader.h b/WebKit/WebView.subproj/WebLoader.h
index 40c18e0..4cbd74d 100644
--- a/WebKit/WebView.subproj/WebLoader.h
+++ b/WebKit/WebView.subproj/WebLoader.h
@@ -14,9 +14,7 @@
 @class NSURLRequest;
 @class NSURLResponse;
 
- at protocol NSURLConnectionDelegate;
-
- at interface WebBaseResourceHandleDelegate : NSObject <NSURLConnectionDelegate>
+ at interface WebBaseResourceHandleDelegate : NSObject
 {
 @protected
     WebDataSource *dataSource;
@@ -36,9 +34,6 @@
 
 - (BOOL)loadWithRequest:(NSURLRequest *)request;
 
-// this method exists only to be subclassed, don't call it directly
-- (void)startLoading:(NSURLRequest *)r;
-
 - (void)setDataSource:(WebDataSource *)d;
 - (WebDataSource *)dataSource;
 
diff --git a/WebKit/WebView.subproj/WebLoader.m b/WebKit/WebView.subproj/WebLoader.m
index 920e807..af6bcef 100644
--- a/WebKit/WebView.subproj/WebLoader.m
+++ b/WebKit/WebView.subproj/WebLoader.m
@@ -64,25 +64,16 @@
     [super dealloc];
 }
 
-- (void)startLoading:(NSURLRequest *)r
-{
-    [connection loadWithDelegate:self];
-}
-
 - (BOOL)loadWithRequest:(NSURLRequest *)r
 {
     ASSERT(connection == nil);
     
-    connection = [[NSURLConnection alloc] initWithRequest:r];
-    if (!connection) {
-        return NO;
-    }
+    r = [self connection:connection willSendRequest:r redirectResponse:nil];
+    connection = [[NSURLConnection alloc] initWithRequest:r delegate:self];
     if (defersCallbacks) {
         [connection setDefersCallbacks:YES];
     }
 
-    [self startLoading:r];
-
     return YES;
 }
 
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.h b/WebKit/WebView.subproj/WebMainResourceClient.h
index 43c255e..6846a26 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.h
+++ b/WebKit/WebView.subproj/WebMainResourceClient.h
@@ -13,11 +13,11 @@
 @class WebPolicyDecisionListener;
 @class WebDataSource;
 
- at interface WebResourceDelegateProxy : NSObject <NSURLConnectionDelegate>
+ at interface WebResourceDelegateProxy : NSObject
 {
-    id <NSURLConnectionDelegate> delegate;
+    id delegate;
 }
-- (void)setDelegate:(id <NSURLConnectionDelegate>)theDelegate;
+- (void)setDelegate:(id)theDelegate;
 @end
 
 @interface WebMainResourceClient : WebBaseResourceHandleDelegate
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 1e41d85..8f49c91 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -270,9 +270,13 @@
     [self receivedError:error];
 }
 
-- (void)startLoading:(NSURLRequest *)r
+- (BOOL)loadWithRequest:(NSURLRequest *)r
 {
+    ASSERT(connection == nil);
+    
     if ([[r URL] _web_shouldLoadAsEmptyDocument]) {
+        connection = [[NSURLConnection alloc] initWithRequest:r delegate:nil];
+
 	[self connection:connection willSendRequest:r redirectResponse:nil];
 
 	NSURLResponse *rsp = [[NSURLResponse alloc] init];
@@ -282,8 +286,17 @@
 	[self connection:connection didReceiveResponse:rsp];
 	[rsp release];
     } else {
-	[connection loadWithDelegate:proxy];
+        // send this synthetic delegate callback since clients expect it, and
+        // we no longer send the callback from within NSURLConnection for
+        // initial requests.
+        r = [proxy connection:nil willSendRequest:r redirectResponse:nil];
+        connection = [[NSURLConnection alloc] initWithRequest:r delegate:proxy];
+        if ([self defersCallbacks]) {
+            [connection setDefersCallbacks:YES];
+        }
     }
+
+    return YES;
 }
 
 - (void)setDefersCallbacks:(BOOL)defers
@@ -298,7 +311,7 @@
 
 @implementation WebResourceDelegateProxy
 
-- (void)setDelegate:(id <NSURLConnectionDelegate>)theDelegate
+- (void)setDelegate:(id)theDelegate
 {
     delegate = theDelegate;
 }
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.h b/WebKit/WebView.subproj/WebMainResourceLoader.h
index 43c255e..6846a26 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.h
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.h
@@ -13,11 +13,11 @@
 @class WebPolicyDecisionListener;
 @class WebDataSource;
 
- at interface WebResourceDelegateProxy : NSObject <NSURLConnectionDelegate>
+ at interface WebResourceDelegateProxy : NSObject
 {
-    id <NSURLConnectionDelegate> delegate;
+    id delegate;
 }
-- (void)setDelegate:(id <NSURLConnectionDelegate>)theDelegate;
+- (void)setDelegate:(id)theDelegate;
 @end
 
 @interface WebMainResourceClient : WebBaseResourceHandleDelegate
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 1e41d85..8f49c91 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -270,9 +270,13 @@
     [self receivedError:error];
 }
 
-- (void)startLoading:(NSURLRequest *)r
+- (BOOL)loadWithRequest:(NSURLRequest *)r
 {
+    ASSERT(connection == nil);
+    
     if ([[r URL] _web_shouldLoadAsEmptyDocument]) {
+        connection = [[NSURLConnection alloc] initWithRequest:r delegate:nil];
+
 	[self connection:connection willSendRequest:r redirectResponse:nil];
 
 	NSURLResponse *rsp = [[NSURLResponse alloc] init];
@@ -282,8 +286,17 @@
 	[self connection:connection didReceiveResponse:rsp];
 	[rsp release];
     } else {
-	[connection loadWithDelegate:proxy];
+        // send this synthetic delegate callback since clients expect it, and
+        // we no longer send the callback from within NSURLConnection for
+        // initial requests.
+        r = [proxy connection:nil willSendRequest:r redirectResponse:nil];
+        connection = [[NSURLConnection alloc] initWithRequest:r delegate:proxy];
+        if ([self defersCallbacks]) {
+            [connection setDefersCallbacks:YES];
+        }
     }
+
+    return YES;
 }
 
 - (void)setDefersCallbacks:(BOOL)defers
@@ -298,7 +311,7 @@
 
 @implementation WebResourceDelegateProxy
 
-- (void)setDelegate:(id <NSURLConnectionDelegate>)theDelegate
+- (void)setDelegate:(id)theDelegate
 {
     delegate = theDelegate;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list