From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/css/CSSFontFaceLoadEvent.h | 42 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'Source/WebCore/css/CSSFontFaceLoadEvent.h') diff --git a/Source/WebCore/css/CSSFontFaceLoadEvent.h b/Source/WebCore/css/CSSFontFaceLoadEvent.h index c0f29c01f..93a613bc6 100644 --- a/Source/WebCore/css/CSSFontFaceLoadEvent.h +++ b/Source/WebCore/css/CSSFontFaceLoadEvent.h @@ -28,46 +28,45 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if ENABLE(FONT_LOAD_EVENTS) +#pragma once -#ifndef CSSFontFaceLoadEvent_h -#define CSSFontFaceLoadEvent_h +#if ENABLE(FONT_LOAD_EVENTS) #include "CSSFontFaceRule.h" #include "CSSValue.h" -#include "DOMError.h" #include "Event.h" #include "EventNames.h" -#include #include namespace WebCore { -struct CSSFontFaceLoadEventInit : public EventInit { - RefPtr fontface; - RefPtr error; -}; +class DOMError; -class CSSFontFaceLoadEvent : public Event { +class CSSFontFaceLoadEvent final : public Event { public: - static PassRefPtr create() + static Ref create() { - return adoptRef(new CSSFontFaceLoadEvent()); + return adoptRef(*new CSSFontFaceLoadEvent); } - static PassRefPtr create(const AtomicString& type, const CSSFontFaceLoadEventInit& initializer) + struct Init : EventInit { + RefPtr fontface; + RefPtr error; + }; + + static Ref create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) { - return adoptRef(new CSSFontFaceLoadEvent(type, initializer)); + return adoptRef(*new CSSFontFaceLoadEvent(type, initializer, isTrusted)); } - static PassRefPtr createForFontFaceRule(const AtomicString& type, PassRefPtr rule) + static Ref createForFontFaceRule(const AtomicString& type, RefPtr&& rule) { - return adoptRef(new CSSFontFaceLoadEvent(type, rule, 0)); + return adoptRef(*new CSSFontFaceLoadEvent(type, WTFMove(rule), nullptr)); } - static PassRefPtr createForError(PassRefPtr rule, PassRefPtr error) + static Ref createForError(RefPtr&& rule, RefPtr&& error) { - return adoptRef(new CSSFontFaceLoadEvent(eventNames().errorEvent, rule, error)); + return adoptRef(*new CSSFontFaceLoadEvent(eventNames().errorEvent, WTFMove(rule), WTFMove(error))); } virtual ~CSSFontFaceLoadEvent(); @@ -75,12 +74,12 @@ public: CSSFontFaceRule* fontface() const { return m_fontface.get(); } DOMError* error() const { return m_error.get(); } - virtual EventInterface eventInterface() const; + EventInterface eventInterface() const final; private: CSSFontFaceLoadEvent(); - CSSFontFaceLoadEvent(const AtomicString&, PassRefPtr, PassRefPtr); - CSSFontFaceLoadEvent(const AtomicString&, const CSSFontFaceLoadEventInit&); + CSSFontFaceLoadEvent(const AtomicString&, RefPtr&&, RefPtr&&); + CSSFontFaceLoadEvent(const AtomicString&, const Init&, IsTrusted); RefPtr m_fontface; RefPtr m_error; @@ -88,5 +87,4 @@ private: } // namespace WebCore -#endif // CSSFontFaceLoadEvent_h #endif // ENABLE(FONT_LOAD_EVENTS) -- cgit v1.2.1