summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/PopStateEvent.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/PopStateEvent.h')
-rw-r--r--Source/WebCore/dom/PopStateEvent.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/Source/WebCore/dom/PopStateEvent.h b/Source/WebCore/dom/PopStateEvent.h
index b2a4f703b..2bdff6926 100644
--- a/Source/WebCore/dom/PopStateEvent.h
+++ b/Source/WebCore/dom/PopStateEvent.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,46 +24,46 @@
*
*/
-#ifndef PopStateEvent_h
-#define PopStateEvent_h
+#pragma once
#include "Event.h"
#include <bindings/ScriptValue.h>
namespace WebCore {
-struct PopStateEventInit : public EventInit {
- PopStateEventInit();
-
- Deprecated::ScriptValue state;
-};
-
class History;
class SerializedScriptValue;
-class PopStateEvent : public Event {
+class PopStateEvent final : public Event {
public:
virtual ~PopStateEvent();
- static PassRefPtr<PopStateEvent> create();
- static PassRefPtr<PopStateEvent> create(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
- static PassRefPtr<PopStateEvent> create(const AtomicString&, const PopStateEventInit&);
+ static Ref<PopStateEvent> create(RefPtr<SerializedScriptValue>&&, History*);
- PassRefPtr<SerializedScriptValue> serializedState() const { return m_serializedState; }
- const Deprecated::ScriptValue& state() const { return m_state; }
- History* history() const { return m_history.get(); }
+ struct Init : EventInit {
+ JSC::JSValue state;
+ };
+
+ static Ref<PopStateEvent> create(JSC::ExecState&, const AtomicString&, const Init&, IsTrusted = IsTrusted::No);
+ static Ref<PopStateEvent> createForBindings();
- virtual EventInterface eventInterface() const override;
+ JSC::JSValue state() const { return m_state; }
+ SerializedScriptValue* serializedState() const { return m_serializedState.get(); }
+
+ RefPtr<SerializedScriptValue> trySerializeState(JSC::ExecState&);
+
+ History* history() const { return m_history.get(); }
private:
- PopStateEvent();
- PopStateEvent(const AtomicString&, const PopStateEventInit&);
- explicit PopStateEvent(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
+ PopStateEvent() = default;
+ PopStateEvent(JSC::ExecState&, const AtomicString&, const Init&, IsTrusted);
+ PopStateEvent(RefPtr<SerializedScriptValue>&&, History*);
+
+ EventInterface eventInterface() const final;
Deprecated::ScriptValue m_state;
RefPtr<SerializedScriptValue> m_serializedState;
+ bool m_triedToSerialize { false };
RefPtr<History> m_history;
};
} // namespace WebCore
-
-#endif // PopStateEvent_h