Use a 1-byte enum class for TextDirection
[WebKit-https.git] / Source / WebCore / dom / PopStateEvent.cpp
index 0f678b1..82995f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #include "EventNames.h"
 #include "History.h"
-#include <runtime/JSCInlines.h>
+#include <JavaScriptCore/JSCInlines.h>
 
 namespace WebCore {
 
-PopStateEvent::PopStateEvent(const AtomicString& type, const PopStateEventInit& initializer)
-    : Event(type, initializer)
+PopStateEvent::PopStateEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
     , m_state(initializer.state)
 {
 }
 
-PopStateEvent::PopStateEvent(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtr<History> history)
-    : Event(eventNames().popstateEvent, false, true)
-    , m_serializedState(serializedState)
+PopStateEvent::PopStateEvent(RefPtr<SerializedScriptValue>&& serializedState, History* history)
+    : Event(eventNames().popstateEvent, false, false)
+    , m_serializedState(WTFMove(serializedState))
     , m_history(history)
 {
 }
 
-PopStateEvent::~PopStateEvent()
-{
-}
+PopStateEvent::~PopStateEvent() = default;
 
-Ref<PopStateEvent> PopStateEvent::create(RefPtr<SerializedScriptValue>&& serializedState, PassRefPtr<History> history)
+Ref<PopStateEvent> PopStateEvent::create(RefPtr<SerializedScriptValue>&& serializedState, History* history)
 {
     return adoptRef(*new PopStateEvent(WTFMove(serializedState), history));
 }
 
-Ref<PopStateEvent> PopStateEvent::createForBindings(const AtomicString& type, const PopStateEventInit& initializer)
+Ref<PopStateEvent> PopStateEvent::create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
 {
-    return adoptRef(*new PopStateEvent(type, initializer));
+    return adoptRef(*new PopStateEvent(type, initializer, isTrusted));
 }
 
 Ref<PopStateEvent> PopStateEvent::createForBindings()
@@ -65,12 +63,12 @@ Ref<PopStateEvent> PopStateEvent::createForBindings()
     return adoptRef(*new PopStateEvent);
 }
 
-RefPtr<SerializedScriptValue> PopStateEvent::trySerializeState(JSC::ExecState* exec)
+RefPtr<SerializedScriptValue> PopStateEvent::trySerializeState(JSC::ExecState& executionState)
 {
-    ASSERT(!m_state.hasNoValue());
+    ASSERT(m_state);
     
     if (!m_serializedState && !m_triedToSerialize) {
-        m_serializedState = SerializedScriptValue::create(exec, m_state.jsValue(), nullptr, nullptr, NonThrowing);
+        m_serializedState = SerializedScriptValue::create(executionState, m_state, SerializationErrorMode::NonThrowing);
         m_triedToSerialize = true;
     }