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

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

Issue 419163004: Add HandleScopes and ScriptForbiddenScope::AllowUserAgentScript to 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 generate_method(method, world_suffix) %} 2 {% macro generate_method(method, world_suffix) %}
3 {% filter conditional(method.conditional_string) %} 3 {% filter conditional(method.conditional_string) %}
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
5 { 5 {
6 {# Local variables #} 6 {# Local variables #}
7 {% if method.has_exception_state %} 7 {% if method.has_exception_state %}
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
9 {% endif %} 9 {% endif %}
10 {# Overloaded methods have length checked during overload resolution #} 10 {# Overloaded methods have length checked during overload resolution #}
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 497 }
498 {% endmacro %} 498 {% endmacro %}
499 499
500 500
501 {##############################################################################} 501 {##############################################################################}
502 {% macro method_implemented_in_private_script(method) %} 502 {% macro method_implemented_in_private_script(method) %}
503 bool {{v8_class}}::{{method.name}}MethodImplementedInPrivateScript({{method.argu ment_declarations_for_private_script | join(', ')}}) 503 bool {{v8_class}}::{{method.name}}MethodImplementedInPrivateScript({{method.argu ment_declarations_for_private_script | join(', ')}})
504 { 504 {
505 if (!frame) 505 if (!frame)
506 return false; 506 return false;
507 v8::HandleScope handleScope(toIsolate(frame));
508 ScriptForbiddenScope::AllowUserAgentScript script;
507 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 509 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
508 if (context.IsEmpty()) 510 if (context.IsEmpty())
509 return false; 511 return false;
510 ScriptState* scriptState = ScriptState::from(context); 512 ScriptState* scriptState = ScriptState::from(context);
511 if (!scriptState->executionContext()) 513 if (!scriptState->executionContext())
512 return false; 514 return false;
513 515
514 ScriptState::Scope scope(scriptState); 516 ScriptState::Scope scope(scriptState);
515 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 517 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
516 518
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIsolate ()); 595 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIsolate ());
594 {% else %} 596 {% else %}
595 {% set constructor_class = v8_class + ('Constructor' 597 {% set constructor_class = v8_class + ('Constructor'
596 if constructor.is_named_constructor else 598 if constructor.is_named_constructor else
597 '') %} 599 '') %}
598 v8::Handle<v8::Object> wrapper = info.Holder(); 600 v8::Handle<v8::Object> wrapper = info.Holder();
599 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr uctor_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configurat ion}}); 601 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr uctor_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configurat ion}});
600 {% endif %} 602 {% endif %}
601 v8SetReturnValue(info, wrapper); 603 v8SetReturnValue(info, wrapper);
602 {% endmacro %} 604 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698