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 "modules/serviceworkers/RespondWithObserver.h" | 6 #include "modules/serviceworkers/RespondWithObserver.h" |
7 | 7 |
8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
10 #include "bindings/core/v8/ScriptValue.h" | 10 #include "bindings/core/v8/ScriptValue.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 } // namespace | 85 } // namespace |
86 | 86 |
87 class RespondWithObserver::ThenFunction final : public ScriptFunction { | 87 class RespondWithObserver::ThenFunction final : public ScriptFunction { |
88 public: | 88 public: |
89 enum ResolveType { | 89 enum ResolveType { |
90 Fulfilled, | 90 Fulfilled, |
91 Rejected, | 91 Rejected, |
92 }; | 92 }; |
93 | 93 |
94 static v8::Handle<v8::Function> createFunction(ScriptState* scriptState, Res
pondWithObserver* observer, ResolveType type) | 94 static v8::Local<v8::Function> createFunction(ScriptState* scriptState, Resp
ondWithObserver* observer, ResolveType type) |
95 { | 95 { |
96 ThenFunction* self = new ThenFunction(scriptState, observer, type); | 96 ThenFunction* self = new ThenFunction(scriptState, observer, type); |
97 return self->bindToV8Function(); | 97 return self->bindToV8Function(); |
98 } | 98 } |
99 | 99 |
100 DEFINE_INLINE_VIRTUAL_TRACE() | 100 DEFINE_INLINE_VIRTUAL_TRACE() |
101 { | 101 { |
102 visitor->trace(m_observer); | 102 visitor->trace(m_observer); |
103 ScriptFunction::trace(visitor); | 103 ScriptFunction::trace(visitor); |
104 } | 104 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 , m_state(Initial) | 229 , m_state(Initial) |
230 { | 230 { |
231 } | 231 } |
232 | 232 |
233 DEFINE_TRACE(RespondWithObserver) | 233 DEFINE_TRACE(RespondWithObserver) |
234 { | 234 { |
235 ContextLifecycleObserver::trace(visitor); | 235 ContextLifecycleObserver::trace(visitor); |
236 } | 236 } |
237 | 237 |
238 } // namespace blink | 238 } // namespace blink |
OLD | NEW |