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..047607492954c3308348ccdbc5fd5bef3f5f61ed 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,11 @@ void V8Promise::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& inf |
{ |
v8SetReturnValue(info, v8::Local<v8::Value>()); |
v8::Isolate* isolate = info.GetIsolate(); |
+ ExecutionContext* executionContext = activeExecutionContext(isolate); |
+ ASSERT(executionContext); |
haraken
2014/02/14 07:21:39
Remove this ASSERT. This should be always non NULL
yhirano
2014/02/14 07:37:55
Done.
|
+ String consoleMessage("Promise API is changing and this function might be affected."); |
+ executionContext->addConsoleMessage(JSMessageSource, WarningMessageLevel, consoleMessage); |
+ UseCounter::count(executionContext, UseCounter::PromiseConstructor); |
if (!info.Length() || !info[0]->IsFunction()) { |
throwTypeError("Promise constructor takes a function argument", isolate); |
return; |
@@ -519,6 +525,11 @@ 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); |
+ ASSERT(executionContext); |
+ String consoleMessage("Promise API is changing and this function might be affected."); |
+ executionContext->addConsoleMessage(JSMessageSource, WarningMessageLevel, consoleMessage); |
+ UseCounter::count(executionContext, UseCounter::PromiseCast); |
v8::Local<v8::Value> result = v8::Undefined(isolate); |
if (info.Length() > 0) |
result = info[0]; |
@@ -544,6 +555,11 @@ 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); |
+ ASSERT(executionContext); |
+ String consoleMessage("Promise API is changing and this function might be affected."); |
+ executionContext->addConsoleMessage(JSMessageSource, WarningMessageLevel, consoleMessage); |
+ UseCounter::count(executionContext, UseCounter::PromiseResolve); |
v8::Local<v8::Value> result = v8::Undefined(isolate); |
if (info.Length() > 0) |
result = info[0]; |
@@ -556,6 +572,11 @@ 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); |
+ ASSERT(executionContext); |
+ String consoleMessage("Promise API is changing and this function might be affected."); |
+ executionContext->addConsoleMessage(JSMessageSource, WarningMessageLevel, consoleMessage); |
+ UseCounter::count(executionContext, UseCounter::PromiseReject); |
v8::Local<v8::Value> result = v8::Undefined(isolate); |
if (info.Length() > 0) |
result = info[0]; |