| 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) | 65 ASSERT(m_state != Pending); |
| 66 sendResponse(nullptr); | |
| 67 } | 66 } |
| 68 | 67 |
| 69 void RespondWithObserver::contextDestroyed() | 68 void RespondWithObserver::contextDestroyed() |
| 70 { | 69 { |
| 71 ContextLifecycleObserver::contextDestroyed(); | 70 ContextLifecycleObserver::contextDestroyed(); |
| 72 m_state = Done; | 71 m_state = Done; |
| 73 } | 72 } |
| 74 | 73 |
| 75 void RespondWithObserver::didDispatchEvent() | 74 void RespondWithObserver::didDispatchEvent() |
| 76 { | 75 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 115 } |
| 117 | 116 |
| 118 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID) | 117 RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID) |
| 119 : ContextLifecycleObserver(context) | 118 : ContextLifecycleObserver(context) |
| 120 , m_eventID(eventID) | 119 , m_eventID(eventID) |
| 121 , m_state(Initial) | 120 , m_state(Initial) |
| 122 { | 121 { |
| 123 } | 122 } |
| 124 | 123 |
| 125 } // namespace blink | 124 } // namespace blink |
| OLD | NEW |