[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:27:23 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 02ed006a61924f8dbbb79a4faf9f3e4347358fac
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jul 25 22:17:21 2002 +0000
WebFoundation:
WebFoundation part of fix for 3006054 -- assert error failingURL != nil
* CacheLoader.subproj/IFURLHandleC.h:
* CacheLoader.subproj/IFURLHandleC.m:
(IFURLHandleBackgroundLoadFailedWithResultCode): Call absoluteString.
(IFErrorGetFailingURL): Change result type to CFStringRef.
* CacheLoader.subproj/WebHTTPProtocolHandler.m:
(-[WebHTTPProtocolHandler continueHeaderReadAfterFailureResponseAndCall:]):
Call absoluteString.
* CacheLoader.subproj/WebResourceLoad.m:
(-[WebResourceLoad failedWithResultCode:inDomain:isTerminal:]): Call absoluteString.
* Misc.subproj/WebError.h:
* Misc.subproj/WebError.m:
(+[WebError errorWithCode:inDomain:failingURL:isTerminal:]): Change type of failingURL to NSString.
(-[WebError initWithErrorCode:inDomain:failingURL:isTerminal:]): Change type of failingURL to NSString.
(-[WebError failingURL]): Change type to NSString.
(-[WebError description]): Don't call absoluteString.
WebCore:
- fixed 2965269 -- sizes reported to progress handler from KWQCheckCacheObjectStatus for images are wrong
- fixed 3006054 -- assert error failingURL != nil
* khtml/misc/loader.h: Add dataSize() and m_dataSize.
* khtml/misc/loader.cpp:
(CachedImage::CachedImage): Initialize m_dataSize.
(CachedImage::data): Update m_dataSize.
* kwq/kio/jobclasses.h:
* kwq/KWQKjobclasses.mm: Store a KURL instead of an NSURL, because KURL can hold any string.
* kwq/KWQLoaderImpl.mm:
(KWQServeRequest): Send an error with [WebCoreBridge reportError:] if the URL is so bad we can't
construct an NSURL from it. This is the only case in all our code where we need to have failingURL
accept a string.
(KWQCheckCacheObjectStatus): If the object is an image, use the dataSize() rather than size().
The size() is a (bad) estimate of how much memory is used in the case of an image, but we want
to report the size of the original data.
* kwq/WebCoreBridge.h: Add a [reportError:] method.
WebKit:
WebKit part of fix for 3006054 -- assert error failingURL != nil
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge reportError:]): New. Passes the error to the controller associated with
the dataSource.
* WebCoreSupport.subproj/WebSubresourceClient.m:
(+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Call absoluteString.
(-[WebSubresourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString.
* WebView.subproj/WebController.m:
(-[WebController haveContentPolicy:andPath:forDataSource:]): Call absoluteString.
* WebView.subproj/WebControllerPrivate.m:
(-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]):
Don't call absoluteString.
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _shouldShowDataSource:]): Call absoluteString.
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString.
WebBrowser:
WebBrowser part of fix for 3006054 -- assert error failingURL != nil
* BrowserWebController.m:
(-[BrowserWebController receivedError:forResourceHandle:partialProgress:fromDataSource:]):
Don't call absoluteString.
* DownloadProgressEntry.m: (-[DownloadProgressEntry stop]): Call absoluteString.
* LocationChangeError.m:
(-[LocationChangeHandler specializedMessageForError:]): Don't call absoluteString.
Also use _web_URLWithString to make a URL to parse out the host part.
(-[LocationChangeHandler genericMessageForError:]): Don't call absoluteString.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 3db552a..b327e95 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,26 @@
+2002-07-25 Darin Adler <darin at apple.com>
+
+ - fixed 2965269 -- sizes reported to progress handler from KWQCheckCacheObjectStatus for images are wrong
+ - fixed 3006054 -- assert error failingURL != nil
+
+ * khtml/misc/loader.h: Add dataSize() and m_dataSize.
+ * khtml/misc/loader.cpp:
+ (CachedImage::CachedImage): Initialize m_dataSize.
+ (CachedImage::data): Update m_dataSize.
+
+ * kwq/kio/jobclasses.h:
+ * kwq/KWQKjobclasses.mm: Store a KURL instead of an NSURL, because KURL can hold any string.
+
+ * kwq/KWQLoaderImpl.mm:
+ (KWQServeRequest): Send an error with [WebCoreBridge reportError:] if the URL is so bad we can't
+ construct an NSURL from it. This is the only case in all our code where we need to have failingURL
+ accept a string.
+ (KWQCheckCacheObjectStatus): If the object is an image, use the dataSize() rather than size().
+ The size() is a (bad) estimate of how much memory is used in the case of an image, but we want
+ to report the size of the original data.
+
+ * kwq/WebCoreBridge.h: Add a [reportError:] method.
+
2002-07-25 David Hyatt <hyatt at apple.com>
Fix for huge white space problem on appleturns.com, bug 2947818. Vertical-align
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 3db552a..b327e95 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,26 @@
+2002-07-25 Darin Adler <darin at apple.com>
+
+ - fixed 2965269 -- sizes reported to progress handler from KWQCheckCacheObjectStatus for images are wrong
+ - fixed 3006054 -- assert error failingURL != nil
+
+ * khtml/misc/loader.h: Add dataSize() and m_dataSize.
+ * khtml/misc/loader.cpp:
+ (CachedImage::CachedImage): Initialize m_dataSize.
+ (CachedImage::data): Update m_dataSize.
+
+ * kwq/kio/jobclasses.h:
+ * kwq/KWQKjobclasses.mm: Store a KURL instead of an NSURL, because KURL can hold any string.
+
+ * kwq/KWQLoaderImpl.mm:
+ (KWQServeRequest): Send an error with [WebCoreBridge reportError:] if the URL is so bad we can't
+ construct an NSURL from it. This is the only case in all our code where we need to have failingURL
+ accept a string.
+ (KWQCheckCacheObjectStatus): If the object is an image, use the dataSize() rather than size().
+ The size() is a (bad) estimate of how much memory is used in the case of an image, but we want
+ to report the size of the original data.
+
+ * kwq/WebCoreBridge.h: Add a [reportError:] method.
+
2002-07-25 David Hyatt <hyatt at apple.com>
Fix for huge white space problem on appleturns.com, bug 2947818. Vertical-align
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 3db552a..b327e95 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,26 @@
+2002-07-25 Darin Adler <darin at apple.com>
+
+ - fixed 2965269 -- sizes reported to progress handler from KWQCheckCacheObjectStatus for images are wrong
+ - fixed 3006054 -- assert error failingURL != nil
+
+ * khtml/misc/loader.h: Add dataSize() and m_dataSize.
+ * khtml/misc/loader.cpp:
+ (CachedImage::CachedImage): Initialize m_dataSize.
+ (CachedImage::data): Update m_dataSize.
+
+ * kwq/kio/jobclasses.h:
+ * kwq/KWQKjobclasses.mm: Store a KURL instead of an NSURL, because KURL can hold any string.
+
+ * kwq/KWQLoaderImpl.mm:
+ (KWQServeRequest): Send an error with [WebCoreBridge reportError:] if the URL is so bad we can't
+ construct an NSURL from it. This is the only case in all our code where we need to have failingURL
+ accept a string.
+ (KWQCheckCacheObjectStatus): If the object is an image, use the dataSize() rather than size().
+ The size() is a (bad) estimate of how much memory is used in the case of an image, but we want
+ to report the size of the original data.
+
+ * kwq/WebCoreBridge.h: Add a [reportError:] method.
+
2002-07-25 David Hyatt <hyatt at apple.com>
Fix for huge white space problem on appleturns.com, bug 2947818. Vertical-align
diff --git a/WebCore/khtml/misc/loader.cpp b/WebCore/khtml/misc/loader.cpp
index 97e5928..73b5304 100644
--- a/WebCore/khtml/misc/loader.cpp
+++ b/WebCore/khtml/misc/loader.cpp
@@ -446,6 +446,9 @@ static bool crossDomain(const QString &a, const QString &b)
CachedImage::CachedImage(DocLoader* dl, const DOMString &url, KIO::CacheControl _cachePolicy, time_t _expireDate)
: QObject(), CachedObject(url, Image, _cachePolicy, _expireDate)
+#ifdef APPLE_CHANGES
+ , m_dataSize(0)
+#endif
{
#ifndef APPLE_CHANGES
static const QString &acceptHeader = KGlobal::staticQString( buildAcceptHeader() );
@@ -853,33 +856,29 @@ void CachedImage::data ( QBuffer &_buffer, bool eof )
}
#else // APPLE_CHANGES
bool canDraw = false;
- if (!eof) {
- // If we didn't get all the data for the image we will always
- // attempt to load the image incrementally. If the AppKit is
- // unable to decode incrementally this pixmap will not be
- // renderable until all the data has been received.
- if (!p)
- p = new QPixmap();
- }
-
- if (p)
- canDraw = p->receivedData (_buffer.buffer(), eof);
+
+ m_dataSize = _buffer.size();
// If we're at eof and don't have a pixmap yet, the data
// must have arrived in one chunk. This avoids the attempt
// to perform incremental decoding.
- if (eof && !p){
- p = new QPixmap( _buffer.buffer() );
+ if (eof && !p) {
+ p = new QPixmap(_buffer.buffer());
canDraw = true;
+ } else {
+ // Always attempt to load the image incrementally.
+ // If the AppKit is unable to decode incrementally this pixmap
+ // will not be renderable until all the data has been received.
+ if (!p)
+ p = new QPixmap;
+ canDraw = p->receivedData(_buffer.buffer(), eof);
}
-
- if (canDraw || eof){
- if(p->isNull())
- {
+
+ if (canDraw || eof) {
+ if (p->isNull()) {
errorOccured = true;
do_notify(pixmap(), QRect(0, 0, 16, 16)); // load "broken image" icon
- }
- else {
+ } else {
// May schedule a redraw.
do_notify(*p, p->rect());
}
diff --git a/WebCore/khtml/misc/loader.h b/WebCore/khtml/misc/loader.h
index 3012c00..7b28e69 100644
--- a/WebCore/khtml/misc/loader.h
+++ b/WebCore/khtml/misc/loader.h
@@ -306,6 +306,13 @@ namespace khtml
KHTMLSettings::KAnimationAdvice m_showAnimations : 2;
friend class Cache;
+
+#ifdef APPLE_CHANGES
+ public:
+ int dataSize() const { return m_dataSize; }
+ private:
+ int m_dataSize;
+#endif
};
/**
diff --git a/WebCore/kwq/KWQKJobClasses.h b/WebCore/kwq/KWQKJobClasses.h
index 2139d4f..2c6b4b1 100644
--- a/WebCore/kwq/KWQKJobClasses.h
+++ b/WebCore/kwq/KWQKJobClasses.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,7 +43,7 @@ class TransferJobPrivate;
class Job : public QObject {
public:
virtual int error() const = 0;
- virtual const QString & errorText() const = 0;
+ virtual QString errorText() const = 0;
virtual void kill() = 0;
};
@@ -54,7 +54,7 @@ public:
int error() const;
void setError(int);
- const QString &errorText() const;
+ QString errorText() const;
bool isErrorPage() const;
QString queryMetaData(const QString &key) const;
void addMetaData(const QString &key, const QString &value);
@@ -63,7 +63,7 @@ public:
void setHandle(WebResourceHandle *);
WebResourceHandle *handle() const;
- NSURL *url() const;
+ KURL url() const;
private:
TransferJobPrivate *d;
diff --git a/WebCore/kwq/KWQKJobClasses.mm b/WebCore/kwq/KWQKJobClasses.mm
index 7e1c348..c703aba 100644
--- a/WebCore/kwq/KWQKJobClasses.mm
+++ b/WebCore/kwq/KWQKJobClasses.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,23 +39,22 @@ class TransferJobPrivate
{
public:
TransferJobPrivate(const KURL &kurl)
+ : status(0)
+ , metaData([[NSMutableDictionary alloc] initWithCapacity:17])
+ , URL(kurl)
+ , handle(nil)
{
- status = 0;
- metaData = [[NSMutableDictionary alloc] initWithCapacity:17];
- url = [kurl.getNSURL() copy];
- handle = nil;
}
~TransferJobPrivate()
{
[metaData release];
- [url release];
[handle release];
}
int status;
NSMutableDictionary *metaData;
- NSURL *url;
+ KURL URL;
WebResourceHandle *handle;
};
@@ -84,11 +83,10 @@ void TransferJob::setError(int e)
d->status = e;
}
-const QString &TransferJob::errorText() const
+QString TransferJob::errorText() const
{
_logNotYetImplemented();
- static QString text("DEFAULT_ERROR_TEXT");
- return text;
+ return 0;
}
QString TransferJob::queryMetaData(const QString &key) const
@@ -125,9 +123,9 @@ WebResourceHandle *TransferJob::handle() const
return d->handle;
}
-NSURL *TransferJob::url() const
+KURL TransferJob::url() const
{
- return [[d->url retain] autorelease];
+ return d->URL;
}
} // namespace KIO
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index a3a5134..527e194 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -30,12 +30,16 @@
#import <khtml_part.h>
+#import <WebFoundation/WebCacheLoaderConstants.h>
+#import <WebFoundation/WebError.h>
+
#import <WebCoreBridge.h>
#import <WebCoreResourceLoader.h>
#import <kwqdebug.h>
using khtml::CachedObject;
+using khtml::CachedImage;
using khtml::DocLoader;
using khtml::Loader;
using khtml::Request;
@@ -94,11 +98,20 @@ void KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
request->m_docLoader->part()->baseURL().url().latin1(),
request->object->url().string().latin1());
- WebCoreResourceLoader *resourceLoader = [[WebCoreResourceLoader alloc] initWithLoader:loader job:job];
-
WebCoreBridge *bridge = ((KHTMLPart *)request->m_docLoader->part())->impl->getBridge();
- job->setHandle([bridge startLoadingResource:resourceLoader withURL:job->url()]);
+
+ NSURL *URL = job->url().getNSURL();
+ if (URL == nil) {
+ WebError *badURLError = [[WebError alloc] initWithErrorCode:WebResultBadURLError
+ inDomain:WebErrorDomainWebFoundation
+ failingURL:job->url().url().getNSString()];
+ [bridge reportError:badURLError];
+ [badURLError release];
+ return;
+ }
+ WebCoreResourceLoader *resourceLoader = [[WebCoreResourceLoader alloc] initWithLoader:loader job:job];
+ job->setHandle([bridge startLoadingResource:resourceLoader withURL:URL]);
[resourceLoader release];
}
@@ -121,8 +134,9 @@ void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
// Notify the caller that we "loaded".
WebCoreBridge *bridge = ((KHTMLPart *)loader->part())->impl->getBridge();
- NSURL *nsURL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
- // FIXME: cachedObject-size() is not the correct size, see Radar 2965269
- [bridge objectLoadedFromCache:nsURL size:cachedObject->size()];
- [nsURL release];
-}
\ No newline at end of file
+ NSURL *URL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
+ KWQ_ASSERT(URL);
+ CachedImage *cachedImage = dynamic_cast<CachedImage *>(cachedObject);
+ [bridge objectLoadedFromCache:URL size:cachedImage ? cachedImage->dataSize() : cachedObject->size()];
+ [URL release];
+}
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index a3a5134..527e194 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -30,12 +30,16 @@
#import <khtml_part.h>
+#import <WebFoundation/WebCacheLoaderConstants.h>
+#import <WebFoundation/WebError.h>
+
#import <WebCoreBridge.h>
#import <WebCoreResourceLoader.h>
#import <kwqdebug.h>
using khtml::CachedObject;
+using khtml::CachedImage;
using khtml::DocLoader;
using khtml::Loader;
using khtml::Request;
@@ -94,11 +98,20 @@ void KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
request->m_docLoader->part()->baseURL().url().latin1(),
request->object->url().string().latin1());
- WebCoreResourceLoader *resourceLoader = [[WebCoreResourceLoader alloc] initWithLoader:loader job:job];
-
WebCoreBridge *bridge = ((KHTMLPart *)request->m_docLoader->part())->impl->getBridge();
- job->setHandle([bridge startLoadingResource:resourceLoader withURL:job->url()]);
+
+ NSURL *URL = job->url().getNSURL();
+ if (URL == nil) {
+ WebError *badURLError = [[WebError alloc] initWithErrorCode:WebResultBadURLError
+ inDomain:WebErrorDomainWebFoundation
+ failingURL:job->url().url().getNSString()];
+ [bridge reportError:badURLError];
+ [badURLError release];
+ return;
+ }
+ WebCoreResourceLoader *resourceLoader = [[WebCoreResourceLoader alloc] initWithLoader:loader job:job];
+ job->setHandle([bridge startLoadingResource:resourceLoader withURL:URL]);
[resourceLoader release];
}
@@ -121,8 +134,9 @@ void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
// Notify the caller that we "loaded".
WebCoreBridge *bridge = ((KHTMLPart *)loader->part())->impl->getBridge();
- NSURL *nsURL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
- // FIXME: cachedObject-size() is not the correct size, see Radar 2965269
- [bridge objectLoadedFromCache:nsURL size:cachedObject->size()];
- [nsURL release];
-}
\ No newline at end of file
+ NSURL *URL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
+ KWQ_ASSERT(URL);
+ CachedImage *cachedImage = dynamic_cast<CachedImage *>(cachedObject);
+ [bridge objectLoadedFromCache:URL size:cachedImage ? cachedImage->dataSize() : cachedObject->size()];
+ [URL release];
+}
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 4dddb7c..6a4ef66 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -157,7 +157,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (void)setWindowFrame:(NSRect)frame;
- (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL;
-
+- (void)reportError:(WebError *)error;
- (void)objectLoadedFromCache:(NSURL *)URL size:(unsigned)bytes;
- (BOOL)openedByScript;
diff --git a/WebCore/kwq/kio/jobclasses.h b/WebCore/kwq/kio/jobclasses.h
index 2139d4f..2c6b4b1 100644
--- a/WebCore/kwq/kio/jobclasses.h
+++ b/WebCore/kwq/kio/jobclasses.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,7 +43,7 @@ class TransferJobPrivate;
class Job : public QObject {
public:
virtual int error() const = 0;
- virtual const QString & errorText() const = 0;
+ virtual QString errorText() const = 0;
virtual void kill() = 0;
};
@@ -54,7 +54,7 @@ public:
int error() const;
void setError(int);
- const QString &errorText() const;
+ QString errorText() const;
bool isErrorPage() const;
QString queryMetaData(const QString &key) const;
void addMetaData(const QString &key, const QString &value);
@@ -63,7 +63,7 @@ public:
void setHandle(WebResourceHandle *);
WebResourceHandle *handle() const;
- NSURL *url() const;
+ KURL url() const;
private:
TransferJobPrivate *d;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 13ed9b9..2bfa2ba 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2002-07-25 Darin Adler <darin at apple.com>
+
+ WebKit part of fix for 3006054 -- assert error failingURL != nil
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge reportError:]): New. Passes the error to the controller associated with
+ the dataSource.
+
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Call absoluteString.
+ (-[WebSubresourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString.
+ * WebView.subproj/WebController.m:
+ (-[WebController haveContentPolicy:andPath:forDataSource:]): Call absoluteString.
+ * WebView.subproj/WebControllerPrivate.m:
+ (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]):
+ Don't call absoluteString.
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _shouldShowDataSource:]): Call absoluteString.
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString.
+
2002-07-25 Chris Blumenberg <cblu at apple.com>
Remove reloadImage until its implemented.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 13ed9b9..2bfa2ba 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,24 @@
+2002-07-25 Darin Adler <darin at apple.com>
+
+ WebKit part of fix for 3006054 -- assert error failingURL != nil
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge reportError:]): New. Passes the error to the controller associated with
+ the dataSource.
+
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Call absoluteString.
+ (-[WebSubresourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString.
+ * WebView.subproj/WebController.m:
+ (-[WebController haveContentPolicy:andPath:forDataSource:]): Call absoluteString.
+ * WebView.subproj/WebControllerPrivate.m:
+ (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]):
+ Don't call absoluteString.
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _shouldShowDataSource:]): Call absoluteString.
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString.
+
2002-07-25 Chris Blumenberg <cblu at apple.com>
Remove reloadImage until its implemented.
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index bfde907..0bdffe3 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -295,4 +295,12 @@
[attributes release];
}
+- (void)reportError:(WebError *)error
+{
+ [[frame controller] _receivedError:error
+ forResourceHandle:nil
+ partialProgress:nil
+ fromDataSource:[self dataSource]];
+}
+
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 01bbfa1..727c75a 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -66,12 +66,12 @@
if (handle == nil) {
[rLoader cancel];
- WebError *badURLError = [WebError errorWithCode:WebResultBadURLError
- inDomain:WebErrorDomainWebFoundation
- failingURL:URL
- isTerminal:YES];
+ WebError *badURLError = [[WebError alloc] initWithErrorCode:WebResultBadURLError
+ inDomain:WebErrorDomainWebFoundation
+ failingURL:[URL absoluteString]];
[[source controller] _receivedError:badURLError forResourceHandle:nil
partialProgress:nil fromDataSource:source];
+ [badURLError release];
} else {
[source _addResourceHandle:handle];
@@ -120,7 +120,7 @@
[dataSource _removeResourceHandle:handle];
error = [[WebError alloc] initWithErrorCode:WebResultCancelled
- inDomain:WebErrorDomainWebFoundation failingURL:[dataSource inputURL]];
+ inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource inputURL] absoluteString]];
[self receivedError:error forHandle:handle];
[error release];
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 01bbfa1..727c75a 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -66,12 +66,12 @@
if (handle == nil) {
[rLoader cancel];
- WebError *badURLError = [WebError errorWithCode:WebResultBadURLError
- inDomain:WebErrorDomainWebFoundation
- failingURL:URL
- isTerminal:YES];
+ WebError *badURLError = [[WebError alloc] initWithErrorCode:WebResultBadURLError
+ inDomain:WebErrorDomainWebFoundation
+ failingURL:[URL absoluteString]];
[[source controller] _receivedError:badURLError forResourceHandle:nil
partialProgress:nil fromDataSource:source];
+ [badURLError release];
} else {
[source _addResourceHandle:handle];
@@ -120,7 +120,7 @@
[dataSource _removeResourceHandle:handle];
error = [[WebError alloc] initWithErrorCode:WebResultCancelled
- inDomain:WebErrorDomainWebFoundation failingURL:[dataSource inputURL]];
+ inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource inputURL] absoluteString]];
[self receivedError:error forHandle:handle];
[error release];
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index e5bc2b2..a1d1800 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -277,7 +277,7 @@
![[self class] canShowMIMEType:[dataSource contentType]]) {
WebError *error = [[WebError alloc] initWithErrorCode:WebErrorCannotShowMIMEType
- inDomain:WebErrorDomainWebKit failingURL: [dataSource inputURL]];
+ inDomain:WebErrorDomainWebKit failingURL:[[dataSource inputURL] absoluteString]];
[[self policyHandler] unableToImplementContentPolicy:error forDataSource:dataSource];
} else {
[dataSource _setContentPolicy:policy];
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 8b9b404..7d1331e 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -131,7 +131,7 @@
[[self resourceProgressHandler] receivedError: error forResourceHandle: resourceHandle partialProgress: progress fromDataSource: dataSource];
[dataSource _addError: error forResource:
- (resourceHandle != nil ? [[resourceHandle url] absoluteString] : [[error failingURL] absoluteString])];
+ (resourceHandle != nil ? [[resourceHandle url] absoluteString] : [error failingURL])];
[frame _checkLoadComplete];
}
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 03429e0..7639725 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -480,14 +480,14 @@ static const char * const stateNames[6] = {
if(!fileExists){
error = [[WebError alloc] initWithErrorCode:WebErrorFileDoesNotExist
- inDomain:WebErrorDomainWebKit failingURL:url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementFileURLPolicy: error forDataSource: dataSource];
return NO;
}
if(![fileManager isReadableFileAtPath:path]){
error = [[WebError alloc] initWithErrorCode:WebErrorFileNotReadable
- inDomain:WebErrorDomainWebKit failingURL:url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementFileURLPolicy: error forDataSource: dataSource];
return NO;
}
@@ -495,13 +495,13 @@ static const char * const stateNames[6] = {
if(fileURLPolicy == WebFileURLPolicyUseContentPolicy){
if(isDirectory){
error = [[WebError alloc] initWithErrorCode:WebErrorCannotShowDirectory
- inDomain:WebErrorDomainWebKit failingURL: url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementFileURLPolicy: error forDataSource: dataSource];
return NO;
}
else if(![WebController canShowMIMEType: type]){
error = [[WebError alloc] initWithErrorCode:WebErrorCannotShowMIMEType
- inDomain:WebErrorDomainWebKit failingURL: url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementFileURLPolicy: error forDataSource: dataSource];
return NO;
}else{
@@ -511,14 +511,14 @@ static const char * const stateNames[6] = {
}else if(fileURLPolicy == WebFileURLPolicyOpenExternally){
if(![workspace openFile:path]){
error = [[WebError alloc] initWithErrorCode:WebErrorCouldNotFindApplicationForFile
- inDomain:WebErrorDomainWebKit failingURL: url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementFileURLPolicy: error forDataSource: dataSource];
}
return NO;
}else if(fileURLPolicy == WebFileURLPolicyReveal){
if(![workspace selectFile:path inFileViewerRootedAtPath:@""]){
error = [[WebError alloc] initWithErrorCode:WebErrorFinderCouldNotOpenDirectory
- inDomain:WebErrorDomainWebKit failingURL: url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementFileURLPolicy: error forDataSource: dataSource];
}
return NO;
@@ -530,7 +530,7 @@ static const char * const stateNames[6] = {
}else{
if(![WebResourceHandle canInitWithURL:url]){
error = [[WebError alloc] initWithErrorCode:WebErrorCannotShowURL
- inDomain:WebErrorDomainWebKit failingURL: url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementURLPolicyForURL: url error: error];
return NO;
}
@@ -541,7 +541,7 @@ static const char * const stateNames[6] = {
else if(urlPolicy == WebURLPolicyOpenExternally){
if(![workspace openURL:url]){
error = [[WebError alloc] initWithErrorCode:WebErrorCouldNotFindApplicationForURL
- inDomain:WebErrorDomainWebKit failingURL: url];
+ inDomain:WebErrorDomainWebKit failingURL:[url absoluteString]];
[policyHandler unableToImplementURLPolicyForURL: url error: error];
}
return NO;
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 3928399..e55a727 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -114,7 +114,7 @@
// FIXME: Maybe we should be passing the URL from the handle here, not from the dataSource.
error = [[WebError alloc] initWithErrorCode:WebResultCancelled
- inDomain:WebErrorDomainWebFoundation failingURL:[dataSource inputURL]];
+ inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource inputURL] absoluteString]];
[self receivedError:error forHandle:handle];
[error release];
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 3928399..e55a727 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -114,7 +114,7 @@
// FIXME: Maybe we should be passing the URL from the handle here, not from the dataSource.
error = [[WebError alloc] initWithErrorCode:WebResultCancelled
- inDomain:WebErrorDomainWebFoundation failingURL:[dataSource inputURL]];
+ inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource inputURL] absoluteString]];
[self receivedError:error forHandle:handle];
[error release];
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index e5bc2b2..a1d1800 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -277,7 +277,7 @@
![[self class] canShowMIMEType:[dataSource contentType]]) {
WebError *error = [[WebError alloc] initWithErrorCode:WebErrorCannotShowMIMEType
- inDomain:WebErrorDomainWebKit failingURL: [dataSource inputURL]];
+ inDomain:WebErrorDomainWebKit failingURL:[[dataSource inputURL] absoluteString]];
[[self policyHandler] unableToImplementContentPolicy:error forDataSource:dataSource];
} else {
[dataSource _setContentPolicy:policy];
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 8b9b404..7d1331e 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -131,7 +131,7 @@
[[self resourceProgressHandler] receivedError: error forResourceHandle: resourceHandle partialProgress: progress fromDataSource: dataSource];
[dataSource _addError: error forResource:
- (resourceHandle != nil ? [[resourceHandle url] absoluteString] : [[error failingURL] absoluteString])];
+ (resourceHandle != nil ? [[resourceHandle url] absoluteString] : [error failingURL])];
[frame _checkLoadComplete];
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list