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

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: Addressed review comments. Created 5 years, 9 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
« no previous file with comments | « Source/bindings/core/v8/V8DOMWrapper.cpp ('k') | Source/core/inspector/InjectedScriptHost.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b786554267c08bad392c7d2ca52bab133ea5956b..14b7d9a851f78972652e291199dfb1f0e331951f 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::isDOMWrapperMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1)
return;
- if (!info[0]->IsObject()) {
- v8SetReturnValue(info, false);
- return;
- }
-
- v8SetReturnValue(info, V8HTMLAllCollection::hasInstance(info[0], info.GetIsolate()));
+ v8SetReturnValue(info, V8DOMWrapper::isWrapper(info.GetIsolate(), info[0]));
}
-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)
« no previous file with comments | « Source/bindings/core/v8/V8DOMWrapper.cpp ('k') | Source/core/inspector/InjectedScriptHost.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698