Index: third_party/WebKit/Source/core/events/PopStateEvent.cpp |
diff --git a/third_party/WebKit/Source/core/events/PopStateEvent.cpp b/third_party/WebKit/Source/core/events/PopStateEvent.cpp |
index 47640bc95ab3784e1d669d2ccf092e3d4e6382e2..e56e126831aa9b8a4b4b7f65354e09f29a7f06b8 100644 |
--- a/third_party/WebKit/Source/core/events/PopStateEvent.cpp |
+++ b/third_party/WebKit/Source/core/events/PopStateEvent.cpp |
@@ -32,40 +32,22 @@ |
namespace blink { |
PopStateEvent::PopStateEvent() |
- : serialized_state_(nullptr), state_(this), history_(nullptr) {} |
+ : serialized_state_(nullptr), history_(nullptr) {} |
-PopStateEvent::PopStateEvent(ScriptState* script_state, |
- const AtomicString& type, |
+PopStateEvent::PopStateEvent(const AtomicString& type, |
const PopStateEventInit& initializer) |
- : Event(type, initializer), state_(this), history_(nullptr) { |
- if (initializer.hasState()) { |
- world_ = RefPtr<DOMWrapperWorld>(script_state->World()); |
- state_.Set(initializer.state().GetIsolate(), initializer.state().V8Value()); |
- } |
+ : Event(type, initializer), history_(nullptr) { |
+ if (initializer.hasState()) |
+ state_ = initializer.state(); |
} |
PopStateEvent::PopStateEvent(PassRefPtr<SerializedScriptValue> serialized_state, |
History* history) |
: Event(EventTypeNames::popstate, false, true), |
serialized_state_(std::move(serialized_state)), |
- state_(this), |
history_(history) {} |
PopStateEvent::~PopStateEvent() {} |
- |
-ScriptValue PopStateEvent::state(ScriptState* script_state) const { |
- if (state_.IsEmpty()) |
- return ScriptValue(); |
- |
- v8::Isolate* isolate = script_state->GetIsolate(); |
- if (world_->GetWorldId() != script_state->World().GetWorldId()) { |
- v8::Local<v8::Value> value = state_.NewLocal(isolate); |
- RefPtr<SerializedScriptValue> serialized = |
- SerializedScriptValue::SerializeAndSwallowExceptions(isolate, value); |
- return ScriptValue(script_state, serialized->Deserialize(isolate)); |
- } |
- return ScriptValue(script_state, state_.NewLocal(isolate)); |
-} |
PopStateEvent* PopStateEvent::Create() { |
return new PopStateEvent; |
@@ -77,10 +59,9 @@ |
return new PopStateEvent(std::move(serialized_state), history); |
} |
-PopStateEvent* PopStateEvent::Create(ScriptState* script_state, |
- const AtomicString& type, |
+PopStateEvent* PopStateEvent::Create(const AtomicString& type, |
const PopStateEventInit& initializer) { |
- return new PopStateEvent(script_state, type, initializer); |
+ return new PopStateEvent(type, initializer); |
} |
const AtomicString& PopStateEvent::InterfaceName() const { |
@@ -92,9 +73,4 @@ |
Event::Trace(visitor); |
} |
-DEFINE_TRACE_WRAPPERS(PopStateEvent) { |
- visitor->TraceWrappers(state_); |
- Event::TraceWrappers(visitor); |
-} |
- |
} // namespace blink |