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

Unified Diff: Source/bindings/core/v8/custom/V8EventTargetCustom.cpp

Issue 1233483002: Add counters for add/removeEventListener() called with one argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No [Conditional] support Created 5 years, 5 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/IDLExtendedAttributes.txt ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/custom/V8EventTargetCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp b/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp
index e49d1da5be0a0a93614eb3d6f4b59a7f1e64c423..97ae719532d8f7bc7cb8bebaaf27e4314e765f60 100644
--- a/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp
@@ -32,15 +32,32 @@
#include "bindings/core/v8/V8EventTarget.h"
#include "bindings/core/v8/V8Window.h"
+#include "core/frame/UseCounter.h"
namespace blink {
+void V8EventTarget::addEventListenerMethodPrologueCustom(const v8::FunctionCallbackInfo<v8::Value>& info, EventTarget*)
+{
+ if (info.Length() < 2) {
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()),
+ info.Length() == 0 ? UseCounter::AddEventListenerNoArguments : UseCounter::AddEventListenerOneArgument);
+ }
+}
+
void V8EventTarget::addEventListenerMethodEpilogueCustom(const v8::FunctionCallbackInfo<v8::Value>& info, EventTarget* impl)
{
if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode())
addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1], V8EventTarget::eventListenerCacheIndex);
}
+void V8EventTarget::removeEventListenerMethodPrologueCustom(const v8::FunctionCallbackInfo<v8::Value>& info, EventTarget*)
+{
+ if (info.Length() < 2) {
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()),
+ info.Length() == 0 ? UseCounter::RemoveEventListenerNoArguments : UseCounter::RemoveEventListenerOneArgument);
+ }
+}
+
void V8EventTarget::removeEventListenerMethodEpilogueCustom(const v8::FunctionCallbackInfo<v8::Value>& info, EventTarget* impl)
{
if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode())
« no previous file with comments | « Source/bindings/IDLExtendedAttributes.txt ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698