OLD | NEW |
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
5 # Copyright (C) 2006 Apple Computer, Inc. | 5 # Copyright (C) 2006 Apple Computer, Inc. |
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. | 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. |
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. | 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. |
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. | 10 # Copyright (C) 2012 Ericsson AB. All rights reserved. |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 $signature = "v8::Local<v8::Signature>()"; | 1155 $signature = "v8::Local<v8::Signature>()"; |
1156 } | 1156 } |
1157 | 1157 |
1158 my $newTemplateParams = "${implClassName}V8Internal::${funcName}MethodCallba
ck, v8Undefined(), $signature"; | 1158 my $newTemplateParams = "${implClassName}V8Internal::${funcName}MethodCallba
ck, v8Undefined(), $signature"; |
1159 | 1159 |
1160 AddToImplIncludes("bindings/v8/BindingSecurity.h"); | 1160 AddToImplIncludes("bindings/v8/BindingSecurity.h"); |
1161 $implementation{nameSpaceInternal}->add(<<END); | 1161 $implementation{nameSpaceInternal}->add(<<END); |
1162 static void ${funcName}AttributeGetter(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 1162 static void ${funcName}AttributeGetter(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
1163 { | 1163 { |
1164 // This is only for getting a unique pointer which we can pass to privateTem
plate. | 1164 // This is only for getting a unique pointer which we can pass to privateTem
plate. |
1165 static const char* privateTemplateUniqueKey = "${funcName}PrivateTemplate"; | 1165 static int privateTemplateUniqueKey; |
1166 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); | 1166 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); |
1167 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 1167 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
1168 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(cur
rentWorldType, &privateTemplateUniqueKey, $newTemplateParams, $functionLength); | 1168 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(cur
rentWorldType, &privateTemplateUniqueKey, $newTemplateParams, $functionLength); |
1169 | 1169 |
1170 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${
v8ClassName}::GetTemplate(info.GetIsolate(), currentWorldType)); | 1170 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${
v8ClassName}::GetTemplate(info.GetIsolate(), currentWorldType)); |
1171 if (holder.IsEmpty()) { | 1171 if (holder.IsEmpty()) { |
1172 // can only reach here by 'object.__proto__.func', and it should passed | 1172 // can only reach here by 'object.__proto__.func', and it should passed |
1173 // domain security check already | 1173 // domain security check already |
1174 v8SetReturnValue(info, privateTemplate->GetFunction()); | 1174 v8SetReturnValue(info, privateTemplate->GetFunction()); |
1175 return; | 1175 return; |
1176 } | 1176 } |
1177 ${implClassName}* imp = ${v8ClassName}::toNative(holder); | 1177 ${implClassName}* imp = ${v8ClassName}::toNative(holder); |
1178 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 1178 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
1179 static const char* sharedTemplateUniqueKey = "${funcName}SharedTemplate"
; | 1179 static int sharedTemplateUniqueKey; |
1180 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, $newTemplateParams, $functionLength)
; | 1180 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, $newTemplateParams, $functionLength)
; |
1181 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 1181 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
1182 return; | 1182 return; |
1183 } | 1183 } |
1184 | 1184 |
1185 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(name); | 1185 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(name); |
1186 if (!hiddenValue.IsEmpty()) { | 1186 if (!hiddenValue.IsEmpty()) { |
1187 v8SetReturnValue(info, hiddenValue); | 1187 v8SetReturnValue(info, hiddenValue); |
1188 return; | 1188 return; |
1189 } | 1189 } |
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 args.GetReturnValue().Set(wrapper); | 2960 args.GetReturnValue().Set(wrapper); |
2961 } | 2961 } |
2962 | 2962 |
2963 END | 2963 END |
2964 $implementation{nameSpaceWebCore}->add($code); | 2964 $implementation{nameSpaceWebCore}->add($code); |
2965 | 2965 |
2966 $code = <<END; | 2966 $code = <<END; |
2967 v8::Handle<v8::FunctionTemplate> ${v8ClassName}Constructor::GetTemplate(v8::Isol
ate* isolate, WrapperWorldType currentWorldType) | 2967 v8::Handle<v8::FunctionTemplate> ${v8ClassName}Constructor::GetTemplate(v8::Isol
ate* isolate, WrapperWorldType currentWorldType) |
2968 { | 2968 { |
2969 // This is only for getting a unique pointer which we can pass to privateTem
plate. | 2969 // This is only for getting a unique pointer which we can pass to privateTem
plate. |
2970 static const char* privateTemplateUniqueKey = "${v8ClassName}Constructor::Ge
tTemplatePrivateTemplate"; | 2970 static int privateTemplateUniqueKey; |
2971 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 2971 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
2972 v8::Handle<v8::FunctionTemplate> result = data->privateTemplateIfExists(curr
entWorldType, &privateTemplateUniqueKey); | 2972 v8::Handle<v8::FunctionTemplate> result = data->privateTemplateIfExists(curr
entWorldType, &privateTemplateUniqueKey); |
2973 if (!result.IsEmpty()) | 2973 if (!result.IsEmpty()) |
2974 return result; | 2974 return result; |
2975 | 2975 |
2976 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink\", \"BuildDOMTemplate"); | 2976 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink\", \"BuildDOMTemplate"); |
2977 v8::HandleScope scope(isolate); | 2977 v8::HandleScope scope(isolate); |
2978 result = v8::FunctionTemplate::New(${v8ClassName}ConstructorCallback); | 2978 result = v8::FunctionTemplate::New(${v8ClassName}ConstructorCallback); |
2979 | 2979 |
2980 v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); | 2980 v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); |
(...skipping 3222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6203 my $interface = shift; | 6203 my $interface = shift; |
6204 | 6204 |
6205 return 1 if $interface->extendedAttributes->{"CustomToV8"}; | 6205 return 1 if $interface->extendedAttributes->{"CustomToV8"}; |
6206 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; | 6206 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; |
6207 return 1 if InheritsInterface($interface, "Document"); | 6207 return 1 if InheritsInterface($interface, "Document"); |
6208 | 6208 |
6209 return 0; | 6209 return 0; |
6210 } | 6210 } |
6211 | 6211 |
6212 1; | 6212 1; |
OLD | NEW |