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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 ResolveType m_resolveType; | 55 ResolveType m_resolveType; |
56 }; | 56 }; |
57 | 57 |
58 PassRefPtr<RespondWithObserver> RespondWithObserver::create(ExecutionContext* co
ntext, int eventID) | 58 PassRefPtr<RespondWithObserver> RespondWithObserver::create(ExecutionContext* co
ntext, int eventID) |
59 { | 59 { |
60 return adoptRef(new RespondWithObserver(context, eventID)); | 60 return adoptRef(new RespondWithObserver(context, eventID)); |
61 } | 61 } |
62 | 62 |
63 RespondWithObserver::~RespondWithObserver() | 63 RespondWithObserver::~RespondWithObserver() |
64 { | 64 { |
65 if (m_state == Pending) | |
66 sendResponse(nullptr); | |
67 } | 65 } |
68 | 66 |
69 void RespondWithObserver::contextDestroyed() | 67 void RespondWithObserver::contextDestroyed() |
70 { | 68 { |
71 ContextLifecycleObserver::contextDestroyed(); | 69 ContextLifecycleObserver::contextDestroyed(); |
72 m_state = Done; | 70 m_state = Done; |
73 } | 71 } |
74 | 72 |
75 void RespondWithObserver::didDispatchEvent() | 73 void RespondWithObserver::didDispatchEvent() |
76 { | 74 { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 114 } |
117 | 115 |
118 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID) | 116 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID) |
119 : ContextLifecycleObserver(context) | 117 : ContextLifecycleObserver(context) |
120 , m_eventID(eventID) | 118 , m_eventID(eventID) |
121 , m_state(Initial) | 119 , m_state(Initial) |
122 { | 120 { |
123 } | 121 } |
124 | 122 |
125 } // namespace blink | 123 } // namespace blink |
OLD | NEW |