+2011-03-13 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add ability to create a WKErrorRef
+ <rdar://problem/9115768>
+ https://bugs.webkit.org/show_bug.cgi?id=56279
+
+ * WebCore.exp.in:
+ Add new exports.
+
+ * platform/network/cf/ResourceError.h:
+ * platform/network/cf/ResourceErrorCF.cpp:
+ (WebCore::ResourceError::platformCompare):
+ (WebCore::ResourceError::cfError):
+ (WebCore::ResourceError::operator CFErrorRef):
+ (WebCore::ResourceError::ResourceError):
+ (WebCore::ResourceError::cfStreamError):
+ (WebCore::ResourceError::operator CFStreamError):
+ * platform/network/mac/ResourceErrorMac.mm:
+ (WebCore::ResourceError::ResourceError):
+ (WebCore::ResourceError::platformCompare):
+ (WebCore::ResourceError::nsError):
+ (WebCore::ResourceError::operator NSError *):
+ (WebCore::ResourceError::cfError):
+ (WebCore::ResourceError::operator CFErrorRef):
+ Clean up ResourceError a bit and add ability to create a ResourceError from a CFErrorRef
+ regardless of whether CFNetwork is being used.
+
2011-03-13 Pratik Solanki <psolanki@apple.com>
Reviewed by Brady Eidson.
__ZN7WebCore13IdentifierRep3getEi
__ZN7WebCore13JSHTMLElement6s_infoE
__ZN7WebCore13KeyboardEventC1ERKN3WTF12AtomicStringEbbPNS_9DOMWindowERKNS1_6StringEjbbbbb
+__ZN7WebCore13ResourceErrorC1EP7NSError
+__ZN7WebCore13ResourceErrorC1EP9__CFError
__ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE
__ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE
__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
__ZN7WebCore8Settings29setDefaultMinDOMTimerIntervalEd
__ZN7WebCore8Settings29setWebArchiveDebugModeEnabledEb
__ZN7WebCore8Settings30setAllowFileAccessFromFileURLsEb
-__ZN7WebCore8Settings31setJavaScriptCanAccessClipboardEb
__ZN7WebCore8Settings31setCanvasUsesAcceleratedDrawingEb
+__ZN7WebCore8Settings31setJavaScriptCanAccessClipboardEb
__ZN7WebCore8Settings31setShrinksStandaloneImagesToFitEb
__ZN7WebCore8Settings32setAcceleratedCompositingEnabledEb
__ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb
__ZN7WebCore9PageGroup14addVisitedLinkEPKtm
__ZN7WebCore9PageGroup17closeLocalStorageEv
__ZN7WebCore9PageGroup18addVisitedLinkHashEy
+__ZN7WebCore9PageGroup18numberOfPageGroupsEv
__ZN7WebCore9PageGroup20addUserScriptToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
__ZN7WebCore9PageGroup20removeAllUserContentEv
__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
__ZN7WebCore9PageGroup29removeUserStyleSheetFromWorldEPNS_15DOMWrapperWorldERKNS_4KURLE
__ZN7WebCore9PageGroup30removeUserStyleSheetsFromWorldEPNS_15DOMWrapperWorldE
__ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
-__ZN7WebCore9PageGroup18numberOfPageGroupsEv
__ZN7WebCore9Scrollbar22maxOverlapBetweenPagesEv
__ZN7WebCore9TimerBase4stopEv
__ZN7WebCore9TimerBase5startEdd
__ZNK7WebCore13HitTestResult5imageEv
__ZNK7WebCore13HitTestResult5titleERNS_13TextDirectionE
__ZNK7WebCore13HitTestResult9imageRectEv
+__ZNK7WebCore13ResourceError7cfErrorEv
__ZNK7WebCore13ResourceErrorcvP7NSErrorEv
__ZNK7WebCore14DocumentLoader10requestURLEv
__ZNK7WebCore14DocumentLoader11frameLoaderEv
__ZNK7WebCore14SecurityOrigin10canDisplayERKNS_4KURLE
__ZNK7WebCore14SecurityOrigin18databaseIdentifierEv
__ZNK7WebCore14SecurityOrigin5equalEPKS0_
-#if ENABLE(DOM_STORAGE)
-__ZN7WebCore14StorageTracker17initializeTrackerERKN3WTF6StringE
-__ZN7WebCore14StorageTracker16deleteAllOriginsEv
-__ZN7WebCore14StorageTracker12deleteOriginEPNS_14SecurityOriginE
-__ZN7WebCore14StorageTracker7trackerEv
-__ZN7WebCore14StorageTracker7originsERN3WTF6VectorINS1_6RefPtrINS_14SecurityOriginEEELm0EEE
-__ZN7WebCore14StorageTracker9setClientEPNS_20StorageTrackerClientE
-__ZN7WebCore14StorageTracker16syncLocalStorageEv
-__ZN7WebCore14StorageTracker32syncFileSystemAndTrackerDatabaseEv
-#endif
__ZNK7WebCore15FocusController18focusedOrMainFrameEv
__ZNK7WebCore15GraphicsContext15platformContextEv
__ZNK7WebCore15GraphicsContext16paintingDisabledEv
_wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes
+#if ENABLE(DOM_STORAGE)
+__ZN7WebCore14StorageTracker17initializeTrackerERKN3WTF6StringE
+__ZN7WebCore14StorageTracker16deleteAllOriginsEv
+__ZN7WebCore14StorageTracker12deleteOriginEPNS_14SecurityOriginE
+__ZN7WebCore14StorageTracker7trackerEv
+__ZN7WebCore14StorageTracker7originsERN3WTF6VectorINS1_6RefPtrINS_14SecurityOriginEEELm0EEE
+__ZN7WebCore14StorageTracker9setClientEPNS_20StorageTrackerClientE
+__ZN7WebCore14StorageTracker16syncLocalStorageEv
+__ZN7WebCore14StorageTracker32syncFileSystemAndTrackerDatabaseEv
+#endif
+
#if !defined(NDEBUG)
__ZN7WebCore20LogNotYetImplementedE
#endif
#if USE(CFNETWORK)
#include <CoreFoundation/CFStream.h>
#else
+
#ifdef __OBJC__
@class NSError;
#else
{
}
-#if USE(CFNETWORK)
- ResourceError(CFStreamError error);
-
- ResourceError(CFErrorRef error)
- : m_dataIsUpToDate(false)
- , m_platformError(error)
- {
- m_isNull = !error;
- }
+ ResourceError(CFErrorRef error);
+ CFErrorRef cfError() const;
operator CFErrorRef() const;
+
+#if USE(CFNETWORK)
+ ResourceError(CFStreamError error);
+ CFStreamError cfStreamError() const;
operator CFStreamError() const;
#else
- ResourceError(NSError* error)
- : m_dataIsUpToDate(false)
- , m_platformError(error)
- {
- m_isNull = !error;
- }
-
- operator NSError*() const;
+ ResourceError(NSError *);
+ NSError *nsError() const;
+ operator NSError *() const;
#endif
private:
*/
#include "config.h"
-#include "KURL.h"
#include "ResourceError.h"
#if USE(CFNETWORK)
-// FIXME: Once <rdar://problem/5050881> is fixed in open source we
-// can remove this extern "C"
-extern "C" {
-#include <CFNetwork/CFNetworkErrors.h>
-}
-
+#include "KURL.h"
#include <CoreFoundation/CFError.h>
+#include <CFNetwork/CFNetworkErrors.h>
#include <WTF/RetainPtr.h>
namespace WebCore {
const CFStringRef failingURLStringKey = CFSTR("NSErrorFailingURLStringKey");
const CFStringRef failingURLKey = CFSTR("NSErrorFailingURLKey");
-// FIXME: Once <rdar://problem/5050841> is fixed we can remove this constructor.
-ResourceError::ResourceError(CFStreamError error)
- : m_dataIsUpToDate(true)
-{
- m_isNull = false;
- m_errorCode = error.error;
-
- switch(error.domain) {
- case kCFStreamErrorDomainCustom:
- m_domain ="NSCustomErrorDomain";
- break;
- case kCFStreamErrorDomainPOSIX:
- m_domain = "NSPOSIXErrorDomain";
- break;
- case kCFStreamErrorDomainMacOSStatus:
- m_domain = "NSOSStatusErrorDomain";
- break;
- }
-}
-
void ResourceError::platformLazyInit()
{
if (m_dataIsUpToDate)
bool ResourceError::platformCompare(const ResourceError& a, const ResourceError& b)
{
- return (CFErrorRef)a == (CFErrorRef)b;
+ return a.cfError() == b.cfError();
}
-ResourceError::operator CFErrorRef() const
+CFErrorRef ResourceError::cfError() const
{
if (m_isNull) {
ASSERT(!m_platformError);
return 0;
}
-
+
if (!m_platformError) {
RetainPtr<CFMutableDictionaryRef> userInfo(AdoptCF, CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
return m_platformError.get();
}
-ResourceError::operator CFStreamError() const
+ResourceError::operator CFErrorRef() const
+{
+ return cfError();
+}
+
+// FIXME: Once <rdar://problem/5050841> is fixed we can remove this constructor.
+ResourceError::ResourceError(CFStreamError error)
+ : m_dataIsUpToDate(true)
+{
+ m_isNull = false;
+ m_errorCode = error.error;
+
+ switch(error.domain) {
+ case kCFStreamErrorDomainCustom:
+ m_domain ="NSCustomErrorDomain";
+ break;
+ case kCFStreamErrorDomainPOSIX:
+ m_domain = "NSPOSIXErrorDomain";
+ break;
+ case kCFStreamErrorDomainMacOSStatus:
+ m_domain = "NSOSStatusErrorDomain";
+ break;
+ }
+}
+
+CFStreamError ResourceError::cfStreamError() const
{
lazyInit();
return result;
}
+ResourceError::operator CFStreamError() const
+{
+ return cfStreamError();
+}
+
} // namespace WebCore
#endif // USE(CFNETWORK)
#import "BlockExceptions.h"
#import "KURL.h"
+#import <CoreFoundation/CFError.h>
#import <Foundation/Foundation.h>
@interface NSError (WebExtras)
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)
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);
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
+2011-03-13 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add ability to create a WKErrorRef
+ <rdar://problem/9115768>
+ https://bugs.webkit.org/show_bug.cgi?id=56279
+
+ * Shared/API/c/cf/WKErrorCF.cpp: Added.
+ (WKErrorCreateWithCFError):
+ (WKErrorCopyCFError):
+ * Shared/API/c/cf/WKErrorCF.h: Added.
+ Add new API to create a WKErrorRef from a CFErrorRef
+ and vice-versa.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ * win/WebKit2.vcproj:
+ * win/WebKit2Generated.make:
+ Add new files.
+
2011-03-13 Pratik Solanki <psolanki@apple.com>
Reviewed by Brady Eidson.
--- /dev/null
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKErrorCF.h"
+
+#include "WKAPICast.h"
+#include "WebError.h"
+
+using namespace WebCore;
+using namespace WebKit;
+
+WKErrorRef WKErrorCreateWithCFError(CFErrorRef cfError)
+{
+ RefPtr<WebError> error = WebError::create(ResourceError(cfError));
+ return toAPI(error.release().releaseRef());
+}
+
+CFErrorRef WKErrorCopyCFError(CFAllocatorRef alloc, WKErrorRef error)
+{
+ return toImpl(error)->platformError().cfError();
+}
--- /dev/null
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKErrorCF_h
+#define WKErrorCF_h
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKErrorRef WKErrorCreateWithCFError(CFErrorRef error);
+WK_EXPORT CFErrorRef WKErrorCopyCFError(CFAllocatorRef alloc, WKErrorRef error);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKErrorCF_h */
BCF69FA31176D01400471A52 /* WebNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA11176D01400471A52 /* WebNavigationData.cpp */; };
BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF69FA71176D1CB00471A52 /* WKNavigationData.h */; settings = {ATTRIBUTES = (Public, ); }; };
BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */; };
+ BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCFD5489132D82680055D816 /* WKErrorCF.cpp */; };
+ BCFD548C132D82680055D816 /* WKErrorCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFD548A132D82680055D816 /* WKErrorCF.h */; settings = {ATTRIBUTES = (Public, ); }; };
BFA6179F12F0B99D0033E0CA /* WKViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BFA6179E12F0B99D0033E0CA /* WKViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */; };
C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C02BFF1D1251502E009CCBEA /* NativeWebKeyboardEventMac.mm */; };
BCF69FA11176D01400471A52 /* WebNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNavigationData.cpp; sourceTree = "<group>"; };
BCF69FA71176D1CB00471A52 /* WKNavigationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationData.h; sourceTree = "<group>"; };
BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNavigationData.cpp; sourceTree = "<group>"; };
+ BCFD5489132D82680055D816 /* WKErrorCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKErrorCF.cpp; sourceTree = "<group>"; };
+ BCFD548A132D82680055D816 /* WKErrorCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKErrorCF.h; sourceTree = "<group>"; };
BFA6179E12F0B99D0033E0CA /* WKViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKViewPrivate.h; sourceTree = "<group>"; };
C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableBitmapCG.cpp; sourceTree = "<group>"; };
C02BFF1512514FD8009CCBEA /* NativeWebKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebKeyboardEvent.h; sourceTree = "<group>"; };
BC4075D5124FEFFA0068F20A /* cf */ = {
isa = PBXGroup;
children = (
+ BCFD5489132D82680055D816 /* WKErrorCF.cpp */,
+ BCFD548A132D82680055D816 /* WKErrorCF.h */,
BC407611124FF0370068F20A /* WKStringCF.cpp */,
BC407612124FF0370068F20A /* WKStringCF.h */,
BC407613124FF0370068F20A /* WKURLCF.cpp */,
E1BB16A413201B9B00F49431 /* FullKeyboardAccessWatcher.h in Headers */,
33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */,
CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */,
+ BCFD548C132D82680055D816 /* WKErrorCF.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */,
CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */,
CDCA8603132ADC0500E961DF /* WebFullScreenManagerMac.mm in Sources */,
+ BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
<Filter
Name="cf"
>
+ <File
+ RelativePath="..\Shared\API\c\cf\WKErrorCF.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Shared\API\c\cf\WKErrorCF.h"
+ >
+ </File>
<File
RelativePath="..\Shared\API\c\cf\WKStringCF.cpp"
>
all:
touch "%ConfigurationBuildDir%\buildfailed"
-mkdir 2>NUL "%ConfigurationBuildDir%\include\WebKit2"
+ xcopy /y /d "..\Shared\API\c\cf\WKErrorCF.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\cf\WKStringCF.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\cf\WKURLCF.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\cf\WKURLRequestCF.h" "%ConfigurationBuildDir%\include\WebKit2"