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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:00:58 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 252d3fe7b8544cf1ef02fbea9e8231aef7d25b05
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 15 11:33:30 2002 +0000

    	Wrap content policy invocation to look asynchronous.
    
            * WebView.subproj/WebBaseResourceHandleDelegate.h:
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient continueAfterContentPolicy:response:]):
            (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]):
            (-[WebMainResourceClient handle:didReceiveResponse:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2687 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 569e4ab..07bc112 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,15 @@
 2002-11-15  Maciej Stachowiak  <mjs at apple.com>
 
+	Wrap content policy invocation to look asynchronous.
+	
+        * WebView.subproj/WebBaseResourceHandleDelegate.h:
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient continueAfterContentPolicy:response:]):
+        (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]):
+        (-[WebMainResourceClient handle:didReceiveResponse:]):
+
+2002-11-15  Maciej Stachowiak  <mjs at apple.com>
+
 	Refactor so that all invocations of navigation policy are set up
 	to be asynchronous. However, the actually delegate method is not
 	async yet.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 569e4ab..07bc112 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,15 @@
 2002-11-15  Maciej Stachowiak  <mjs at apple.com>
 
+	Wrap content policy invocation to look asynchronous.
+	
+        * WebView.subproj/WebBaseResourceHandleDelegate.h:
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient continueAfterContentPolicy:response:]):
+        (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]):
+        (-[WebMainResourceClient handle:didReceiveResponse:]):
+
+2002-11-15  Maciej Stachowiak  <mjs at apple.com>
+
 	Refactor so that all invocations of navigation policy are set up
 	to be asynchronous. However, the actually delegate method is not
 	async yet.
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
index c4a5bf8..371b130 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
@@ -18,8 +18,8 @@
 {
 @protected
     WebDataSource *dataSource;
- at private
     WebResourceHandle *handle;
+ at private
     WebResourceRequest *request;
     WebResourceResponse *response;
     id identifier;
diff --git a/WebKit/WebView.subproj/WebLoader.h b/WebKit/WebView.subproj/WebLoader.h
index c4a5bf8..371b130 100644
--- a/WebKit/WebView.subproj/WebLoader.h
+++ b/WebKit/WebView.subproj/WebLoader.h
@@ -18,8 +18,8 @@
 {
 @protected
     WebDataSource *dataSource;
- at private
     WebResourceHandle *handle;
+ at private
     WebResourceRequest *request;
     WebResourceResponse *response;
     id identifier;
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index efddd1d..57142a9 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -149,26 +149,14 @@
     [super notifyDelegatesOfInterruptionByPolicyChange];
 }
 
--(void)handle:(WebResourceHandle *)h didReceiveResponse:(WebResourceResponse *)r
+-(void)continueAfterContentPolicy:(WebPolicyAction)contentPolicy response:(WebResourceResponse *)r
 {
-    [dataSource _setResponse:r];
-
-    LOG(Download, "main content type: %@", [r contentType]);
-
-    WebPolicyAction contentPolicy;
+    if (!defersBeforeCheckingPolicy) {
+	[[dataSource controller] _setDefersCallbacks:NO];
+    }
 
     WebResourceRequest *req = [dataSource request];
 
-
-    // Figure out the content policy.
-    if (![dataSource isDownloading]) {
-	contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForMIMEType:[r contentType]
-								  andRequest:req
-								  inFrame:[dataSource webFrame]];
-    } else {
-	contentPolicy = WebPolicySave;
-    }
-
     switch (contentPolicy) {
     case WebPolicyShow:
 	if (![WebController canShowMIMEType:[r contentType]]) {
@@ -230,8 +218,38 @@
         ERROR("contentPolicyForMIMEType:andRequest:inFrame: returned an invalid content policy.");
     }
 
-    [super handle:h didReceiveResponse:r];
-    
+    [super handle:handle didReceiveResponse:r];
+}
+
+
+-(void)checkContentPolicyForResponse:(WebResourceResponse *)r andCallSelector:(SEL)selector
+{
+    WebPolicyAction contentPolicy = 
+	[[[dataSource controller] policyDelegate] contentPolicyForMIMEType:[r contentType]
+						  andRequest:[dataSource request]
+						  inFrame:[dataSource webFrame]];
+    [self performSelector:selector withObject:(id)contentPolicy withObject:r];
+}
+
+
+-(void)handle:(WebResourceHandle *)h didReceiveResponse:(WebResourceResponse *)r
+{
+    [dataSource _setResponse:r];
+
+    LOG(Download, "main content type: %@", [r contentType]);
+
+    defersBeforeCheckingPolicy = [[dataSource controller] _defersCallbacks];
+    if (!defersBeforeCheckingPolicy) {
+	[[dataSource controller] _setDefersCallbacks:YES];
+    }
+
+    // Figure out the content policy.
+    if (![dataSource isDownloading]) {
+	[self checkContentPolicyForResponse:r andCallSelector:@selector(continueAfterContentPolicy:response:)];
+    } else {
+	[self continueAfterContentPolicy:WebPolicySave response:r];
+    }
+
     _contentLength = [r contentLength];
 }
 
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index efddd1d..57142a9 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -149,26 +149,14 @@
     [super notifyDelegatesOfInterruptionByPolicyChange];
 }
 
--(void)handle:(WebResourceHandle *)h didReceiveResponse:(WebResourceResponse *)r
+-(void)continueAfterContentPolicy:(WebPolicyAction)contentPolicy response:(WebResourceResponse *)r
 {
-    [dataSource _setResponse:r];
-
-    LOG(Download, "main content type: %@", [r contentType]);
-
-    WebPolicyAction contentPolicy;
+    if (!defersBeforeCheckingPolicy) {
+	[[dataSource controller] _setDefersCallbacks:NO];
+    }
 
     WebResourceRequest *req = [dataSource request];
 
-
-    // Figure out the content policy.
-    if (![dataSource isDownloading]) {
-	contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForMIMEType:[r contentType]
-								  andRequest:req
-								  inFrame:[dataSource webFrame]];
-    } else {
-	contentPolicy = WebPolicySave;
-    }
-
     switch (contentPolicy) {
     case WebPolicyShow:
 	if (![WebController canShowMIMEType:[r contentType]]) {
@@ -230,8 +218,38 @@
         ERROR("contentPolicyForMIMEType:andRequest:inFrame: returned an invalid content policy.");
     }
 
-    [super handle:h didReceiveResponse:r];
-    
+    [super handle:handle didReceiveResponse:r];
+}
+
+
+-(void)checkContentPolicyForResponse:(WebResourceResponse *)r andCallSelector:(SEL)selector
+{
+    WebPolicyAction contentPolicy = 
+	[[[dataSource controller] policyDelegate] contentPolicyForMIMEType:[r contentType]
+						  andRequest:[dataSource request]
+						  inFrame:[dataSource webFrame]];
+    [self performSelector:selector withObject:(id)contentPolicy withObject:r];
+}
+
+
+-(void)handle:(WebResourceHandle *)h didReceiveResponse:(WebResourceResponse *)r
+{
+    [dataSource _setResponse:r];
+
+    LOG(Download, "main content type: %@", [r contentType]);
+
+    defersBeforeCheckingPolicy = [[dataSource controller] _defersCallbacks];
+    if (!defersBeforeCheckingPolicy) {
+	[[dataSource controller] _setDefersCallbacks:YES];
+    }
+
+    // Figure out the content policy.
+    if (![dataSource isDownloading]) {
+	[self checkContentPolicyForResponse:r andCallSelector:@selector(continueAfterContentPolicy:response:)];
+    } else {
+	[self continueAfterContentPolicy:WebPolicySave response:r];
+    }
+
     _contentLength = [r contentLength];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list