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

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

Issue 140663012: IDL compiler: Window-specific code + Window-only features (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 10 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
Index: Source/bindings/templates/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index d45d9ab1974094886a9467227929097646bf5bf6..3c2a608f765f35a1fd9cf5e4b535dbb1eea98eb4 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -278,13 +278,16 @@ static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall
{% macro origin_safe_method_getter(method, world_suffix) %}
static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::PropertyCallbackInfo<v8::Value>& info)
{
+ {% set signature = 'v8::Local<v8::Signature>()'
+ if method.is_do_not_check_signature else
+ 'v8::Signature::New(info.GetIsolate(), %s::domTemplate(info.GetIsolate(), currentWorldType))' % v8_class %}
{# FIXME: don't call GetIsolate() so often #}
// This is only for getting a unique pointer which we can pass to privateTemplate.
static int privateTemplateUniqueKey;
WrapperWorldType currentWorldType = worldType(info.GetIsolate());
V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
{# FIXME: 1 case of [DoNotCheckSignature] in Window.idl may differ #}
- v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), v8::Signature::New(info.GetIsolate(), {{v8_class}}::domTemplate(info.GetIsolate(), currentWorldType)), {{method.number_of_required_or_variadic_arguments}});
+ v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), {{signature}}, {{method.number_of_required_or_variadic_arguments}});
v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class}}::domTemplate(info.GetIsolate(), currentWorldType));
if (holder.IsEmpty()) {
@@ -296,7 +299,7 @@ static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop
{{cpp_class}}* imp = {{v8_class}}::toNative(holder);
if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), DoNotReportSecurityError)) {
static int sharedTemplateUniqueKey;
- v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), v8::Signature::New(info.GetIsolate(), {{v8_class}}::domTemplate(info.GetIsolate(), currentWorldType)), {{method.number_of_required_or_variadic_arguments}});
+ v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), {{signature}}, {{method.number_of_required_or_variadic_arguments}});
v8SetReturnValue(info, sharedTemplate->GetFunction());
return;
}
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/idls/TestInterfaceCheckSecurity.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698