From: zandobersek@gmail.com Date: Tue, 28 Apr 2015 08:09:22 +0000 (+0000) Subject: [WK2] API::UserContentURLPattern creation functions should return Ref<> X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=9fa2ab5553e501c9ccf3875e36bcf5f0b1005073 [WK2] API::UserContentURLPattern creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144225 Reviewed by Darin Adler. Have API::UserContentURLPattern creation functions return Ref<>. Call-sites are also updated, using and operating on the returned Ref<> object where possible. * Shared/API/APIUserContentURLPattern.h: (API::UserContentURLPattern::create): * Shared/API/c/WKUserContentURLPattern.cpp: (WKUserContentURLPatternCreate): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183463 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index a3fc052..0036a27 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,5 +1,21 @@ 2015-04-28 Zan Dobersek + [WK2] API::UserContentURLPattern creation functions should return Ref<> + https://bugs.webkit.org/show_bug.cgi?id=144225 + + Reviewed by Darin Adler. + + Have API::UserContentURLPattern creation functions return Ref<>. + Call-sites are also updated, using and operating on the returned Ref<> + object where possible. + + * Shared/API/APIUserContentURLPattern.h: + (API::UserContentURLPattern::create): + * Shared/API/c/WKUserContentURLPattern.cpp: + (WKUserContentURLPatternCreate): + +2015-04-28 Zan Dobersek + [WK2] API::URLRequest, API::URLResponse creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144224 diff --git a/Source/WebKit2/Shared/API/APIUserContentURLPattern.h b/Source/WebKit2/Shared/API/APIUserContentURLPattern.h index 10a6a50..aff4613 100644 --- a/Source/WebKit2/Shared/API/APIUserContentURLPattern.h +++ b/Source/WebKit2/Shared/API/APIUserContentURLPattern.h @@ -30,15 +30,14 @@ #include #include -#include namespace API { class UserContentURLPattern : public API::ObjectImpl { public: - static PassRefPtr create(const WTF::String& pattern) + static Ref create(const WTF::String& pattern) { - return adoptRef(new UserContentURLPattern(pattern)); + return adoptRef(*new UserContentURLPattern(pattern)); } const WTF::String& host() const { return m_pattern.host(); } diff --git a/Source/WebKit2/Shared/API/c/WKUserContentURLPattern.cpp b/Source/WebKit2/Shared/API/c/WKUserContentURLPattern.cpp index 9f9b836..ceedc76 100644 --- a/Source/WebKit2/Shared/API/c/WKUserContentURLPattern.cpp +++ b/Source/WebKit2/Shared/API/c/WKUserContentURLPattern.cpp @@ -39,8 +39,7 @@ WKTypeID WKUserContentURLPatternGetTypeID() WKUserContentURLPatternRef WKUserContentURLPatternCreate(WKStringRef patternRef) { - RefPtr userContentURLPattern = API::UserContentURLPattern::create(toImpl(patternRef)->string()); - return toAPI(userContentURLPattern.release().leakRef()); + return toAPI(&API::UserContentURLPattern::create(toImpl(patternRef)->string()).leakRef()); } WKStringRef WKUserContentURLPatternCopyHost(WKUserContentURLPatternRef urlPatternRef)