| 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 "modules/serviceworkers/RespondWithObserver.h" | 5 #include "modules/serviceworkers/RespondWithObserver.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptFunction.h" | 7 #include "bindings/core/v8/ScriptFunction.h" |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
| 10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 WebURLRequest::RequestContext requestContext, | 181 WebURLRequest::RequestContext requestContext, |
| 182 WaitUntilObserver* observer) { | 182 WaitUntilObserver* observer) { |
| 183 return new RespondWithObserver(context, eventID, requestURL, requestMode, | 183 return new RespondWithObserver(context, eventID, requestURL, requestMode, |
| 184 frameType, requestContext, observer); | 184 frameType, requestContext, observer); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void RespondWithObserver::contextDestroyed() { | 187 void RespondWithObserver::contextDestroyed() { |
| 188 ContextLifecycleObserver::contextDestroyed(); | 188 ContextLifecycleObserver::contextDestroyed(); |
| 189 if (m_observer) { | 189 if (m_observer) { |
| 190 DCHECK_EQ(Pending, m_state); | 190 DCHECK_EQ(Pending, m_state); |
| 191 m_observer->decrementPendingActivity(); | |
| 192 m_observer.clear(); | 191 m_observer.clear(); |
| 193 } | 192 } |
| 194 m_state = Done; | 193 m_state = Done; |
| 195 } | 194 } |
| 196 | 195 |
| 197 void RespondWithObserver::willDispatchEvent() { | 196 void RespondWithObserver::willDispatchEvent() { |
| 198 m_eventDispatchTime = WTF::currentTime(); | 197 m_eventDispatchTime = WTF::currentTime(); |
| 199 } | 198 } |
| 200 | 199 |
| 201 void RespondWithObserver::didDispatchEvent(DispatchEventResult dispatchResult) { | 200 void RespondWithObserver::didDispatchEvent(DispatchEventResult dispatchResult) { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 m_requestContext(requestContext), | 337 m_requestContext(requestContext), |
| 339 m_state(Initial), | 338 m_state(Initial), |
| 340 m_observer(observer) {} | 339 m_observer(observer) {} |
| 341 | 340 |
| 342 DEFINE_TRACE(RespondWithObserver) { | 341 DEFINE_TRACE(RespondWithObserver) { |
| 343 visitor->trace(m_observer); | 342 visitor->trace(m_observer); |
| 344 ContextLifecycleObserver::trace(visitor); | 343 ContextLifecycleObserver::trace(visitor); |
| 345 } | 344 } |
| 346 | 345 |
| 347 } // namespace blink | 346 } // namespace blink |
| OLD | NEW |