Index: Source/bindings/v8/custom/V8PromiseCustom.cpp |
diff --git a/Source/bindings/v8/custom/V8PromiseCustom.cpp b/Source/bindings/v8/custom/V8PromiseCustom.cpp |
index 66e366818b480da0a7bda3739656916d8076b59c..21f923d92f52a92fce2102d771ac626b8d6fce47 100644 |
--- a/Source/bindings/v8/custom/V8PromiseCustom.cpp |
+++ b/Source/bindings/v8/custom/V8PromiseCustom.cpp |
@@ -44,6 +44,7 @@ |
#include "core/dom/Document.h" |
#include "core/dom/ExecutionContextTask.h" |
#include "core/frame/DOMWindow.h" |
+#include "core/frame/UseCounter.h" |
#include "core/inspector/InspectorInstrumentation.h" |
#include "core/workers/WorkerGlobalScope.h" |
#include "platform/Task.h" |
@@ -486,6 +487,8 @@ void V8Promise::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& inf |
{ |
v8SetReturnValue(info, v8::Local<v8::Value>()); |
v8::Isolate* isolate = info.GetIsolate(); |
+ ExecutionContext* executionContext = activeExecutionContext(isolate); |
+ UseCounter::count(executionContext, UseCounter::PromiseConstructor); |
if (!info.Length() || !info[0]->IsFunction()) { |
throwTypeError("Promise constructor takes a function argument", isolate); |
return; |
@@ -519,6 +522,8 @@ void V8Promise::thenMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info |
void V8Promise::castMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
v8::Isolate* isolate = info.GetIsolate(); |
+ ExecutionContext* executionContext = activeExecutionContext(isolate); |
+ UseCounter::count(executionContext, UseCounter::PromiseCast); |
v8::Local<v8::Value> result = v8::Undefined(isolate); |
if (info.Length() > 0) |
result = info[0]; |
@@ -544,6 +549,8 @@ void V8Promise::catchMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& inf |
void V8Promise::resolveMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
v8::Isolate* isolate = info.GetIsolate(); |
+ ExecutionContext* executionContext = activeExecutionContext(isolate); |
+ UseCounter::count(executionContext, UseCounter::PromiseResolve); |
v8::Local<v8::Value> result = v8::Undefined(isolate); |
if (info.Length() > 0) |
result = info[0]; |
@@ -556,6 +563,8 @@ void V8Promise::resolveMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& i |
void V8Promise::rejectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
v8::Isolate* isolate = info.GetIsolate(); |
+ ExecutionContext* executionContext = activeExecutionContext(isolate); |
+ UseCounter::count(executionContext, UseCounter::PromiseReject); |
v8::Local<v8::Value> result = v8::Undefined(isolate); |
if (info.Length() > 0) |
result = info[0]; |