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

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

Issue 330293002: Removing unnecessary PerWorldBindings for DOM API calls that are monitored by Activity Logger. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: style Created 6 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 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 7fd53925f10121c5d332e1419cbaa8b195eb6cb6..ebcf7e75a8d9f0834c815545643c97f5c2f4018f 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -165,8 +165,13 @@ v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info
UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as}});
{% endif %}
{% if world_suffix in attribute.activity_logging_world_list_for_getter %}
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
+ ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext());
+ V8PerContextData* contextData = scriptState->perContextData();
+ {% if attribute.activity_logging_world_check %}
+ if (contextData && contextData->activityLogger() && scriptState->world().isIsolatedWorld())
+ {% else %}
if (contextData && contextData->activityLogger())
+ {% endif %}
contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute.name}}");
{% endif %}
{% if attribute.has_custom_getter %}
@@ -313,8 +318,13 @@ v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackI
UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as}});
{% endif %}
{% if world_suffix in attribute.activity_logging_world_list_for_setter %}
- V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
+ ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext());
+ V8PerContextData* contextData = scriptState->perContextData();
+ {% if attribute.activity_logging_world_check %}
+ if (contextData && contextData->activityLogger() && scriptState->world().isIsolatedWorld()) {
+ {% else %}
if (contextData && contextData->activityLogger()) {
+ {% endif %}
{% if attribute.activity_logging_include_old_value_for_setter %}
{{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder());
{% if attribute.cpp_value_original %}

Powered by Google App Engine
This is Rietveld 408576698