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

Side by Side Diff: Source/bindings/templates/interface.cpp

Issue 656693002: Don't count UseCounters in private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/bindings/templates/constants.cpp ('k') | Source/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 security_check_functions %} 5 {% block security_check_functions %}
6 {% if has_access_check_callbacks %} 6 {% if has_access_check_callbacks %}
7 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access Type type, v8::Local<v8::Value>) 7 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access Type type, v8::Local<v8::Value>)
8 { 8 {
9 {{cpp_class}}* impl = {{v8_class}}::toImpl(host); 9 {{cpp_class}}* impl = {{v8_class}}::toImpl(host);
10 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError); 10 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError);
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 return false; 644 return false;
645 645
646 {% endif %} 646 {% endif %}
647 {% for attribute in attributes 647 {% for attribute in attributes
648 if (attribute.is_initialized_by_event_constructor and 648 if (attribute.is_initialized_by_event_constructor and
649 not attribute.idl_type == 'any')%} 649 not attribute.idl_type == 'any')%}
650 {% set is_nullable = 'true' if attribute.is_nullable else 'false' %} 650 {% set is_nullable = 'true' if attribute.is_nullable else 'false' %}
651 {% if attribute.deprecate_as %} 651 {% if attribute.deprecate_as %}
652 if (DictionaryHelper::convert(options, conversionContext.setConversionType(" {{attribute.idl_type}}", {{is_nullable}}), "{{attribute.name}}", eventInit.{{att ribute.cpp_name}})) { 652 if (DictionaryHelper::convert(options, conversionContext.setConversionType(" {{attribute.idl_type}}", {{is_nullable}}), "{{attribute.name}}", eventInit.{{att ribute.cpp_name}})) {
653 if (options.hasProperty("{{attribute.name}}")) 653 if (options.hasProperty("{{attribute.name}}"))
654 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate ()), UseCounter::{{attribute.deprecate_as}}); 654 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), ca llingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}} );
655 } else { 655 } else {
656 return false; 656 return false;
657 } 657 }
658 {% else %} 658 {% else %}
659 if (!DictionaryHelper::convert(options, conversionContext.setConversionType( "{{attribute.idl_type}}", {{is_nullable}}), "{{attribute.name}}", eventInit.{{at tribute.cpp_name}})) 659 if (!DictionaryHelper::convert(options, conversionContext.setConversionType( "{{attribute.idl_type}}", {{is_nullable}}), "{{attribute.name}}", eventInit.{{at tribute.cpp_name}}))
660 return false; 660 return false;
661 {% endif %} 661 {% endif %}
662 {% endfor %} 662 {% endfor %}
663 return true; 663 return true;
664 } 664 }
665 665
666 {% endif %} 666 {% endif %}
667 {% endblock %} 667 {% endblock %}
668 668
669 669
670 {##############################################################################} 670 {##############################################################################}
671 {% block constructor_callback %} 671 {% block constructor_callback %}
672 {% if constructors or has_custom_constructor or has_event_constructor %} 672 {% if constructors or has_custom_constructor or has_event_constructor %}
673 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 673 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
674 { 674 {
675 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); 675 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor");
676 {% if measure_as %} 676 {% if measure_as %}
677 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ measure_as}}); 677 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{measure_as}});
678 {% endif %} 678 {% endif %}
679 if (!info.IsConstructCall()) { 679 if (!info.IsConstructCall()) {
680 V8ThrowException::throwTypeError(ExceptionMessages::constructorNotCallab leAsFunction("{{interface_name}}"), info.GetIsolate()); 680 V8ThrowException::throwTypeError(ExceptionMessages::constructorNotCallab leAsFunction("{{interface_name}}"), info.GetIsolate());
681 return; 681 return;
682 } 682 }
683 683
684 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis tingObject) { 684 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis tingObject) {
685 v8SetReturnValue(info, info.Holder()); 685 v8SetReturnValue(info, info.Holder());
686 return; 686 return;
687 } 687 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 {% endif %} 960 {% endif %}
961 } 961 }
962 962
963 template<> 963 template<>
964 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 964 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
965 { 965 {
966 return toV8(impl, creationContext, isolate); 966 return toV8(impl, creationContext, isolate);
967 } 967 }
968 968
969 {% endblock %} 969 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/constants.cpp ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698