[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 06:12:48 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c3f95033fa0f484a1b6feba57f0b4db18591b93d
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 15 00:19:12 2002 +0000

    WebCore:
    
            Changed slotData to slotData(NSString *encoding, const char *bytes, int length)
    
            * khtml/khtml_part.h:
            * kwq/KWQKHTMLPart.mm:
            (KHTMLPart::slotData):
            * libwebcore.exp:
    
    
    WebKit:
    
            Removed retain of the URL handle. This was causing everything to leak.
    
            * WebView.subproj/IFMainURLHandleClient.h:
            * WebView.subproj/IFMainURLHandleClient.mm:
            (-[IFMainURLHandleClient initWithDataSource:part:]):
            (-[IFMainURLHandleClient dealloc]):
            (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]):
            (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]):
            (-[IFMainURLHandleClient processData:isComplete:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1149 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 13431b8..729a922 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,12 @@
+2002-05-14  Chris Blumenberg  <cblu at apple.com>
+
+	Changed slotData to slotData(NSString *encoding, const char *bytes, int length)
+
+	* khtml/khtml_part.h:
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::slotData):
+	* libwebcore.exp:
+
 2002-05-14  Darin Adler  <darin at apple.com>
 
 	Fixed 2925291 -- CSS2 test page causes infinite recursion, crash
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 13431b8..729a922 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,12 @@
+2002-05-14  Chris Blumenberg  <cblu at apple.com>
+
+	Changed slotData to slotData(NSString *encoding, const char *bytes, int length)
+
+	* khtml/khtml_part.h:
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::slotData):
+	* libwebcore.exp:
+
 2002-05-14  Darin Adler  <darin at apple.com>
 
 	Fixed 2925291 -- CSS2 test page causes infinite recursion, crash
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 13431b8..729a922 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,12 @@
+2002-05-14  Chris Blumenberg  <cblu at apple.com>
+
+	Changed slotData to slotData(NSString *encoding, const char *bytes, int length)
+
+	* khtml/khtml_part.h:
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::slotData):
+	* libwebcore.exp:
+
 2002-05-14  Darin Adler  <darin at apple.com>
 
 	Fixed 2925291 -- CSS2 test page causes infinite recursion, crash
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index 62594bf..c194c86 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -1110,7 +1110,7 @@ public:
 
     void setView(KHTMLView *view);
 
-    void slotData(IFURLHandle *, const char *bytes, int length);
+    void slotData(NSString *, const char *bytes, int length);
 
     void setBaseURL(const KURL &);
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 2824a65..71ea7b0 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -423,10 +423,9 @@ DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const
     return 0;
 }
 
-void KHTMLPart::slotData(IFURLHandle *handle, const char *bytes, int length)
+void KHTMLPart::slotData(NSString *encoding, const char *bytes, int length)
 {
 // NOTE: This code emulates the interface used by the original khtml part  
-    NSString *encoding;
     QString enc;
 
     if (!d->m_workingURL.isEmpty()) {
@@ -437,7 +436,6 @@ void KHTMLPart::slotData(IFURLHandle *handle, const char *bytes, int length)
         d->m_workingURL = KURL();
     }
 
-    encoding = [handle characterSet];
     if (encoding != NULL) {
       enc = QString::fromCFString((CFStringRef) encoding);
       setEncoding(enc, true);
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 2824a65..71ea7b0 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -423,10 +423,9 @@ DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const
     return 0;
 }
 
-void KHTMLPart::slotData(IFURLHandle *handle, const char *bytes, int length)
+void KHTMLPart::slotData(NSString *encoding, const char *bytes, int length)
 {
 // NOTE: This code emulates the interface used by the original khtml part  
-    NSString *encoding;
     QString enc;
 
     if (!d->m_workingURL.isEmpty()) {
@@ -437,7 +436,6 @@ void KHTMLPart::slotData(IFURLHandle *handle, const char *bytes, int length)
         d->m_workingURL = KURL();
     }
 
-    encoding = [handle characterSet];
     if (encoding != NULL) {
       enc = QString::fromCFString((CFStringRef) encoding);
       setEncoding(enc, true);
diff --git a/WebCore/libwebcore.exp b/WebCore/libwebcore.exp
index 70045a5..7104083 100644
--- a/WebCore/libwebcore.exp
+++ b/WebCore/libwebcore.exp
@@ -20,7 +20,7 @@ __ZN9KHTMLPart10setBaseURLERK4KURL
 __ZN9KHTMLPart13setDataSourceEP15IFWebDataSource
 __ZN9KHTMLPart14gotoBaseAnchorEv
 __ZN9KHTMLPart7setViewEP9KHTMLView
-__ZN9KHTMLPart8slotDataEP11IFURLHandlePKci
+__ZN9KHTMLPart8slotDataEP8NSStringPKci
 __ZN9KHTMLPartC1EP7QWidgetPKcP7QObjectS3_NS_10GUIProfileE
 __ZN9KHTMLView6layoutEv
 __ZN9KHTMLViewC1EP9KHTMLPartP7QWidgetPKc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 64add42..38c2f59 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2002-05-14  Chris Blumenberg  <cblu at apple.com>
+
+	Removed retain of the URL handle. This was causing everything to leak.
+
+	* WebView.subproj/IFMainURLHandleClient.h:
+	* WebView.subproj/IFMainURLHandleClient.mm:
+	(-[IFMainURLHandleClient initWithDataSource:part:]):
+	(-[IFMainURLHandleClient dealloc]):
+	(-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]):
+	(-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]):
+	(-[IFMainURLHandleClient processData:isComplete:]):
+
 2002-05-14  Darin Adler  <darin at apple.com>
 
 	* WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]):
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 64add42..38c2f59 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,15 @@
+2002-05-14  Chris Blumenberg  <cblu at apple.com>
+
+	Removed retain of the URL handle. This was causing everything to leak.
+
+	* WebView.subproj/IFMainURLHandleClient.h:
+	* WebView.subproj/IFMainURLHandleClient.mm:
+	(-[IFMainURLHandleClient initWithDataSource:part:]):
+	(-[IFMainURLHandleClient dealloc]):
+	(-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]):
+	(-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]):
+	(-[IFMainURLHandleClient processData:isComplete:]):
+
 2002-05-14  Darin Adler  <darin at apple.com>
 
 	* WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]):
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.h b/WebKit/WebView.subproj/IFMainURLHandleClient.h
index 5db1b3f..8873d3a 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.h
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.h
@@ -20,13 +20,14 @@ class KHTMLPart;
 {
     id dataSource;
     KHTMLPart *part;
-    BOOL sentFakeDocForNonHTMLContentType, checkedMIMEType, downloadStarted, loadFinished, sentInitialData;
+    BOOL sentFakeDocForNonHTMLContentType, examinedInitialData, downloadStarted, loadFinished, sentInitialData;
     IFMIMEHandler *mimeHandler;
     IFMIMEHandlerType handlerType;
     IFDownloadHandler *downloadHandler;
     IFContentPolicy contentPolicy;
     NSData *resourceData;
-    IFURLHandle *urlHandle;
+    NSString *encoding;
+    NSURL *url;
 }
 - initWithDataSource: (IFWebDataSource *)ds part: (KHTMLPart *)p;
 - (void)setContentPolicy:(IFContentPolicy)theContentPolicy;
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.mm b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
index 0fd5fcf..c6c00b2 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.mm
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
@@ -35,8 +35,8 @@
         part = p;
         part->ref();
         sentFakeDocForNonHTMLContentType = NO;
+        examinedInitialData = NO;
         downloadStarted = NO;
-        checkedMIMEType = NO;
         loadFinished    = NO;
         sentInitialData = NO;
         contentPolicy = IFContentPolicyNone;
@@ -52,7 +52,8 @@
     [dataSource release];
     [mimeHandler release];
     [resourceData release];
-    [urlHandle release];
+    [encoding release];
+    [url release];
     [super dealloc];
 }
 
@@ -115,18 +116,19 @@
     
     // Check the mime type and ask the client for the content policy.
     // This only happens once.
-    if(!checkedMIMEType){
+    if(!examinedInitialData){
         WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", [[sender contentType] cString]);
         [[dataSource _locationChangeHandler] requestContentPolicyForMIMEType:[sender contentType]];
         
         // FIXME: Remove/replace IFMIMEHandler stuff
         mimeHandler = [[[IFMIMEDatabase sharedMIMEDatabase] MIMEHandlerForMIMEType:[sender contentType]] retain];
         handlerType = [mimeHandler handlerType];
-        checkedMIMEType = YES;
+        
+        encoding = [[sender characterSet] retain];
+        url = [[sender url] retain];
+        examinedInitialData = YES;
     }
     
-    urlHandle = [sender retain];
-    
     if(contentPolicy != IFContentPolicyNone && contentPolicy != IFContentPolicyIgnore){
         if(!sentInitialData){
             // process all data that has been received 
@@ -144,6 +146,8 @@
         [sender cancelLoadInBackground];
     }
     
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "%d of %d", [sender contentLengthReceived], [sender contentLength]);
+    
     // update progress
     IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
     loadProgress->totalToLoad = [sender contentLength];
@@ -166,14 +170,14 @@
 }
 
 
-- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)url
+- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)URL
 {
-    WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[url absoluteString] cString]);
-    part->setBaseURL([[url absoluteString] cString]);
+    WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[URL absoluteString] cString]);
+    part->setBaseURL([[URL absoluteString] cString]);
     
-    [dataSource _setFinalURL: url];
+    [dataSource _setFinalURL: URL];
     
-    [[dataSource _locationChangeHandler] serverRedirectTo: url forDataSource: dataSource];
+    [[dataSource _locationChangeHandler] serverRedirectTo: URL forDataSource: dataSource];
 }
 
 
@@ -188,7 +192,7 @@
         
         if(handlerType == IFMIMEHANDLERTYPE_NIL || handlerType == IFMIMEHANDLERTYPE_HTML) {
             // If data is html, send it to the part.
-            part->slotData(urlHandle, (const char *)[data bytes], [data length]);
+            part->slotData(encoding, (const char *)[data bytes], [data length]);
         }
         
         else if(handlerType == IFMIMEHANDLERTYPE_IMAGE  || 
@@ -197,17 +201,17 @@
                 
             // For a non-html document, create html doc that embeds it.
             if (!sentFakeDocForNonHTMLContentType) {
-                contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:[urlHandle url]];
+                contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:url];
                 fakeHTMLDocument = [contentHandler HTMLDocument];
                 fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
-                part->slotData(urlHandle, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
+                part->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
                 [contentHandler release];
                 sentFakeDocForNonHTMLContentType = YES;
             }
             
             // For text documents, the incoming data is part of the main page.
             if(handlerType == IFMIMEHANDLERTYPE_TEXT){
-                part->slotData(urlHandle, (const char *)[data bytes], [data length]);
+                part->slotData(encoding, (const char *)[data bytes], [data length]);
             }
         }
     }
@@ -225,7 +229,6 @@
                 [[dataSource _locationChangeHandler] locationChangeDone:nil];
                 downloadStarted = YES;
             }
-            WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "%d of %d", [urlHandle contentLengthReceived], [urlHandle contentLength]);
     }
     
     if(complete)
@@ -240,10 +243,10 @@
     
     if(contentPolicy == IFContentPolicyShow){
         if(handlerType == IFMIMEHANDLERTYPE_TEXT) {
-            contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:[urlHandle url]];
+            contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:url];
             fakeHTMLDocument = [contentHandler textHTMLDocumentBottom];
             fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
-            part->slotData(urlHandle, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
+            part->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
             [contentHandler release];
         }
     }
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.h b/WebKit/WebView.subproj/WebMainResourceClient.h
index 5db1b3f..8873d3a 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.h
+++ b/WebKit/WebView.subproj/WebMainResourceClient.h
@@ -20,13 +20,14 @@ class KHTMLPart;
 {
     id dataSource;
     KHTMLPart *part;
-    BOOL sentFakeDocForNonHTMLContentType, checkedMIMEType, downloadStarted, loadFinished, sentInitialData;
+    BOOL sentFakeDocForNonHTMLContentType, examinedInitialData, downloadStarted, loadFinished, sentInitialData;
     IFMIMEHandler *mimeHandler;
     IFMIMEHandlerType handlerType;
     IFDownloadHandler *downloadHandler;
     IFContentPolicy contentPolicy;
     NSData *resourceData;
-    IFURLHandle *urlHandle;
+    NSString *encoding;
+    NSURL *url;
 }
 - initWithDataSource: (IFWebDataSource *)ds part: (KHTMLPart *)p;
 - (void)setContentPolicy:(IFContentPolicy)theContentPolicy;
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 0fd5fcf..c6c00b2 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -35,8 +35,8 @@
         part = p;
         part->ref();
         sentFakeDocForNonHTMLContentType = NO;
+        examinedInitialData = NO;
         downloadStarted = NO;
-        checkedMIMEType = NO;
         loadFinished    = NO;
         sentInitialData = NO;
         contentPolicy = IFContentPolicyNone;
@@ -52,7 +52,8 @@
     [dataSource release];
     [mimeHandler release];
     [resourceData release];
-    [urlHandle release];
+    [encoding release];
+    [url release];
     [super dealloc];
 }
 
@@ -115,18 +116,19 @@
     
     // Check the mime type and ask the client for the content policy.
     // This only happens once.
-    if(!checkedMIMEType){
+    if(!examinedInitialData){
         WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", [[sender contentType] cString]);
         [[dataSource _locationChangeHandler] requestContentPolicyForMIMEType:[sender contentType]];
         
         // FIXME: Remove/replace IFMIMEHandler stuff
         mimeHandler = [[[IFMIMEDatabase sharedMIMEDatabase] MIMEHandlerForMIMEType:[sender contentType]] retain];
         handlerType = [mimeHandler handlerType];
-        checkedMIMEType = YES;
+        
+        encoding = [[sender characterSet] retain];
+        url = [[sender url] retain];
+        examinedInitialData = YES;
     }
     
-    urlHandle = [sender retain];
-    
     if(contentPolicy != IFContentPolicyNone && contentPolicy != IFContentPolicyIgnore){
         if(!sentInitialData){
             // process all data that has been received 
@@ -144,6 +146,8 @@
         [sender cancelLoadInBackground];
     }
     
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "%d of %d", [sender contentLengthReceived], [sender contentLength]);
+    
     // update progress
     IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
     loadProgress->totalToLoad = [sender contentLength];
@@ -166,14 +170,14 @@
 }
 
 
-- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)url
+- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)URL
 {
-    WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[url absoluteString] cString]);
-    part->setBaseURL([[url absoluteString] cString]);
+    WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[URL absoluteString] cString]);
+    part->setBaseURL([[URL absoluteString] cString]);
     
-    [dataSource _setFinalURL: url];
+    [dataSource _setFinalURL: URL];
     
-    [[dataSource _locationChangeHandler] serverRedirectTo: url forDataSource: dataSource];
+    [[dataSource _locationChangeHandler] serverRedirectTo: URL forDataSource: dataSource];
 }
 
 
@@ -188,7 +192,7 @@
         
         if(handlerType == IFMIMEHANDLERTYPE_NIL || handlerType == IFMIMEHANDLERTYPE_HTML) {
             // If data is html, send it to the part.
-            part->slotData(urlHandle, (const char *)[data bytes], [data length]);
+            part->slotData(encoding, (const char *)[data bytes], [data length]);
         }
         
         else if(handlerType == IFMIMEHANDLERTYPE_IMAGE  || 
@@ -197,17 +201,17 @@
                 
             // For a non-html document, create html doc that embeds it.
             if (!sentFakeDocForNonHTMLContentType) {
-                contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:[urlHandle url]];
+                contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:url];
                 fakeHTMLDocument = [contentHandler HTMLDocument];
                 fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
-                part->slotData(urlHandle, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
+                part->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
                 [contentHandler release];
                 sentFakeDocForNonHTMLContentType = YES;
             }
             
             // For text documents, the incoming data is part of the main page.
             if(handlerType == IFMIMEHANDLERTYPE_TEXT){
-                part->slotData(urlHandle, (const char *)[data bytes], [data length]);
+                part->slotData(encoding, (const char *)[data bytes], [data length]);
             }
         }
     }
@@ -225,7 +229,6 @@
                 [[dataSource _locationChangeHandler] locationChangeDone:nil];
                 downloadStarted = YES;
             }
-            WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "%d of %d", [urlHandle contentLengthReceived], [urlHandle contentLength]);
     }
     
     if(complete)
@@ -240,10 +243,10 @@
     
     if(contentPolicy == IFContentPolicyShow){
         if(handlerType == IFMIMEHANDLERTYPE_TEXT) {
-            contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:[urlHandle url]];
+            contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:url];
             fakeHTMLDocument = [contentHandler textHTMLDocumentBottom];
             fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
-            part->slotData(urlHandle, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
+            part->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
             [contentHandler release];
         }
     }
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.h b/WebKit/WebView.subproj/WebMainResourceLoader.h
index 5db1b3f..8873d3a 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.h
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.h
@@ -20,13 +20,14 @@ class KHTMLPart;
 {
     id dataSource;
     KHTMLPart *part;
-    BOOL sentFakeDocForNonHTMLContentType, checkedMIMEType, downloadStarted, loadFinished, sentInitialData;
+    BOOL sentFakeDocForNonHTMLContentType, examinedInitialData, downloadStarted, loadFinished, sentInitialData;
     IFMIMEHandler *mimeHandler;
     IFMIMEHandlerType handlerType;
     IFDownloadHandler *downloadHandler;
     IFContentPolicy contentPolicy;
     NSData *resourceData;
-    IFURLHandle *urlHandle;
+    NSString *encoding;
+    NSURL *url;
 }
 - initWithDataSource: (IFWebDataSource *)ds part: (KHTMLPart *)p;
 - (void)setContentPolicy:(IFContentPolicy)theContentPolicy;
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 0fd5fcf..c6c00b2 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -35,8 +35,8 @@
         part = p;
         part->ref();
         sentFakeDocForNonHTMLContentType = NO;
+        examinedInitialData = NO;
         downloadStarted = NO;
-        checkedMIMEType = NO;
         loadFinished    = NO;
         sentInitialData = NO;
         contentPolicy = IFContentPolicyNone;
@@ -52,7 +52,8 @@
     [dataSource release];
     [mimeHandler release];
     [resourceData release];
-    [urlHandle release];
+    [encoding release];
+    [url release];
     [super dealloc];
 }
 
@@ -115,18 +116,19 @@
     
     // Check the mime type and ask the client for the content policy.
     // This only happens once.
-    if(!checkedMIMEType){
+    if(!examinedInitialData){
         WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", [[sender contentType] cString]);
         [[dataSource _locationChangeHandler] requestContentPolicyForMIMEType:[sender contentType]];
         
         // FIXME: Remove/replace IFMIMEHandler stuff
         mimeHandler = [[[IFMIMEDatabase sharedMIMEDatabase] MIMEHandlerForMIMEType:[sender contentType]] retain];
         handlerType = [mimeHandler handlerType];
-        checkedMIMEType = YES;
+        
+        encoding = [[sender characterSet] retain];
+        url = [[sender url] retain];
+        examinedInitialData = YES;
     }
     
-    urlHandle = [sender retain];
-    
     if(contentPolicy != IFContentPolicyNone && contentPolicy != IFContentPolicyIgnore){
         if(!sentInitialData){
             // process all data that has been received 
@@ -144,6 +146,8 @@
         [sender cancelLoadInBackground];
     }
     
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "%d of %d", [sender contentLengthReceived], [sender contentLength]);
+    
     // update progress
     IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
     loadProgress->totalToLoad = [sender contentLength];
@@ -166,14 +170,14 @@
 }
 
 
-- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)url
+- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)URL
 {
-    WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[url absoluteString] cString]);
-    part->setBaseURL([[url absoluteString] cString]);
+    WEBKITDEBUGLEVEL (WEBKIT_LOG_REDIRECT, "url = %s\n", [[URL absoluteString] cString]);
+    part->setBaseURL([[URL absoluteString] cString]);
     
-    [dataSource _setFinalURL: url];
+    [dataSource _setFinalURL: URL];
     
-    [[dataSource _locationChangeHandler] serverRedirectTo: url forDataSource: dataSource];
+    [[dataSource _locationChangeHandler] serverRedirectTo: URL forDataSource: dataSource];
 }
 
 
@@ -188,7 +192,7 @@
         
         if(handlerType == IFMIMEHANDLERTYPE_NIL || handlerType == IFMIMEHANDLERTYPE_HTML) {
             // If data is html, send it to the part.
-            part->slotData(urlHandle, (const char *)[data bytes], [data length]);
+            part->slotData(encoding, (const char *)[data bytes], [data length]);
         }
         
         else if(handlerType == IFMIMEHANDLERTYPE_IMAGE  || 
@@ -197,17 +201,17 @@
                 
             // For a non-html document, create html doc that embeds it.
             if (!sentFakeDocForNonHTMLContentType) {
-                contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:[urlHandle url]];
+                contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:url];
                 fakeHTMLDocument = [contentHandler HTMLDocument];
                 fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
-                part->slotData(urlHandle, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
+                part->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
                 [contentHandler release];
                 sentFakeDocForNonHTMLContentType = YES;
             }
             
             // For text documents, the incoming data is part of the main page.
             if(handlerType == IFMIMEHANDLERTYPE_TEXT){
-                part->slotData(urlHandle, (const char *)[data bytes], [data length]);
+                part->slotData(encoding, (const char *)[data bytes], [data length]);
             }
         }
     }
@@ -225,7 +229,6 @@
                 [[dataSource _locationChangeHandler] locationChangeDone:nil];
                 downloadStarted = YES;
             }
-            WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "%d of %d", [urlHandle contentLengthReceived], [urlHandle contentLength]);
     }
     
     if(complete)
@@ -240,10 +243,10 @@
     
     if(contentPolicy == IFContentPolicyShow){
         if(handlerType == IFMIMEHANDLERTYPE_TEXT) {
-            contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:[urlHandle url]];
+            contentHandler = [[IFContentHandler alloc] initWithMIMEHandler:mimeHandler URL:url];
             fakeHTMLDocument = [contentHandler textHTMLDocumentBottom];
             fakeHTMLDocumentBytes = [fakeHTMLDocument cString];
-            part->slotData(urlHandle, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
+            part->slotData(encoding, (const char *)fakeHTMLDocumentBytes, strlen(fakeHTMLDocumentBytes));
             [contentHandler release];
         }
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list