[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:36:10 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b1498730f8396f186d18b44085581ed421b524d7
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 4 17:04:06 2002 +0000

    WebFoundation:
    
    	Modified API and behavior so that WebResourceHandle objects no longer
    	buffer data as it is loaded. The responsibility to buffer data is now
    	passed to WebResourceClient objects, and I modified the code to
    	perform that buffering where necessary.
    
    	There was also an API change to the WebResourceClient protoccol.
    
    	- (void)handleDidFinishLoading:(WebResourceHandle *)handle data:(NSData *)data;
    
    	has become
    
    	- (void)handleDidFinishLoading:(WebResourceHandle *)handle;
    
    	This reflects the fact that WebResourceHandle no longer has the data to pass
    	in this callback (and may not be able to ask other objects in the framework to
    	provide the data so that it may be presented in the callback).
    
    	I also added a new WebResourceResponse class, although it is not wired up
    	to anything yet.
    
            * CacheLoader.subproj/IFURLHandleC.h:
            * CacheLoader.subproj/IFURLHandleC.m:
            * CacheLoader.subproj/WebResourceCallbackClient.m:
            (-[WebResourceCallbackClient handleDidFinishLoading:])
            * CacheLoader.subproj/WebResourceClient.h:
            * CacheLoader.subproj/WebResourceHandle.h:
            * CacheLoader.subproj/WebResourceHandle.m:
            (-[WebResourceHandle loadInForeground:])
            (-[WebResourceHandle contentLengthReceived])
            * CacheLoader.subproj/WebResourceHandleInternal.h:
            * CacheLoader.subproj/WebResourceHandleInternal.m:
            (-[WebResourceHandleInstanceVariables initWithHandle:])
            (-[WebResourceHandleInstanceVariables dealloc])
            (-[WebResourceHandle _notifyClientDataDidBecomeAvailable])
            (-[WebResourceHandle _notifyClientDidFinishLoading])
            * CacheLoader.subproj/WebResourceHandlePrivate.m:
            (-[WebResourceHandle _didLoadData:])
            * CacheLoader.subproj/WebResourceResponse.h: Added.
            * CacheLoader.subproj/WebResourceResponse.m: Added.
            * CacheLoader.subproj/WebResourceResponsePrivate.h: Added.
            * CacheLoader.subproj/WebResourceSynchronousClient.h:
            * CacheLoader.subproj/WebResourceSynchronousClient.m:
            (-[WebResourceSynchronousClient initWithMonitor:realClient:])
            (-[WebResourceSynchronousClient dealloc])
            (-[WebResourceSynchronousClient resourceData])
            (-[WebResourceSynchronousClient handleDidFinishLoading:])
            (-[WebResourceSynchronousClient handleDidReceiveData:data:])
            * WebFoundation.exp:
            * WebFoundation.pbproj/project.pbxproj:
    
    WebKit:
    
    	Made more adjustments for API and behavior change that occurred in WebFoundation,
    	now that WebResourceHandle objects no buffer resource data as it is loaded. Where
    	necessary, the WebKit objects now do their own buffering, however, in many cases,
    	buffering is not necessary to maintain correct behavior.
    
            * Misc.subproj/WebIconLoader.m:
            (-[WebIconLoaderPrivate dealloc]): Release new buffered resource data object.
            (-[WebIconLoader initWithURL:]): Allocate new buffered resource data object.
            (-[WebIconLoader handleDidFinishLoading:]): Modify API to remove data parameter.
            (-[WebIconLoader handleDidReceiveData:data:]): Buffer data as it is received.
            * Plugins.subproj/WebPluginStream.h: Added new buffered resource data object.
            * Plugins.subproj/WebPluginStream.m:
            (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:attributes:]): Allocate new buffered resource data object.
            (-[WebNetscapePluginStream dealloc]): Release new buffered resource data object.
            (-[WebNetscapePluginStream receivedData:]): Buffer data as it is received (when necessary maintain correct behavior).
            (-[WebNetscapePluginStream handleDidFinishLoading:]): Modify API to remove data parameter.
            * WebCoreSupport.subproj/WebSubresourceClient.m:
            (-[WebSubresourceClient handleDidFinishLoading:]): Modify API to remove data parameter.
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient handleDidFinishLoading:]): Modify API to remove data parameter.
            (-[WebMainResourceClient handleDidReceiveData:data:]): Buffer data as it is received (when necessary maintain correct behavior).
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1959 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 70f290d..9355a4c 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,27 @@
+2002-09-04  Ken Kocienda  <kocienda at apple.com>
+
+	Made more adjustments for API and behavior change that occurred in WebFoundation, 
+	now that WebResourceHandle objects no buffer resource data as it is loaded. Where
+	necessary, the WebKit objects now do their own buffering, however, in many cases,
+	buffering is not necessary to maintain correct behavior.
+
+        * Misc.subproj/WebIconLoader.m:
+        (-[WebIconLoaderPrivate dealloc]): Release new buffered resource data object.
+        (-[WebIconLoader initWithURL:]): Allocate new buffered resource data object.
+        (-[WebIconLoader handleDidFinishLoading:]): Modify API to remove data parameter.
+        (-[WebIconLoader handleDidReceiveData:data:]): Buffer data as it is received.
+        * Plugins.subproj/WebPluginStream.h: Added new buffered resource data object.
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:attributes:]): Allocate new buffered resource data object.
+        (-[WebNetscapePluginStream dealloc]): Release new buffered resource data object.
+        (-[WebNetscapePluginStream receivedData:]): Buffer data as it is received (when necessary maintain correct behavior).
+        (-[WebNetscapePluginStream handleDidFinishLoading:]): Modify API to remove data parameter.
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (-[WebSubresourceClient handleDidFinishLoading:]): Modify API to remove data parameter.
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handleDidFinishLoading:]): Modify API to remove data parameter.
+        (-[WebMainResourceClient handleDidReceiveData:data:]): Buffer data as it is received (when necessary maintain correct behavior).
+
 2002-09-04  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: 3043024 - Built-in icons should match on *whatever.com or *whatever.whatever
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 70f290d..9355a4c 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,27 @@
+2002-09-04  Ken Kocienda  <kocienda at apple.com>
+
+	Made more adjustments for API and behavior change that occurred in WebFoundation, 
+	now that WebResourceHandle objects no buffer resource data as it is loaded. Where
+	necessary, the WebKit objects now do their own buffering, however, in many cases,
+	buffering is not necessary to maintain correct behavior.
+
+        * Misc.subproj/WebIconLoader.m:
+        (-[WebIconLoaderPrivate dealloc]): Release new buffered resource data object.
+        (-[WebIconLoader initWithURL:]): Allocate new buffered resource data object.
+        (-[WebIconLoader handleDidFinishLoading:]): Modify API to remove data parameter.
+        (-[WebIconLoader handleDidReceiveData:data:]): Buffer data as it is received.
+        * Plugins.subproj/WebPluginStream.h: Added new buffered resource data object.
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:attributes:]): Allocate new buffered resource data object.
+        (-[WebNetscapePluginStream dealloc]): Release new buffered resource data object.
+        (-[WebNetscapePluginStream receivedData:]): Buffer data as it is received (when necessary maintain correct behavior).
+        (-[WebNetscapePluginStream handleDidFinishLoading:]): Modify API to remove data parameter.
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (-[WebSubresourceClient handleDidFinishLoading:]): Modify API to remove data parameter.
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handleDidFinishLoading:]): Modify API to remove data parameter.
+        (-[WebMainResourceClient handleDidReceiveData:data:]): Buffer data as it is received (when necessary maintain correct behavior).
+
 2002-09-04  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: 3043024 - Built-in icons should match on *whatever.com or *whatever.whatever
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
index eda407b..0b7da98 100644
--- a/WebKit/Misc.subproj/WebIconLoader.m
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -23,6 +23,7 @@
     WebResourceHandle *handle;
     id delegate;
     NSURL *URL;
+    NSMutableData *resourceData;
 }
 
 @end;
@@ -33,6 +34,7 @@
 {
     [URL release];
     [handle release];
+    [resourceData release];
     [super dealloc];
 }
 
@@ -50,6 +52,7 @@
     [super init];
     _private = [[WebIconLoaderPrivate alloc] init];
     _private->URL = [URL retain];
+    _private->resourceData = [[NSMutableData alloc] init];
     return self;
 }
 
@@ -114,9 +117,9 @@
 {
 }
 
-- (void)handleDidFinishLoading:(WebResourceHandle *)sender data:(NSData *)data
+- (void)handleDidFinishLoading:(WebResourceHandle *)sender
 {
-    NSImage *icon = [[NSImage alloc] initWithData:data];
+    NSImage *icon = [[NSImage alloc] initWithData:_private->resourceData];
     if (icon) {
         [[WebIconDatabase sharedIconDatabase] _setIcon:icon forIconURL:_private->URL];
         [_private->delegate iconLoader:self receivedPageIcon:icon];
@@ -126,6 +129,7 @@
 
 - (void)handleDidReceiveData:(WebResourceHandle *)sender data:(NSData *)data
 {
+    [_private->resourceData appendData:data];
 }
 
 - (void)handleDidFailLoading:(WebResourceHandle *)sender withError:(WebError *)result
diff --git a/WebKit/Plugins.subproj/WebPluginStream.h b/WebKit/Plugins.subproj/WebPluginStream.h
index c1c897d..08fa4e2 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.h
+++ b/WebKit/Plugins.subproj/WebPluginStream.h
@@ -29,6 +29,7 @@
     BOOL isFirstChunk;
     
     WebResourceHandle *resource;
+    NSMutableData *resourceData;
     
     NPP_NewStreamProcPtr NPP_NewStream;
     NPP_DestroyStreamProcPtr NPP_DestroyStream;
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index 337be69..e3f3d7b 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -71,6 +71,7 @@
     attributes = [theAttributes retain];
     instance = thePluginPointer;
     notifyData = theNotifyData;
+    resourceData = [[NSMutableData alloc] init];
 
     [self getFunctionPointersFromPluginView:view];
     
@@ -91,6 +92,7 @@
     free((void *)npStream.URL);
     [URL release];
     [attributes release];
+    [resourceData release];
     [super dealloc];
 }
 
@@ -158,6 +160,11 @@
         }
     }
 
+    if(transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY) {
+        // only need to buffer data in this case
+        [resourceData appendData:data];
+    }
+
     if(transferMode != NP_ASFILEONLY){
         numBytes = NPP_WriteReady(instance, &npStream);
         WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "NPP_WriteReady bytes=%lu\n", numBytes);
@@ -271,14 +278,14 @@
         forResourceHandle: handle fromDataSource: [view webDataSource] complete: NO];
 }
 
-- (void)handleDidFinishLoading:(WebResourceHandle *)handle data: (NSData *)data
+- (void)handleDidFinishLoading:(WebResourceHandle *)handle
 {
     WebController *webController = [view webController];
     
     [webController _receivedProgress:[WebLoadProgress progressWithResourceHandle:handle]
             forResourceHandle: handle fromDataSource: [view webDataSource] complete: YES];
  
-    [self finishedLoadingWithData:data];
+    [self finishedLoadingWithData:resourceData];
           
     [webController _didStopLoading:URL];
 }
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index c5f8026..330f266 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -130,11 +130,10 @@
     [self didStopLoading];
 }
 
-- (void)handleDidFinishLoading:(WebResourceHandle *)handle data:(NSData *)data
+- (void)handleDidFinishLoading:(WebResourceHandle *)handle
 {    
     WEBKIT_ASSERT([currentURL isEqual:[handle URL]]);
     WEBKIT_ASSERT([handle statusCode] == WebResourceHandleStatusLoadComplete);
-    WEBKIT_ASSERT((int)[data length] == [handle contentLengthReceived]);
 
     [loader finish];
     
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index c5f8026..330f266 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -130,11 +130,10 @@
     [self didStopLoading];
 }
 
-- (void)handleDidFinishLoading:(WebResourceHandle *)handle data:(NSData *)data
+- (void)handleDidFinishLoading:(WebResourceHandle *)handle
 {    
     WEBKIT_ASSERT([currentURL isEqual:[handle URL]]);
     WEBKIT_ASSERT([handle statusCode] == WebResourceHandleStatusLoadComplete);
-    WEBKIT_ASSERT((int)[data length] == [handle contentLengthReceived]);
 
     [loader finish];
     
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index f34a6e3..5f8c31d 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -139,19 +139,18 @@
     [self didStopLoading];
 }
 
-- (void)handleDidFinishLoading:(WebResourceHandle *)handle data: (NSData *)data
+- (void)handleDidFinishLoading:(WebResourceHandle *)handle
 {
     WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s\n", DEBUG_OBJECT([handle URL]));
     
     WEBKIT_ASSERT([currentURL isEqual:[handle URL]]);
     WEBKIT_ASSERT([handle statusCode] == WebResourceHandleStatusLoadComplete);
-    WEBKIT_ASSERT((int)[data length] == [handle contentLengthReceived]);
 
     WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
     
     // Don't retain data for downloaded files
     if(contentAction != WebContentPolicySave && contentAction != WebContentPolicySaveAndOpenExternally){
-       [dataSource _setResourceData:data];
+       [dataSource _setResourceData:resourceData];
     }
 
     if(contentAction == WebContentPolicyShow){
@@ -210,10 +209,10 @@
         WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", DEBUG_OBJECT(contentType));
     }
 
-    [resourceData appendData:data];
-
     switch (policyAction) {
     case WebContentPolicyShow:
+        // only need to buffer data in this case
+        [resourceData appendData:data];
         [dataSource _receivedData:data];
         break;
     case WebContentPolicySave:
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index f34a6e3..5f8c31d 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -139,19 +139,18 @@
     [self didStopLoading];
 }
 
-- (void)handleDidFinishLoading:(WebResourceHandle *)handle data: (NSData *)data
+- (void)handleDidFinishLoading:(WebResourceHandle *)handle
 {
     WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s\n", DEBUG_OBJECT([handle URL]));
     
     WEBKIT_ASSERT([currentURL isEqual:[handle URL]]);
     WEBKIT_ASSERT([handle statusCode] == WebResourceHandleStatusLoadComplete);
-    WEBKIT_ASSERT((int)[data length] == [handle contentLengthReceived]);
 
     WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
     
     // Don't retain data for downloaded files
     if(contentAction != WebContentPolicySave && contentAction != WebContentPolicySaveAndOpenExternally){
-       [dataSource _setResourceData:data];
+       [dataSource _setResourceData:resourceData];
     }
 
     if(contentAction == WebContentPolicyShow){
@@ -210,10 +209,10 @@
         WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", DEBUG_OBJECT(contentType));
     }
 
-    [resourceData appendData:data];
-
     switch (policyAction) {
     case WebContentPolicyShow:
+        // only need to buffer data in this case
+        [resourceData appendData:data];
         [dataSource _receivedData:data];
         break;
     case WebContentPolicySave:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list