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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Support runtime feature on templates Created 3 years, 6 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
OLDNEW
1 {% extends 'interface_base.cpp.tmpl' %} 1 {% extends 'interface_base.cpp.tmpl' %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% block indexed_property_getter %} 4 {% block indexed_property_getter %}
5 {% if indexed_property_getter and not indexed_property_getter.is_custom %} 5 {% if indexed_property_getter and not indexed_property_getter.is_custom %}
6 {% set getter = indexed_property_getter %} 6 {% set getter = indexed_property_getter %}
7 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) { 7 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) {
8 {% if getter.is_raises_exception %} 8 {% if getter.is_raises_exception %}
9 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedGette rContext, "{{interface_name}}"); 9 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedGette rContext, "{{interface_name}}");
10 {% endif %} 10 {% endif %}
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 } 913 }
914 914
915 {% endblock %} 915 {% endblock %}
916 916
917 917
918 {##############################################################################} 918 {##############################################################################}
919 {% block partial_interface %} 919 {% block partial_interface %}
920 {% if has_partial_interface %} 920 {% if has_partial_interface %}
921 {% if needs_runtime_enabled_installer %} 921 {% if needs_runtime_enabled_installer %}
922 InstallRuntimeEnabledFunction {{v8_class}}::install{{v8_class}}RuntimeEnabledFun ction = 922 InstallRuntimeEnabledFunction {{v8_class}}::install{{v8_class}}RuntimeEnabledFun ction =
923 &{{v8_class}}::installRuntimeEnabledFeatures; 923 &{{v8_class}}::InstallRuntimeEnabledFeatures;
924 InstallRuntimeEnabledOnTemplateFunction {{v8_class}}::install{{v8_class}}Runtime EnabledOnTemplateFunction =
925 &{{v8_class}}::InstallRuntimeEnabledFeaturesOnTemplate;
924 {% endif %} 926 {% endif %}
925 927
926 InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = 928 InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction =
927 &{{v8_class}}::install{{v8_class}}Template; 929 &{{v8_class}}::install{{v8_class}}Template;
928 930
929 void {{v8_class}}::updateWrapperTypeInfo( 931 void {{v8_class}}::updateWrapperTypeInfo(
930 InstallTemplateFunction installTemplateFunction, 932 InstallTemplateFunction installTemplateFunction,
931 InstallRuntimeEnabledFunction installRuntimeEnabledFunction, 933 InstallRuntimeEnabledFunction installRuntimeEnabledFunction,
934 InstallRuntimeEnabledOnTemplateFunction installRuntimeEnabledOnTemplateFunct ion,
932 PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjec tFunction) { 935 PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjec tFunction) {
933 ALLOW_UNUSED_LOCAL(installRuntimeEnabledFunction); 936 ALLOW_UNUSED_LOCAL(installRuntimeEnabledFunction);
934 937
935 {{v8_class}}::install{{v8_class}}TemplateFunction = 938 {{v8_class}}::install{{v8_class}}TemplateFunction =
936 installTemplateFunction; 939 installTemplateFunction;
937 {% if needs_runtime_enabled_installer %} 940 {% if needs_runtime_enabled_installer %}
938 CHECK(installRuntimeEnabledFunction); 941 CHECK(installRuntimeEnabledFunction);
942 CHECK(installRuntimeEnabledOnTemplateFunction);
939 {{v8_class}}::install{{v8_class}}RuntimeEnabledFunction = 943 {{v8_class}}::install{{v8_class}}RuntimeEnabledFunction =
940 installRuntimeEnabledFunction; 944 installRuntimeEnabledFunction;
945 {{v8_class}}::install{{v8_class}}RuntimeEnabledOnTemplateFunction =
946 installRuntimeEnabledOnTemplateFunction;
941 {% endif %} 947 {% endif %}
942 if (preparePrototypeAndInterfaceObjectFunction) { 948 if (preparePrototypeAndInterfaceObjectFunction) {
943 {{v8_class}}::wrapperTypeInfo.prepare_prototype_and_interface_object_functio n = 949 {{v8_class}}::wrapperTypeInfo.prepare_prototype_and_interface_object_functio n =
944 preparePrototypeAndInterfaceObjectFunction; 950 preparePrototypeAndInterfaceObjectFunction;
945 } 951 }
946 } 952 }
947 953
948 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 954 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
949 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { 955 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) {
950 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 956 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
951 } 957 }
952 958
953 {% endfor %} 959 {% endfor %}
954 {% endif %} 960 {% endif %}
955 {% endblock %} 961 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698