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

Unified Diff: Source/bindings/templates/attributes.cpp

Issue 618373003: [bindings] partial interfaces should not violate componentization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed http/tests/serviceworker/fetch\* regression 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/templates/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index 0c2875bc49cbd8be2c352e946d9df93409183d10..c2551986bd644f208c800dc6e379472ceb9bb2f5 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -165,8 +165,12 @@ v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info
{% if attribute.has_custom_getter %}
{{v8_class}}::{{attribute.name}}AttributeGetterCustom(info);
{% else %}
+ {% if is_partial %}
+ {{cpp_class}}PartialV8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(info);
+ {% else %}
{{cpp_class}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(info);
{% endif %}
+ {% endif %}
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
{% endfilter %}
@@ -185,7 +189,11 @@ static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca
{% if attribute.measure_as %}
UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as}});
{% endif %}
+ {% if is_partial %}
+ {{cpp_class}}PartialV8Internal::{{cpp_class}}ConstructorGetter{{world_suffix}}(property, info);
haraken 2014/10/09 04:24:00 Is it possible that a partial interface has a cons
tasak 2014/10/10 07:52:23 This code is used for ServiceWorker, i.e.: partia
+ {% else %}
{{cpp_class}}V8Internal::{{cpp_class}}ConstructorGetter{{world_suffix}}(property, info);
+ {% endif %}
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
{% endfilter %}
@@ -322,8 +330,12 @@ v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackI
{% if attribute.has_custom_setter %}
{{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info);
{% else %}
+ {% if is_partial %}
+ {{cpp_class}}PartialV8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v8Value, info);
+ {% else %}
{{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v8Value, info);
{% endif %}
+ {% endif %}
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
{% endfilter %}
@@ -387,22 +399,23 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame*
{##############################################################################}
{% macro attribute_configuration(attribute) %}
+{% set empty_or_partial = '' if not is_partial else 'Partial' %}
haraken 2014/10/09 04:24:00 As commented in another place, we want to avoid cr
tasak 2014/10/10 07:52:23 Done. Added "acutal_cpp_class" and "actual_v8_clas
{% set getter_callback =
- '%sV8Internal::%sAttributeGetterCallback' %
- (cpp_class, attribute.name)
+ '%s%sV8Internal::%sAttributeGetterCallback' %
+ (cpp_class, empty_or_partial, attribute.name)
if not attribute.constructor_type else
- ('%sV8Internal::%sConstructorGetterCallback' %
- (cpp_class, attribute.name)
+ ('%s%sV8Internal::%sConstructorGetterCallback' %
+ (cpp_class, empty_or_partial, attribute.name)
if attribute.needs_constructor_getter_callback else
- '{0}V8Internal::{0}ConstructorGetter'.format(cpp_class)) %}
+ '%s%sV8Internal::%sConstructorGetter' % (cpp_class, empty_or_partial, cpp_class)) %}
{% set getter_callback_for_main_world =
- '%sV8Internal::%sAttributeGetterCallbackForMainWorld' %
- (cpp_class, attribute.name)
+ '%s%sV8Internal::%sAttributeGetterCallbackForMainWorld' %
+ (cpp_class, empty_or_partial, attribute.name)
if attribute.is_per_world_bindings else '0' %}
{% set setter_callback = attribute.setter_callback %}
{% set setter_callback_for_main_world =
- '%sV8Internal::%sAttributeSetterCallbackForMainWorld' %
- (cpp_class, attribute.name)
+ '%s%sV8Internal::%sAttributeSetterCallbackForMainWorld' %
+ (cpp_class, empty_or_partial, attribute.name)
if attribute.is_per_world_bindings and
(not attribute.is_read_only or attribute.put_forwards) else '0' %}
{% set wrapper_type_info =

Powered by Google App Engine
This is Rietveld 408576698