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

Side by Side Diff: Source/bindings/templates/attributes.cpp

Issue 394773003: Implement HTMLMarqueeElement's animation in private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 {% endfilter %} 338 {% endfilter %}
339 {% endmacro %} 339 {% endmacro %}
340 340
341 341
342 {##############################################################################} 342 {##############################################################################}
343 {% macro attribute_getter_implemented_in_private_script(attribute) %} 343 {% macro attribute_getter_implemented_in_private_script(attribute) %}
344 bool {{v8_class}}::{{attribute.name}}AttributeGetterImplementedInPrivateScript(L ocalFrame* frame, {{cpp_class}}* holderImpl, {{attribute.cpp_type}}* result) 344 bool {{v8_class}}::{{attribute.name}}AttributeGetterImplementedInPrivateScript(L ocalFrame* frame, {{cpp_class}}* holderImpl, {{attribute.cpp_type}}* result)
345 { 345 {
346 if (!frame) 346 if (!frame)
347 return false; 347 return false;
348 v8::HandleScope handleScope(toIsolate(frame));
348 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 349 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
349 if (context.IsEmpty()) 350 if (context.IsEmpty())
350 return false; 351 return false;
351 ScriptState* scriptState = ScriptState::from(context); 352 ScriptState* scriptState = ScriptState::from(context);
352 if (!scriptState->executionContext()) 353 if (!scriptState->executionContext())
353 return false; 354 return false;
354 355
355 ScriptState::Scope scope(scriptState); 356 ScriptState::Scope scope(scriptState);
356 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 357 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
357 358
(...skipping 14 matching lines...) Expand all
372 return true; 373 return true;
373 } 374 }
374 {% endmacro %} 375 {% endmacro %}
375 376
376 377
377 {% macro attribute_setter_implemented_in_private_script(attribute) %} 378 {% macro attribute_setter_implemented_in_private_script(attribute) %}
378 bool {{v8_class}}::{{attribute.name}}AttributeSetterImplementedInPrivateScript(L ocalFrame* frame, {{cpp_class}}* holderImpl, {{attribute.argument_cpp_type}} cpp Value) 379 bool {{v8_class}}::{{attribute.name}}AttributeSetterImplementedInPrivateScript(L ocalFrame* frame, {{cpp_class}}* holderImpl, {{attribute.argument_cpp_type}} cpp Value)
379 { 380 {
380 if (!frame) 381 if (!frame)
381 return false; 382 return false;
383 v8::HandleScope handleScope(toIsolate(frame));
382 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 384 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
383 if (context.IsEmpty()) 385 if (context.IsEmpty())
384 return false; 386 return false;
385 ScriptState* scriptState = ScriptState::from(context); 387 ScriptState* scriptState = ScriptState::from(context);
386 if (!scriptState->executionContext()) 388 if (!scriptState->executionContext())
387 return false; 389 return false;
388 390
389 ScriptState::Scope scope(scriptState); 391 ScriptState::Scope scope(scriptState);
390 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 392 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
391 393
392 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate() ); 394 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate() );
393 v8::TryCatch block; 395 v8::TryCatch block;
394 V8RethrowTryCatchScope rethrow(block); 396 V8RethrowTryCatchScope rethrow(block);
395 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{ attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}}); 397 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{ attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}});
396 if (block.HasCaught()) { 398 if (block.HasCaught()) {
397 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 399 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
398 // FIXME: We should support exceptions other than DOM exceptions. 400 // FIXME: We should support exceptions other than DOM exceptions.
399 RELEASE_ASSERT_NOT_REACHED(); 401 RELEASE_ASSERT_NOT_REACHED();
400 } 402 }
401 return false; 403 return false;
402 } 404 }
403 return true; 405 return true;
404 } 406 }
405 {% endmacro %} 407 {% endmacro %}
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/methods.cpp » ('j') | Source/core/html/HTMLMarqueeElement.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698