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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:29:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit bca5ce04cc7df01599901bc9f65a2312bfc0e799
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 17 16:59:09 2003 +0000

    	Fixed: 3199951 - Standalone plug-in content that is cancelled doesn't restart when switching tabs
    
    	Instead of creating and managing resourceData in WebMainResourceClient then passing the ownership to WebDataSource, just manage it in WebDataSource. We had the prior behavior because we didn't buffer downloads. Now, we always buffer. The fix for the bug is to retain the incomplete data even though the load ends in error.
    
            Reviewed by darin.
    
            * WebView.subproj/WebDataSource.h: updated headerdoc for the data method
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource data]): just return resourceData
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _receivedData:]): create resourceData if necessary, append data to it.
            * WebView.subproj/WebMainResourceClient.h:
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient initWithDataSource:]): don't work with resourceData
            (-[WebMainResourceClient dealloc]): don't work with resourceData
            (-[WebMainResourceClient resource:didReceiveData:]): don't work with resourceData
            (-[WebMainResourceClient resourceDidFinishLoading:]): don't work with resourceData
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3844 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1566603..e4ddf7a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2003-03-17  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 3199951 - Standalone plug-in content that is cancelled doesn't restart when switching tabs
+
+	Instead of creating and managing resourceData in WebMainResourceClient then passing the ownership to WebDataSource, just manage it in WebDataSource. We had the prior behavior because we didn't buffer downloads. Now, we always buffer. The fix for the bug is to retain the incomplete data even though the load ends in error.
+
+        Reviewed by darin.
+
+        * WebView.subproj/WebDataSource.h: updated headerdoc for the data method
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource data]): just return resourceData
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _receivedData:]): create resourceData if necessary, append data to it.
+        * WebView.subproj/WebMainResourceClient.h:
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient initWithDataSource:]): don't work with resourceData
+        (-[WebMainResourceClient dealloc]): don't work with resourceData
+        (-[WebMainResourceClient resource:didReceiveData:]): don't work with resourceData
+        (-[WebMainResourceClient resourceDidFinishLoading:]): don't work with resourceData
+
 2003-03-16  Trey Matteson  <trey at apple.com>
 
 	3198135 - need to fix our projects so SYMROOT is not stripped
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index fe753c2..dc2eca0 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -40,10 +40,9 @@
 
 /*!
     @method data
-    @discussion The data associated with a datasource will not be valid until
-    a datasource has completely loaded.  
-    @result Returns the raw data associated with this datasource.  Returns nil
-    if the datasource hasn't loaded.
+    @discussion The data will be incomplete until the datasource has completely loaded.  
+    @result Returns the raw data associated with the datasource.  Returns nil
+    if the datasource hasn't loaded any data.
 */
 - (NSData *)data;
 
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 7bc6313..14e8a55 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -51,11 +51,7 @@
 
 - (NSData *)data
 {
-    if(!_private->resourceData){
-        return [_private->mainClient resourceData];
-    }else{
-        return _private->resourceData;
-    }
+    return _private->resourceData;
 }
 
 - (id <WebDocumentRepresentation>) representation
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 1d49b62..a80641d 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -21,7 +21,7 @@
 @interface WebDataSourcePrivate : NSObject
 {
 @public
-    NSData *resourceData;
+    NSMutableData *resourceData;
 
     id <WebDocumentRepresentation> representation;
     
@@ -119,7 +119,6 @@
 - (void)_stopLoading;
 - (NSURL *)_URL;
 - (WebController *)_controller;
-- (void)_setResourceData:(NSData *)data;
 - (Class)_representationClass;
 - (void)_setRepresentation:(id<WebDocumentRepresentation>)representation;
 - (void)_setController:(WebController *)controller;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 98f1104..21ab091 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -83,12 +83,6 @@
     return _private->controller;
 }
 
-- (void)_setResourceData:(NSData *)data
-{
-    [_private->resourceData release];
-    _private->resourceData = [data retain];
-}
-
 - (void)_setRepresentation: (id<WebDocumentRepresentation>)representation
 {
     [_private->representation release];
@@ -534,6 +528,11 @@
 
 -(void)_receivedData:(NSData *)data
 {
+    if (!_private->resourceData) {
+        _private->resourceData = [[NSMutableData alloc] init];
+    }
+    [_private->resourceData appendData:data];
+    
     _private->gotFirstByte = YES;
     [self _commitIfReady];
 
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.h b/WebKit/WebView.subproj/WebMainResourceClient.h
index 1ca574c..44ada66 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.h
+++ b/WebKit/WebView.subproj/WebMainResourceClient.h
@@ -22,7 +22,6 @@
 
 @interface WebMainResourceClient : WebBaseResourceHandleDelegate
 {
-    NSMutableData *resourceData;
     int _contentLength; // for logging only
     int _bytesReceived; // for logging only
     WebPolicyDecisionListener *listener;
@@ -31,6 +30,5 @@
 }
 
 - initWithDataSource:(WebDataSource *)dataSource;
-- (NSData *)resourceData;
 
 @end
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index f352662..971dea9 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -41,7 +41,6 @@
     self = [super init];
     
     if (self) {
-        resourceData = [[NSMutableData alloc] init];
         [self setDataSource:ds];
         proxy = [[WebResourceDelegateProxy alloc] init];
         [proxy setDelegate:self];
@@ -52,18 +51,12 @@
 
 - (void)dealloc
 {
-    [resourceData release];
     [proxy setDelegate:nil];
     [proxy release];
     
     [super dealloc];
 }
 
-- (NSData *)resourceData
-{
-    return resourceData;
-}
-
 - (void)receivedError:(WebError *)error
 {
     // Calling _receivedError will likely result in a call to release, so we must retain.
@@ -233,11 +226,10 @@
  
     LOG(Loading, "URL = %@, data = %p, length %d", [dataSource _URL], data, [data length]);
 
-    [resourceData appendData:data];
     [dataSource _receivedData:data];
-    [[dataSource _controller] _mainReceivedBytesSoFar:[resourceData length]
-                                        fromDataSource:dataSource
-                                            complete:NO];
+    [[dataSource _controller] _mainReceivedBytesSoFar:[[dataSource data] length]
+                                       fromDataSource:dataSource
+                                             complete:NO];
 
     [super resource:h didReceiveData:data];
     _bytesReceived += [data length];
@@ -256,11 +248,10 @@
     // Calls in this method will most likely result in a call to release, so we must retain.
     [self retain];
 
-    [dataSource _setResourceData:resourceData];
     [dataSource _finishedLoading];
-    [[dataSource _controller] _mainReceivedBytesSoFar:[resourceData length]
-                                        fromDataSource:dataSource
-                                            complete:YES];
+    [[dataSource _controller] _mainReceivedBytesSoFar:[[dataSource data] length]
+                                       fromDataSource:dataSource
+                                             complete:YES];
     [super resourceDidFinishLoading:h];
     
     [self release];
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.h b/WebKit/WebView.subproj/WebMainResourceLoader.h
index 1ca574c..44ada66 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.h
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.h
@@ -22,7 +22,6 @@
 
 @interface WebMainResourceClient : WebBaseResourceHandleDelegate
 {
-    NSMutableData *resourceData;
     int _contentLength; // for logging only
     int _bytesReceived; // for logging only
     WebPolicyDecisionListener *listener;
@@ -31,6 +30,5 @@
 }
 
 - initWithDataSource:(WebDataSource *)dataSource;
-- (NSData *)resourceData;
 
 @end
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index f352662..971dea9 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -41,7 +41,6 @@
     self = [super init];
     
     if (self) {
-        resourceData = [[NSMutableData alloc] init];
         [self setDataSource:ds];
         proxy = [[WebResourceDelegateProxy alloc] init];
         [proxy setDelegate:self];
@@ -52,18 +51,12 @@
 
 - (void)dealloc
 {
-    [resourceData release];
     [proxy setDelegate:nil];
     [proxy release];
     
     [super dealloc];
 }
 
-- (NSData *)resourceData
-{
-    return resourceData;
-}
-
 - (void)receivedError:(WebError *)error
 {
     // Calling _receivedError will likely result in a call to release, so we must retain.
@@ -233,11 +226,10 @@
  
     LOG(Loading, "URL = %@, data = %p, length %d", [dataSource _URL], data, [data length]);
 
-    [resourceData appendData:data];
     [dataSource _receivedData:data];
-    [[dataSource _controller] _mainReceivedBytesSoFar:[resourceData length]
-                                        fromDataSource:dataSource
-                                            complete:NO];
+    [[dataSource _controller] _mainReceivedBytesSoFar:[[dataSource data] length]
+                                       fromDataSource:dataSource
+                                             complete:NO];
 
     [super resource:h didReceiveData:data];
     _bytesReceived += [data length];
@@ -256,11 +248,10 @@
     // Calls in this method will most likely result in a call to release, so we must retain.
     [self retain];
 
-    [dataSource _setResourceData:resourceData];
     [dataSource _finishedLoading];
-    [[dataSource _controller] _mainReceivedBytesSoFar:[resourceData length]
-                                        fromDataSource:dataSource
-                                            complete:YES];
+    [[dataSource _controller] _mainReceivedBytesSoFar:[[dataSource data] length]
+                                       fromDataSource:dataSource
+                                             complete:YES];
     [super resourceDidFinishLoading:h];
     
     [self release];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list