diff options
Diffstat (limited to 'Source/WebCore/platform/network/mac/ResourceErrorMac.mm')
-rw-r--r-- | Source/WebCore/platform/network/mac/ResourceErrorMac.mm | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/Source/WebCore/platform/network/mac/ResourceErrorMac.mm b/Source/WebCore/platform/network/mac/ResourceErrorMac.mm index 275ca41..0bada1f 100644 --- a/Source/WebCore/platform/network/mac/ResourceErrorMac.mm +++ b/Source/WebCore/platform/network/mac/ResourceErrorMac.mm @@ -28,6 +28,7 @@ #import "BlockExceptions.h" #import "KURL.h" +#import <CoreFoundation/CFError.h> #import <Foundation/Foundation.h> @interface NSError (WebExtras) @@ -36,6 +37,20 @@ namespace WebCore { +ResourceError::ResourceError(NSError *nsError) + : m_dataIsUpToDate(false) + , m_platformError(nsError) +{ + m_isNull = !nsError; +} + +ResourceError::ResourceError(CFErrorRef cfError) + : m_dataIsUpToDate(false) + , m_platformError((NSError *)cfError) +{ + m_isNull = !cfError; +} + void ResourceError::platformLazyInit() { if (m_dataIsUpToDate) @@ -59,10 +74,10 @@ void ResourceError::platformLazyInit() bool ResourceError::platformCompare(const ResourceError& a, const ResourceError& b) { - return (NSError*)a == (NSError*)b; + return a.nsError() == b.nsError(); } -ResourceError::operator NSError*() const +NSError *ResourceError::nsError() const { if (m_isNull) { ASSERT(!m_platformError); @@ -87,4 +102,19 @@ ResourceError::operator NSError*() const return m_platformError.get(); } +ResourceError::operator NSError *() const +{ + return nsError(); +} + +CFErrorRef ResourceError::cfError() const +{ + return (CFErrorRef)nsError(); +} + +ResourceError::operator CFErrorRef() const +{ + return cfError(); +} + } // namespace WebCore |