[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:46:21 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 92a8664b3593c97acb30ebaf49b4f4de0e0dd874
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 2 19:47:43 2002 +0000
Use the text encoding name from the response and got rid of
[WebDataSource encoding]. Also remove the "first chunk" logic since we
now get a separate callback for the response.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge receivedData:withDataSource:]): Get the encoding name
from the response, or fall back on the default.
* WebView.subproj/WebDataSource.h: Removed encoding.
* WebView.subproj/WebDataSource.m: Ditto.
* WebView.subproj/WebDataSourcePrivate.h: Removed _setEncoding.
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSourcePrivate dealloc]): No need to release encoding any more.
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient initWithDataSource:]): No isFirstChunk to initialize.
(-[WebMainResourceClient handle:didReceiveResponse:]): Moved the response handling
in here, including the policy logic.
(-[WebMainResourceClient handle:didReceiveData:]): This has only what's left.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 90d6bfe..7788e5f 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,26 @@
+2002-10-02 Darin Adler <darin at apple.com>
+
+ Use the text encoding name from the response and got rid of
+ [WebDataSource encoding]. Also remove the "first chunk" logic since we
+ now get a separate callback for the response.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge receivedData:withDataSource:]): Get the encoding name
+ from the response, or fall back on the default.
+
+ * WebView.subproj/WebDataSource.h: Removed encoding.
+ * WebView.subproj/WebDataSource.m: Ditto.
+
+ * WebView.subproj/WebDataSourcePrivate.h: Removed _setEncoding.
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSourcePrivate dealloc]): No need to release encoding any more.
+
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient initWithDataSource:]): No isFirstChunk to initialize.
+ (-[WebMainResourceClient handle:didReceiveResponse:]): Moved the response handling
+ in here, including the policy logic.
+ (-[WebMainResourceClient handle:didReceiveData:]): This has only what's left.
+
2002-10-02 Chris Blumenberg <cblu at apple.com>
Replaced contentType on WebDataSource to response.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 90d6bfe..7788e5f 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,26 @@
+2002-10-02 Darin Adler <darin at apple.com>
+
+ Use the text encoding name from the response and got rid of
+ [WebDataSource encoding]. Also remove the "first chunk" logic since we
+ now get a separate callback for the response.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge receivedData:withDataSource:]): Get the encoding name
+ from the response, or fall back on the default.
+
+ * WebView.subproj/WebDataSource.h: Removed encoding.
+ * WebView.subproj/WebDataSource.m: Ditto.
+
+ * WebView.subproj/WebDataSourcePrivate.h: Removed _setEncoding.
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSourcePrivate dealloc]): No need to release encoding any more.
+
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient initWithDataSource:]): No isFirstChunk to initialize.
+ (-[WebMainResourceClient handle:didReceiveResponse:]): Moved the response handling
+ in here, including the policy logic.
+ (-[WebMainResourceClient handle:didReceiveData:]): This has only what's left.
+
2002-10-02 Chris Blumenberg <cblu at apple.com>
Replaced contentType on WebDataSource to response.
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 7c0ca66..ae31cf9 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -15,16 +15,17 @@
#import <WebKit/WebKitStatisticsPrivate.h>
#import <WebKit/WebLoadProgress.h>
#import <WebKit/WebLocationChangeDelegate.h>
+#import <WebKit/WebPreferences.h>
#import <WebKit/WebSubresourceClient.h>
#import <WebKit/WebViewPrivate.h>
#import <WebKit/WebWindowOperationsDelegate.h>
#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebError.h>
+#import <WebFoundation/WebHTTPResourceRequest.h>
#import <WebFoundation/WebNSStringExtras.h>
#import <WebFoundation/WebResourceHandle.h>
-#import <WebFoundation/WebResourceRequest.h>
-#import <WebFoundation/WebHTTPResourceRequest.h>
+#import <WebFoundation/WebResourceResponse.h>
@interface NSApplication (DeclarationStolenFromAppKit)
- (void)_cycleWindowsReversed:(BOOL)reversed;
@@ -153,8 +154,10 @@
if ([withDataSource _overrideEncoding]) {
[self addData:data withOverrideEncoding:[withDataSource _overrideEncoding]];
+ } else if ([[withDataSource response] textEncodingName]) {
+ [self addData:data withEncoding:[[withDataSource response] textEncodingName]];
} else {
- [self addData:data withEncoding:[withDataSource encoding]];
+ [self addData:data withEncoding:[[WebPreferences standardPreferences] defaultTextEncodingName]];
}
}
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 20ac804..0044a93 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -176,12 +176,6 @@
- (BOOL)isDocumentHTML;
/*!
- @method encoding
- // FIXME rename to textEncodingName, move to WebHTMLRepresentation
-*/
-- (NSString *)encoding;
-
-/*!
@method pageTitle
@result Returns nil or the page title.
// FIXME move to WebHTMLRepresentation
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 6629da7..b40ed25 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -220,11 +220,6 @@
return [[self representation] isKindOfClass: [WebHTMLRepresentation class]];
}
-- (NSString *)encoding
-{
- return _private->encoding;
-}
-
// Returns nil or the page title.
- (NSString *)pageTitle
{
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 4a98a21..06b10d0 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -101,8 +101,7 @@
- (void)_setURL:(NSURL *)URL;
- (void)_setRequest:(WebResourceRequest *)request;
- (void)_setResponse:(WebResourceResponse *)response;
-- (void)_setEncoding:(NSString *)encoding;
-- (void) _setContentPolicy:(WebContentPolicy *)policy;
+- (void)_setContentPolicy:(WebContentPolicy *)policy;
- (void)_layoutChildren;
- (void)_clearErrors;
- (void)_setMainDocumentError:(WebError *)error;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index a1533f9..4b5a03c 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -23,7 +23,6 @@
#import <WebKit/WebKitLogging.h>
#import <WebKit/WebLocationChangeDelegate.h>
#import <WebKit/WebMainResourceClient.h>
-#import <WebKit/WebPreferences.h>
#import <WebKit/WebSubresourceClient.h>
#import <WebKit/WebTextRepresentation.h>
#import <WebKit/WebViewPrivate.h>
@@ -38,17 +37,8 @@
#import <WebFoundation/WebResourceResponse.h>
#import <WebFoundation/WebHTTPResourceRequest.h>
-#import <WebCore/WebCoreEncodings.h>
-
@implementation WebDataSourcePrivate
-- init
-{
- [super init];
- encoding = [[[WebPreferences standardPreferences] defaultTextEncodingName] copy];
- return self;
-}
-
- (void)dealloc
{
// controller is only retained while loading, but this object is also
@@ -71,7 +61,6 @@
[mainHandle release];
[subresourceClients release];
[pageTitle release];
- [encoding release];
[response release];
[errors release];
[mainDocumentError release];
@@ -327,13 +316,6 @@
[self _commitIfReady];
}
-- (void)_setEncoding:(NSString *)encoding
-{
- NSString *copy = [encoding copy];
- [_private->encoding release];
- _private->encoding = copy;
-}
-
- (void)_setOverrideEncoding:(NSString *)overrideEncoding
{
NSString *copy = [overrideEncoding copy];
@@ -557,7 +539,4 @@
[_private->frames setObject: frame forKey: [frame name]];
}
-
-
-
@end
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.h b/WebKit/WebView.subproj/WebMainResourceClient.h
index a29f80a..df64f19 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.h
+++ b/WebKit/WebView.subproj/WebMainResourceClient.h
@@ -21,7 +21,6 @@
{
NSURL *currentURL;
WebDataSource *dataSource;
- BOOL isFirstChunk;
BOOL suppressErrors;
WebDownloadHandler *downloadHandler;
id <WebResourceProgressDelegate> downloadProgressDelegate;
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 956f07c..fe9fe89 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -38,7 +38,6 @@
if (self) {
dataSource = [ds retain];
resourceData = [[NSMutableData alloc] init];
- isFirstChunk = YES;
// set the user agent for the request
// consult the data source's controller
@@ -140,9 +139,9 @@
[self receivedError:error forHandle:handle];
[error release];
- if(downloadHandler){
+ if (downloadHandler) {
WebError *downloadError = [downloadHandler cancel];
- if(downloadError){
+ if(downloadError) {
[self receivedError:downloadError forHandle:handle];
}
[downloadHandler release];
@@ -180,9 +179,9 @@
[self receivedProgressWithHandle:handle complete:YES];
}
- if(downloadHandler){
+ if (downloadHandler) {
WebError *downloadError = [downloadHandler finishedLoading];
- if(downloadError){
+ if (downloadError) {
[self receivedError:downloadError forHandle:handle];
}
[downloadHandler release];
@@ -213,71 +212,66 @@
-(void)handle:(WebResourceHandle *)handle didReceiveResponse:(WebResourceResponse *)response
{
+ NSString *contentType = [response contentType];
+
[dataSource _setResponse:response];
-}
-- (void)handle:(WebResourceHandle *)handle didReceiveData:(NSData *)data
-{
- WebController *controller = [dataSource controller];
- WebResourceResponse *response = [dataSource response];
- NSString *contentType = [response contentType];
- WebFrame *frame = [dataSource webFrame];
- WebError *downloadError = nil;
-
- LOG(Loading, "URL = %@, data = %p, length %d", currentURL, data, [data length]);
-
- // Check the mime type and ask the client for the content policy.
- if(isFirstChunk){
- // Make assumption that if the contentType is the default
- // and there is no extension, this is text/html
- if([contentType isEqualToString:@"application/octet-stream"] && [[[currentURL path] pathExtension] isEqualToString:@""])
- contentType = @"text/html";
-
- [dataSource _setEncoding:[response textEncodingName]];
-
- // retain the downloadProgressDelegate just in case this is a download.
- // Alexander releases the WebController if no window is created for it.
- // This happens in the cases mentioned in 2981866 and 2965312.
- downloadProgressDelegate = [[[dataSource controller] downloadProgressDelegate] retain];
-
- WebContentPolicy *contentPolicy = [dataSource contentPolicy];
- if(contentPolicy == nil){
- contentPolicy = [[controller policyDelegate] contentPolicyForMIMEType:contentType URL:currentURL inFrame:frame];
- [dataSource _setContentPolicy:contentPolicy];
- }
- policyAction = [contentPolicy policyAction];
-
- LOG(Download, "main content type: %@", contentType);
+ // Make assumption that if the contentType is the default and there is no extension, this is text/html.
+ if ([contentType isEqualToString:@"application/octet-stream"]
+ && [[[currentURL path] pathExtension] isEqualToString:@""])
+ contentType = @"text/html";
+ LOG(Download, "main content type: %@", contentType);
+
+ // Retain the downloadProgressDelegate just in case this is a download.
+ // Alexander releases the WebController if no window is created for it.
+ // This happens in the cases mentioned in 2981866 and 2965312.
+ downloadProgressDelegate = [[[dataSource controller] downloadProgressDelegate] retain];
+
+ // Figure out the content policy.
+ WebContentPolicy *contentPolicy = [dataSource contentPolicy];
+ if (contentPolicy == nil) {
+ contentPolicy = [[[dataSource controller] policyDelegate]
+ contentPolicyForMIMEType:contentType URL:currentURL inFrame:[dataSource webFrame]];
+ [dataSource _setContentPolicy:contentPolicy];
}
+ policyAction = [contentPolicy policyAction];
switch (policyAction) {
case WebContentPolicyShow:
- // only need to buffer data in this case
- [resourceData appendData:data];
- [dataSource _receivedData:data];
break;
case WebContentPolicySave:
case WebContentPolicySaveAndOpenExternally:
- if (!downloadHandler) {
- [frame _setProvisionalDataSource:nil];
- [[[dataSource controller] locationChangeDelegate] locationChangeDone:nil forDataSource:dataSource];
- downloadHandler = [[WebDownloadHandler alloc] initWithDataSource:dataSource];
- }
- downloadError = [downloadHandler receivedData:data];
+ [[dataSource webFrame] _setProvisionalDataSource:nil];
+ [[[dataSource controller] locationChangeDelegate] locationChangeDone:nil forDataSource:dataSource];
+ downloadHandler = [[WebDownloadHandler alloc] initWithDataSource:dataSource];
break;
case WebContentPolicyIgnore:
[handle cancel];
[self didCancelWithHandle:handle];
- [frame _setProvisionalDataSource:nil];
+ [[dataSource webFrame] _setProvisionalDataSource:nil];
[[[dataSource controller] locationChangeDelegate] locationChangeDone:nil forDataSource:dataSource];
break;
default:
ERROR("contentPolicyForMIMEType:URL:inFrame: returned an invalid content policy.");
}
+}
+
+- (void)handle:(WebResourceHandle *)handle didReceiveData:(NSData *)data
+{
+ LOG(Loading, "URL = %@, data = %p, length %d", currentURL, data, [data length]);
+
+ WebError *downloadError = nil;
+
+ if (downloadHandler) {
+ downloadError = [downloadHandler receivedData:data];
+ } else {
+ [resourceData appendData:data];
+ [dataSource _receivedData:data];
+ }
[self receivedProgressWithHandle:handle complete:NO];
- if(downloadError){
+ if (downloadError) {
[self receivedError:downloadError forHandle:handle];
// Supress errors because we don't want to confuse the client with
@@ -286,8 +280,7 @@
[handle cancel];
}
- LOG(Download, "%d of %d", [response contentLengthReceived], [response contentLength]);
- isFirstChunk = NO;
+ LOG(Download, "%d of %d", [[dataSource response] contentLengthReceived], [[dataSource response] contentLength]);
}
- (void)handle:(WebResourceHandle *)handle didFailLoadingWithError:(WebError *)result
@@ -299,9 +292,9 @@
[self receivedError:result forHandle:handle];
- if(downloadHandler){
+ if (downloadHandler) {
WebError *downloadError = [downloadHandler cancel];
- if(downloadError){
+ if (downloadError) {
[self receivedError:downloadError forHandle:handle];
}
[downloadHandler release];
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.h b/WebKit/WebView.subproj/WebMainResourceLoader.h
index a29f80a..df64f19 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.h
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.h
@@ -21,7 +21,6 @@
{
NSURL *currentURL;
WebDataSource *dataSource;
- BOOL isFirstChunk;
BOOL suppressErrors;
WebDownloadHandler *downloadHandler;
id <WebResourceProgressDelegate> downloadProgressDelegate;
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 956f07c..fe9fe89 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -38,7 +38,6 @@
if (self) {
dataSource = [ds retain];
resourceData = [[NSMutableData alloc] init];
- isFirstChunk = YES;
// set the user agent for the request
// consult the data source's controller
@@ -140,9 +139,9 @@
[self receivedError:error forHandle:handle];
[error release];
- if(downloadHandler){
+ if (downloadHandler) {
WebError *downloadError = [downloadHandler cancel];
- if(downloadError){
+ if(downloadError) {
[self receivedError:downloadError forHandle:handle];
}
[downloadHandler release];
@@ -180,9 +179,9 @@
[self receivedProgressWithHandle:handle complete:YES];
}
- if(downloadHandler){
+ if (downloadHandler) {
WebError *downloadError = [downloadHandler finishedLoading];
- if(downloadError){
+ if (downloadError) {
[self receivedError:downloadError forHandle:handle];
}
[downloadHandler release];
@@ -213,71 +212,66 @@
-(void)handle:(WebResourceHandle *)handle didReceiveResponse:(WebResourceResponse *)response
{
+ NSString *contentType = [response contentType];
+
[dataSource _setResponse:response];
-}
-- (void)handle:(WebResourceHandle *)handle didReceiveData:(NSData *)data
-{
- WebController *controller = [dataSource controller];
- WebResourceResponse *response = [dataSource response];
- NSString *contentType = [response contentType];
- WebFrame *frame = [dataSource webFrame];
- WebError *downloadError = nil;
-
- LOG(Loading, "URL = %@, data = %p, length %d", currentURL, data, [data length]);
-
- // Check the mime type and ask the client for the content policy.
- if(isFirstChunk){
- // Make assumption that if the contentType is the default
- // and there is no extension, this is text/html
- if([contentType isEqualToString:@"application/octet-stream"] && [[[currentURL path] pathExtension] isEqualToString:@""])
- contentType = @"text/html";
-
- [dataSource _setEncoding:[response textEncodingName]];
-
- // retain the downloadProgressDelegate just in case this is a download.
- // Alexander releases the WebController if no window is created for it.
- // This happens in the cases mentioned in 2981866 and 2965312.
- downloadProgressDelegate = [[[dataSource controller] downloadProgressDelegate] retain];
-
- WebContentPolicy *contentPolicy = [dataSource contentPolicy];
- if(contentPolicy == nil){
- contentPolicy = [[controller policyDelegate] contentPolicyForMIMEType:contentType URL:currentURL inFrame:frame];
- [dataSource _setContentPolicy:contentPolicy];
- }
- policyAction = [contentPolicy policyAction];
-
- LOG(Download, "main content type: %@", contentType);
+ // Make assumption that if the contentType is the default and there is no extension, this is text/html.
+ if ([contentType isEqualToString:@"application/octet-stream"]
+ && [[[currentURL path] pathExtension] isEqualToString:@""])
+ contentType = @"text/html";
+ LOG(Download, "main content type: %@", contentType);
+
+ // Retain the downloadProgressDelegate just in case this is a download.
+ // Alexander releases the WebController if no window is created for it.
+ // This happens in the cases mentioned in 2981866 and 2965312.
+ downloadProgressDelegate = [[[dataSource controller] downloadProgressDelegate] retain];
+
+ // Figure out the content policy.
+ WebContentPolicy *contentPolicy = [dataSource contentPolicy];
+ if (contentPolicy == nil) {
+ contentPolicy = [[[dataSource controller] policyDelegate]
+ contentPolicyForMIMEType:contentType URL:currentURL inFrame:[dataSource webFrame]];
+ [dataSource _setContentPolicy:contentPolicy];
}
+ policyAction = [contentPolicy policyAction];
switch (policyAction) {
case WebContentPolicyShow:
- // only need to buffer data in this case
- [resourceData appendData:data];
- [dataSource _receivedData:data];
break;
case WebContentPolicySave:
case WebContentPolicySaveAndOpenExternally:
- if (!downloadHandler) {
- [frame _setProvisionalDataSource:nil];
- [[[dataSource controller] locationChangeDelegate] locationChangeDone:nil forDataSource:dataSource];
- downloadHandler = [[WebDownloadHandler alloc] initWithDataSource:dataSource];
- }
- downloadError = [downloadHandler receivedData:data];
+ [[dataSource webFrame] _setProvisionalDataSource:nil];
+ [[[dataSource controller] locationChangeDelegate] locationChangeDone:nil forDataSource:dataSource];
+ downloadHandler = [[WebDownloadHandler alloc] initWithDataSource:dataSource];
break;
case WebContentPolicyIgnore:
[handle cancel];
[self didCancelWithHandle:handle];
- [frame _setProvisionalDataSource:nil];
+ [[dataSource webFrame] _setProvisionalDataSource:nil];
[[[dataSource controller] locationChangeDelegate] locationChangeDone:nil forDataSource:dataSource];
break;
default:
ERROR("contentPolicyForMIMEType:URL:inFrame: returned an invalid content policy.");
}
+}
+
+- (void)handle:(WebResourceHandle *)handle didReceiveData:(NSData *)data
+{
+ LOG(Loading, "URL = %@, data = %p, length %d", currentURL, data, [data length]);
+
+ WebError *downloadError = nil;
+
+ if (downloadHandler) {
+ downloadError = [downloadHandler receivedData:data];
+ } else {
+ [resourceData appendData:data];
+ [dataSource _receivedData:data];
+ }
[self receivedProgressWithHandle:handle complete:NO];
- if(downloadError){
+ if (downloadError) {
[self receivedError:downloadError forHandle:handle];
// Supress errors because we don't want to confuse the client with
@@ -286,8 +280,7 @@
[handle cancel];
}
- LOG(Download, "%d of %d", [response contentLengthReceived], [response contentLength]);
- isFirstChunk = NO;
+ LOG(Download, "%d of %d", [[dataSource response] contentLengthReceived], [[dataSource response] contentLength]);
}
- (void)handle:(WebResourceHandle *)handle didFailLoadingWithError:(WebError *)result
@@ -299,9 +292,9 @@
[self receivedError:result forHandle:handle];
- if(downloadHandler){
+ if (downloadHandler) {
WebError *downloadError = [downloadHandler cancel];
- if(downloadError){
+ if (downloadError) {
[self receivedError:downloadError forHandle:handle];
}
[downloadHandler release];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list