Bug 37603 - Add WKRetainPtr helper class as private header
Summary: Add WKRetainPtr helper class as private header
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 13:49 PDT by Sam Weinig
Modified: 2010-04-14 14:08 PDT (History)
1 user (show)

See Also:


Attachments
patch (10.96 KB, patch)
2010-04-14 13:55 PDT, Sam Weinig
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.