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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:56:27 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8c9809ee13732bed059108e77895db1a9b9e5bb4
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 1 02:37:19 2002 +0000

    Finished up progress notifications for main document.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@679 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 1e987f6..67e4af5 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-02-28  Richard Williamson  <rjw at apple.com>
+
+        Finished up progress notification for main document.  
+        Made the IFLoadProgress allocator accessible to KHTMLPart.mm.
+        
+	* src/kwq/KWQKHTMLPart.mm: (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]), (-[KHTMLPartLoadClient
+	setDataSource:]), (KHTMLPart::openURL):
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[URLLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]):
+	* src/kwq/WCLoadProgress.h:
+
 2002-02-27  Kenneth Kocienda  <kocienda at apple.com>
 
 	I have changed the way that WebCore is glued to WebFoundation and WebKit. 
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1e987f6..67e4af5 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2002-02-28  Richard Williamson  <rjw at apple.com>
+
+        Finished up progress notification for main document.  
+        Made the IFLoadProgress allocator accessible to KHTMLPart.mm.
+        
+	* src/kwq/KWQKHTMLPart.mm: (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]), (-[KHTMLPartLoadClient
+	setDataSource:]), (KHTMLPart::openURL):
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[URLLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]):
+	* src/kwq/WCLoadProgress.h:
+
 2002-02-27  Kenneth Kocienda  <kocienda at apple.com>
 
 	I have changed the way that WebCore is glued to WebFoundation and WebKit. 
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1e987f6..67e4af5 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2002-02-28  Richard Williamson  <rjw at apple.com>
+
+        Finished up progress notification for main document.  
+        Made the IFLoadProgress allocator accessible to KHTMLPart.mm.
+        
+	* src/kwq/KWQKHTMLPart.mm: (-[KHTMLPartLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[KHTMLPartLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]), (-[KHTMLPartLoadClient
+	setDataSource:]), (KHTMLPart::openURL):
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient
+	IFURLHandleResourceDidFinishLoading:data:]), (-[URLLoadClient
+	IFURLHandle:resourceDataDidBecomeAvailable:]):
+	* src/kwq/WCLoadProgress.h:
+
 2002-02-27  Kenneth Kocienda  <kocienda at apple.com>
 
 	I have changed the way that WebCore is glued to WebFoundation and WebKit. 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index ab999a1..dbb0e12 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -57,6 +57,8 @@
 
 #import <KWQView.h>
 
+#include <WCLoadProgress.h>
+
 @class IFWebDataSource;
 @class IFWebView;
 @class IFWebFrame;
@@ -100,6 +102,31 @@
 - (void *)_renderFramePart;
 @end
 
+typedef enum {
+    IF_LOAD_TYPE_CSS    = 1,
+    IF_LOAD_TYPE_IMAGE  = 2,
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
+} IF_LOAD_TYPE;
+
+
+ at interface IFLoadProgress : NSObject
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalToLoad;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+}
+- init;
+ at end
+
+ at protocol  IFLoadHandler
+- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+
+- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+
+ at end
+
 static bool cache_init = false;
 
 static void recursive(const DOM::Node &pNode, const DOM::Node &node)
@@ -122,6 +149,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     @public
     KHTMLPart *m_part;
     NSData *m_data;
+    id dataSource;
 }
 @end
 
@@ -165,6 +193,12 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 
     KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
     m_part->closeURL();
+
+    IFLoadProgress *loadProgress = WCIFLoadProgressMake();
+    loadProgress->totalToLoad = [data length];
+    loadProgress->bytesSoFar = [data length];
+    [[dataSource controller] receivedProgress: (IFLoadProgress *)loadProgress forResource: [[sender url] absoluteString] fromDataSource: dataSource];
+
     [sender autorelease];
 }
 
@@ -179,6 +213,11 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
         m_data = [data retain];
     }
     m_part->slotData(sender, (const char *)[data bytes], [data length]);
+    
+    IFLoadProgress *loadProgress = WCIFLoadProgressMake();
+    loadProgress->totalToLoad = [sender contentLength];
+    loadProgress->bytesSoFar = [data length];
+    [[dataSource controller] receivedProgress: (IFLoadProgress *)loadProgress forResource: [[sender url] absoluteString] fromDataSource: dataSource];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)sender resourceDidFailLoadingWithResult:(int)result
@@ -191,6 +230,12 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     [sender autorelease];
 }
 
+// Non-retained
+- (void)setDataSource: d
+{
+    dataSource = d;
+}
+
 
 -(void)checkCompleted:(NSNotification *)notification
 {
@@ -430,6 +475,8 @@ bool KHTMLPart::openURL( const KURL &url )
         urlString = [urlString substringToIndex:([urlString length] - 1)];
     }
     theURL = [NSURL URLWithString:urlString];
+
+    [d->m_recv setDataSource: getDataSource()];
     
     d->m_handle = [[IFURLHandle alloc] initWithURL:theURL];
     [d->m_handle addClient:d->m_recv];
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index ab999a1..dbb0e12 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -57,6 +57,8 @@
 
 #import <KWQView.h>
 
+#include <WCLoadProgress.h>
+
 @class IFWebDataSource;
 @class IFWebView;
 @class IFWebFrame;
@@ -100,6 +102,31 @@
 - (void *)_renderFramePart;
 @end
 
+typedef enum {
+    IF_LOAD_TYPE_CSS    = 1,
+    IF_LOAD_TYPE_IMAGE  = 2,
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
+} IF_LOAD_TYPE;
+
+
+ at interface IFLoadProgress : NSObject
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalToLoad;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+}
+- init;
+ at end
+
+ at protocol  IFLoadHandler
+- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+
+- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+
+ at end
+
 static bool cache_init = false;
 
 static void recursive(const DOM::Node &pNode, const DOM::Node &node)
@@ -122,6 +149,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     @public
     KHTMLPart *m_part;
     NSData *m_data;
+    id dataSource;
 }
 @end
 
@@ -165,6 +193,12 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 
     KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
     m_part->closeURL();
+
+    IFLoadProgress *loadProgress = WCIFLoadProgressMake();
+    loadProgress->totalToLoad = [data length];
+    loadProgress->bytesSoFar = [data length];
+    [[dataSource controller] receivedProgress: (IFLoadProgress *)loadProgress forResource: [[sender url] absoluteString] fromDataSource: dataSource];
+
     [sender autorelease];
 }
 
@@ -179,6 +213,11 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
         m_data = [data retain];
     }
     m_part->slotData(sender, (const char *)[data bytes], [data length]);
+    
+    IFLoadProgress *loadProgress = WCIFLoadProgressMake();
+    loadProgress->totalToLoad = [sender contentLength];
+    loadProgress->bytesSoFar = [data length];
+    [[dataSource controller] receivedProgress: (IFLoadProgress *)loadProgress forResource: [[sender url] absoluteString] fromDataSource: dataSource];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)sender resourceDidFailLoadingWithResult:(int)result
@@ -191,6 +230,12 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     [sender autorelease];
 }
 
+// Non-retained
+- (void)setDataSource: d
+{
+    dataSource = d;
+}
+
 
 -(void)checkCompleted:(NSNotification *)notification
 {
@@ -430,6 +475,8 @@ bool KHTMLPart::openURL( const KURL &url )
         urlString = [urlString substringToIndex:([urlString length] - 1)];
     }
     theURL = [NSURL URLWithString:urlString];
+
+    [d->m_recv setDataSource: getDataSource()];
     
     d->m_handle = [[IFURLHandle alloc] initWithURL:theURL];
     [d->m_handle addClient:d->m_recv];
diff --git a/WebCore/kwq/KWQKloader.mm b/WebCore/kwq/KWQKloader.mm
index ec20319..5bd0c5d 100644
--- a/WebCore/kwq/KWQKloader.mm
+++ b/WebCore/kwq/KWQKloader.mm
@@ -59,7 +59,7 @@ using namespace khtml;
 using namespace DOM;
 
 
-static WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
+WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
 
 void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
 {
@@ -926,7 +926,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 typedef enum {
     IF_LOAD_TYPE_CSS    = 1,
     IF_LOAD_TYPE_IMAGE  = 2,
-    IF_LOAD_TYPE_SCRIPT = 3
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
 } IF_LOAD_TYPE;
 
 
@@ -956,6 +957,11 @@ typedef enum {
 - controller;
 @end
 
+ at interface WCURLHandle
+-(int)contentLength;
+ at end
+
+
 @implementation URLLoadClient
 
 -(id)initWithLoader:(Loader *)loader dataSource: dataSource
@@ -994,6 +1000,7 @@ typedef enum {
 
 - (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
 {
+    id <IFLoadHandler> controller;
     void *userData;
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
@@ -1007,12 +1014,11 @@ typedef enum {
 
     m_loader->slotFinished(job);
     
-    id <IFLoadHandler> controller;
-    
-    controller = [m_dataSource controller];
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
     loadProgress->totalToLoad = [data length];
     loadProgress->bytesSoFar = [data length];
+
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 
     [sender autorelease];
@@ -1033,10 +1039,12 @@ typedef enum {
 
     id <IFLoadHandler> controller;
     
-    controller = [m_dataSource controller];
+
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
-    loadProgress->totalToLoad = -1;
+    loadProgress->totalToLoad = [sender contentLength];
     loadProgress->bytesSoFar = [data length];
+    
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 }
 
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index ec20319..5bd0c5d 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -59,7 +59,7 @@ using namespace khtml;
 using namespace DOM;
 
 
-static WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
+WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
 
 void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
 {
@@ -926,7 +926,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 typedef enum {
     IF_LOAD_TYPE_CSS    = 1,
     IF_LOAD_TYPE_IMAGE  = 2,
-    IF_LOAD_TYPE_SCRIPT = 3
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
 } IF_LOAD_TYPE;
 
 
@@ -956,6 +957,11 @@ typedef enum {
 - controller;
 @end
 
+ at interface WCURLHandle
+-(int)contentLength;
+ at end
+
+
 @implementation URLLoadClient
 
 -(id)initWithLoader:(Loader *)loader dataSource: dataSource
@@ -994,6 +1000,7 @@ typedef enum {
 
 - (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
 {
+    id <IFLoadHandler> controller;
     void *userData;
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
@@ -1007,12 +1014,11 @@ typedef enum {
 
     m_loader->slotFinished(job);
     
-    id <IFLoadHandler> controller;
-    
-    controller = [m_dataSource controller];
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
     loadProgress->totalToLoad = [data length];
     loadProgress->bytesSoFar = [data length];
+
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 
     [sender autorelease];
@@ -1033,10 +1039,12 @@ typedef enum {
 
     id <IFLoadHandler> controller;
     
-    controller = [m_dataSource controller];
+
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
-    loadProgress->totalToLoad = -1;
+    loadProgress->totalToLoad = [sender contentLength];
     loadProgress->bytesSoFar = [data length];
+    
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 }
 
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index ec20319..5bd0c5d 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -59,7 +59,7 @@ using namespace khtml;
 using namespace DOM;
 
 
-static WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
+WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
 
 void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
 {
@@ -926,7 +926,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 typedef enum {
     IF_LOAD_TYPE_CSS    = 1,
     IF_LOAD_TYPE_IMAGE  = 2,
-    IF_LOAD_TYPE_SCRIPT = 3
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
 } IF_LOAD_TYPE;
 
 
@@ -956,6 +957,11 @@ typedef enum {
 - controller;
 @end
 
+ at interface WCURLHandle
+-(int)contentLength;
+ at end
+
+
 @implementation URLLoadClient
 
 -(id)initWithLoader:(Loader *)loader dataSource: dataSource
@@ -994,6 +1000,7 @@ typedef enum {
 
 - (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
 {
+    id <IFLoadHandler> controller;
     void *userData;
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
@@ -1007,12 +1014,11 @@ typedef enum {
 
     m_loader->slotFinished(job);
     
-    id <IFLoadHandler> controller;
-    
-    controller = [m_dataSource controller];
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
     loadProgress->totalToLoad = [data length];
     loadProgress->bytesSoFar = [data length];
+
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 
     [sender autorelease];
@@ -1033,10 +1039,12 @@ typedef enum {
 
     id <IFLoadHandler> controller;
     
-    controller = [m_dataSource controller];
+
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
-    loadProgress->totalToLoad = -1;
+    loadProgress->totalToLoad = [sender contentLength];
     loadProgress->bytesSoFar = [data length];
+    
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 }
 
diff --git a/WebCore/kwq/WCLoadProgress.h b/WebCore/kwq/WCLoadProgress.h
index 31f4f6e..c33f1b4 100644
--- a/WebCore/kwq/WCLoadProgress.h
+++ b/WebCore/kwq/WCLoadProgress.h
@@ -28,7 +28,10 @@
 
 #import <Foundation/Foundation.h>
 
+
 typedef id (*WCIFLoadProgressMakeFunc)();
 void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func);
 
+extern WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
+
 #endif /* __WCLOADPROGRESS__ */
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index ab999a1..dbb0e12 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -57,6 +57,8 @@
 
 #import <KWQView.h>
 
+#include <WCLoadProgress.h>
+
 @class IFWebDataSource;
 @class IFWebView;
 @class IFWebFrame;
@@ -100,6 +102,31 @@
 - (void *)_renderFramePart;
 @end
 
+typedef enum {
+    IF_LOAD_TYPE_CSS    = 1,
+    IF_LOAD_TYPE_IMAGE  = 2,
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
+} IF_LOAD_TYPE;
+
+
+ at interface IFLoadProgress : NSObject
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalToLoad;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    IF_LOAD_TYPE type;	// load types, either image, css, or jscript
+}
+- init;
+ at end
+
+ at protocol  IFLoadHandler
+- (void)receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
+
+- (void)receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+
+ at end
+
 static bool cache_init = false;
 
 static void recursive(const DOM::Node &pNode, const DOM::Node &node)
@@ -122,6 +149,7 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     @public
     KHTMLPart *m_part;
     NSData *m_data;
+    id dataSource;
 }
 @end
 
@@ -165,6 +193,12 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 
     KWQDEBUGLEVEL1 (0x2000, "userData = 0x%08x\n", userData);
     m_part->closeURL();
+
+    IFLoadProgress *loadProgress = WCIFLoadProgressMake();
+    loadProgress->totalToLoad = [data length];
+    loadProgress->bytesSoFar = [data length];
+    [[dataSource controller] receivedProgress: (IFLoadProgress *)loadProgress forResource: [[sender url] absoluteString] fromDataSource: dataSource];
+
     [sender autorelease];
 }
 
@@ -179,6 +213,11 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
         m_data = [data retain];
     }
     m_part->slotData(sender, (const char *)[data bytes], [data length]);
+    
+    IFLoadProgress *loadProgress = WCIFLoadProgressMake();
+    loadProgress->totalToLoad = [sender contentLength];
+    loadProgress->bytesSoFar = [data length];
+    [[dataSource controller] receivedProgress: (IFLoadProgress *)loadProgress forResource: [[sender url] absoluteString] fromDataSource: dataSource];
 }
 
 - (void)IFURLHandle:(IFURLHandle *)sender resourceDidFailLoadingWithResult:(int)result
@@ -191,6 +230,12 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
     [sender autorelease];
 }
 
+// Non-retained
+- (void)setDataSource: d
+{
+    dataSource = d;
+}
+
 
 -(void)checkCompleted:(NSNotification *)notification
 {
@@ -430,6 +475,8 @@ bool KHTMLPart::openURL( const KURL &url )
         urlString = [urlString substringToIndex:([urlString length] - 1)];
     }
     theURL = [NSURL URLWithString:urlString];
+
+    [d->m_recv setDataSource: getDataSource()];
     
     d->m_handle = [[IFURLHandle alloc] initWithURL:theURL];
     [d->m_handle addClient:d->m_recv];
diff --git a/WebCore/src/kwq/KWQKloader.mm b/WebCore/src/kwq/KWQKloader.mm
index ec20319..5bd0c5d 100644
--- a/WebCore/src/kwq/KWQKloader.mm
+++ b/WebCore/src/kwq/KWQKloader.mm
@@ -59,7 +59,7 @@ using namespace khtml;
 using namespace DOM;
 
 
-static WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
+WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
 
 void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func)
 {
@@ -926,7 +926,8 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 typedef enum {
     IF_LOAD_TYPE_CSS    = 1,
     IF_LOAD_TYPE_IMAGE  = 2,
-    IF_LOAD_TYPE_SCRIPT = 3
+    IF_LOAD_TYPE_SCRIPT = 3,
+    IF_LOAD_TYPE_HTML   = 4
 } IF_LOAD_TYPE;
 
 
@@ -956,6 +957,11 @@ typedef enum {
 - controller;
 @end
 
+ at interface WCURLHandle
+-(int)contentLength;
+ at end
+
+
 @implementation URLLoadClient
 
 -(id)initWithLoader:(Loader *)loader dataSource: dataSource
@@ -994,6 +1000,7 @@ typedef enum {
 
 - (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
 {
+    id <IFLoadHandler> controller;
     void *userData;
     
     userData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
@@ -1007,12 +1014,11 @@ typedef enum {
 
     m_loader->slotFinished(job);
     
-    id <IFLoadHandler> controller;
-    
-    controller = [m_dataSource controller];
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
     loadProgress->totalToLoad = [data length];
     loadProgress->bytesSoFar = [data length];
+
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 
     [sender autorelease];
@@ -1033,10 +1039,12 @@ typedef enum {
 
     id <IFLoadHandler> controller;
     
-    controller = [m_dataSource controller];
+
     IFLoadProgress *loadProgress = WCIFLoadProgressMake();
-    loadProgress->totalToLoad = -1;
+    loadProgress->totalToLoad = [sender contentLength];
     loadProgress->bytesSoFar = [data length];
+    
+    controller = [m_dataSource controller];
     [controller receivedProgress: (IFLoadProgress *)loadProgress forResource: QSTRING_TO_NSSTRING(urlString) fromDataSource: m_dataSource];
 }
 
diff --git a/WebCore/src/kwq/WCLoadProgress.h b/WebCore/src/kwq/WCLoadProgress.h
index 31f4f6e..c33f1b4 100644
--- a/WebCore/src/kwq/WCLoadProgress.h
+++ b/WebCore/src/kwq/WCLoadProgress.h
@@ -28,7 +28,10 @@
 
 #import <Foundation/Foundation.h>
 
+
 typedef id (*WCIFLoadProgressMakeFunc)();
 void WCSetIFLoadProgressMakeFunc(WCIFLoadProgressMakeFunc func);
 
+extern WCIFLoadProgressMakeFunc WCIFLoadProgressMake;
+
 #endif /* __WCLOADPROGRESS__ */

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list