[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 07:24:01 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 40677c73e9cab836b26ea495eda0389da638a66d
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Feb 7 00:52:26 2003 +0000
- Made WebDownload.h a public header.
- Added stubs for the new methods.
- Moved all private methods to the WebPrivate category.
- Added FIXMEs for things that needed to be removed or implemented.
Reviewed by rjw.
* Downloads.subproj/WebDownload.h:
* Downloads.subproj/WebDownload.m:
(-[WebDownload initWithRequest:delegate:]):
(-[WebDownload dealloc]):
(-[WebDownload cancel]):
(-[WebDownload _initWithLoadingHandle:request:response:delegate:]):
(-[WebDownload initWithDataSource:]):
(-[WebDownload receivedData:]):
(-[WebDownload finishedLoading]):
(-[WebDownload decodeHeaderData:dataForkData:resourceForkData:]):
(-[WebDownload decodeData:dataForkData:resourceForkData:]):
(-[WebDownload createFileIfNecessary]):
(-[WebDownload writeDataForkData:resourceForkData:]):
(-[WebDownload dataIfDoneBufferingData:]):
(-[WebDownload decodeData:]):
(-[WebDownload finishDecoding]):
* Downloads.subproj/WebDownloadPrivate.h:
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/WebMainResourceClient.m:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d0817ce..ea82f23 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,34 @@
2003-02-06 Chris Blumenberg <cblu at apple.com>
+ - Made WebDownload.h a public header.
+ - Added stubs for the new methods.
+ - Moved all private methods to the WebPrivate category.
+ - Added FIXMEs for things that needed to be removed or implemented.
+
+ Reviewed by rjw.
+
+ * Downloads.subproj/WebDownload.h:
+ * Downloads.subproj/WebDownload.m:
+ (-[WebDownload initWithRequest:delegate:]):
+ (-[WebDownload dealloc]):
+ (-[WebDownload cancel]):
+ (-[WebDownload _initWithLoadingHandle:request:response:delegate:]):
+ (-[WebDownload initWithDataSource:]):
+ (-[WebDownload receivedData:]):
+ (-[WebDownload finishedLoading]):
+ (-[WebDownload decodeHeaderData:dataForkData:resourceForkData:]):
+ (-[WebDownload decodeData:dataForkData:resourceForkData:]):
+ (-[WebDownload createFileIfNecessary]):
+ (-[WebDownload writeDataForkData:resourceForkData:]):
+ (-[WebDownload dataIfDoneBufferingData:]):
+ (-[WebDownload decodeData:]):
+ (-[WebDownload finishDecoding]):
+ * Downloads.subproj/WebDownloadPrivate.h:
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebMainResourceClient.m:
+
+2003-02-06 Chris Blumenberg <cblu at apple.com>
+
Renamed WebDownloadHandler to WebDownload.
Made ivars of WebDownload private.
diff --git a/WebKit/Downloads.subproj/WebDownload.h b/WebKit/Downloads.subproj/WebDownload.h
index 25ca7e7..cd04902 100644
--- a/WebKit/Downloads.subproj/WebDownload.h
+++ b/WebKit/Downloads.subproj/WebDownload.h
@@ -7,9 +7,24 @@
#import <Foundation/Foundation.h>
- at class WebDataSource;
+ at class WebDownload;
@class WebDownloadPrivate;
@class WebError;
+ at class WebResourceRequest;
+ at class WebResourceResponse;
+
+ at protocol WebDownloadDecisionListener <NSObject>
+-(void)setPath:(NSString *)path;
+ at end
+
+ at protocol WebDownloadDelegate <NSObject>
+- (WebResourceRequest *)download:(WebDownload *)download willSendRequest:(WebResourceRequest *)request;
+- (void)download:(WebDownload *)download didReceiveResponse:(WebResourceResponse *)response;
+- (void)download:(WebDownload *)download decidePathWithListener:(id <WebDownloadDecisionListener>)listener;
+- (void)download:(WebDownload *)download didReceiveDataOfLength:(unsigned)length;
+- (void)downloadDidFinishLoading:(WebDownload *)download;
+- (void)download:(WebDownload *)download didFailLoadingWithError:(WebError *)error;
+ at end
@interface WebDownload : NSObject
{
@@ -17,9 +32,7 @@
WebDownloadPrivate *_private;
}
-- initWithDataSource:(WebDataSource *)dSource;
-- (WebError *)receivedData:(NSData *)data;
-- (WebError *)finishedLoading;
+- initWithRequest:(WebResourceRequest *)request delegate:(id <WebDownloadDelegate>)delegate;
- (void)cancel;
@end
diff --git a/WebKit/Downloads.subproj/WebDownload.m b/WebKit/Downloads.subproj/WebDownload.m
index fc5cb3b..6617f23 100644
--- a/WebKit/Downloads.subproj/WebDownload.m
+++ b/WebKit/Downloads.subproj/WebDownload.m
@@ -93,21 +93,79 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
@implementation WebDownload
+- initWithRequest:(WebResourceRequest *)request delegate:(id <WebDownloadDelegate>)delegate
+{
+ [super init];
+ // FIXME: Implement.
+ return self;
+}
+
+- (void)dealloc
+{
+ [_private release];
+ [super dealloc];
+}
+
+- (void)cancel
+{
+ _private->isCancelled = YES;
+ [self cleanUpAfterFailure];
+}
+
+ at end
+
+ at implementation WebDownload (WebPrivate)
+
+- _initWithLoadingHandle:(WebResourceHandle *)handle
+ request:(WebResourceRequest *)request
+ response:(WebResourceRequest *)response
+ delegate:(id <WebDownloadDelegate>)delegate
+{
+ [super init];
+ // FIXME: Implement.
+ return self;
+}
+
+// FIXME: Remove many of the following methods.
+
- initWithDataSource:(WebDataSource *)dSource
{
[super init];
_private = [[WebDownloadPrivate alloc] init];
_private->dataSource = [dSource retain];
-
+
LOG(Download, "Download started for: %@", [[dSource request] URL]);
return self;
}
-- (void)dealloc
+- (WebError *)receivedData:(NSData *)data
{
- [_private release];
- [super dealloc];
+ ASSERT(data);
+
+ return [self decodeData:[self dataIfDoneBufferingData:data]];
+}
+
+- (WebError *)finishedLoading
+{
+ WebError *error = [self decodeData:_private->bufferedData];
+ [_private->bufferedData release];
+ _private->bufferedData = nil;
+ if (error) {
+ return error;
+ }
+
+ if (![self finishDecoding]) {
+ ERROR("Download decoding failed.");
+ [self cleanUpAfterFailure];
+ return [self errorWithCode:WebKitErrorDownloadDecodingFailedToComplete];
+ }
+
+ [self closeFile];
+
+ LOG(Download, "Download complete. Saved to: %@", [_private->dataSource downloadPath]);
+
+ return nil;
}
- (void)decodeHeaderData:(NSData *)headerData
@@ -118,7 +176,7 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
ASSERT([headerData length]);
ASSERT(dataForkData);
ASSERT(resourceForkData);
-
+
unsigned i;
for (i = 0; i < [_private->decoderClasses count]; i++) {
Class decoderClass = [_private->decoderClasses objectAtIndex:i];
@@ -134,7 +192,7 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
}
[_private->decoderSequence addObject:decoder];
-
+
[self decodeHeaderData:*dataForkData dataForkData:dataForkData resourceForkData:resourceForkData];
break;
}
@@ -149,20 +207,20 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
ASSERT([data length]);
ASSERT(dataForkData);
ASSERT(resourceForkData);
-
+
if (!_private->decoderSequence) {
_private->decoderSequence = [[NSMutableArray array] retain];
[self decodeHeaderData:data dataForkData:dataForkData resourceForkData:resourceForkData];
} else {
unsigned i;
for (i = 0; i< [_private->decoderSequence count]; i++) {
- NSObject <WebDownloadDecoder> *decoder = [_private->decoderSequence objectAtIndex:i];
+ NSObject <WebDownloadDecoder> *decoder = [_private->decoderSequence objectAtIndex:i];
BOOL didDecode = [decoder decodeData:data dataForkData:dataForkData resourceForkData:resourceForkData];
-
+
if (!didDecode) {
return NO;
}
-
+
data = *dataForkData;
}
}
@@ -171,7 +229,7 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
*dataForkData = data;
*resourceForkData = nil;
}
-
+
return YES;
}
@@ -209,11 +267,11 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
if (_private->fileRefPtr) {
return nil;
}
-
+
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *path = [_private->dataSource downloadPath];
NSObject <WebDownloadDecoder> *lastDecoder = [_private->decoderSequence lastObject];
-
+
NSString *filename = [[lastDecoder filename] _web_filenameByFixingIllegalCharacters];
if ([filename length] != 0) {
@@ -250,7 +308,7 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
[response createdDate], NSFileCreationDate,
[response lastModifiedDate], NSFileModificationDate, nil];
}
-
+
if (![fileManager _web_createFileAtPath:path contents:nil attributes:fileAttributes]) {
ERROR("-[NSFileManager _web_createFileAtPath:contents:attributes:] failed.");
return [self errorWithCode:WebKitErrorCannotCreateFile];
@@ -276,9 +334,9 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
if (error) {
return error;
}
-
+
BOOL didWrite = YES;
-
+
if ([dataForkData length]) {
didWrite = [self writeForkData:dataForkData isDataFork:YES];
}
@@ -303,7 +361,7 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
// When bufferedData's length is 0, we're done buffering.
return data;
} else {
- // Append new data.
+ // Append new data.
[_private->bufferedData appendData:data];
}
@@ -324,10 +382,10 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
if ([data length] == 0) {
return nil;
}
-
+
NSData *dataForkData = nil;
NSData *resourceForkData = nil;
-
+
if (![self decodeData:data dataForkData:&dataForkData resourceForkData:&resourceForkData]) {
ERROR("Download decoding failed.");
[self cleanUpAfterFailure];
@@ -342,18 +400,11 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
return nil;
}
-- (WebError *)receivedData:(NSData *)data
-{
- ASSERT(data);
-
- return [self decodeData:[self dataIfDoneBufferingData:data]];
-}
-
- (BOOL)finishDecoding
{
NSObject <WebDownloadDecoder> *decoder;
unsigned i;
-
+
for (i = 0; i < [_private->decoderSequence count]; i++) {
decoder = [_private->decoderSequence objectAtIndex:i];
if (![decoder finishDecoding]) {
@@ -364,38 +415,6 @@ static void DeleteCompletionCallback(ParmBlkPtr paramBlock);
return YES;
}
-- (WebError *)finishedLoading
-{
- WebError *error = [self decodeData:_private->bufferedData];
- [_private->bufferedData release];
- _private->bufferedData = nil;
- if (error) {
- return error;
- }
-
- if (![self finishDecoding]) {
- ERROR("Download decoding failed.");
- [self cleanUpAfterFailure];
- return [self errorWithCode:WebKitErrorDownloadDecodingFailedToComplete];
- }
-
- [self closeFile];
-
- LOG(Download, "Download complete. Saved to: %@", [_private->dataSource downloadPath]);
-
- return nil;
-}
-
-- (void)cancel
-{
- _private->isCancelled = YES;
- [self cleanUpAfterFailure];
-}
-
- at end
-
- at implementation WebDownload (WebPrivate)
-
- (NSString *)path
{
return [_private->dataSource downloadPath];
diff --git a/WebKit/Downloads.subproj/WebDownloadPrivate.h b/WebKit/Downloads.subproj/WebDownloadPrivate.h
index a1ebabf..d1ffe7d 100644
--- a/WebKit/Downloads.subproj/WebDownloadPrivate.h
+++ b/WebKit/Downloads.subproj/WebDownloadPrivate.h
@@ -7,7 +7,33 @@
#import <WebKit/WebDownload.h>
+ at class WebDataSource;
+ at class WebResourceHandle;
+
@interface WebDownload (WebPrivate)
+- _initWithLoadingHandle:(WebResourceHandle *)handle
+ request:(WebResourceRequest *)request
+ response:(WebResourceRequest *)response
+ delegate:(id <WebDownloadDelegate>)delegate;
+// FIXME: Remove many of the following methods.
+- initWithDataSource:(WebDataSource *)dSource;
+- (WebError *)receivedData:(NSData *)data;
+- (WebError *)finishedLoading;
+- (void)decodeHeaderData:(NSData *)headerData
+ dataForkData:(NSData **)dataForkData
+ resourceForkData:(NSData **)resourceForkData;
+- (BOOL)decodeData:(NSData *)data
+ dataForkData:(NSData **)dataForkData
+ resourceForkData:(NSData **)resourceForkData;
+- (void)closeFork:(SInt16)forkRefNum deleteFile:(BOOL)deleteFile;
+- (void)closeFileAndDelete:(BOOL)deleteFile;
+- (void)closeFile;
+- (void)cleanUpAfterFailure;
+- (WebError *)createFileIfNecessary;
+- (WebError *)writeDataForkData:(NSData *)dataForkData resourceForkData:(NSData *)resourceForkData;
+- (NSData *)dataIfDoneBufferingData:(NSData *)data;
+- (WebError *)decodeData:(NSData *)data;
+- (BOOL)finishDecoding;
- (NSString *)path;
- (WebError *)errorWithCode:(int)code;
- (void)cancelWithError:(WebError *)error;
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 41b6570..8f48182 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -1679,10 +1679,10 @@
83413E890375BCBE004719BE,
9316400C0379832D008635CE,
9316400D0379832D008635CE,
- 832E26A1036F95CA005E2B4F,
832E26A3036F9614005E2B4F,
- 8324709903F32305003026AC,
832E26A4036F9614005E2B4F,
+ 832E26A1036F95CA005E2B4F,
+ 8324709903F32305003026AC,
936F62BD039DF0BF008635CE,
936F62BE039DF0BF008635CE,
83413E8C0375BCD3004719BE,
@@ -1721,6 +1721,9 @@
fileRef = 832E26A3036F9614005E2B4F;
isa = PBXBuildFile;
settings = {
+ ATTRIBUTES = (
+ Public,
+ );
};
};
832E26A6036F9614005E2B4F = {
@@ -3702,6 +3705,7 @@
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
+ Private,
);
};
};
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 46c580c..511f91a 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -22,7 +22,7 @@
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebDocument.h>
-#import <WebKit/WebDownload.h>
+#import <WebKit/WebDownloadPrivate.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebKitErrors.h>
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 46c580c..511f91a 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -22,7 +22,7 @@
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebDocument.h>
-#import <WebKit/WebDownload.h>
+#import <WebKit/WebDownloadPrivate.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebKitErrors.h>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list