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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp

Issue 1493023004: Add use counters for NodeFilter being a function or an object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp
index 45e5517d63a6d4ea8a258f4458f0eb7e98b93f32..2346c0bf95888d0d8a101f9a7b7e5c0afb2edc5c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp
@@ -36,6 +36,7 @@
#include "bindings/core/v8/V8Node.h"
#include "core/dom/Node.h"
#include "core/dom/NodeFilter.h"
+#include "core/frame/UseCounter.h"
#include "wtf/OwnPtr.h"
namespace blink {
@@ -73,6 +74,7 @@ unsigned V8NodeFilterCondition::acceptNode(Node* node, ExceptionState& exception
v8::Local<v8::Function> callback;
v8::Local<v8::Value> receiver;
if (filter->IsFunction()) {
+ UseCounter::countIfNotPrivateScript(isolate, callingExecutionContext(isolate), UseCounter::NodeFilterIsFunction);
callback = v8::Local<v8::Function>::Cast(filter);
receiver = v8::Undefined(isolate);
} else {
@@ -86,6 +88,7 @@ unsigned V8NodeFilterCondition::acceptNode(Node* node, ExceptionState& exception
exceptionState.throwTypeError("NodeFilter object does not have an acceptNode function");
return NodeFilter::FILTER_REJECT;
}
+ UseCounter::countIfNotPrivateScript(isolate, callingExecutionContext(isolate), UseCounter::NodeFilterIsObject);
callback = v8::Local<v8::Function>::Cast(value);
receiver = filter;
}

Powered by Google App Engine
This is Rietveld 408576698