OLD | NEW |
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 Loading... |
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 |
OLD | NEW |