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

Unified Diff: Source/bindings/v8/ScriptPromise.cpp

Issue 293933002: Remove the Promises old implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/ScriptPromiseResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptPromise.cpp
diff --git a/Source/bindings/v8/ScriptPromise.cpp b/Source/bindings/v8/ScriptPromise.cpp
index 3db7406e686770c10d73eb19686d3d63252d6cc1..111d7964a2ec69069c871ddde3604234e116d202 100644
--- a/Source/bindings/v8/ScriptPromise.cpp
+++ b/Source/bindings/v8/ScriptPromise.cpp
@@ -31,11 +31,8 @@
#include "config.h"
#include "bindings/v8/ScriptPromise.h"
-#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/ScriptPromiseResolver.h"
#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/custom/V8PromiseCustom.h"
#include <v8.h>
@@ -47,7 +44,7 @@ ScriptPromise::ScriptPromise(ScriptState* scriptState, v8::Handle<v8::Value> val
if (value.IsEmpty())
return;
- if (!V8PromiseCustom::isPromise(value, scriptState->isolate()) && !value->IsPromise()) {
+ if (!value->IsPromise()) {
m_promise = ScriptValue(scriptState, v8::Handle<v8::Value>());
V8ThrowException::throwTypeError("the given value is not a Promise", scriptState->isolate());
return;
@@ -64,9 +61,6 @@ ScriptPromise ScriptPromise::then(PassOwnPtr<ScriptFunction> onFulfilled, PassOw
v8::Local<v8::Function> v8OnFulfilled = ScriptFunction::adoptByGarbageCollector(onFulfilled);
v8::Local<v8::Function> v8OnRejected = ScriptFunction::adoptByGarbageCollector(onRejected);
- if (V8PromiseCustom::isPromise(promise, m_scriptState->isolate()))
- return ScriptPromise(m_scriptState.get(), V8PromiseCustom::then(promise, v8OnFulfilled, v8OnRejected, m_scriptState->isolate()));
-
ASSERT(promise->IsPromise());
// Return this Promise if no handlers are given.
// In fact it is not the exact bahavior of Promise.prototype.then
@@ -96,8 +90,7 @@ ScriptPromise ScriptPromise::cast(ScriptState* scriptState, v8::Handle<v8::Value
{
if (value.IsEmpty())
return ScriptPromise();
- v8::Isolate* isolate = scriptState->isolate();
- if (V8PromiseCustom::isPromise(value, isolate) || value->IsPromise()) {
+ if (value->IsPromise()) {
return ScriptPromise(scriptState, value);
}
RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/ScriptPromiseResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698