[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:43:23 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit df05a5beeace5a4bd4f0a4f91154f274d07830ad
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 29 15:57:44 2003 +0000

            Reviewed by Richard
    
    	Fix for this bug:
    
    	Radar 3260323 (Some links at nike.com cause assertion failure
    	(connectionDidFinishLoading sent after cancel))
    
    	Added a flag which is set when a load is cancelled. This flag prevents
    	bad behvior when loads that finish cause the load itself to be
    	cancelled (which could happen with a javascript that changes the
    	window location). This is used to prevent both the body of
    	cancelWithError: and the body of connectionDidFinishLoading: running
    	for a single delegate. Cancelling wins.
    
            * WebView.subproj/WebBaseResourceHandleDelegate.h:
            * WebView.subproj/WebBaseResourceHandleDelegate.m:
            (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]):
            (-[WebBaseResourceHandleDelegate cancelWithError:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4443 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f2dfce8..f90d7c1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2003-05-28  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Richard
+
+	Fix for this bug:
+
+	Radar 3260323 (Some links at nike.com cause assertion failure 
+	(connectionDidFinishLoading sent after cancel))
+
+	Added a flag which is set when a load is cancelled. This flag prevents
+	bad behvior when loads that finish cause the load itself to be
+	cancelled (which could happen with a javascript that changes the
+	window location). This is used to prevent both the body of
+	cancelWithError: and the body of connectionDidFinishLoading: running
+	for a single delegate. Cancelling wins.
+
+        * WebView.subproj/WebBaseResourceHandleDelegate.h:
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]):
+        (-[WebBaseResourceHandleDelegate cancelWithError:]):
+
 2003-05-28  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: 3270576 - RealPlayer plug-in fails to load
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
index 3fa58ae..46c31b6 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
@@ -31,6 +31,7 @@
     id downloadDelegate;
     NSURLAuthenticationChallenge *currentConnectionChallenge;
     NSURLAuthenticationChallenge *currentWebChallenge;
+    BOOL cancelledFlag;
     BOOL reachedTerminalState;
     BOOL defersCallbacks;
     WebResourceDelegateImplementationCache implementations;
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
index e5114ec..704673d 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
@@ -301,6 +301,12 @@
 
 - (void)connectionDidFinishLoading:(NSURLConnection *)con
 {
+    // If load has been cancelled after finishing (which could happen with a 
+    // javascript that changes the window location), do nothing.
+    if (cancelledFlag) {
+        return;
+    }
+    
     ASSERT(con == connection);
     ASSERT(!reachedTerminalState);
 
@@ -326,6 +332,13 @@
 {
     ASSERT(!reachedTerminalState);
 
+    // This flag prevents bad behvior when loads that finish cause the
+    // load itself to be cancelled (which could happen with a javascript that 
+    // changes the window location). This is used to prevent both the body
+    // of this method and the body of connectionDidFinishLoading: running
+    // for a single delegate. Cancelling wins.
+    cancelledFlag = YES;
+    
     [currentConnectionChallenge release];
     currentConnectionChallenge = nil;
     
diff --git a/WebKit/WebView.subproj/WebLoader.h b/WebKit/WebView.subproj/WebLoader.h
index 3fa58ae..46c31b6 100644
--- a/WebKit/WebView.subproj/WebLoader.h
+++ b/WebKit/WebView.subproj/WebLoader.h
@@ -31,6 +31,7 @@
     id downloadDelegate;
     NSURLAuthenticationChallenge *currentConnectionChallenge;
     NSURLAuthenticationChallenge *currentWebChallenge;
+    BOOL cancelledFlag;
     BOOL reachedTerminalState;
     BOOL defersCallbacks;
     WebResourceDelegateImplementationCache implementations;
diff --git a/WebKit/WebView.subproj/WebLoader.m b/WebKit/WebView.subproj/WebLoader.m
index e5114ec..704673d 100644
--- a/WebKit/WebView.subproj/WebLoader.m
+++ b/WebKit/WebView.subproj/WebLoader.m
@@ -301,6 +301,12 @@
 
 - (void)connectionDidFinishLoading:(NSURLConnection *)con
 {
+    // If load has been cancelled after finishing (which could happen with a 
+    // javascript that changes the window location), do nothing.
+    if (cancelledFlag) {
+        return;
+    }
+    
     ASSERT(con == connection);
     ASSERT(!reachedTerminalState);
 
@@ -326,6 +332,13 @@
 {
     ASSERT(!reachedTerminalState);
 
+    // This flag prevents bad behvior when loads that finish cause the
+    // load itself to be cancelled (which could happen with a javascript that 
+    // changes the window location). This is used to prevent both the body
+    // of this method and the body of connectionDidFinishLoading: running
+    // for a single delegate. Cancelling wins.
+    cancelledFlag = YES;
+    
     [currentConnectionChallenge release];
     currentConnectionChallenge = nil;
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list