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

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

Issue 2352333002: Add more use counters for document.createTouch (Closed)
Patch Set: back out Touch changes Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp
index 9fd507af5c2fafc65b68678987a2f76c97a1bc5e..5c8cf0260999ee1f7e1a3face2bb36e2d6bb7de7 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp
@@ -40,6 +40,7 @@
#include "core/dom/Document.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/UseCounter.h"
#include "core/html/HTMLAllCollection.h"
#include "core/html/HTMLCollection.h"
#include "core/html/HTMLIFrameElement.h"
@@ -91,4 +92,30 @@ void V8Document::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& inf
v8SetReturnValue(info, info.Holder());
}
+void V8Document::createTouchMethodPrologueCustom(const v8::FunctionCallbackInfo<v8::Value>& info, Document*)
+{
+ v8::Local<v8::Value> v8Window = info[0];
+ if (isUndefinedOrNull(v8Window)) {
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionContext(info.GetIsolate()),
+ UseCounter::DocumentCreateTouchWindowNull);
+ } else if (!toDOMWindow(info.GetIsolate(), v8Window)) {
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionContext(info.GetIsolate()),
+ UseCounter::DocumentCreateTouchWindowWrongType);
+ }
+
+ v8::Local<v8::Value> v8Target = info[1];
+ if (isUndefinedOrNull(v8Target)) {
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionContext(info.GetIsolate()),
+ UseCounter::DocumentCreateTouchTargetNull);
+ } else if (!toEventTarget(info.GetIsolate(), v8Target)) {
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionContext(info.GetIsolate()),
+ UseCounter::DocumentCreateTouchTargetWrongType);
+ }
+
+ if (info.Length() < 7) {
+ UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionContext(info.GetIsolate()),
+ UseCounter::DocumentCreateTouchLessThanSevenArguments);
+ }
+}
+
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698