[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 06:58:51 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 6bf718ab3bdfa1348dc4f230b17edbc2f6e6b552
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 11 15:01:17 2002 +0000

    WebKit:
    
    	Store path and the fact that we're downloading in the data source,
    	instead of storing the content policy.
    
            * Downloads.subproj/WebDownloadHandler.m:
            (-[WebDownloadHandler cleanUpAfterFailure]):
            (-[WebDownloadHandler createFileIfNecessary]):
            (-[WebDownloadHandler finishedLoading]):
            * WebView.subproj/WebControllerPrivate.m:
            (-[WebController _downloadURL:withContentPolicy:]):
            * WebView.subproj/WebDataSource.h:
            * WebView.subproj/WebDataSource.m:
            (+[WebDataSource registerRepresentationClass:forMIMEType:]):
            (-[WebDataSource isDownloading]):
            (-[WebDataSource downloadPath]):
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSourcePrivate dealloc]):
            (-[WebDataSource _commitIfReady]):
            (-[WebDataSource _setIsDownloading:]):
            (-[WebDataSource _setDownloadPath:]):
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient receivedError:]):
            (-[WebMainResourceClient handle:didReceiveResponse:]):
            (-[WebMainResourceClient handleDidFinishLoading:]):
    
    WebBrowser:
    
    	Adjusted for WebKit API changes.
    
            * DownloadProgressEntry.m:
            (+[DownloadProgressEntry entryWithDataSource:]):
            (-[DownloadProgressEntry path]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2623 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5befbe5..2a59498 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,32 @@
 2002-11-11  Maciej Stachowiak  <mjs at apple.com>
 
+	Store path and the fact that we're downloading in the data source,
+	instead of storing the content policy.
+	
+        * Downloads.subproj/WebDownloadHandler.m:
+        (-[WebDownloadHandler cleanUpAfterFailure]):
+        (-[WebDownloadHandler createFileIfNecessary]):
+        (-[WebDownloadHandler finishedLoading]):
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _downloadURL:withContentPolicy:]):
+        * WebView.subproj/WebDataSource.h:
+        * WebView.subproj/WebDataSource.m:
+        (+[WebDataSource registerRepresentationClass:forMIMEType:]):
+        (-[WebDataSource isDownloading]):
+        (-[WebDataSource downloadPath]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _commitIfReady]):
+        (-[WebDataSource _setIsDownloading:]):
+        (-[WebDataSource _setDownloadPath:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient receivedError:]):
+        (-[WebMainResourceClient handle:didReceiveResponse:]):
+        (-[WebMainResourceClient handleDidFinishLoading:]):
+
+2002-11-11  Maciej Stachowiak  <mjs at apple.com>
+
 	Don't ask for the content policy any more if the previous policies
 	said to save - in effect this means to ask only if the previous
 	policies said to use the content policy. Also, remove now-useless
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 5befbe5..2a59498 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,32 @@
 2002-11-11  Maciej Stachowiak  <mjs at apple.com>
 
+	Store path and the fact that we're downloading in the data source,
+	instead of storing the content policy.
+	
+        * Downloads.subproj/WebDownloadHandler.m:
+        (-[WebDownloadHandler cleanUpAfterFailure]):
+        (-[WebDownloadHandler createFileIfNecessary]):
+        (-[WebDownloadHandler finishedLoading]):
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _downloadURL:withContentPolicy:]):
+        * WebView.subproj/WebDataSource.h:
+        * WebView.subproj/WebDataSource.m:
+        (+[WebDataSource registerRepresentationClass:forMIMEType:]):
+        (-[WebDataSource isDownloading]):
+        (-[WebDataSource downloadPath]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _commitIfReady]):
+        (-[WebDataSource _setIsDownloading:]):
+        (-[WebDataSource _setDownloadPath:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient receivedError:]):
+        (-[WebMainResourceClient handle:didReceiveResponse:]):
+        (-[WebMainResourceClient handleDidFinishLoading:]):
+
+2002-11-11  Maciej Stachowiak  <mjs at apple.com>
+
 	Don't ask for the content policy any more if the previous policies
 	said to save - in effect this means to ask only if the previous
 	policies said to use the content policy. Also, remove now-useless
diff --git a/WebKit/Downloads.subproj/WebDownload.m b/WebKit/Downloads.subproj/WebDownload.m
index 37b52d6..83dea20 100644
--- a/WebKit/Downloads.subproj/WebDownload.m
+++ b/WebKit/Downloads.subproj/WebDownload.m
@@ -130,7 +130,7 @@
 
 - (void)cleanUpAfterFailure
 {
-    NSString *path = [[dataSource contentPolicy] path];
+    NSString *path = [dataSource downloadPath];
 
     [self closeFile];
     
@@ -146,7 +146,7 @@
     }
     
     NSFileManager *fileManager = [NSFileManager defaultManager];
-    NSString *path = [[dataSource contentPolicy] path];
+    NSString *path = [dataSource downloadPath];
     NSObject <WebDownloadDecoder> *lastDecoder = [decoderSequence lastObject];
         
     NSString *filename = [lastDecoder filename];
@@ -170,7 +170,7 @@
         }
     }
 
-    [[dataSource contentPolicy] _setPath:path];
+    [dataSource _setDownloadPath:path];
 
     NSDictionary *fileAttributes = [lastDecoder fileAttributes];
     if(!fileAttributes){
@@ -349,7 +349,7 @@
 
     [self closeFile];
 
-    LOG(Download, "Download complete. Saved to: %@", [[dataSource contentPolicy] path]);
+    LOG(Download, "Download complete. Saved to: %@", [dataSource downloadPath]);
 
     return nil;
 }
diff --git a/WebKit/Downloads.subproj/WebDownloadHandler.m b/WebKit/Downloads.subproj/WebDownloadHandler.m
index 37b52d6..83dea20 100644
--- a/WebKit/Downloads.subproj/WebDownloadHandler.m
+++ b/WebKit/Downloads.subproj/WebDownloadHandler.m
@@ -130,7 +130,7 @@
 
 - (void)cleanUpAfterFailure
 {
-    NSString *path = [[dataSource contentPolicy] path];
+    NSString *path = [dataSource downloadPath];
 
     [self closeFile];
     
@@ -146,7 +146,7 @@
     }
     
     NSFileManager *fileManager = [NSFileManager defaultManager];
-    NSString *path = [[dataSource contentPolicy] path];
+    NSString *path = [dataSource downloadPath];
     NSObject <WebDownloadDecoder> *lastDecoder = [decoderSequence lastObject];
         
     NSString *filename = [lastDecoder filename];
@@ -170,7 +170,7 @@
         }
     }
 
-    [[dataSource contentPolicy] _setPath:path];
+    [dataSource _setDownloadPath:path];
 
     NSDictionary *fileAttributes = [lastDecoder fileAttributes];
     if(!fileAttributes){
@@ -349,7 +349,7 @@
 
     [self closeFile];
 
-    LOG(Download, "Download complete. Saved to: %@", [[dataSource contentPolicy] path]);
+    LOG(Download, "Download complete. Saved to: %@", [dataSource downloadPath]);
 
     return nil;
 }
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index d511b8e..07130c0 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -191,7 +191,7 @@
     WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:URL];
     WebFrame *webFrame = [self mainFrame];
         
-    [dataSource _setContentPolicy:contentPolicy];
+    [dataSource _setIsDownloading:YES];
     if([webFrame setProvisionalDataSource:dataSource]){
         [webFrame startLoading];
     }
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index d13c33f..9419378 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -7,7 +7,6 @@
 
 #import <Cocoa/Cocoa.h>
 
- at class WebContentPolicy;
 @class WebController;
 @class WebDataSourcePrivate;
 @class WebError;
@@ -141,12 +140,6 @@
 - (NSString *)frameName;
 
 /*!
-    @method contentPolicy
-    @result The content policy used by this datasource.
-*/
-- (WebContentPolicy *)contentPolicy;
-
-/*!
     @method fileType
     @result The extension based on the MIME type 
 */
@@ -167,6 +160,11 @@
 */
 - (NSString *)stringWithData:(NSData *)data;
 
+
+- (BOOL)isDownloading;
+- (NSString *)downloadPath;
+
+
 /*!
     @method registerRepresentationClass:forMIMEType:
     @discussion A class that implements WebDocumentRepresentation may be registered 
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index a512295..deb9c64 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -180,11 +180,6 @@
     return _private->pageTitle;
 }
 
-- (WebContentPolicy *) contentPolicy
-{
-    return _private->contentPolicy;
-}
-
 - (NSString *)fileType
 {
     return [[WebFileTypeMappings sharedMappings] preferredExtensionForMIMEType:[[self response] contentType]];
@@ -216,4 +211,14 @@
     [[self _repTypes] setObject:repClass forKey:MIMEType];
 }
 
+- (BOOL)isDownloading
+{
+    return _private->isDownloading;
+}
+
+- (NSString *)downloadPath
+{
+    return [[_private->downloadPath retain] autorelease];
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 6e401f5..2bd59c9 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -9,7 +9,6 @@
 #import <WebKit/WebDataSource.h>
 #import <WebKit/WebBridge.h>
 
- at class WebContentPolicy;
 @class WebIconLoader;
 @class WebMainResourceClient;
 @class WebResourceHandle;
@@ -59,8 +58,6 @@
     // Error associated with main document.
     WebError *mainDocumentError;
 
-    WebContentPolicy *contentPolicy;
-
     BOOL loading; // self and controller are retained while loading
 
     BOOL gotFirstByte; // got first byte
@@ -82,6 +79,9 @@
     // we keep this around for the benefit of the various policy
     // handlers.
     NSEvent *triggeringEvent;
+
+    BOOL isDownloading;
+    NSString *downloadPath;
 }
 
 @end
@@ -104,7 +104,6 @@
 - (void)_setURL:(NSURL *)URL;
 - (void)_setRequest:(WebResourceRequest *)request;
 - (void)_setResponse:(WebResourceResponse *)response;
-- (void)_setContentPolicy:(WebContentPolicy *)policy;
 - (void)_layoutChildren;
 - (void)_clearErrors;
 - (void)_setMainDocumentError:(WebError *)error;
@@ -142,4 +141,7 @@
 - (void)_setTriggeringEvent:(NSEvent *)event;
 - (NSEvent *)_triggeringEvent;
 
+- (void)_setIsDownloading:(BOOL)isDownloading;
+- (void)_setDownloadPath:(NSString *)downloadPath;
+
 @end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index bf10e91..2407b27 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -53,7 +53,6 @@
     [pageTitle release];
     [response release];
     [mainDocumentError release];
-    [contentPolicy release];
     [iconLoader setDelegate:nil];
     [iconLoader release];
     [iconURL release];
@@ -61,6 +60,7 @@
     [previousBackForwardItem release];
     [ourBackForwardItems release];
     [triggeringEvent release];
+    [downloadPath release];
 
     [super dealloc];
 }
@@ -300,14 +300,6 @@
     _private->response = [response retain];
 }
 
-- (void) _setContentPolicy:(WebContentPolicy *)policy
-{
-    [policy retain];
-    [_private->contentPolicy release];
-    _private->contentPolicy = policy;
-    [self _commitIfReady];
-}
-
 - (void)_setOverrideEncoding:(NSString *)overrideEncoding
 {
     NSString *copy = [overrideEncoding copy];
@@ -457,7 +449,7 @@
 
 -(void)_commitIfReady
 {
-    if ([[self contentPolicy] policyAction] == WebContentPolicyShow && _private->gotFirstByte && !_private->committed) {
+    if (![self isDownloading] && _private->gotFirstByte && !_private->committed) {
         LOG(Loading, "committed resource = %@", [[self request] URL]);
 	_private->committed = TRUE;
 	[self _makeRepresentation];
@@ -485,16 +477,6 @@
     [[[self webFrame] webView] _makeDocumentViewForDataSource:self];
 }
 
--(BOOL)_isReadyForData
-{
-    // The data source is ready for data when the content policy is
-    // determined, and if the policy is show, if it has been committed
-    // (so that we know it's representation and such are ready).
-
-    return [[self contentPolicy] policyAction] != WebContentPolicyNone &&
-	(_private->committed || [[self contentPolicy] policyAction] != WebContentPolicyShow);
-}
-
 -(void)_receivedData:(NSData *)data
 {
     _private->gotFirstByte = YES;
@@ -597,5 +579,20 @@
     return [[_private->triggeringEvent retain] autorelease];
 }
 
+
+- (void)_setIsDownloading:(BOOL)isDownloading
+{
+    _private->isDownloading = isDownloading;
+}
+
+- (void)_setDownloadPath:(NSString *)downloadPath
+{
+    [downloadPath retain];
+    [_private->downloadPath release];
+    _private->downloadPath = [downloadPath copy];
+    [downloadPath release];
+}
+
+
 @end
 
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 8d7dffe..df6cbbd 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -67,9 +67,7 @@
 
 - (void)receivedError:(WebError *)error
 {    
-    WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
-
-    if (contentAction != WebContentPolicySave) {
+    if (![dataSource isDownloading]) {
         [[dataSource controller] _mainReceivedError:error fromDataSource:dataSource];
     }
 }
@@ -142,22 +140,17 @@
 
     LOG(Download, "main content type: %@", [r contentType]);
 
-    // Figure out the content policy.
-    WebContentPolicy *contentPolicy = [dataSource contentPolicy];
+    WebContentPolicy *contentPolicy;
 
-    if ([contentPolicy policyAction] != WebPolicySave) {
+    // Figure out the content policy.
+    if (![dataSource isDownloading]) {
 	contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForResponse:r
 								  andRequest:[dataSource request]
 								  inFrame:[dataSource webFrame]];
+    } else {
+	contentPolicy = [WebContentPolicy webPolicyWithContentAction:WebContentPolicySave andPath:nil];
     }
 
-    if ([contentPolicy policyAction] == WebPolicySave) {
-	NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
-	[contentPolicy _setPath:saveFilename];
-    }
-
-    [dataSource _setContentPolicy:contentPolicy];
-
     policyAction = [contentPolicy policyAction];
 
     switch (policyAction) {
@@ -166,6 +159,10 @@
         
     case WebContentPolicySave:
         {
+	    [dataSource _setIsDownloading:YES];
+	    NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
+	    [dataSource _setDownloadPath:saveFilename];
+
             [[dataSource webFrame] _setProvisionalDataSource:nil];
             
             [self notifyDelegatesOfInterruptionByPolicyChange];
@@ -227,14 +224,10 @@
     // Calling receivedError will likely result in a call to release, so we must retain.
     [self retain];
 
-    WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
-    
-    // Don't retain data for downloaded files
-    if (contentAction != WebContentPolicySave) {
+    if (![dataSource isDownloading]) {
+	// Don't retain data for downloaded files
     	[dataSource _setResourceData:resourceData];
-    }
 
-    if (contentAction == WebContentPolicyShow) {
         [[dataSource representation] finishedLoadingWithDataSource:dataSource];
     }
     
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 8d7dffe..df6cbbd 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -67,9 +67,7 @@
 
 - (void)receivedError:(WebError *)error
 {    
-    WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
-
-    if (contentAction != WebContentPolicySave) {
+    if (![dataSource isDownloading]) {
         [[dataSource controller] _mainReceivedError:error fromDataSource:dataSource];
     }
 }
@@ -142,22 +140,17 @@
 
     LOG(Download, "main content type: %@", [r contentType]);
 
-    // Figure out the content policy.
-    WebContentPolicy *contentPolicy = [dataSource contentPolicy];
+    WebContentPolicy *contentPolicy;
 
-    if ([contentPolicy policyAction] != WebPolicySave) {
+    // Figure out the content policy.
+    if (![dataSource isDownloading]) {
 	contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForResponse:r
 								  andRequest:[dataSource request]
 								  inFrame:[dataSource webFrame]];
+    } else {
+	contentPolicy = [WebContentPolicy webPolicyWithContentAction:WebContentPolicySave andPath:nil];
     }
 
-    if ([contentPolicy policyAction] == WebPolicySave) {
-	NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
-	[contentPolicy _setPath:saveFilename];
-    }
-
-    [dataSource _setContentPolicy:contentPolicy];
-
     policyAction = [contentPolicy policyAction];
 
     switch (policyAction) {
@@ -166,6 +159,10 @@
         
     case WebContentPolicySave:
         {
+	    [dataSource _setIsDownloading:YES];
+	    NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
+	    [dataSource _setDownloadPath:saveFilename];
+
             [[dataSource webFrame] _setProvisionalDataSource:nil];
             
             [self notifyDelegatesOfInterruptionByPolicyChange];
@@ -227,14 +224,10 @@
     // Calling receivedError will likely result in a call to release, so we must retain.
     [self retain];
 
-    WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
-    
-    // Don't retain data for downloaded files
-    if (contentAction != WebContentPolicySave) {
+    if (![dataSource isDownloading]) {
+	// Don't retain data for downloaded files
     	[dataSource _setResourceData:resourceData];
-    }
 
-    if (contentAction == WebContentPolicyShow) {
         [[dataSource representation] finishedLoadingWithDataSource:dataSource];
     }
     
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index d511b8e..07130c0 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -191,7 +191,7 @@
     WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:URL];
     WebFrame *webFrame = [self mainFrame];
         
-    [dataSource _setContentPolicy:contentPolicy];
+    [dataSource _setIsDownloading:YES];
     if([webFrame setProvisionalDataSource:dataSource]){
         [webFrame startLoading];
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list