Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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):



Canonical link: https://commits.webkit.org/56559@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
weinig committed Aug 22, 2010
1 parent 7cbf5c6 commit 343e10a
Show file tree
Hide file tree
Showing 44 changed files with 117 additions and 307 deletions.
68 changes: 68 additions & 0 deletions WebKit2/ChangeLog
@@ -1,3 +1,71 @@
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.
Expand Down
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKArray.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKArray.h
Expand Up @@ -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
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKBackForwardList.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKBackForwardList.h
Expand Up @@ -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
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKBackForwardListItem.h
Expand Up @@ -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 */
10 changes: 0 additions & 10 deletions WebKit2/UIProcess/API/C/WKBase.h
Expand Up @@ -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 */
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKContext.cpp
Expand Up @@ -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());
Expand Down
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKContext.h
Expand Up @@ -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 */
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKData.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKData.h
Expand Up @@ -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
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKDictionary.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKDictionary.h
Expand Up @@ -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 */
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKError.h
Expand Up @@ -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
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKFormSubmissionListener.h
Expand Up @@ -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 */
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKFrame.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKFrame.h
Expand Up @@ -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 */
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKFramePolicyListener.h
Expand Up @@ -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 */
11 changes: 0 additions & 11 deletions WebKit2/UIProcess/API/C/WKNavigationData.cpp
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions WebKit2/UIProcess/API/C/WKNavigationData.h
Expand Up @@ -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 */

0 comments on commit 343e10a

Please sign in to comment.