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
2015-04-28 Zan Dobersek <zdobersek@igalia.com>
2015-04-28 Zan Dobersek <zdobersek@igalia.com>
+ [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 <zdobersek@igalia.com>
+
[WK2] API::URLRequest, API::URLResponse creation functions should return Ref<>
https://bugs.webkit.org/show_bug.cgi?id=144224
[WK2] API::URLRequest, API::URLResponse creation functions should return Ref<>
https://bugs.webkit.org/show_bug.cgi?id=144224
#include <WebCore/URL.h>
#include <WebCore/UserContentURLPattern.h>
#include <WebCore/URL.h>
#include <WebCore/UserContentURLPattern.h>
namespace API {
class UserContentURLPattern : public API::ObjectImpl<API::Object::Type::UserContentURLPattern> {
public:
namespace API {
class UserContentURLPattern : public API::ObjectImpl<API::Object::Type::UserContentURLPattern> {
public:
- static PassRefPtr<UserContentURLPattern> create(const WTF::String& pattern)
+ static Ref<UserContentURLPattern> create(const WTF::String& pattern)
- return adoptRef(new UserContentURLPattern(pattern));
+ return adoptRef(*new UserContentURLPattern(pattern));
}
const WTF::String& host() const { return m_pattern.host(); }
}
const WTF::String& host() const { return m_pattern.host(); }
WKUserContentURLPatternRef WKUserContentURLPatternCreate(WKStringRef patternRef)
{
WKUserContentURLPatternRef WKUserContentURLPatternCreate(WKStringRef patternRef)
{
- RefPtr<API::UserContentURLPattern> 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)
}
WKStringRef WKUserContentURLPatternCopyHost(WKUserContentURLPatternRef urlPatternRef)