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

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

Issue 2571063002: Remove Blink-in-JS (Closed)
Patch Set: Created 4 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 unified diff | Download patch
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 22 matching lines...) Expand all
33 #include "bindings/core/v8/V8Window.h" 33 #include "bindings/core/v8/V8Window.h"
34 #include "core/frame/LocalDOMWindow.h" 34 #include "core/frame/LocalDOMWindow.h"
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( 39 void V8EventTarget::addEventListenerMethodPrologueCustom(
40 const v8::FunctionCallbackInfo<v8::Value>& info, 40 const v8::FunctionCallbackInfo<v8::Value>& info,
41 EventTarget*) { 41 EventTarget*) {
42 if (info.Length() >= 3 && info[2]->IsObject()) { 42 if (info.Length() >= 3 && info[2]->IsObject()) {
43 UseCounter::countIfNotPrivateScript( 43 UseCounter::count(currentExecutionContext(info.GetIsolate()),
44 info.GetIsolate(), currentExecutionContext(info.GetIsolate()), 44 UseCounter::AddEventListenerThirdArgumentIsObject);
45 UseCounter::AddEventListenerThirdArgumentIsObject);
46 } 45 }
47 if (info.Length() >= 4) { 46 if (info.Length() >= 4) {
48 UseCounter::countIfNotPrivateScript( 47 UseCounter::count(currentExecutionContext(info.GetIsolate()),
49 info.GetIsolate(), currentExecutionContext(info.GetIsolate()), 48 UseCounter::AddEventListenerFourArguments);
50 UseCounter::AddEventListenerFourArguments);
51 } 49 }
52 } 50 }
53 51
54 void V8EventTarget::addEventListenerMethodEpilogueCustom( 52 void V8EventTarget::addEventListenerMethodEpilogueCustom(
55 const v8::FunctionCallbackInfo<v8::Value>& info, 53 const v8::FunctionCallbackInfo<v8::Value>& info,
56 EventTarget* impl) { 54 EventTarget* impl) {
57 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) 55 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode())
58 addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1], 56 addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1],
59 V8EventTarget::eventListenerCacheIndex); 57 V8EventTarget::eventListenerCacheIndex);
60 } 58 }
61 59
62 void V8EventTarget::removeEventListenerMethodPrologueCustom( 60 void V8EventTarget::removeEventListenerMethodPrologueCustom(
63 const v8::FunctionCallbackInfo<v8::Value>& info, 61 const v8::FunctionCallbackInfo<v8::Value>& info,
64 EventTarget*) { 62 EventTarget*) {
65 if (info.Length() >= 3 && info[2]->IsObject()) { 63 if (info.Length() >= 3 && info[2]->IsObject()) {
66 UseCounter::countIfNotPrivateScript( 64 UseCounter::count(currentExecutionContext(info.GetIsolate()),
67 info.GetIsolate(), currentExecutionContext(info.GetIsolate()), 65 UseCounter::RemoveEventListenerThirdArgumentIsObject);
68 UseCounter::RemoveEventListenerThirdArgumentIsObject);
69 } 66 }
70 if (info.Length() >= 4) { 67 if (info.Length() >= 4) {
71 UseCounter::countIfNotPrivateScript( 68 UseCounter::count(currentExecutionContext(info.GetIsolate()),
72 info.GetIsolate(), currentExecutionContext(info.GetIsolate()), 69 UseCounter::RemoveEventListenerFourArguments);
73 UseCounter::RemoveEventListenerFourArguments);
74 } 70 }
75 } 71 }
76 72
77 void V8EventTarget::removeEventListenerMethodEpilogueCustom( 73 void V8EventTarget::removeEventListenerMethodEpilogueCustom(
78 const v8::FunctionCallbackInfo<v8::Value>& info, 74 const v8::FunctionCallbackInfo<v8::Value>& info,
79 EventTarget* impl) { 75 EventTarget* impl) {
80 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) 76 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode())
81 removeHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[1], 77 removeHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[1],
82 V8EventTarget::eventListenerCacheIndex); 78 V8EventTarget::eventListenerCacheIndex);
83 } 79 }
84 80
85 } // namespace blink 81 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698