Commit ac92273a authored by kocienda's avatar kocienda
Browse files

WebFoundation:

	Begin to refactor WebFoundation in preparation for some planned API changes.
	This change removes all WebResourceHandle subclasses, pushing the functionality
	that was contained in those classes to the corresponding WebProtocolHandler
	subclasses. To make this work, I also did a small amount of mime type cleanup, and
	as a bonus, I (unintentionally) managed to fix these two bugs:

	Radar 3034795 (README fiel displays as HTML even though it's plain text)
	Radar 3035320 (iana.org character sets page displays as HTML even though it's MIME type text/plain)

	Bonus! :-)

	Removed:

	* CacheLoader.subproj/WebAboutResource.h
	* CacheLoader.subproj/WebAboutResource.m
	* CacheLoader.subproj/WebFileResourceHandle.h
	* CacheLoader.subproj/WebFileResourceHandle.m
	* CacheLoader.subproj/WebHTTPResourceHandle.h
	* CacheLoader.subproj/WebHTTPResourceHandle.m

WebKit:

        * WebView.subproj/WebControllerPrivate.m:
        (+[WebController _MIMETypeForFile:]): Small tweak to account for change
	in behavior of a WebFoundation method upon which this method depends.
	The WebFoundation now returns nil when it cannot find a suitable mime
	type rather than returning a default. This function now checks for a nil
	return value and sets @"application/octet-stream" in that case.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 54c87c1a
2002-08-30 Ken Kocienda <kocienda@apple.com>
* WebView.subproj/WebControllerPrivate.m:
(+[WebController _MIMETypeForFile:]): Small tweak to account for change
in behavior of a WebFoundation method upon which this method depends.
The WebFoundation now returns nil when it cannot find a suitable mime
type rather than returning a default. This function now checks for a nil
return value and sets @"application/octet-stream" in that case.
2002-08-30 Richard Williamson (Home) <rjw@apple.com>
Change link dragging behavior. Drags URL, not URL contents.
......
2002-08-30 Ken Kocienda <kocienda@apple.com>
* WebView.subproj/WebControllerPrivate.m:
(+[WebController _MIMETypeForFile:]): Small tweak to account for change
in behavior of a WebFoundation method upon which this method depends.
The WebFoundation now returns nil when it cannot find a suitable mime
type rather than returning a default. This function now checks for a nil
return value and sets @"application/octet-stream" in that case.
2002-08-30 Richard Williamson (Home) <rjw@apple.com>
Change link dragging behavior. Drags URL, not URL contents.
......
......@@ -171,12 +171,22 @@ - (void)_didStopLoading: (NSURL *)URL
+ (NSString *)_MIMETypeForFile: (NSString *)path
{
NSString *result;
NSString *extension = [path pathExtension];
if([extension isEqualToString:@""])
return @"text/html";
return [[WebFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
if ([extension isEqualToString:@""]) {
result = @"text/html";
}
else {
result = [[WebFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
if (result == nil) {
result = @"application/octet-stream";
}
}
NSLog(@"_MIMETypeForFile: %@ -> %@", path, result);
return result;
}
- (void)_downloadURL:(NSURL *)URL toPath:(NSString *)path
......
......@@ -171,12 +171,22 @@ - (void)_didStopLoading: (NSURL *)URL
+ (NSString *)_MIMETypeForFile: (NSString *)path
{
NSString *result;
NSString *extension = [path pathExtension];
if([extension isEqualToString:@""])
return @"text/html";
return [[WebFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
if ([extension isEqualToString:@""]) {
result = @"text/html";
}
else {
result = [[WebFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
if (result == nil) {
result = @"application/octet-stream";
}
}
NSLog(@"_MIMETypeForFile: %@ -> %@", path, result);
return result;
}
- (void)_downloadURL:(NSURL *)URL toPath:(NSString *)path
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment