Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
| 2 | 2 |
| 3 | 3 |
| 4 {##############################################################################} | 4 {##############################################################################} |
| 5 {% block indexed_property_getter %} | 5 {% block indexed_property_getter %} |
| 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} | 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} |
| 7 {% set getter = indexed_property_getter %} | 7 {% set getter = indexed_property_getter %} |
| 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) | 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) |
| 9 { | 9 { |
| 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); | 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 455 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 456 } | 456 } |
| 457 | 457 |
| 458 {% endif %} | 458 {% endif %} |
| 459 {% endblock %} | 459 {% endblock %} |
| 460 | 460 |
| 461 | 461 |
| 462 {##############################################################################} | 462 {##############################################################################} |
| 463 {% block origin_safe_method_setter %} | 463 {% block origin_safe_method_setter %} |
| 464 {% if has_origin_safe_method_setter %} | 464 {% if has_origin_safe_method_setter %} |
| 465 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::String> name, v8:: Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 465 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 466 { | 466 { |
| 467 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in fo.This(), info.GetIsolate()); | 467 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in fo.This(), info.GetIsolate()); |
| 468 if (holder.IsEmpty()) | 468 if (holder.IsEmpty()) |
| 469 return; | 469 return; |
| 470 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); | 470 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); |
| 471 v8::String::Utf8Value attributeName(name); | 471 v8::String::Utf8Value attributeName(name); |
| 472 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate()); | 472 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate()); |
| 473 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) { | 473 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) { |
| 474 exceptionState.throwIfNeeded(); | 474 exceptionState.throwIfNeeded(); |
| 475 return; | 475 return; |
| 476 } | 476 } |
| 477 | 477 |
| 478 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha ndle if info.This() is an Object. #} | 478 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha ndle if info.This() is an Object. #} |
| 479 V8HiddenValue::setHiddenValue(info.GetIsolate(), v8::Local<v8::Object>::Cast (info.This()), name, v8Value); | 479 ASSERT(name->IsString()); |
|
Yuki
2015/03/13 09:05:06
Please add a FIXME comment, or shall we wait for V
dcarney
2015/03/16 20:17:44
As<v8::String> is already providing an ASSERT, so
bashi
2015/03/17 01:07:31
Removed.
| |
| 480 V8HiddenValue::setHiddenValue(info.GetIsolate(), v8::Local<v8::Object>::Cast (info.This()), name.As<v8::String>(), v8Value); | |
| 480 } | 481 } |
| 481 | 482 |
| 482 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::String> na me, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 483 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 483 { | 484 { |
| 484 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 485 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 485 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, info); | 486 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, info); |
| 486 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 487 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 487 } | 488 } |
| 488 | 489 |
| 489 {% endif %} | 490 {% endif %} |
| 490 {% endblock %} | 491 {% endblock %} |
| 491 | 492 |
| 492 | 493 |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1030 } | 1031 } |
| 1031 | 1032 |
| 1032 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} | 1033 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} |
| 1033 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 1034 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 1034 { | 1035 { |
| 1035 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 1036 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
| 1036 } | 1037 } |
| 1037 {% endfor %} | 1038 {% endfor %} |
| 1038 {% endif %} | 1039 {% endif %} |
| 1039 {% endblock %} | 1040 {% endblock %} |
| OLD | NEW |