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

Side by Side Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 77453002: IDL compiler: [CheckSecurity=Frame] interface + [DoNotCheckSecurity] members (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Other extended attribute combinations Created 7 years, 1 month 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 # 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 3317 matching lines...) Expand 10 before | Expand all | Expand 10 after
3328 $conditional4 = "if (${contextEnabledFunction}(impl->document()))\n "; 3328 $conditional4 = "if (${contextEnabledFunction}(impl->document()))\n ";
3329 } 3329 }
3330 $conditional8 = $conditional4 . " " if $conditional4 ne ""; 3330 $conditional8 = $conditional4 . " " if $conditional4 ne "";
3331 3331
3332 if ($interface->extendedAttributes->{"CheckSecurity"} && $attrExt->{"DoNotCh eckSecurity"}) { 3332 if ($interface->extendedAttributes->{"CheckSecurity"} && $attrExt->{"DoNotCh eckSecurity"}) {
3333 my $setter = $attrExt->{"ReadOnly"} ? "0" : "${implClassName}V8Internal: :${implClassName}DomainSafeFunctionSetter"; 3333 my $setter = $attrExt->{"ReadOnly"} ? "0" : "${implClassName}V8Internal: :${implClassName}DomainSafeFunctionSetter";
3334 # Functions that are marked DoNotCheckSecurity are always readable but i f they are changed 3334 # Functions that are marked DoNotCheckSecurity are always readable but i f they are changed
3335 # and then accessed on a different domain we do not return the underlyin g value but instead 3335 # and then accessed on a different domain we do not return the underlyin g value but instead
3336 # return a new copy of the original function. This is achieved by storin g the changed value 3336 # return a new copy of the original function. This is achieved by storin g the changed value
3337 # as hidden property. 3337 # as hidden property.
3338 $code .= <<END;
3339
3340 // $commentInfo
3341 END
3342 if ($function->extendedAttributes->{"PerWorldBindings"}) { 3338 if ($function->extendedAttributes->{"PerWorldBindings"}) {
3343 $code .= <<END; 3339 $code .= <<END;
3344 if (currentWorldType == MainWorld) { 3340 if (currentWorldType == MainWorld) {
3345 ${conditional8}$template->SetAccessor(v8::String::NewSymbol("$name"), ${ implClassName}V8Internal::${name}AttributeGetterCallbackForMainWorld, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_a ttributes)); 3341 ${conditional8}$template->SetAccessor(v8::String::NewSymbol("$name"), ${ implClassName}V8Internal::${name}AttributeGetterCallbackForMainWorld, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_a ttributes));
3346 } else { 3342 } else {
3347 ${conditional8}$template->SetAccessor(v8::String::NewSymbol("$name"), ${ implClassName}V8Internal::${name}AttributeGetterCallback, ${setter}, v8Undefined (), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes)); 3343 ${conditional8}$template->SetAccessor(v8::String::NewSymbol("$name"), ${ implClassName}V8Internal::${name}AttributeGetterCallback, ${setter}, v8Undefined (), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
3348 } 3344 }
3349 END 3345 END
3350 } else { 3346 } else {
3351 $code .= " ${conditional4}$template->SetAccessor(v8::String::NewS ymbol(\"$name\"), ${implClassName}V8Internal::${name}AttributeGetterCallback, ${ setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($pr operty_attributes));\n"; 3347 $code .= " ${conditional4}$template->SetAccessor(v8::String::NewS ymbol(\"$name\"), ${implClassName}V8Internal::${name}AttributeGetterCallback, ${ setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($pr operty_attributes));\n";
(...skipping 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after
6315 my $interface = shift; 6311 my $interface = shift;
6316 6312
6317 return 1 if $interface->extendedAttributes->{"CustomToV8"}; 6313 return 1 if $interface->extendedAttributes->{"CustomToV8"};
6318 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; 6314 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
6319 return 1 if InheritsInterface($interface, "Document"); 6315 return 1 if InheritsInterface($interface, "Document");
6320 6316
6321 return 0; 6317 return 0;
6322 } 6318 }
6323 6319
6324 1; 6320 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_interface.py » ('j') | Source/bindings/templates/interface.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698