[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 06:47:31 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b8d1e8a2a59c9655c117ac946504a7f9f7a06624
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 7 19:38:06 2002 +0000

            'Re'play the delegate messages when an item is loaded from
            the WebCore cache.
    
            Note that the client will NOT receive a willSendRequest: message.  The client
            presumably already did any request substitution before the object was loaded
            into the cache.  Allowing the delegate to override the request and replace
            the object in the WebCore cache would introduce significant complexity.
    
            Fixes 3069138.
    
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge objectLoadedFromCache:response:size:]):
            * WebCoreSupport.subproj/WebSubresourceClient.m:
            (-[WebSubresourceClient handle:didReceiveResponse:]):
    
            Added response to WebCore's CachedObject.  This allows us to correctly
            emulated the WebResourceLoadDelegate API when 're'loading an item
            from the WebCore cache.
    
            * khtml/misc/loader.cpp:
            (CachedObject::~CachedObject):
            (CachedObject::setResponse):
            (Loader::receivedResponse):
            * khtml/misc/loader.h:
            * kwq/KWQLoaderImpl.h:
            * kwq/KWQLoaderImpl.mm:
            (-[WebCoreResourceLoader receivedResponse:]):
            (KWQCheckCacheObjectStatus):
            (KWQRetainResponse):
            (KWQReleaseResponse):
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreResourceLoader.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 704984c..07ea2d0 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,23 @@
+2002-10-07  Richard Williamson   <rjw at apple.com>
+
+        Added response to WebCore's CachedObject.  This allows us to correctly
+        emulated the WebResourceLoadDelegate API when 're'loading an item
+        from the WebCore cache.  
+        
+        * khtml/misc/loader.cpp:
+        (CachedObject::~CachedObject):
+        (CachedObject::setResponse):
+        (Loader::receivedResponse):
+        * khtml/misc/loader.h:
+        * kwq/KWQLoaderImpl.h:
+        * kwq/KWQLoaderImpl.mm:
+        (-[WebCoreResourceLoader receivedResponse:]):
+        (KWQCheckCacheObjectStatus):
+        (KWQRetainResponse):
+        (KWQReleaseResponse):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreResourceLoader.h:
+
 2002-10-06  Darin Adler  <darin at apple.com>
 
 	- fixed 3046737 -- infinite loop in font name matching code on some pages
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 704984c..07ea2d0 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,23 @@
+2002-10-07  Richard Williamson   <rjw at apple.com>
+
+        Added response to WebCore's CachedObject.  This allows us to correctly
+        emulated the WebResourceLoadDelegate API when 're'loading an item
+        from the WebCore cache.  
+        
+        * khtml/misc/loader.cpp:
+        (CachedObject::~CachedObject):
+        (CachedObject::setResponse):
+        (Loader::receivedResponse):
+        * khtml/misc/loader.h:
+        * kwq/KWQLoaderImpl.h:
+        * kwq/KWQLoaderImpl.mm:
+        (-[WebCoreResourceLoader receivedResponse:]):
+        (KWQCheckCacheObjectStatus):
+        (KWQRetainResponse):
+        (KWQReleaseResponse):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreResourceLoader.h:
+
 2002-10-06  Darin Adler  <darin at apple.com>
 
 	- fixed 3046737 -- infinite loop in font name matching code on some pages
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 704984c..07ea2d0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2002-10-07  Richard Williamson   <rjw at apple.com>
+
+        Added response to WebCore's CachedObject.  This allows us to correctly
+        emulated the WebResourceLoadDelegate API when 're'loading an item
+        from the WebCore cache.  
+        
+        * khtml/misc/loader.cpp:
+        (CachedObject::~CachedObject):
+        (CachedObject::setResponse):
+        (Loader::receivedResponse):
+        * khtml/misc/loader.h:
+        * kwq/KWQLoaderImpl.h:
+        * kwq/KWQLoaderImpl.mm:
+        (-[WebCoreResourceLoader receivedResponse:]):
+        (KWQCheckCacheObjectStatus):
+        (KWQRetainResponse):
+        (KWQReleaseResponse):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreResourceLoader.h:
+
 2002-10-06  Darin Adler  <darin at apple.com>
 
 	- fixed 3046737 -- infinite loop in font name matching code on some pages
diff --git a/WebCore/khtml/misc/loader.cpp b/WebCore/khtml/misc/loader.cpp
index e8d3bbc..59336d5 100644
--- a/WebCore/khtml/misc/loader.cpp
+++ b/WebCore/khtml/misc/loader.cpp
@@ -72,6 +72,7 @@ CachedObject::~CachedObject()
     if(m_deleted) abort();
     Cache::removeFromLRUList(this);
     m_deleted = true;
+    KWQReleaseResponse (m_response);
 }
 
 void CachedObject::finish()
@@ -115,6 +116,15 @@ bool CachedObject::isExpired() const
     return (difftime(now, m_expireDate) >= 0);
 }
 
+void CachedObject::setResponse (void *response)
+{
+    if (m_response != response){
+        KWQReleaseResponse (m_response);
+        m_response = response;
+        KWQRetainResponse (m_response);
+    }
+}
+
 void CachedObject::setRequest(Request *_request)
 {
     if ( _request && !m_request )
@@ -1212,6 +1222,18 @@ kdDebug(6060) << "Loader::slotFinished, url = " << j->url().url() << " expires "
 }
 
 #ifdef APPLE_CHANGES
+void Loader::receivedResponse (KIO::Job*job,void *response)
+{
+    Request *r = m_requestsLoading[job];
+    if(!r) {
+        kdDebug( 6060 ) << "got response for unknown request!" << endl;
+        return;
+    }
+    r->object->setResponse( response );
+}
+#endif
+
+#ifdef APPLE_CHANGES
 void Loader::slotData( KIO::Job*job, const char *data, int size )
 #else
 void Loader::slotData( KIO::Job*job, const QByteArray &data )
diff --git a/WebCore/khtml/misc/loader.h b/WebCore/khtml/misc/loader.h
index 14187ed..1e663c3 100644
--- a/WebCore/khtml/misc/loader.h
+++ b/WebCore/khtml/misc/loader.h
@@ -108,6 +108,9 @@ namespace khtml
 	    m_free = false;
 	    m_cachePolicy = _cachePolicy;
 	    m_request = 0;
+#ifdef APPLE_CHANGES
+            m_response = 0;
+#endif            
 	    m_expireDate = _expireDate;
             m_deleted = false;
             m_expireDateChanged = false;
@@ -149,6 +152,10 @@ namespace khtml
 
         void setRequest(Request *_request);
 
+#ifdef APPLE_CHANGES
+        void *response() { return m_response; }
+        void setResponse (void *response);
+#endif
         bool canDelete() const { return (m_clients.count() == 0 && !m_request); }
 
 	void setExpireDate(time_t _expireDate, bool changeHttpCache);
@@ -170,6 +177,9 @@ namespace khtml
 	DOM::DOMString m_url;
         QString m_accept;
         Request *m_request;
+#ifdef APPLE_CHANGES
+        void *m_response;
+#endif
 	Type m_type;
 	Status m_status;
 	int m_size;
@@ -406,6 +416,7 @@ namespace khtml
 	void slotFinished( KIO::Job * );
 #ifdef APPLE_CHANGES
 	void slotData( KIO::Job *, const char *data, int size );
+        void receivedResponse ( KIO::Job *, void *response );
 #else
 	void slotData( KIO::Job *, const QByteArray & );
 #endif
diff --git a/WebCore/kwq/KWQLoader.h b/WebCore/kwq/KWQLoader.h
index 735b4b4..defd3fc 100644
--- a/WebCore/kwq/KWQLoader.h
+++ b/WebCore/kwq/KWQLoader.h
@@ -36,4 +36,6 @@ namespace KIO {
 
 bool KWQServeRequest(khtml::Loader *, khtml::Request *, KIO::TransferJob *);
 void KWQCheckCacheObjectStatus(khtml::DocLoader *, khtml::CachedObject *);
-bool KWQCheckIfReloading(khtml::DocLoader *loader);
\ No newline at end of file
+bool KWQCheckIfReloading(khtml::DocLoader *loader);
+void KWQRetainResponse(void *response);
+void KWQReleaseResponse(void *response);
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index 3689207..fe73cc5 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -70,6 +70,11 @@ using KIO::TransferJob;
     [super dealloc];
 }
 
+- (void)receivedResponse: response
+{
+    loader->receivedResponse (job, response);
+}
+
 - (void)addData:(NSData *)data
 {
     loader->slotData(job, (const char *)[data bytes], [data length]);
@@ -144,6 +149,18 @@ void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
     NSURL *URL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
     ASSERT(URL);
     CachedImage *cachedImage = dynamic_cast<CachedImage *>(cachedObject);
-    [bridge objectLoadedFromCache:URL size:cachedImage ? cachedImage->dataSize() : cachedObject->size()];
+    [bridge objectLoadedFromCache:URL response: (id)cachedObject->response() size:cachedImage ? cachedImage->dataSize() : cachedObject->size()];
     [URL release];
 }
+
+void KWQRetainResponse(void *response)
+{
+    [(id)response retain];
+}
+
+void KWQReleaseResponse(void *response)
+{
+    [(id)response release];
+}
+
+
diff --git a/WebCore/kwq/KWQLoaderImpl.h b/WebCore/kwq/KWQLoaderImpl.h
index 735b4b4..defd3fc 100644
--- a/WebCore/kwq/KWQLoaderImpl.h
+++ b/WebCore/kwq/KWQLoaderImpl.h
@@ -36,4 +36,6 @@ namespace KIO {
 
 bool KWQServeRequest(khtml::Loader *, khtml::Request *, KIO::TransferJob *);
 void KWQCheckCacheObjectStatus(khtml::DocLoader *, khtml::CachedObject *);
-bool KWQCheckIfReloading(khtml::DocLoader *loader);
\ No newline at end of file
+bool KWQCheckIfReloading(khtml::DocLoader *loader);
+void KWQRetainResponse(void *response);
+void KWQReleaseResponse(void *response);
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index 3689207..fe73cc5 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -70,6 +70,11 @@ using KIO::TransferJob;
     [super dealloc];
 }
 
+- (void)receivedResponse: response
+{
+    loader->receivedResponse (job, response);
+}
+
 - (void)addData:(NSData *)data
 {
     loader->slotData(job, (const char *)[data bytes], [data length]);
@@ -144,6 +149,18 @@ void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
     NSURL *URL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
     ASSERT(URL);
     CachedImage *cachedImage = dynamic_cast<CachedImage *>(cachedObject);
-    [bridge objectLoadedFromCache:URL size:cachedImage ? cachedImage->dataSize() : cachedObject->size()];
+    [bridge objectLoadedFromCache:URL response: (id)cachedObject->response() size:cachedImage ? cachedImage->dataSize() : cachedObject->size()];
     [URL release];
 }
+
+void KWQRetainResponse(void *response)
+{
+    [(id)response retain];
+}
+
+void KWQReleaseResponse(void *response)
+{
+    [(id)response release];
+}
+
+
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 86739da..4119a92 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -174,7 +174,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
 
 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL referrer:(NSString *)referrer;
 - (void)reportBadURL:(NSString *)badURL;
-- (void)objectLoadedFromCache:(NSURL *)URL size:(unsigned)bytes;
+- (void)objectLoadedFromCache:(NSURL *)URL response: response size:(unsigned)bytes;
 - (BOOL)isReloading;
 
 - (void)reportClientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
diff --git a/WebCore/kwq/WebCoreResourceLoader.h b/WebCore/kwq/WebCoreResourceLoader.h
index 7508c79..21f2c5a 100644
--- a/WebCore/kwq/WebCoreResourceLoader.h
+++ b/WebCore/kwq/WebCoreResourceLoader.h
@@ -27,6 +27,8 @@
 
 @protocol WebCoreResourceLoader <NSObject>
 
+- (void)receivedResponse: response;
+
 - (void)addData:(NSData *)data;
 
 // Either cancel or finish will be called before the loader is released, but never both.
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index efad513..2c41612 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2002-10-07  Richard Williamson   <rjw at apple.com>
+
+        'Re'play the delegate messages when an item is loaded from
+        the WebCore cache.
+
+        Note that the client will NOT receive a willSendRequest: message.  The client
+        presumably already did any request substitution before the object was loaded 
+        into the cache.  Allowing the delegate to override the request and replace
+        the object in the WebCore cache would introduce significant complexity.
+        
+        Fixes 3069138.
+        
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge objectLoadedFromCache:response:size:]):
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (-[WebSubresourceClient handle:didReceiveResponse:]):
+
 2002-10-05  Darin Adler  <darin at apple.com>
 
 	- fixed 3068323 -- nil object inserted in dictionary exception on mouse move
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index efad513..2c41612 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-10-07  Richard Williamson   <rjw at apple.com>
+
+        'Re'play the delegate messages when an item is loaded from
+        the WebCore cache.
+
+        Note that the client will NOT receive a willSendRequest: message.  The client
+        presumably already did any request substitution before the object was loaded 
+        into the cache.  Allowing the delegate to override the request and replace
+        the object in the WebCore cache would introduce significant complexity.
+        
+        Fixes 3069138.
+        
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge objectLoadedFromCache:response:size:]):
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (-[WebSubresourceClient handle:didReceiveResponse:]):
+
 2002-10-05  Darin Adler  <darin at apple.com>
 
 	- fixed 3068323 -- nil object inserted in dictionary exception on mouse move
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index fc6d7f4..bd96b19 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -15,6 +15,7 @@
 #import <WebKit/WebKitStatisticsPrivate.h>
 #import <WebKit/WebLocationChangeDelegate.h>
 #import <WebKit/WebPreferences.h>
+#import <WebKit/WebResourceLoadDelegate.h>
 #import <WebKit/WebSubresourceClient.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebWindowOperationsDelegate.h>
@@ -168,16 +169,20 @@
                                         forDataSource:[self dataSource]];
 }
 
-- (void)objectLoadedFromCache:(NSURL *)URL size:(unsigned)bytes
+- (void)objectLoadedFromCache:(NSURL *)URL response: response size:(unsigned)bytes
 {
     ASSERT(frame != nil);
 
-    //WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
-    //WebResourceHandle *handle = [[WebResourceHandle alloc] initWithRequest:request];
-    //[handle loadWithDelegate:nil];
+    WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
+    id <WebResourceLoadDelegate> delegate = [[frame controller] resourceLoadDelegate];
+    
+    // No chance for delegate to modify request, so we don't send a willSendRequest: message.
+    [delegate resourceRequest: request didReceiveResponse: response fromDataSource: [self dataSource]];
+    [delegate resourceRequest: request didReceiveContentLength: bytes fromDataSource: [self dataSource]];
+    [delegate resourceRequest: request didFinishLoadingFromDataSource: [self dataSource]];
+    
     [[frame controller] _receivedProgressForResourceHandle:nil fromDataSource:[self dataSource] complete:YES];
-    //[handle release];
-    //[request release];
+    [request release];
 }
 
 - (BOOL)isReloading
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 17e109f..3269b1e 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -157,6 +157,8 @@
     [response release];
     response = r;
     [resourceProgressDelegate resourceRequest: request didReceiveResponse: r fromDataSource: dataSource];
+
+    [loader receivedResponse:r];
 }
 
 - (void)handle:(WebResourceHandle *)h didReceiveData:(NSData *)data
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 17e109f..3269b1e 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -157,6 +157,8 @@
     [response release];
     response = r;
     [resourceProgressDelegate resourceRequest: request didReceiveResponse: r fromDataSource: dataSource];
+
+    [loader receivedResponse:r];
 }
 
 - (void)handle:(WebResourceHandle *)h didReceiveData:(NSData *)data

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list