Commit 761f6f59 authored by Marina Sakai's avatar Marina Sakai Committed by Commit Bot

Remove a macro-generated function for a private property of PopStateEvent

This CL removes a macro-generated fucntion for a private property of PopStateEvent, and replaces it with the new API GetSymbol, which uses an instance address of V8PrivateProperty::SymbolKey as a key to get Symbol.

Bug: 715418
Change-Id: Iaabcd308a18c20eabfa5c4c53ec32d5b72cd4fbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893481Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Marina Sakai <marinasakai@google.com>
Cr-Commit-Position: refs/heads/master@{#711627}
parent cdcce704
...@@ -37,12 +37,15 @@ ...@@ -37,12 +37,15 @@
namespace blink { namespace blink {
const V8PrivateProperty::SymbolKey kPrivatePropertyState;
// Save the state value to a hidden attribute in the V8PopStateEvent, and return // Save the state value to a hidden attribute in the V8PopStateEvent, and return
// it, for convenience. // it, for convenience.
static v8::Local<v8::Value> CacheState(ScriptState* script_state, static v8::Local<v8::Value> CacheState(ScriptState* script_state,
v8::Local<v8::Object> pop_state_event, v8::Local<v8::Object> pop_state_event,
v8::Local<v8::Value> state) { v8::Local<v8::Value> state) {
V8PrivateProperty::GetPopStateEventState(script_state->GetIsolate()) V8PrivateProperty::GetSymbol(script_state->GetIsolate(),
kPrivatePropertyState)
.Set(pop_state_event, state); .Set(pop_state_event, state);
return state; return state;
} }
...@@ -52,7 +55,7 @@ void V8PopStateEvent::StateAttributeGetterCustom( ...@@ -52,7 +55,7 @@ void V8PopStateEvent::StateAttributeGetterCustom(
v8::Isolate* isolate = info.GetIsolate(); v8::Isolate* isolate = info.GetIsolate();
ScriptState* script_state = ScriptState::Current(isolate); ScriptState* script_state = ScriptState::Current(isolate);
V8PrivateProperty::Symbol property_symbol = V8PrivateProperty::Symbol property_symbol =
V8PrivateProperty::GetPopStateEventState(isolate); V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyState);
v8::Local<v8::Value> result; v8::Local<v8::Value> result;
if (property_symbol.GetOrUndefined(info.Holder()).ToLocal(&result) && if (property_symbol.GetOrUndefined(info.Holder()).ToLocal(&result) &&
......
...@@ -28,7 +28,6 @@ class ScriptWrappable; ...@@ -28,7 +28,6 @@ class ScriptWrappable;
X(Global, Event) \ X(Global, Event) \
X(MessageEvent, CachedData) \ X(MessageEvent, CachedData) \
X(NamedConstructor, Initialized) \ X(NamedConstructor, Initialized) \
X(PopStateEvent, State) \
SCRIPT_PROMISE_PROPERTIES(X, Promise) \ SCRIPT_PROMISE_PROPERTIES(X, Promise) \
SCRIPT_PROMISE_PROPERTIES(X, Resolver) SCRIPT_PROMISE_PROPERTIES(X, Resolver)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment