| Index: third_party/WebKit/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
|
| index 141a8426f20404c2afa61835d9fdbd345b6510c0..d7513745f5c28c733f67e6ec1629ded7bf60d3bc 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
|
| @@ -32,8 +32,8 @@
|
|
|
| #include "bindings/core/v8/SerializedScriptValue.h"
|
| #include "bindings/core/v8/SerializedScriptValueFactory.h"
|
| -#include "bindings/core/v8/V8HiddenValue.h"
|
| #include "bindings/core/v8/V8History.h"
|
| +#include "bindings/core/v8/V8PrivateProperty.h"
|
| #include "core/events/PopStateEvent.h"
|
| #include "core/frame/History.h"
|
|
|
| @@ -44,9 +44,8 @@ namespace blink {
|
| static v8::Local<v8::Value> cacheState(ScriptState* scriptState,
|
| v8::Local<v8::Object> popStateEvent,
|
| v8::Local<v8::Value> state) {
|
| - V8HiddenValue::setHiddenValue(scriptState, popStateEvent,
|
| - V8HiddenValue::state(scriptState->isolate()),
|
| - state);
|
| + V8PrivateProperty::getScriptState(scriptState->isolate())
|
| + .set(scriptState->context(), popStateEvent, state);
|
| return state;
|
| }
|
|
|
| @@ -54,8 +53,10 @@ void V8PopStateEvent::stateAttributeGetterCustom(
|
| const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| v8::Isolate* isolate = info.GetIsolate();
|
| ScriptState* scriptState = ScriptState::current(isolate);
|
| - v8::Local<v8::Value> result = V8HiddenValue::getHiddenValue(
|
| - scriptState, info.Holder(), V8HiddenValue::state(isolate));
|
| + v8::Local<v8::Context> context = scriptState->context();
|
| + V8PrivateProperty::Symbol stateSymbol =
|
| + V8PrivateProperty::getScriptState(isolate);
|
| + v8::Local<v8::Value> result = stateSymbol.get(context, info.Holder());
|
|
|
| if (!result.IsEmpty()) {
|
| v8SetReturnValue(info, result);
|
| @@ -93,17 +94,13 @@ void V8PopStateEvent::stateAttributeGetterCustom(
|
| if (v8HistoryValue.IsEmpty())
|
| return;
|
| v8::Local<v8::Object> v8History = v8HistoryValue.As<v8::Object>();
|
| - if (!history->stateChanged()) {
|
| - result = V8HiddenValue::getHiddenValue(scriptState, v8History,
|
| - V8HiddenValue::state(isolate));
|
| - if (!result.IsEmpty()) {
|
| - v8SetReturnValue(info, cacheState(scriptState, info.Holder(), result));
|
| - return;
|
| - }
|
| + if (!history->stateChanged() && stateSymbol.hasValue(context, v8History)) {
|
| + v8SetReturnValue(info, cacheState(scriptState, info.Holder(),
|
| + stateSymbol.get(context, v8History)));
|
| + return;
|
| }
|
| result = event->serializedState()->deserialize(isolate);
|
| - V8HiddenValue::setHiddenValue(scriptState, v8History,
|
| - V8HiddenValue::state(isolate), result);
|
| + stateSymbol.set(context, v8History, result);
|
| } else {
|
| result = event->serializedState()->deserialize(isolate);
|
| }
|
|
|