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

Side by Side Diff: sky/engine/bindings/templates/interface.cpp

Issue 867903002: Remove UseCounter (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/bindings/templates/attributes.cpp ('k') | sky/engine/bindings/templates/methods.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% extends 'interface_base.cpp' %} 1 {% extends 'interface_base.cpp' %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% block constructor_getter %} 5 {% block constructor_getter %}
6 {% if has_constructor_attributes %} 6 {% if has_constructor_attributes %}
7 static void {{cpp_class}}ConstructorGetter(v8::Local<v8::String>, const v8::Prop ertyCallbackInfo<v8::Value>& info) 7 static void {{cpp_class}}ConstructorGetter(v8::Local<v8::String>, const v8::Prop ertyCallbackInfo<v8::Value>& info)
8 { 8 {
9 v8::Handle<v8::Value> data = info.Data(); 9 v8::Handle<v8::Value> data = info.Data();
10 ASSERT(data->IsExternal()); 10 ASSERT(data->IsExternal());
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? Str ing("{{interface_name}}") : forEventName, "", exceptionState); 718 Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? Str ing("{{interface_name}}") : forEventName, "", exceptionState);
719 {% if parent_interface %}{# any Event interface except Event itself #} 719 {% if parent_interface %}{# any Event interface except Event itself #}
720 if (!initialize{{parent_interface}}(eventInit, options, exceptionState, info , forEventName.isEmpty() ? String("{{interface_name}}") : forEventName)) 720 if (!initialize{{parent_interface}}(eventInit, options, exceptionState, info , forEventName.isEmpty() ? String("{{interface_name}}") : forEventName))
721 return false; 721 return false;
722 722
723 {% endif %} 723 {% endif %}
724 {% for attribute in attributes 724 {% for attribute in attributes
725 if (attribute.is_initialized_by_event_constructor and 725 if (attribute.is_initialized_by_event_constructor and
726 not attribute.idl_type == 'any')%} 726 not attribute.idl_type == 'any')%}
727 {% set is_nullable = 'true' if attribute.is_nullable else 'false' %} 727 {% set is_nullable = 'true' if attribute.is_nullable else 'false' %}
728 {% if attribute.deprecate_as %}
729 if (DictionaryHelper::convert(options, conversionContext.setConversionType(" {{attribute.idl_type}}", {{is_nullable}}), "{{attribute.name}}", eventInit.{{att ribute.cpp_name}})) {
730 if (options.hasProperty("{{attribute.name}}"))
731 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate ()), UseCounter::{{attribute.deprecate_as}});
732 } else {
733 return false;
734 }
735 {% else %}
736 if (!DictionaryHelper::convert(options, conversionContext.setConversionType( "{{attribute.idl_type}}", {{is_nullable}}), "{{attribute.name}}", eventInit.{{at tribute.cpp_name}})) 728 if (!DictionaryHelper::convert(options, conversionContext.setConversionType( "{{attribute.idl_type}}", {{is_nullable}}), "{{attribute.name}}", eventInit.{{at tribute.cpp_name}}))
737 return false; 729 return false;
738 {% endif %}
739 {% endfor %} 730 {% endfor %}
740 return true; 731 return true;
741 } 732 }
742 733
743 {% endif %} 734 {% endif %}
744 {% endblock %} 735 {% endblock %}
745 736
746 737
747 {##############################################################################} 738 {##############################################################################}
748 {% block constructor_callback %} 739 {% block constructor_callback %}
749 {% if constructors or has_custom_constructor or has_event_constructor %} 740 {% if constructors or has_custom_constructor or has_event_constructor %}
750 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 741 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
751 { 742 {
752 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); 743 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor");
753 {% if measure_as %}
754 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ measure_as}});
755 {% endif %}
756 if (!info.IsConstructCall()) { 744 if (!info.IsConstructCall()) {
757 V8ThrowException::throwTypeError(ExceptionMessages::constructorNotCallab leAsFunction("{{interface_name}}"), info.GetIsolate()); 745 V8ThrowException::throwTypeError(ExceptionMessages::constructorNotCallab leAsFunction("{{interface_name}}"), info.GetIsolate());
758 return; 746 return;
759 } 747 }
760 748
761 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis tingObject) { 749 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis tingObject) {
762 v8SetReturnValue(info, info.Holder()); 750 v8SetReturnValue(info, info.Holder());
763 return; 751 return;
764 } 752 }
765 753
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 fromInternalPointer(internalPointer)->deref(); 1187 fromInternalPointer(internalPointer)->deref();
1200 } 1188 }
1201 1189
1202 template<> 1190 template<>
1203 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1191 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1204 { 1192 {
1205 return toV8(impl, creationContext, isolate); 1193 return toV8(impl, creationContext, isolate);
1206 } 1194 }
1207 1195
1208 {% endblock %} 1196 {% endblock %}
OLDNEW
« no previous file with comments | « sky/engine/bindings/templates/attributes.cpp ('k') | sky/engine/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698