Commit 61512437 authored by weinig@apple.com's avatar weinig@apple.com

Remove specialized retain/release functions in favor of a single one for WKTypeRefs

https://bugs.webkit.org/show_bug.cgi?id=44386

Reviewed by Dan Bernstein.

WebKit2: 

* UIProcess/API/C/WKArray.cpp:
(WKArrayGetSize):
* UIProcess/API/C/WKArray.h:
* UIProcess/API/C/WKBackForwardList.cpp:
(WKBackForwardListCopyForwardListWithLimit):
* UIProcess/API/C/WKBackForwardList.h:
* UIProcess/API/C/WKBackForwardListItem.cpp:
(WKBackForwardListItemCopyTitle):
* UIProcess/API/C/WKBackForwardListItem.h:
* UIProcess/API/C/WKBase.h:
* UIProcess/API/C/WKContext.cpp:
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKData.cpp:
(WKDataGetSize):
* UIProcess/API/C/WKData.h:
* UIProcess/API/C/WKDictionary.cpp:
(WKDictionaryCopyKeys):
* UIProcess/API/C/WKDictionary.h:
* UIProcess/API/C/WKError.h:
* UIProcess/API/C/WKFormSubmissionListener.cpp:
(WKFormSubmissionListenerContinue):
* UIProcess/API/C/WKFormSubmissionListener.h:
* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetPage):
* UIProcess/API/C/WKFrame.h:
* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerIgnore):
* UIProcess/API/C/WKFramePolicyListener.h:
* UIProcess/API/C/WKNavigationData.cpp:
(WKNavigationDataCopyURL):
* UIProcess/API/C/WKNavigationData.h:
* UIProcess/API/C/WKPage.cpp:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/C/WKPageNamespace.cpp:
(WKPageNamespaceGetContext):
* UIProcess/API/C/WKPageNamespace.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesCreate):
(WKPreferencesGetLocalStorageEnabled):
* UIProcess/API/C/WKPreferences.h:
* UIProcess/API/C/WKString.cpp:
* UIProcess/API/C/WKString.h:
* UIProcess/API/C/WKType.cpp:
(WKRetain):
(WKRelease):
* UIProcess/API/C/WKType.h:
* UIProcess/API/C/WKURL.cpp:
(WKURLGetTypeID):
* UIProcess/API/C/WKURL.h:
* UIProcess/API/cpp/WKRetainPtr.h:
* UIProcess/API/win/WKView.cpp:
* UIProcess/API/win/WKView.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::shared):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleGetTypeID):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
(WKBundleScriptWorldNormalWorld):
* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:

WebKitTools: 

* MiniBrowser/mac/AppDelegate.m:
(didRecieveMessageFromInjectedBundle):
(didNavigateWithNavigationData):
(-[BrowserAppDelegate init]):
(-[BrowserAppDelegate applicationWillTerminate:]):
* MiniBrowser/mac/BrowserStatisticsWindowController.m:
(-[BrowserStatisticsWindowController initWithThreadedWKContextRef:processWKContextRef:]):
(-[BrowserStatisticsWindowController dealloc]):
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController initWithPageNamespace:]):
(-[BrowserWindowController fetch:]):
(-[BrowserWindowController windowWillClose:]):
(-[BrowserWindowController applicationTerminating]):
(closePage):
(runJavaScriptAlert):
(runJavaScriptConfirm):
(runJavaScriptPrompt):
(-[BrowserWindowController updateProvisionalURLForFrame:]):
* MiniBrowser/mac/WebBundle/WebBundleMain.m:
(didClearWindowObjectForFrame):
* MiniBrowser/win/BrowserView.cpp:
(BrowserView::goToURL):
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::~PlatformWebView):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9d1e8b1e
2010-08-21 Sam Weinig <sam@webkit.org>
Reviewed by Dan Bernstein.
Remove specialized retain/release functions in favor of a single one for WKTypeRefs
https://bugs.webkit.org/show_bug.cgi?id=44386
* UIProcess/API/C/WKArray.cpp:
(WKArrayGetSize):
* UIProcess/API/C/WKArray.h:
* UIProcess/API/C/WKBackForwardList.cpp:
(WKBackForwardListCopyForwardListWithLimit):
* UIProcess/API/C/WKBackForwardList.h:
* UIProcess/API/C/WKBackForwardListItem.cpp:
(WKBackForwardListItemCopyTitle):
* UIProcess/API/C/WKBackForwardListItem.h:
* UIProcess/API/C/WKBase.h:
* UIProcess/API/C/WKContext.cpp:
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKData.cpp:
(WKDataGetSize):
* UIProcess/API/C/WKData.h:
* UIProcess/API/C/WKDictionary.cpp:
(WKDictionaryCopyKeys):
* UIProcess/API/C/WKDictionary.h:
* UIProcess/API/C/WKError.h:
* UIProcess/API/C/WKFormSubmissionListener.cpp:
(WKFormSubmissionListenerContinue):
* UIProcess/API/C/WKFormSubmissionListener.h:
* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetPage):
* UIProcess/API/C/WKFrame.h:
* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerIgnore):
* UIProcess/API/C/WKFramePolicyListener.h:
* UIProcess/API/C/WKNavigationData.cpp:
(WKNavigationDataCopyURL):
* UIProcess/API/C/WKNavigationData.h:
* UIProcess/API/C/WKPage.cpp:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/C/WKPageNamespace.cpp:
(WKPageNamespaceGetContext):
* UIProcess/API/C/WKPageNamespace.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesCreate):
(WKPreferencesGetLocalStorageEnabled):
* UIProcess/API/C/WKPreferences.h:
* UIProcess/API/C/WKString.cpp:
* UIProcess/API/C/WKString.h:
* UIProcess/API/C/WKType.cpp:
(WKRetain):
(WKRelease):
* UIProcess/API/C/WKType.h:
* UIProcess/API/C/WKURL.cpp:
(WKURLGetTypeID):
* UIProcess/API/C/WKURL.h:
* UIProcess/API/cpp/WKRetainPtr.h:
* UIProcess/API/win/WKView.cpp:
* UIProcess/API/win/WKView.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::shared):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleGetTypeID):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
(WKBundleScriptWorldNormalWorld):
* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
2010-08-20 Balazs Kelemen <kb@inf.u-szeged.hu>
Reviewed by Antonio Gomes.
......
......@@ -56,14 +56,3 @@ size_t WKArrayGetSize(WKArrayRef arrayRef)
{
return toWK(arrayRef)->size();
}
WKArrayRef WKArrayRetain(WKArrayRef arrayRef)
{
toWK(arrayRef)->ref();
return arrayRef;
}
void WKArrayRelease(WKArrayRef arrayRef)
{
toWK(arrayRef)->deref();
}
......@@ -42,13 +42,8 @@ WK_EXPORT WKArrayRef WKArrayCreateAdoptingValues(WKTypeRef* values, size_t numbe
WK_EXPORT WKTypeRef WKArrayGetItemAtIndex(WKArrayRef array, size_t index);
WK_EXPORT size_t WKArrayGetSize(WKArrayRef array);
WK_EXPORT WKArrayRef WKArrayRetain(WKArrayRef array);
WK_EXPORT void WKArrayRelease(WKArrayRef array);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKArray)
#endif // WKArray_h
......@@ -69,14 +69,3 @@ WKArrayRef WKBackForwardListCopyForwardListWithLimit(WKBackForwardListRef listRe
{
return toRef(toWK(listRef)->forwardListAsImmutableArrayWithLimit(limit).releaseRef());
}
WKBackForwardListRef WKBackForwardListRetain(WKBackForwardListRef listRef)
{
toWK(listRef)->ref();
return listRef;
}
void WKBackForwardListRelease(WKBackForwardListRef listRef)
{
toWK(listRef)->deref();
}
......@@ -44,13 +44,8 @@ WK_EXPORT unsigned WKBackForwardListGetForwardListCount(WKBackForwardListRef lis
WK_EXPORT WKArrayRef WKBackForwardListCopyBackListWithLimit(WKBackForwardListRef list, unsigned limit);
WK_EXPORT WKArrayRef WKBackForwardListCopyForwardListWithLimit(WKBackForwardListRef list, unsigned limit);
WK_EXPORT WKBackForwardListRef WKBackForwardListRetain(WKBackForwardListRef list);
WK_EXPORT void WKBackForwardListRelease(WKBackForwardListRef list);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKBackForwardList)
#endif // WKBackForwardList_h
......@@ -49,14 +49,3 @@ WKStringRef WKBackForwardListItemCopyTitle(WKBackForwardListItemRef itemRef)
{
return toCopiedRef(toWK(itemRef)->title());
}
WKBackForwardListItemRef WKBackForwardListItemRetain(WKBackForwardListItemRef itemRef)
{
toWK(itemRef)->ref();
return itemRef;
}
void WKBackForwardListItemRelease(WKBackForwardListItemRef itemRef)
{
toWK(itemRef)->deref();
}
......@@ -38,13 +38,8 @@ WK_EXPORT WKURLRef WKBackForwardListItemCopyOriginalURL(WKBackForwardListItemRef
WK_EXPORT WKURLRef WKBackForwardListItemCopyURL(WKBackForwardListItemRef item);
WK_EXPORT WKStringRef WKBackForwardListItemCopyTitle(WKBackForwardListItemRef item);
WK_EXPORT WKBackForwardListItemRef WKBackForwardListItemRetain(WKBackForwardListItemRef item);
WK_EXPORT void WKBackForwardListItemRelease(WKBackForwardListItemRef item);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKBackForwardListItem)
#endif /* WKBackForwardListItem_h */
......@@ -67,14 +67,4 @@ typedef struct OpaqueWKURL* WKURLRef;
#define WK_EXPORT
#endif
#ifdef __cplusplus
#define WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKType) \
inline void WKRetain(WKType##Ref p) { WKType##Retain(p); } \
inline void WKRelease(WKType##Ref p) { WKType##Release(p); } \
// end of macro
#else
#define WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKType)
#endif
#endif /* WKBase_h */
......@@ -99,17 +99,6 @@ void WKContextAddVisitedLink(WKContextRef contextRef, WKStringRef visitedURL)
toWK(contextRef)->addVisitedLink(toWK(visitedURL)->string());
}
WKContextRef WKContextRetain(WKContextRef contextRef)
{
toWK(contextRef)->ref();
return contextRef;
}
void WKContextRelease(WKContextRef contextRef)
{
toWK(contextRef)->deref();
}
void _WKContextSetAdditionalPluginsDirectory(WKContextRef contextRef, WKStringRef pluginsDirectory)
{
toWK(contextRef)->setAdditionalPluginsDirectory(toWK(pluginsDirectory)->string());
......
......@@ -76,13 +76,8 @@ WK_EXPORT void WKContextPostMessageToInjectedBundle(WKContextRef context, WKStri
WK_EXPORT void WKContextAddVisitedLink(WKContextRef context, WKStringRef visitedURL);
WK_EXPORT WKContextRef WKContextRetain(WKContextRef context);
WK_EXPORT void WKContextRelease(WKContextRef context);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKContext)
#endif /* WKContext_h */
......@@ -50,14 +50,3 @@ size_t WKDataGetSize(WKDataRef dataRef)
{
return toWK(dataRef)->size();
}
WKDataRef WKDataRetain(WKDataRef dataRef)
{
toWK(dataRef)->ref();
return dataRef;
}
void WKDataRelease(WKDataRef dataRef)
{
toWK(dataRef)->deref();
}
......@@ -41,13 +41,8 @@ WK_EXPORT WKDataRef WKDataCreate(const unsigned char* bytes, size_t size);
WK_EXPORT const unsigned char* WKDataGetBytes(WKDataRef data);
WK_EXPORT size_t WKDataGetSize(WKDataRef data);
WK_EXPORT WKDataRef WKDataRetain(WKDataRef data);
WK_EXPORT void WKDataRelease(WKDataRef data);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKData)
#endif // WKData_h
......@@ -51,14 +51,3 @@ WKArrayRef WKDictionaryCopyKeys(WKDictionaryRef dictionaryRef)
RefPtr<ImmutableArray> keys = toWK(dictionaryRef)->keys();
return toRef(keys.release().releaseRef());
}
WKDictionaryRef WKDictionaryRetain(WKDictionaryRef dictionaryRef)
{
toWK(dictionaryRef)->ref();
return dictionaryRef;
}
void WKDictionaryRelease(WKDictionaryRef dictionaryRef)
{
toWK(dictionaryRef)->deref();
}
......@@ -41,13 +41,8 @@ WK_EXPORT size_t WKDictionaryGetSize(WKDictionaryRef dictionary);
WK_EXPORT WKArrayRef WKDictionaryCopyKeys(WKDictionaryRef dictionary);
WK_EXPORT WKDictionaryRef WKDictionaryRetain(WKDictionaryRef dictionary);
WK_EXPORT void WKDictionaryRelease(WKDictionaryRef dictionary);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKDictionary)
#endif /* WKDictionary_h */
......@@ -34,13 +34,8 @@ extern "C" {
WK_EXPORT WKTypeID WKErrorGetTypeID();
WK_EXPORT WKErrorRef WKErrorRetain(WKErrorRef error);
WK_EXPORT void WKErrorRelease(WKErrorRef error);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKError)
#endif // WKError_h
......@@ -39,14 +39,3 @@ void WKFormSubmissionListenerContinue(WKFormSubmissionListenerRef submissionList
{
toWK(submissionListener)->continueSubmission();
}
WKFormSubmissionListenerRef WKFormSubmissionListenerRetain(WKFormSubmissionListenerRef submissionListenerRef)
{
toWK(submissionListenerRef)->ref();
return submissionListenerRef;
}
void WKFormSubmissionListenerRelease(WKFormSubmissionListenerRef submissionListenerRef)
{
toWK(submissionListenerRef)->deref();
}
......@@ -36,13 +36,8 @@ WK_EXPORT WKTypeID WKFormSubmissionListenerGetTypeID();
WK_EXPORT void WKFormSubmissionListenerContinue(WKFormSubmissionListenerRef submissionListener);
WK_EXPORT WKFormSubmissionListenerRef WKFormSubmissionListenerRetain(WKFormSubmissionListenerRef submissionListener);
WK_EXPORT void WKFormSubmissionListenerRelease(WKFormSubmissionListenerRef submissionListener);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKFormSubmissionListener)
#endif /* WKFormSubmissionListener_h */
......@@ -70,14 +70,3 @@ WKPageRef WKFrameGetPage(WKFrameRef frameRef)
{
return toRef(toWK(frameRef)->page());
}
WKFrameRef WKFrameRetain(WKFrameRef frameRef)
{
toWK(frameRef)->ref();
return frameRef;
}
void WKFrameRelease(WKFrameRef frameRef)
{
toWK(frameRef)->deref();
}
......@@ -52,13 +52,8 @@ WK_EXPORT WKURLRef WKFrameCopyURL(WKFrameRef frame);
WK_EXPORT WKPageRef WKFrameGetPage(WKFrameRef frame);
WK_EXPORT WKFrameRef WKFrameRetain(WKFrameRef frame);
WK_EXPORT void WKFrameRelease(WKFrameRef frame);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKFrame)
#endif /* WKFrame_h */
......@@ -50,14 +50,3 @@ void WKFramePolicyListenerIgnore(WKFramePolicyListenerRef policyListenerRef)
{
toWK(policyListenerRef)->ignore();
}
WKFramePolicyListenerRef WKFramePolicyListenerRetain(WKFramePolicyListenerRef policyListenerRef)
{
toWK(policyListenerRef)->ref();
return policyListenerRef;
}
void WKFramePolicyListenerRelease(WKFramePolicyListenerRef policyListenerRef)
{
toWK(policyListenerRef)->deref();
}
......@@ -38,13 +38,8 @@ WK_EXPORT void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListener)
WK_EXPORT void WKFramePolicyListenerDownload(WKFramePolicyListenerRef policyListener);
WK_EXPORT void WKFramePolicyListenerIgnore(WKFramePolicyListenerRef policyListener);
WK_EXPORT WKFramePolicyListenerRef WKFramePolicyListenerRetain(WKFramePolicyListenerRef policyListener);
WK_EXPORT void WKFramePolicyListenerRelease(WKFramePolicyListenerRef policyListener);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKFramePolicyListener)
#endif /* WKFramePolicyListener_h */
......@@ -44,14 +44,3 @@ WKURLRef WKNavigationDataCopyURL(WKNavigationDataRef navigationDataRef)
{
return toCopiedURLRef(toWK(navigationDataRef)->url());
}
WKNavigationDataRef WKNavigationDataRetain(WKNavigationDataRef navigationDataRef)
{
toWK(navigationDataRef)->ref();
return navigationDataRef;
}
void WKNavigationDataRelease(WKNavigationDataRef navigationDataRef)
{
toWK(navigationDataRef)->deref();
}
......@@ -37,13 +37,8 @@ WK_EXPORT WKTypeID WKNavigationDataGetTypeID();
WK_EXPORT WKStringRef WKNavigationDataCopyTitle(WKNavigationDataRef navigationData);
WK_EXPORT WKURLRef WKNavigationDataCopyURL(WKNavigationDataRef navigationData);
WK_EXPORT WKNavigationDataRef WKNavigationDataRetain(WKNavigationDataRef navigationData);
WK_EXPORT void WKNavigationDataRelease(WKNavigationDataRef navigationData);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKNavigationData)
#endif /* WKNavigationData_h */
......@@ -209,14 +209,3 @@ void WKPageRenderTreeExternalRepresentation_b(WKPageRef pageRef, WKPageRenderTre
WKPageRenderTreeExternalRepresentation(pageRef, Block_copy(block), callRenderTreeExternalRepresentationBlockAndDispose);
}
#endif
WKPageRef WKPageRetain(WKPageRef pageRef)
{
toWK(pageRef)->ref();
return pageRef;
}
void WKPageRelease(WKPageRef pageRef)
{
toWK(pageRef)->deref();
}
......@@ -197,14 +197,8 @@ typedef void (^WKPageRunJavaScriptBlock)(WKStringRef, WKErrorRef);
WK_EXPORT void WKPageRunJavaScriptInMainFrame_b(WKPageRef page, WKStringRef script, WKPageRunJavaScriptBlock block);
#endif
WK_EXPORT WKPageRef WKPageRetain(WKPageRef page);
WK_EXPORT void WKPageRelease(WKPageRef page);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKPage)
#endif /* WKPage_h */
......@@ -46,14 +46,3 @@ WKContextRef WKPageNamespaceGetContext(WKPageNamespaceRef pageNamespaceRef)
{
return toRef(toWK(pageNamespaceRef)->context());
}
WKPageNamespaceRef WKPageNamespaceRetain(WKPageNamespaceRef pageNamespaceRef)
{
toWK(pageNamespaceRef)->ref();
return pageNamespaceRef;
}
void WKPageNamespaceRelease(WKPageNamespaceRef pageNamespaceRef)
{
toWK(pageNamespaceRef)->deref();
}
......@@ -38,13 +38,8 @@ WK_EXPORT WKPageNamespaceRef WKPageNamespaceCreate(WKContextRef ownerContext);
WK_EXPORT WKContextRef WKPageNamespaceGetContext(WKPageNamespaceRef pageNamespace);
WK_EXPORT WKPageNamespaceRef WKPageNamespaceRetain(WKPageNamespaceRef pageNamespace);
WK_EXPORT void WKPageNamespaceRelease(WKPageNamespaceRef pageNamespace);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKPageNamespace)
#endif /* WKPageNamespace_h */
......@@ -40,7 +40,7 @@ WKTypeID WKPreferencesGetTypeID()
WKPreferencesRef WKPreferencesCreate()
{
RefPtr<WebPreferences> preferences = WebPreferences::create();
return toRef(preferences.release().releaseRef());
return toRef(preferences.release().leakRef());
}
WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef)
......@@ -88,14 +88,3 @@ bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferencesRef)
{
return toWK(preferencesRef)->localStorageEnabled();
}
WKPreferencesRef WKPreferencesRetain(WKPreferencesRef preferencesRef)
{
toWK(preferencesRef)->ref();
return preferencesRef;
}
void WKPreferencesRelease(WKPreferencesRef preferencesRef)
{
toWK(preferencesRef)->deref();
}
......@@ -57,13 +57,8 @@ WK_EXPORT bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRe
WK_EXPORT void WKPreferencesSetLocalStorageEnabled(WKPreferencesRef preferences, bool localStorageEnabled);
WK_EXPORT bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferences);
WK_EXPORT WKPreferencesRef WKPreferencesRetain(WKPreferencesRef preferences);
WK_EXPORT void WKPreferencesRelease(WKPreferencesRef preferences);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKPreferences)
#endif /* WKPreferences_h */
......@@ -34,17 +34,6 @@ WKTypeID WKStringGetTypeID()
return toRef(WebString::APIType);
}
WKStringRef WKStringRetain(WKStringRef stringRef)
{
toWK(stringRef)->ref();
return stringRef;
}
void WKStringRelease(WKStringRef stringRef)
{
toWK(stringRef)->deref();
}
bool WKStringIsEmpty(WKStringRef stringRef)
{
return toWK(stringRef)->isEmpty();
......
......@@ -38,15 +38,10 @@ extern "C" {
WK_EXPORT WKTypeID WKStringGetTypeID();
WK_EXPORT WKStringRef WKStringRetain(WKStringRef string);
WK_EXPORT void WKStringRelease(WKStringRef string);
WK_EXPORT bool WKStringIsEmpty(WKStringRef string);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKString)
#endif /* WKString_h */
......@@ -34,3 +34,14 @@ WKTypeID WKGetTypeID(WKTypeRef typeRef)
{
return toRef(static_cast<APIObject*>(typeRef)->type());
}
WKTypeRef WKRetain(WKTypeRef typeRef)
{
static_cast<APIObject*>(typeRef)->ref();
return typeRef;
}
void WKRelease(WKTypeRef typeRef)
{
static_cast<APIObject*>(typeRef)->deref();
}
......@@ -34,6 +34,9 @@ extern "C" {
WK_EXPORT WKTypeID WKGetTypeID(WKTypeRef type);
WK_EXPORT WKTypeRef WKRetain(WKTypeRef type);
WK_EXPORT void WKRelease(WKTypeRef type);
#ifdef __cplusplus
}
#endif
......
......@@ -33,14 +33,3 @@ WKTypeID WKURLGetTypeID()
{
return toRef(WebURL::APIType);
}
WKURLRef WKURLRetain(WKURLRef URLRef)
{
toWK(URLRef)->ref();
return URLRef;
}
void WKURLRelease(WKURLRef URLRef)
{
toWK(URLRef)->deref();
}
......@@ -34,13 +34,8 @@ extern "C" {
WK_EXPORT WKTypeID WKURLGetTypeID();
WK_EXPORT WKURLRef WKURLRetain(WKURLRef URL);
WK_EXPORT void WKURLRelease(WKURLRef URL);
#ifdef __cplusplus
}
#endif
WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKURL)
#endif /* WKURL_h */
......@@ -26,6 +26,7 @@
#ifndef WKRetainPtr_h
#define WKRetainPtr_h
#include <WebKit2/WKType.h>
#include <algorithm>
namespace WebKit {
......@@ -105,9 +106,6 @@ public:
void adopt(PtrType);
void swap(WKRetainPtr&);
// FIXME: Remove once all callers are calling leakRef.
PtrType releaseRef() { leakRef(); }
private:
PtrType m_ptr;
};
......
......@@ -56,17 +56,6 @@ WKPageRef WKViewGetPage(WKViewRef viewRef)
return toRef(toWK(viewRef)->page());
}
WKViewRef WKViewRetain(WKViewRef viewRef)
{
toWK(viewRef)->ref();
return viewRef;
}
void WKViewRelease(WKViewRef viewRef)
{
toWK(viewRef)->deref();
}
void WKViewSetHostWindow(WKViewRef viewRef, HWND hostWindow)
{
toWK(viewRef)->setHostWindow(hostWindow);
......