diff options
Diffstat (limited to 'Source/WebCore/dom/BeforeLoadEvent.h')
-rw-r--r-- | Source/WebCore/dom/BeforeLoadEvent.h | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/Source/WebCore/dom/BeforeLoadEvent.h b/Source/WebCore/dom/BeforeLoadEvent.h index 0ae76985c..7c57daaac 100644 --- a/Source/WebCore/dom/BeforeLoadEvent.h +++ b/Source/WebCore/dom/BeforeLoadEvent.h @@ -13,7 +13,7 @@ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -24,56 +24,42 @@ * */ -#ifndef BeforeLoadEvent_h -#define BeforeLoadEvent_h +#pragma once #include "Event.h" #include "EventNames.h" namespace WebCore { -struct BeforeLoadEventInit : public EventInit { - BeforeLoadEventInit() - { - }; - - String url; -}; - -class BeforeLoadEvent : public Event { +class BeforeLoadEvent final : public Event { public: - static PassRefPtr<BeforeLoadEvent> create() + static Ref<BeforeLoadEvent> create(const String& url) { - return adoptRef(new BeforeLoadEvent); + return adoptRef(*new BeforeLoadEvent(url)); } - static PassRefPtr<BeforeLoadEvent> create(const String& url) - { - return adoptRef(new BeforeLoadEvent(url)); - } + struct Init : EventInit { + String url; + }; - static PassRefPtr<BeforeLoadEvent> create(const AtomicString& type, const BeforeLoadEventInit& initializer) + static Ref<BeforeLoadEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) { - return adoptRef(new BeforeLoadEvent(type, initializer)); + return adoptRef(*new BeforeLoadEvent(type, initializer, isTrusted)); } const String& url() const { return m_url; } - virtual EventInterface eventInterface() const override { return BeforeLoadEventInterfaceType; } + EventInterface eventInterface() const override { return BeforeLoadEventInterfaceType; } private: - BeforeLoadEvent() - { - } - explicit BeforeLoadEvent(const String& url) : Event(eventNames().beforeloadEvent, false, true) , m_url(url) { } - BeforeLoadEvent(const AtomicString& type, const BeforeLoadEventInit& initializer) - : Event(type, initializer) + BeforeLoadEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted) + : Event(type, initializer, isTrusted) , m_url(initializer.url) { } @@ -82,5 +68,3 @@ private: }; } // namespace WebCore - -#endif // BeforeLoadEvent_h |