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/WaitUntilObserver.h" | 6 #include "modules/serviceworkers/WaitUntilObserver.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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 } // anonymous namespace | 38 } // anonymous namespace |
39 | 39 |
40 class WaitUntilObserver::ThenFunction final : public ScriptFunction { | 40 class WaitUntilObserver::ThenFunction final : public ScriptFunction { |
41 public: | 41 public: |
42 enum ResolveType { | 42 enum ResolveType { |
43 Fulfilled, | 43 Fulfilled, |
44 Rejected, | 44 Rejected, |
45 }; | 45 }; |
46 | 46 |
47 static v8::Handle<v8::Function> createFunction(ScriptState* scriptState, Wai
tUntilObserver* observer, ResolveType type) | 47 static v8::Local<v8::Function> createFunction(ScriptState* scriptState, Wait
UntilObserver* observer, ResolveType type) |
48 { | 48 { |
49 ThenFunction* self = new ThenFunction(scriptState, observer, type); | 49 ThenFunction* self = new ThenFunction(scriptState, observer, type); |
50 return self->bindToV8Function(); | 50 return self->bindToV8Function(); |
51 } | 51 } |
52 | 52 |
53 DEFINE_INLINE_VIRTUAL_TRACE() | 53 DEFINE_INLINE_VIRTUAL_TRACE() |
54 { | 54 { |
55 visitor->trace(m_observer); | 55 visitor->trace(m_observer); |
56 ScriptFunction::trace(visitor); | 56 ScriptFunction::trace(visitor); |
57 } | 57 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 return; | 186 return; |
187 executionContext()->consumeWindowInteraction(); | 187 executionContext()->consumeWindowInteraction(); |
188 } | 188 } |
189 | 189 |
190 DEFINE_TRACE(WaitUntilObserver) | 190 DEFINE_TRACE(WaitUntilObserver) |
191 { | 191 { |
192 ContextLifecycleObserver::trace(visitor); | 192 ContextLifecycleObserver::trace(visitor); |
193 } | 193 } |
194 | 194 |
195 } // namespace blink | 195 } // namespace blink |
OLD | NEW |