OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro attribute_getter(attribute, world_suffix) %} | 2 {% macro attribute_getter(attribute, world_suffix) %} |
3 {% filter conditional(attribute.conditional_string) %} | 3 {% filter conditional(attribute.conditional_string) %} |
4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
5 {%- if attribute.is_expose_js_accessors %} | 5 {%- if attribute.is_expose_js_accessors %} |
6 const v8::FunctionCallbackInfo<v8::Value>& info | 6 const v8::FunctionCallbackInfo<v8::Value>& info |
7 {%- else %} | 7 {%- else %} |
8 const v8::PropertyCallbackInfo<v8::Value>& info | 8 const v8::PropertyCallbackInfo<v8::Value>& info |
9 {%- endif %}) | 9 {%- endif %}) |
10 { | 10 { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 356 |
357 ScriptState::Scope scope(scriptState); | 357 ScriptState::Scope scope(scriptState); |
358 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 358 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
359 | 359 |
360 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); | 360 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); |
361 v8::TryCatch block; | 361 v8::TryCatch block; |
362 V8RethrowTryCatchScope rethrow(block); | 362 V8RethrowTryCatchScope rethrow(block); |
363 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "{{cpp_class}}", "{{attribute.name}}", holder); | 363 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "{{cpp_class}}", "{{attribute.name}}", holder); |
364 if (block.HasCaught()) { | 364 if (block.HasCaught()) { |
365 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 365 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
366 // FIXME: We should support exceptions other than DOM exceptions. | 366 // FIXME: We should support more exceptions. |
367 RELEASE_ASSERT_NOT_REACHED(); | 367 RELEASE_ASSERT_NOT_REACHED(); |
368 } | 368 } |
369 return false; | 369 return false; |
370 } | 370 } |
371 {{attribute.private_script_v8_value_to_local_cpp_value}}; | 371 {{attribute.private_script_v8_value_to_local_cpp_value}}; |
372 RELEASE_ASSERT(!exceptionState.hadException()); | 372 RELEASE_ASSERT(!exceptionState.hadException()); |
373 *result = cppValue; | 373 *result = cppValue; |
374 return true; | 374 return true; |
375 } | 375 } |
376 {% endmacro %} | 376 {% endmacro %} |
(...skipping 15 matching lines...) Expand all Loading... |
392 | 392 |
393 ScriptState::Scope scope(scriptState); | 393 ScriptState::Scope scope(scriptState); |
394 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 394 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
395 | 395 |
396 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); | 396 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); |
397 v8::TryCatch block; | 397 v8::TryCatch block; |
398 V8RethrowTryCatchScope rethrow(block); | 398 V8RethrowTryCatchScope rethrow(block); |
399 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{
attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}}); | 399 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{
attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}}); |
400 if (block.HasCaught()) { | 400 if (block.HasCaught()) { |
401 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 401 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
402 // FIXME: We should support exceptions other than DOM exceptions. | 402 // FIXME: We should support more exceptions. |
403 RELEASE_ASSERT_NOT_REACHED(); | 403 RELEASE_ASSERT_NOT_REACHED(); |
404 } | 404 } |
405 return false; | 405 return false; |
406 } | 406 } |
407 return true; | 407 return true; |
408 } | 408 } |
409 {% endmacro %} | 409 {% endmacro %} |
OLD | NEW |