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

Unified Diff: Source/bindings/core/v8/V8Binding.cpp

Issue 978233002: bindings,devtools: Shows DOM attributes' values in DevTools. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/core/v8/V8Binding.cpp
diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp
index 9d52428fd65061187f4d4bac23574645fca3a314..38112e38fa7126b5985f4a00a46d03817f6c3125 100644
--- a/Source/bindings/core/v8/V8Binding.cpp
+++ b/Source/bindings/core/v8/V8Binding.cpp
@@ -1055,6 +1055,43 @@ PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
return InspectorFunctionCallEvent::data(context, info.scriptId(), info.resourceName(), info.lineNumber());
}
+bool AttributesWithObservableSideEffectOnGet::hasNoSideEffect(v8::Isolate* isolate, v8::Handle<v8::Value> domObject, v8::Handle<v8::Value> attributeName)
+{
+ if (!V8DOMWrapper::isWrapper(isolate, domObject))
+ return false;
+ const WrapperTypeInfo* wrapperTypeInfo =
+ toWrapperTypeInfo(v8::Handle<v8::Object>::Cast(domObject));
+
+ if (attributeName.IsEmpty() || !attributeName->IsString())
+ return false;
+ String attribute = V8StringResource<>(attributeName);
+
+ if (!wrapperTypeInfo || attribute.isEmpty())
+ return false;
+
+ for (const auto& entry : *attributesWithSideEffectOnGet()) {
+ if (wrapperTypeInfo->isSubclass(entry.first)
+ && attribute == entry.second)
+ return false;
+ }
+
+ return true;
+}
+
+void AttributesWithObservableSideEffectOnGet::add(const WrapperTypeInfo* wrapperTypeInfo, String attributeName)
+{
+ AttributeSet* attributes = attributesWithSideEffectOnGet();
+ AttributeSet::ValueType value(wrapperTypeInfo, attributeName);
+ if (!attributes->contains(value))
+ attributes->append(value);
+}
+
+AttributesWithObservableSideEffectOnGet::AttributeSet* AttributesWithObservableSideEffectOnGet::attributesWithSideEffectOnGet()
+{
+ DEFINE_STATIC_LOCAL(AttributeSet, attributes, ());
+ return &attributes;
+}
+
void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8ConstructorAttributeGetter(info);

Powered by Google App Engine
This is Rietveld 408576698