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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp

Issue 1414533002: Usage counter for add/removeEventListener third argument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 24 matching lines...) Expand all
35 #include "core/frame/UseCounter.h" 35 #include "core/frame/UseCounter.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 void V8EventTarget::addEventListenerMethodPrologueCustom(const v8::FunctionCallb ackInfo<v8::Value>& info, EventTarget*) 39 void V8EventTarget::addEventListenerMethodPrologueCustom(const v8::FunctionCallb ackInfo<v8::Value>& info, EventTarget*)
40 { 40 {
41 if (info.Length() < 2) { 41 if (info.Length() < 2) {
42 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionC ontext(info.GetIsolate()), 42 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionC ontext(info.GetIsolate()),
43 info.Length() == 0 ? UseCounter::AddEventListenerNoArguments : UseCo unter::AddEventListenerOneArgument); 43 info.Length() == 0 ? UseCounter::AddEventListenerNoArguments : UseCo unter::AddEventListenerOneArgument);
44 } 44 }
45 if (info.Length() >= 3 && info[2]->IsObject()) {
46 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionC ontext(info.GetIsolate()),
47 UseCounter::AddEventListenerThirdArgumentIsObject);
48 }
45 } 49 }
46 50
47 void V8EventTarget::addEventListenerMethodEpilogueCustom(const v8::FunctionCallb ackInfo<v8::Value>& info, EventTarget* impl) 51 void V8EventTarget::addEventListenerMethodEpilogueCustom(const v8::FunctionCallb ackInfo<v8::Value>& info, EventTarget* impl)
48 { 52 {
49 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) 53 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode())
50 addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1], V8Event Target::eventListenerCacheIndex); 54 addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1], V8Event Target::eventListenerCacheIndex);
51 } 55 }
52 56
53 void V8EventTarget::removeEventListenerMethodPrologueCustom(const v8::FunctionCa llbackInfo<v8::Value>& info, EventTarget*) 57 void V8EventTarget::removeEventListenerMethodPrologueCustom(const v8::FunctionCa llbackInfo<v8::Value>& info, EventTarget*)
54 { 58 {
55 if (info.Length() < 2) { 59 if (info.Length() < 2) {
56 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionC ontext(info.GetIsolate()), 60 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionC ontext(info.GetIsolate()),
57 info.Length() == 0 ? UseCounter::RemoveEventListenerNoArguments : Us eCounter::RemoveEventListenerOneArgument); 61 info.Length() == 0 ? UseCounter::RemoveEventListenerNoArguments : Us eCounter::RemoveEventListenerOneArgument);
58 } 62 }
63 if (info.Length() >= 3 && info[2]->IsObject()) {
64 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionC ontext(info.GetIsolate()),
65 UseCounter::RemoveEventListenerThirdArgumentIsObject);
66 }
59 } 67 }
60 68
61 void V8EventTarget::removeEventListenerMethodEpilogueCustom(const v8::FunctionCa llbackInfo<v8::Value>& info, EventTarget* impl) 69 void V8EventTarget::removeEventListenerMethodEpilogueCustom(const v8::FunctionCa llbackInfo<v8::Value>& info, EventTarget* impl)
62 { 70 {
63 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) 71 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode())
64 removeHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[1], V8 EventTarget::eventListenerCacheIndex); 72 removeHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[1], V8 EventTarget::eventListenerCacheIndex);
65 } 73 }
66 74
67 } // namespace blink 75 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698