[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 05:54:50 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d900d2e9b85c236ed4a903e956fca3cec63d8a20
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 31 21:28:52 2002 +0000

    2002-01-31  Kenneth Kocienda  <kocienda at apple.com>
    
            Created a no-copy version of NSData (WKMutableData) that will minimize the amount of data copying.
            Removed obsoleted WKURLData class
            Incorporated use of the no-copy NSData object.
    
            * CacheLoader.subproj/WKHTTPURLProtocolHandler.m: (-[WKHTTPURLProtocolHandler
            performStreamRead:]):
            * CacheLoader.subproj/WKURLData.h:
            * CacheLoader.subproj/WKURLData.m:
            * CacheLoader.subproj/WKURLHandle.h:
            * Misc.subproj/WKMutableData.h:
            * Misc.subproj/WKMutableData.m: (+[WKByteBlock byteBlockWithBytes:length:]),
            (-[WKByteBlock initWithBytes:length:]), (-[WKByteBlock bytes]), (-[WKByteBlock
            length]), (-[WKByteBlock byteLength]), (-[WKByteBlock dealloc]), (+[WKByteRange
            rangeWithRange:]), (-[WKByteRange initWithRange:]), (-[WKByteRange range]),
            (-[WKByteRange isEqual:]), (-[WKByteRange hash]), (-[WKByteRange copyWithZone:]),
            (-[WKMutableData createBlockForRange:buffer:]), (-[WKMutableData length]),
            (-[WKMutableData bytes]), (-[WKMutableData byteBlocksForRange:]),
            (-[WKMutableData bytesInRange:]), (-[WKMutableData getBytes:]), (-[WKMutableData
            getBytes:length:]), (-[WKMutableData getBytes:range:]), (-[WKMutableData
            subdataWithRange:]), (-[WKMutableData
            initWithBytes:length:copy:freeWhenDone:bytesAreVM:]), (-[WKMutableData
            appendBytes:length:]), (-[WKMutableData dealloc]):
            * WebFoundation.pbproj/project.pbxproj:
    
            Changes to incorporate use of the no-copy NSData object.
    
            * include/WCURLHandle.h:
            * src/kwq/KWQKHTMLPart.mm: (-[KHTMLPartLoadClient
            WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
            * src/kwq/KWQKloader.mm: (-[URLLoadClient
            WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@570 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 8498c70..6bfec9c 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,13 @@
+2002-01-31  Kenneth Kocienda  <kocienda at apple.com>
+
+        Changes to incorporate use of the no-copy NSData object.
+
+	* include/WCURLHandle.h:
+	* src/kwq/KWQKHTMLPart.mm: (-[KHTMLPartLoadClient
+	WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient
+	WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
+
 2002-01-30  Richard Williamson  <rjw at apple.com>
     
     Cleaned up frame code a bit.  Fixed duplicate content problem.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 8498c70..6bfec9c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,13 @@
+2002-01-31  Kenneth Kocienda  <kocienda at apple.com>
+
+        Changes to incorporate use of the no-copy NSData object.
+
+	* include/WCURLHandle.h:
+	* src/kwq/KWQKHTMLPart.mm: (-[KHTMLPartLoadClient
+	WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient
+	WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
+
 2002-01-30  Richard Williamson  <rjw at apple.com>
     
     Cleaned up frame code a bit.  Fixed duplicate content problem.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 8498c70..6bfec9c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2002-01-31  Kenneth Kocienda  <kocienda at apple.com>
+
+        Changes to incorporate use of the no-copy NSData object.
+
+	* include/WCURLHandle.h:
+	* src/kwq/KWQKHTMLPart.mm: (-[KHTMLPartLoadClient
+	WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
+	* src/kwq/KWQKloader.mm: (-[URLLoadClient
+	WCURLHandle:resourceDataDidBecomeAvailable:offset:length:userData:]):
+
 2002-01-30  Richard Williamson  <rjw at apple.com>
     
     Cleaned up frame code a bit.  Fixed duplicate content problem.
diff --git a/WebCore/include/WCURLHandle.h b/WebCore/include/WCURLHandle.h
index 3090819..cfeb4bb 100644
--- a/WebCore/include/WCURLHandle.h
+++ b/WebCore/include/WCURLHandle.h
@@ -21,6 +21,15 @@
 -(NSString *)responseHeaderForKey:(NSString *)key;
 @end
 
+ at protocol WCMutableData
+-(NSArray *)byteBlocksForRange:(NSRange)range;
+ at end
+
+ at protocol WCByteBlock
+-(const void *)bytes;
+-(unsigned)byteLength;
+ at end
+
 #if defined(__cplusplus)
 extern "C" {
 #endif
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 959aa85..bb29342 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -109,15 +109,32 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 
 - (void)WCURLHandle:(id)sender resourceDataDidBecomeAvailable:(NSData *)data offset:(int)offset length:(int)length userData:(void *)userData
 {
+    NSArray *byteBlocks;
     char *bytes;
+    int byteBlockCount;
+    id object;
+    id <WCByteBlock> byteBlock;
 
     if (!m_data) {
         m_data = [data retain];
     }
-    
-    bytes = ((char *)[data bytes]) + offset;    
-    
-    m_part->slotData(sender, (const char *)bytes, length);
+
+    byteBlocks = nil;
+    if ([data respondsToSelector:@selector(byteBlocksForRange:)]) {
+        object = data;
+        byteBlocks = [object byteBlocksForRange:NSMakeRange(offset, length)];  
+    }
+    if (byteBlocks) {
+        byteBlockCount = [byteBlocks count];
+        for (int i = 0; i < byteBlockCount; i++) {
+            byteBlock = [byteBlocks objectAtIndex:i];
+            m_part->slotData(sender, (const char *)[byteBlock bytes], [byteBlock byteLength]);
+        }
+    }
+    else {
+        bytes = ((char *)[data bytes]) + offset;    
+        m_part->slotData(sender, (const char *)bytes, length);
+    }
 }
 
 - (void)WCURLHandle:(id)sender resourceDidFailLoadingWithResult:(int)result userData:(void *)userData
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 959aa85..bb29342 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -109,15 +109,32 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 
 - (void)WCURLHandle:(id)sender resourceDataDidBecomeAvailable:(NSData *)data offset:(int)offset length:(int)length userData:(void *)userData
 {
+    NSArray *byteBlocks;
     char *bytes;
+    int byteBlockCount;
+    id object;
+    id <WCByteBlock> byteBlock;
 
     if (!m_data) {
         m_data = [data retain];
     }
-    
-    bytes = ((char *)[data bytes]) + offset;    
-    
-    m_part->slotData(sender, (const char *)bytes, length);
+
+    byteBlocks = nil;
+    if ([data respondsToSelector:@selector(byteBlocksForRange:)]) {
+        object = data;
+        byteBlocks = [object byteBlocksForRange:NSMakeRange(offset, length)];  
+    }
+    if (byteBlocks) {
+        byteBlockCount = [byteBlocks count];
+        for (int i = 0; i < byteBlockCount; i++) {
+            byteBlock = [byteBlocks objectAtIndex:i];
+            m_part->slotData(sender, (const char *)[byteBlock bytes], [byteBlock byteLength]);
+        }
+    }
+    else {
+        bytes = ((char *)[data bytes]) + offset;    
+        m_part->slotData(sender, (const char *)bytes, length);
+    }
 }
 
 - (void)WCURLHandle:(id)sender resourceDidFailLoadingWithResult:(int)result userData:(void *)userData
diff --git a/WebCore/kwq/KWQKloader.mm b/WebCore/kwq/KWQKloader.mm
index 6e111ad..3e40085 100644
--- a/WebCore/kwq/KWQKloader.mm
+++ b/WebCore/kwq/KWQKloader.mm
@@ -29,6 +29,8 @@
 #include <kwqdebug.h>
 #include <loader.h>
 
+#include <WCURLHandle.h>
+
 // up to which size is a picture for sure cacheable
 #define MAXCACHEABLE 40*1024
 // default cache size
@@ -941,16 +943,35 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 
 - (void)WCURLHandle:(id)sender resourceDataDidBecomeAvailable:(NSData *)data offset:(int)offset length:(int)length userData:(void *)userData
 {
+    NSArray *byteBlocks;
     char *bytes;
+    int byteBlockCount;
+    id object;
+    id <WCByteBlock> byteBlock;
 
     if (!m_data) {
         m_data = [data retain];
     }
+
+    KIO::Job *job = static_cast<KIO::Job *>(userData);
     
-    bytes = ((char *)[data bytes]) + offset;    
+    byteBlocks = nil;
+    if ([data respondsToSelector:@selector(byteBlocksForRange:)]) {
+        object = data;
+        byteBlocks = [object byteBlocksForRange:NSMakeRange(offset, length)];  
+    }
+    if (byteBlocks) {
+        byteBlockCount = [byteBlocks count];
+        for (int i = 0; i < byteBlockCount; i++) {
+            byteBlock = [byteBlocks objectAtIndex:i];
+            m_loader->slotData(job, (const char *)[byteBlock bytes], [byteBlock byteLength]);
+        }
+    }
+    else {
+        bytes = ((char *)[data bytes]) + offset;    
+        m_loader->slotData(job, (const char *)bytes, length);
+    }
     
-    KIO::Job *job = static_cast<KIO::Job *>(userData);
-    m_loader->slotData(job, (const char *)bytes, length);
 }
 
 - (void)WCURLHandle:(id)sender resourceDidFailLoadingWithResult:(int)result userData:(void *)userData
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index 6e111ad..3e40085 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -29,6 +29,8 @@
 #include <kwqdebug.h>
 #include <loader.h>
 
+#include <WCURLHandle.h>
+
 // up to which size is a picture for sure cacheable
 #define MAXCACHEABLE 40*1024
 // default cache size
@@ -941,16 +943,35 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 
 - (void)WCURLHandle:(id)sender resourceDataDidBecomeAvailable:(NSData *)data offset:(int)offset length:(int)length userData:(void *)userData
 {
+    NSArray *byteBlocks;
     char *bytes;
+    int byteBlockCount;
+    id object;
+    id <WCByteBlock> byteBlock;
 
     if (!m_data) {
         m_data = [data retain];
     }
+
+    KIO::Job *job = static_cast<KIO::Job *>(userData);
     
-    bytes = ((char *)[data bytes]) + offset;    
+    byteBlocks = nil;
+    if ([data respondsToSelector:@selector(byteBlocksForRange:)]) {
+        object = data;
+        byteBlocks = [object byteBlocksForRange:NSMakeRange(offset, length)];  
+    }
+    if (byteBlocks) {
+        byteBlockCount = [byteBlocks count];
+        for (int i = 0; i < byteBlockCount; i++) {
+            byteBlock = [byteBlocks objectAtIndex:i];
+            m_loader->slotData(job, (const char *)[byteBlock bytes], [byteBlock byteLength]);
+        }
+    }
+    else {
+        bytes = ((char *)[data bytes]) + offset;    
+        m_loader->slotData(job, (const char *)bytes, length);
+    }
     
-    KIO::Job *job = static_cast<KIO::Job *>(userData);
-    m_loader->slotData(job, (const char *)bytes, length);
 }
 
 - (void)WCURLHandle:(id)sender resourceDidFailLoadingWithResult:(int)result userData:(void *)userData
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index 6e111ad..3e40085 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -29,6 +29,8 @@
 #include <kwqdebug.h>
 #include <loader.h>
 
+#include <WCURLHandle.h>
+
 // up to which size is a picture for sure cacheable
 #define MAXCACHEABLE 40*1024
 // default cache size
@@ -941,16 +943,35 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 
 - (void)WCURLHandle:(id)sender resourceDataDidBecomeAvailable:(NSData *)data offset:(int)offset length:(int)length userData:(void *)userData
 {
+    NSArray *byteBlocks;
     char *bytes;
+    int byteBlockCount;
+    id object;
+    id <WCByteBlock> byteBlock;
 
     if (!m_data) {
         m_data = [data retain];
     }
+
+    KIO::Job *job = static_cast<KIO::Job *>(userData);
     
-    bytes = ((char *)[data bytes]) + offset;    
+    byteBlocks = nil;
+    if ([data respondsToSelector:@selector(byteBlocksForRange:)]) {
+        object = data;
+        byteBlocks = [object byteBlocksForRange:NSMakeRange(offset, length)];  
+    }
+    if (byteBlocks) {
+        byteBlockCount = [byteBlocks count];
+        for (int i = 0; i < byteBlockCount; i++) {
+            byteBlock = [byteBlocks objectAtIndex:i];
+            m_loader->slotData(job, (const char *)[byteBlock bytes], [byteBlock byteLength]);
+        }
+    }
+    else {
+        bytes = ((char *)[data bytes]) + offset;    
+        m_loader->slotData(job, (const char *)bytes, length);
+    }
     
-    KIO::Job *job = static_cast<KIO::Job *>(userData);
-    m_loader->slotData(job, (const char *)bytes, length);
 }
 
 - (void)WCURLHandle:(id)sender resourceDidFailLoadingWithResult:(int)result userData:(void *)userData
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 959aa85..bb29342 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -109,15 +109,32 @@ static void recursive(const DOM::Node &pNode, const DOM::Node &node)
 
 - (void)WCURLHandle:(id)sender resourceDataDidBecomeAvailable:(NSData *)data offset:(int)offset length:(int)length userData:(void *)userData
 {
+    NSArray *byteBlocks;
     char *bytes;
+    int byteBlockCount;
+    id object;
+    id <WCByteBlock> byteBlock;
 
     if (!m_data) {
         m_data = [data retain];
     }
-    
-    bytes = ((char *)[data bytes]) + offset;    
-    
-    m_part->slotData(sender, (const char *)bytes, length);
+
+    byteBlocks = nil;
+    if ([data respondsToSelector:@selector(byteBlocksForRange:)]) {
+        object = data;
+        byteBlocks = [object byteBlocksForRange:NSMakeRange(offset, length)];  
+    }
+    if (byteBlocks) {
+        byteBlockCount = [byteBlocks count];
+        for (int i = 0; i < byteBlockCount; i++) {
+            byteBlock = [byteBlocks objectAtIndex:i];
+            m_part->slotData(sender, (const char *)[byteBlock bytes], [byteBlock byteLength]);
+        }
+    }
+    else {
+        bytes = ((char *)[data bytes]) + offset;    
+        m_part->slotData(sender, (const char *)bytes, length);
+    }
 }
 
 - (void)WCURLHandle:(id)sender resourceDidFailLoadingWithResult:(int)result userData:(void *)userData
diff --git a/WebCore/src/kwq/KWQKloader.mm b/WebCore/src/kwq/KWQKloader.mm
index 6e111ad..3e40085 100644
--- a/WebCore/src/kwq/KWQKloader.mm
+++ b/WebCore/src/kwq/KWQKloader.mm
@@ -29,6 +29,8 @@
 #include <kwqdebug.h>
 #include <loader.h>
 
+#include <WCURLHandle.h>
+
 // up to which size is a picture for sure cacheable
 #define MAXCACHEABLE 40*1024
 // default cache size
@@ -941,16 +943,35 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
 
 - (void)WCURLHandle:(id)sender resourceDataDidBecomeAvailable:(NSData *)data offset:(int)offset length:(int)length userData:(void *)userData
 {
+    NSArray *byteBlocks;
     char *bytes;
+    int byteBlockCount;
+    id object;
+    id <WCByteBlock> byteBlock;
 
     if (!m_data) {
         m_data = [data retain];
     }
+
+    KIO::Job *job = static_cast<KIO::Job *>(userData);
     
-    bytes = ((char *)[data bytes]) + offset;    
+    byteBlocks = nil;
+    if ([data respondsToSelector:@selector(byteBlocksForRange:)]) {
+        object = data;
+        byteBlocks = [object byteBlocksForRange:NSMakeRange(offset, length)];  
+    }
+    if (byteBlocks) {
+        byteBlockCount = [byteBlocks count];
+        for (int i = 0; i < byteBlockCount; i++) {
+            byteBlock = [byteBlocks objectAtIndex:i];
+            m_loader->slotData(job, (const char *)[byteBlock bytes], [byteBlock byteLength]);
+        }
+    }
+    else {
+        bytes = ((char *)[data bytes]) + offset;    
+        m_loader->slotData(job, (const char *)bytes, length);
+    }
     
-    KIO::Job *job = static_cast<KIO::Job *>(userData);
-    m_loader->slotData(job, (const char *)bytes, length);
 }
 
 - (void)WCURLHandle:(id)sender resourceDidFailLoadingWithResult:(int)result userData:(void *)userData

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list