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

Unified Diff: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.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/custom/V8InjectedScriptHostCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
index 17e238d1d7cc8cdee7ef7b121163b136ca644f3c..05df31cea8726654ca0b25fda65d1cf89d2e6d97 100644
--- a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -139,24 +139,16 @@ void V8InjectedScriptHost::internalConstructorNameMethodCustom(const v8::Functio
v8SetReturnValue(info, result);
}
-void V8InjectedScriptHost::isHTMLAllCollectionMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
+void V8InjectedScriptHost::isDOMAttributeWithNoSideEffectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- if (info.Length() < 1)
- return;
-
- if (!info[0]->IsObject()) {
- v8SetReturnValue(info, false);
+ if (info.Length() < 2)
return;
- }
- v8SetReturnValue(info, V8HTMLAllCollection::hasInstance(info[0], info.GetIsolate()));
+ v8SetReturnValue(info, AttributesWithObservableSideEffectOnGet::hasNoSideEffect(info.GetIsolate(), info[0], info[1]));
}
-void V8InjectedScriptHost::isPopularDOMObjectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
+void V8InjectedScriptHost::isHTMLAllCollectionMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- // FIXME: Stop using this function (whilelisting) once we come up with a way
- // to distinguish DOM wrappers from other obejcts.
-
if (info.Length() < 1)
return;
@@ -165,27 +157,7 @@ void V8InjectedScriptHost::isPopularDOMObjectMethodCustom(const v8::FunctionCall
return;
}
- v8::Local<v8::Value> object = info[0];
- v8::Isolate* isolate = info.GetIsolate();
- bool isPopularDOMObject = false;
- static bool (*hasInstances[])(v8::Local<v8::Value>, v8::Isolate*) = {
- V8Blob::hasInstance,
- V8DOMError::hasInstance,
- V8DOMException::hasInstance,
- V8Element::hasInstance,
- V8Event::hasInstance,
- V8EventTarget::hasInstance,
- V8Location::hasInstance,
- V8Navigator::hasInstance,
- };
- for (size_t i = 0; i < sizeof hasInstances / sizeof *hasInstances; ++i) {
- if (hasInstances[i](object, isolate)) {
- isPopularDOMObject = true;
- break;
- }
- }
-
- v8SetReturnValue(info, isPopularDOMObject);
+ v8SetReturnValue(info, V8HTMLAllCollection::hasInstance(info[0], info.GetIsolate()));
}
void V8InjectedScriptHost::isTypedArrayMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698