Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl

Issue 2794453002: [Bindings] Replace V8HiddenValue in generated code with V8PrivateProperty (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
index dc5dde35aa16013d8289e401ac118c398c5f19c3..7ed4d7fc98e4581c2e4b3d1c61e923f1bff1b3c4 100644
--- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
@@ -491,14 +491,20 @@ static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo
if (holder.IsEmpty())
return;
{{cpp_class}}* impl = {{v8_class}}::toImpl(holder);
- v8::String::Utf8Value attributeName(name);
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "{{interface_name}}", *attributeName);
+ v8::String::Utf8Value methodName(name);
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "{{interface_name}}", *methodName);
if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
return;
}
{# The findInstanceInPrototypeChain() call above only returns a non-empty handle if info.Holder() is an Object. #}
- V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value);
+ {% raw %}
+ // |methodName| must be same with {{method.name}} in
+ // {{method.name}}OriginSafeMethodGetter{{world_suffix}} defined in
+ // methods.cpp.tmpl
+ {% endraw %}
+ V8PrivateProperty::getSymbol(info.GetIsolate(), *methodName)
+ .set(v8::Local<v8::Object>::Cast(info.Holder()), v8Value);
}
{% endif %}
{% endblock %}

Powered by Google App Engine
This is Rietveld 408576698