OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "bindings/core/v8/ScriptPromiseResolver.h" | 6 #include "bindings/core/v8/ScriptPromiseResolver.h" |
7 | 7 |
8 #include "bindings/core/v8/V8RecursionScope.h" | 8 #include "bindings/core/v8/V8RecursionScope.h" |
9 | 9 |
10 namespace WebCore { | 10 namespace blink { |
11 | 11 |
12 ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState) | 12 ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState) |
13 : ActiveDOMObject(scriptState->executionContext()) | 13 : ActiveDOMObject(scriptState->executionContext()) |
14 , m_state(Pending) | 14 , m_state(Pending) |
15 , m_scriptState(scriptState) | 15 , m_scriptState(scriptState) |
16 , m_mode(Default) | 16 , m_mode(Default) |
17 , m_timer(this, &ScriptPromiseResolver::onTimerFired) | 17 , m_timer(this, &ScriptPromiseResolver::onTimerFired) |
18 , m_resolver(scriptState) | 18 , m_resolver(scriptState) |
19 #if ENABLE(ASSERT) | 19 #if ENABLE(ASSERT) |
20 , m_isPromiseCalled(false) | 20 , m_isPromiseCalled(false) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 // |this| may be deleted here, but it is safe to check |state| because | 93 // |this| may be deleted here, but it is safe to check |state| because |
94 // it doesn't depend on |this|. When |this| is deleted, |state| can't be | 94 // it doesn't depend on |this|. When |this| is deleted, |state| can't be |
95 // |Resolving| nor |Rejecting| and hence |this->deref()| can't be executed. | 95 // |Resolving| nor |Rejecting| and hence |this->deref()| can't be executed. |
96 if (state == Resolving || state == Rejecting) { | 96 if (state == Resolving || state == Rejecting) { |
97 // |ref| was called in |resolveOrReject|. | 97 // |ref| was called in |resolveOrReject|. |
98 deref(); | 98 deref(); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 } // namespace WebCore | 102 } // namespace blink |
OLD | NEW |