Bug 37603

Summary: Add WKRetainPtr helper class as private header
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
patch andersca: review+

Description Sam Weinig 2010-04-14 13:49:09 PDT
Add WKRetainPtr helper class as private header
Comment 1 Sam Weinig 2010-04-14 13:55:07 PDT
Created attachment 53362 [details]
patch
Comment 2 WebKit Review Bot 2010-04-14 13:57:15 PDT
Attachment 53362 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebKit2/UIProcess/API/cpp/WKRetainPtr.h:95:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Anders Carlsson 2010-04-14 13:58:00 PDT
Comment on attachment 53362 [details]
patch

> +
> +#define 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
> +
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKContext)
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKFrame)
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKFramePolicyListener)
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKPage)
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKPageNamespace)
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKPreferences)
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKString)
> +DECLARE_RETAIN_RELEASE_OVERLOADS(WKURL)
> +
> +#undef DECLARE_RETAIN_RELEASE_OVERLOADS

Could you add a fixme about adding these overloads to the respective headers (when compiling as C++).
> +template <typename T> inline void WKRetainPtr<T>::adoptCF(PtrType optr)

This shouldn't be here.

> +template <typename T> inline void WKRetainPtr<T>::adoptNS(PtrType optr)

Nor should this.

Looks good otherwise!

r=me
Comment 4 Sam Weinig 2010-04-14 14:08:58 PDT
Landed in r57605.