[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 06:52:28 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit afe8515e2cdf4e0689b886d431c72558117a7a35
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 22 22:01:47 2002 +0000

    WebKit:
    
            * Misc.subproj/WebKitErrors.h: Add new error code to signify that a location
    	change has been interrupted by a change in the URLPolicy governing the load.
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient handle:willSendRequest:]): Add code to check the URLPolicy
    	for the URL in the request that is submitted to us in this delegate method. Send
    	a locationChangeDone:forDataSource: message with an error using the newly-defined
    	code in cases where the location change should be cancelled.
    
    WebBrowser:
    
    	Update LocationChangeHandler to handle the case where the
    	URLPolicy changes during a page load. This happens in the
    	case where we attempt to load an FTP URL that looks like
    	a URL to a file, but turns out to be a URL to a directory.
    
            * LocationChangeHandler.m:
            (-[LocationChangeHandler locationChangeDone:forDataSource:])
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f74233c..e40ee20 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2002-10-22  Ken Kocienda  <kocienda at apple.com>
+
+        * Misc.subproj/WebKitErrors.h: Add new error code to signify that a location
+	change has been interrupted by a change in the URLPolicy governing the load.
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handle:willSendRequest:]): Add code to check the URLPolicy
+	for the URL in the request that is submitted to us in this delegate method. Send
+	a locationChangeDone:forDataSource: message with an error using the newly-defined
+	code in cases where the location change should be cancelled.
+
 2002-10-22  Chris Blumenberg  <cblu at apple.com>
 
 	Added protocol headers for new plug-in API.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index f74233c..e40ee20 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,13 @@
+2002-10-22  Ken Kocienda  <kocienda at apple.com>
+
+        * Misc.subproj/WebKitErrors.h: Add new error code to signify that a location
+	change has been interrupted by a change in the URLPolicy governing the load.
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handle:willSendRequest:]): Add code to check the URLPolicy
+	for the URL in the request that is submitted to us in this delegate method. Send
+	a locationChangeDone:forDataSource: message with an error using the newly-defined
+	code in cases where the location change should be cancelled.
+
 2002-10-22  Chris Blumenberg  <cblu at apple.com>
 
 	Added protocol headers for new plug-in API.
diff --git a/WebKit/Misc.subproj/WebKitErrors.h b/WebKit/Misc.subproj/WebKitErrors.h
index d668c45..eee4c44 100644
--- a/WebKit/Misc.subproj/WebKitErrors.h
+++ b/WebKit/Misc.subproj/WebKitErrors.h
@@ -24,6 +24,7 @@ extern NSString *WebErrorDomainWebKit;
     @constant WebErrorCannotShowMIMEType
     @constant WebErrorCannotShowURL
     @constant WebErrorCannotNotFindApplicationForURL
+    @constant WebErrorLocationChangeInterruptedByURLPolicyChange
 */
 enum {
     WebErrorCannotFindFile = 10000,
@@ -37,5 +38,6 @@ enum {
     WebErrorCannotShowDirectory = 10008,
     WebErrorCannotShowMIMEType = 10009,
     WebErrorCannotShowURL = 10010,
-    WebErrorCannotNotFindApplicationForURL = 10011
+    WebErrorCannotNotFindApplicationForURL = 10011,
+    WebErrorLocationChangeInterruptedByURLPolicyChange = 10012
 };
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index b963d32..0aa0bc9 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -10,6 +10,7 @@
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDocument.h>
 #import <WebKit/WebDownloadHandler.h>
+#import <WebKit/WebKitErrors.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebKitLogging.h>
@@ -185,6 +186,8 @@
 
 -(WebResourceRequest *)handle:(WebResourceHandle *)handle willSendRequest:(WebResourceRequest *)newRequest
 {
+    WebResourceRequest *result;
+
     [newRequest setUserAgent:[[dataSource controller] userAgentForURL:[newRequest URL]]];
 
     // Let the resourceProgressDelegate get a crack at modifying the request.
@@ -201,31 +204,39 @@
 
     NSURL *URL = [newRequest URL];
 
-    LOG(Redirect, "URL = %@", URL);
-
-    // Update cookie policy base URL as URL changes, except for subframes, which use the
-    // URL of the main frame which doesn't change when we redirect.
-    if ([dataSource webFrame] == [[dataSource controller] mainFrame]) {
-        [newRequest setCookiePolicyBaseURL:URL];
+    if (![[dataSource webFrame] _shouldShowURL:URL]) {
+        [handle cancel];
+        [[dataSource webFrame] _setProvisionalDataSource:nil];
+	[[[dataSource controller] locationChangeDelegate] locationChangeDone:[WebError errorWithCode:WebErrorLocationChangeInterruptedByURLPolicyChange inDomain:WebErrorDomainWebKit failingURL:nil] forDataSource:dataSource];
+        result = nil;
     }
-
-    WebResourceRequest *copy = [newRequest copy];
-
-    // Don't set this on the first request.  It is set
-    // when the main load was started.
-    if (request)
-        [dataSource _setRequest:copy];
-
-    // Not the first send, so reload.
-    if (request) {
-        [self didStopLoading];
-        [self didStartLoadingWithURL:URL];
+    else {
+        LOG(Redirect, "URL = %@", URL);
+    
+        // Update cookie policy base URL as URL changes, except for subframes, which use the
+        // URL of the main frame which doesn't change when we redirect.
+        if ([dataSource webFrame] == [[dataSource controller] mainFrame]) {
+            [newRequest setCookiePolicyBaseURL:URL];
+        }
+    
+        WebResourceRequest *copy = [newRequest copy];
+    
+        // Don't set this on the first request.  It is set
+        // when the main load was started.
+        if (request)
+            [dataSource _setRequest:copy];
+    
+        // Not the first send, so reload.
+        if (request) {
+            [self didStopLoading];
+            [self didStartLoadingWithURL:URL];
+        }
+    
+        [request release];
+        result = request = copy;
     }
-
-    [request release];
-    request = copy;
         
-    return newRequest;
+    return result;
 }
 
 -(void)handle:(WebResourceHandle *)handle didReceiveResponse:(WebResourceResponse *)r
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index b963d32..0aa0bc9 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -10,6 +10,7 @@
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDocument.h>
 #import <WebKit/WebDownloadHandler.h>
+#import <WebKit/WebKitErrors.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebKitLogging.h>
@@ -185,6 +186,8 @@
 
 -(WebResourceRequest *)handle:(WebResourceHandle *)handle willSendRequest:(WebResourceRequest *)newRequest
 {
+    WebResourceRequest *result;
+
     [newRequest setUserAgent:[[dataSource controller] userAgentForURL:[newRequest URL]]];
 
     // Let the resourceProgressDelegate get a crack at modifying the request.
@@ -201,31 +204,39 @@
 
     NSURL *URL = [newRequest URL];
 
-    LOG(Redirect, "URL = %@", URL);
-
-    // Update cookie policy base URL as URL changes, except for subframes, which use the
-    // URL of the main frame which doesn't change when we redirect.
-    if ([dataSource webFrame] == [[dataSource controller] mainFrame]) {
-        [newRequest setCookiePolicyBaseURL:URL];
+    if (![[dataSource webFrame] _shouldShowURL:URL]) {
+        [handle cancel];
+        [[dataSource webFrame] _setProvisionalDataSource:nil];
+	[[[dataSource controller] locationChangeDelegate] locationChangeDone:[WebError errorWithCode:WebErrorLocationChangeInterruptedByURLPolicyChange inDomain:WebErrorDomainWebKit failingURL:nil] forDataSource:dataSource];
+        result = nil;
     }
-
-    WebResourceRequest *copy = [newRequest copy];
-
-    // Don't set this on the first request.  It is set
-    // when the main load was started.
-    if (request)
-        [dataSource _setRequest:copy];
-
-    // Not the first send, so reload.
-    if (request) {
-        [self didStopLoading];
-        [self didStartLoadingWithURL:URL];
+    else {
+        LOG(Redirect, "URL = %@", URL);
+    
+        // Update cookie policy base URL as URL changes, except for subframes, which use the
+        // URL of the main frame which doesn't change when we redirect.
+        if ([dataSource webFrame] == [[dataSource controller] mainFrame]) {
+            [newRequest setCookiePolicyBaseURL:URL];
+        }
+    
+        WebResourceRequest *copy = [newRequest copy];
+    
+        // Don't set this on the first request.  It is set
+        // when the main load was started.
+        if (request)
+            [dataSource _setRequest:copy];
+    
+        // Not the first send, so reload.
+        if (request) {
+            [self didStopLoading];
+            [self didStartLoadingWithURL:URL];
+        }
+    
+        [request release];
+        result = request = copy;
     }
-
-    [request release];
-    request = copy;
         
-    return newRequest;
+    return result;
 }
 
 -(void)handle:(WebResourceHandle *)handle didReceiveResponse:(WebResourceResponse *)r

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list