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

Unified Diff: Source/bindings/v8/ScriptPromiseResolverWithContext.h

Issue 339443004: Revert of Introduce KeepAliveWhilePending to ScriptPromiseResolverWithContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@refactor-webmidi-initialization
Patch Set: Created 6 years, 6 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 | Source/bindings/v8/ScriptPromiseResolverWithContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptPromiseResolverWithContext.h
diff --git a/Source/bindings/v8/ScriptPromiseResolverWithContext.h b/Source/bindings/v8/ScriptPromiseResolverWithContext.h
index 1159305e60762d8b0769f26cc421b439ec505f23..0ccf94e1c1d77195839cb79d9341d22c808fd0b2 100644
--- a/Source/bindings/v8/ScriptPromiseResolverWithContext.h
+++ b/Source/bindings/v8/ScriptPromiseResolverWithContext.h
@@ -31,23 +31,12 @@
WTF_MAKE_NONCOPYABLE(ScriptPromiseResolverWithContext);
public:
- enum Mode {
- Default,
- KeepAliveWhilePending,
- };
-
- // Create a ScriptPromiseResolverWithContext.
- // If |mode| is KeepAliveWhilePending, the resolver refers itself in order
- // to stay alive while the promise is pending and the associated
- // ExecutionContext isn't stopped.
- static PassRefPtr<ScriptPromiseResolverWithContext> create(ScriptState* scriptState, Mode mode = Default)
+ static PassRefPtr<ScriptPromiseResolverWithContext> create(ScriptState* scriptState)
{
- RefPtr<ScriptPromiseResolverWithContext> resolver = adoptRef(new ScriptPromiseResolverWithContext(scriptState, mode));
+ RefPtr<ScriptPromiseResolverWithContext> resolver = adoptRef(new ScriptPromiseResolverWithContext(scriptState));
resolver->suspendIfNeeded();
return resolver.release();
}
-
- virtual ~ScriptPromiseResolverWithContext();
// Anything that can be passed to toV8Value can be passed to this function.
template <typename T>
@@ -80,9 +69,7 @@
virtual void stop() OVERRIDE;
protected:
- // You need to call suspendIfNeeded after the construction because
- // this is an ActiveDOMObject.
- ScriptPromiseResolverWithContext(ScriptState*, Mode);
+ explicit ScriptPromiseResolverWithContext(ScriptState*);
private:
enum ResolutionState {
@@ -103,7 +90,6 @@
{
if (m_state != Pending || !executionContext() || executionContext()->activeDOMObjectsAreStopped())
return;
- ASSERT(newState == Resolving || newState == Rejecting);
m_state = newState;
// Retain this object until it is actually resolved or rejected.
// |deref| will be called in |clear|.
@@ -121,7 +107,6 @@
ResolutionState m_state;
const RefPtr<ScriptState> m_scriptState;
- Mode m_mode;
Timer<ScriptPromiseResolverWithContext> m_timer;
RefPtr<ScriptPromiseResolver> m_resolver;
ScopedPersistent<v8::Value> m_value;
« no previous file with comments | « no previous file | Source/bindings/v8/ScriptPromiseResolverWithContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698