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

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

Issue 18789002: Implement Custom Elements' attributeChangedCallback. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Sync to tip. Created 7 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 # 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 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 sub GenerateReplaceableAttrSetterCallback 1642 sub GenerateReplaceableAttrSetterCallback
1643 { 1643 {
1644 my $interface = shift; 1644 my $interface = shift;
1645 my $implClassName = GetImplName($interface); 1645 my $implClassName = GetImplName($interface);
1646 1646
1647 my $code = ""; 1647 my $code = "";
1648 $code .= "static void ${implClassName}ReplaceableAttrSetterCallback(v8::Loca l<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v oid>& info)\n"; 1648 $code .= "static void ${implClassName}ReplaceableAttrSetterCallback(v8::Loca l<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v oid>& info)\n";
1649 $code .= "{\n"; 1649 $code .= "{\n";
1650 $code .= GenerateFeatureObservation($interface->extendedAttributes->{"Measur eAs"}); 1650 $code .= GenerateFeatureObservation($interface->extendedAttributes->{"Measur eAs"});
1651 $code .= GenerateDeprecationNotification($interface->extendedAttributes->{"D eprecateAs"}); 1651 $code .= GenerateDeprecationNotification($interface->extendedAttributes->{"D eprecateAs"});
1652 $code .= GenerateCustomElementInvocationScopeIfNeeded($interface->extendedAt tributes);
1652 if (HasActivityLogging("", $interface->extendedAttributes, "Setter")) { 1653 if (HasActivityLogging("", $interface->extendedAttributes, "Setter")) {
1653 die "IDL error: ActivityLog attribute cannot exist on a ReplacableAttrS etterCallback"; 1654 die "IDL error: ActivityLog attribute cannot exist on a ReplacableAttrS etterCallback";
1654 } 1655 }
1655 $code .= " ${implClassName}V8Internal::${implClassName}ReplaceableAttrSet ter(name, value, info);\n"; 1656 $code .= " ${implClassName}V8Internal::${implClassName}ReplaceableAttrSet ter(name, value, info);\n";
1656 $code .= "}\n\n"; 1657 $code .= "}\n\n";
1657 $implementation{nameSpaceInternal}->add($code); 1658 $implementation{nameSpaceInternal}->add($code);
1658 } 1659 }
1659 1660
1660 sub GenerateReplaceableAttrSetter 1661 sub GenerateReplaceableAttrSetter
1661 { 1662 {
(...skipping 23 matching lines...) Expand all
1685 1686
1686 END 1687 END
1687 $implementation{nameSpaceInternal}->add($code); 1688 $implementation{nameSpaceInternal}->add($code);
1688 } 1689 }
1689 1690
1690 sub GenerateCustomElementInvocationScopeIfNeeded 1691 sub GenerateCustomElementInvocationScopeIfNeeded
1691 { 1692 {
1692 my $code = ""; 1693 my $code = "";
1693 my $ext = shift; 1694 my $ext = shift;
1694 1695
1695 if ($ext->{"DeliverCustomElementCallbacks"}) { 1696 if ($ext->{"DeliverCustomElementCallbacks"} or $ext->{"Reflect"}) {
1696 if ($ext->{"Reflect"}) {
1697 die "IDL error: [Reflect] and [DeliverCustomElementCallbacks] cannot coexist yet";
1698 }
1699
1700 AddToImplIncludes("core/dom/CustomElementCallbackDispatcher.h"); 1697 AddToImplIncludes("core/dom/CustomElementCallbackDispatcher.h");
1701 $code .= <<END; 1698 $code .= <<END;
1702 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 1699 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1703 END 1700 END
1704 } 1701 }
1705 return $code; 1702 return $code;
1706 } 1703 }
1707 1704
1708 sub GenerateNormalAttrSetterCallback 1705 sub GenerateNormalAttrSetterCallback
1709 { 1706 {
(...skipping 13 matching lines...) Expand all
1723 $code .= "static void ${attrName}AttrSetterCallback${forMainWorldSuffix}(v8: :Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackI nfo<void>& info)\n"; 1720 $code .= "static void ${attrName}AttrSetterCallback${forMainWorldSuffix}(v8: :Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackI nfo<void>& info)\n";
1724 $code .= "{\n"; 1721 $code .= "{\n";
1725 if (!$attrExt->{"PerWorldBindings"}) { 1722 if (!$attrExt->{"PerWorldBindings"}) {
1726 $code .= " TRACE_EVENT_SET_SAMPLING_STATE(\"Blink\", \"DOMMethod\");\ n"; 1723 $code .= " TRACE_EVENT_SET_SAMPLING_STATE(\"Blink\", \"DOMMethod\");\ n";
1727 } 1724 }
1728 $code .= GenerateFeatureObservation($attrExt->{"MeasureAs"}); 1725 $code .= GenerateFeatureObservation($attrExt->{"MeasureAs"});
1729 $code .= GenerateDeprecationNotification($attrExt->{"DeprecateAs"}); 1726 $code .= GenerateDeprecationNotification($attrExt->{"DeprecateAs"});
1730 if (HasActivityLogging($forMainWorldSuffix, $attrExt, "Setter")) { 1727 if (HasActivityLogging($forMainWorldSuffix, $attrExt, "Setter")) {
1731 $code .= GenerateActivityLogging("Setter", $interface, "${attrName}"); 1728 $code .= GenerateActivityLogging("Setter", $interface, "${attrName}");
1732 } 1729 }
1730 $code .= GenerateCustomElementInvocationScopeIfNeeded($attrExt);
1733 if (HasCustomSetter($attrExt)) { 1731 if (HasCustomSetter($attrExt)) {
1734 $code .= " ${v8ClassName}::${attrName}AttrSetterCustom(name, value, i nfo);\n"; 1732 $code .= " ${v8ClassName}::${attrName}AttrSetterCustom(name, value, i nfo);\n";
1735 } else { 1733 } else {
1736 $code .= " ${implClassName}V8Internal::${attrName}AttrSetter${forMain WorldSuffix}(name, value, info);\n"; 1734 $code .= " ${implClassName}V8Internal::${attrName}AttrSetter${forMain WorldSuffix}(name, value, info);\n";
1737 } 1735 }
1738 if (!$attrExt->{"PerWorldBindings"}) { 1736 if (!$attrExt->{"PerWorldBindings"}) {
1739 $code .= " TRACE_EVENT_SET_SAMPLING_STATE(\"V8\", \"Execution\");\n"; 1737 $code .= " TRACE_EVENT_SET_SAMPLING_STATE(\"V8\", \"Execution\");\n";
1740 } 1738 }
1741 $code .= "}\n\n"; 1739 $code .= "}\n\n";
1742 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; 1740 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString;
(...skipping 4286 matching lines...) Expand 10 before | Expand all | Expand 10 after
6029 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 6027 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
6030 $found = 1; 6028 $found = 1;
6031 } 6029 }
6032 return 1 if $found; 6030 return 1 if $found;
6033 }, 0); 6031 }, 0);
6034 6032
6035 return $found; 6033 return $found;
6036 } 6034 }
6037 6035
6038 1; 6036 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698