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

Unified Diff: Source/bindings/templates/attributes.cpp

Issue 27476003: IDL compiler: [Unforgeable] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 2 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
« no previous file with comments | « Source/bindings/scripts/unstable/v8_attributes.py ('k') | Source/bindings/tests/idls/TestObjectPython.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index 415fb7d5877f88c5edc2f0e872d250733a52675b..e0c72c1e75137cc64d62452be093606bb319ef6e 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -3,6 +3,12 @@
{% filter conditional(attribute.conditional_string) %}
static void {{attribute.name}}AttributeGetter{{world_suffix}}(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
+ {% if attribute.is_unforgeable %}
+ v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class_name}}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
+ if (holder.IsEmpty())
+ return;
+ {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder);
+ {% endif %}
{% if attribute.cached_attribute_validation_method %}
v8::Handle<v8::String> propertyName = v8::String::NewSymbol("{{attribute.name}}");
{{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
@@ -13,7 +19,7 @@ static void {{attribute.name}}AttributeGetter{{world_suffix}}(v8::Local<v8::Stri
return;
}
}
- {% elif not attribute.is_static %}
+ {% elif not (attribute.is_static or attribute.is_unforgeable) %}
{{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
{% endif %}
{% if attribute.is_call_with_script_execution_context %}
« no previous file with comments | « Source/bindings/scripts/unstable/v8_attributes.py ('k') | Source/bindings/tests/idls/TestObjectPython.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698