| 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/v8/ScriptFunction.h" | 8 #include "bindings/v8/ScriptFunction.h" |
| 9 #include "bindings/v8/ScriptPromise.h" | 9 #include "bindings/v8/ScriptPromise.h" |
| 10 #include "bindings/v8/ScriptValue.h" | 10 #include "bindings/v8/ScriptValue.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 { | 37 { |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual ScriptValue call(ScriptValue value) OVERRIDE | 40 virtual ScriptValue call(ScriptValue value) OVERRIDE |
| 41 { | 41 { |
| 42 ASSERT(m_observer); | 42 ASSERT(m_observer); |
| 43 ASSERT(m_resolveType == Fulfilled || m_resolveType == Rejected); | 43 ASSERT(m_resolveType == Fulfilled || m_resolveType == Rejected); |
| 44 if (m_resolveType == Rejected) | 44 if (m_resolveType == Rejected) |
| 45 m_observer->reportError(value); | 45 m_observer->reportError(value); |
| 46 m_observer->decrementPendingActivity(); | 46 m_observer->decrementPendingActivity(); |
| 47 m_observer = 0; | 47 m_observer = nullptr; |
| 48 return value; | 48 return value; |
| 49 } | 49 } |
| 50 | 50 |
| 51 RefPtr<WaitUntilObserver> m_observer; | 51 RefPtr<WaitUntilObserver> m_observer; |
| 52 ResolveType m_resolveType; | 52 ResolveType m_resolveType; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 PassRefPtr<WaitUntilObserver> WaitUntilObserver::create(ExecutionContext* contex
t, int eventID) | 55 PassRefPtr<WaitUntilObserver> WaitUntilObserver::create(ExecutionContext* contex
t, int eventID) |
| 56 { | 56 { |
| 57 return adoptRef(new WaitUntilObserver(context, eventID)); | 57 return adoptRef(new WaitUntilObserver(context, eventID)); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 { | 102 { |
| 103 ASSERT(m_pendingActivity > 0); | 103 ASSERT(m_pendingActivity > 0); |
| 104 if (--m_pendingActivity || !executionContext()) | 104 if (--m_pendingActivity || !executionContext()) |
| 105 return; | 105 return; |
| 106 | 106 |
| 107 ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleInstallEv
ent(m_eventID); | 107 ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleInstallEv
ent(m_eventID); |
| 108 observeContext(0); | 108 observeContext(0); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace WebCore | 111 } // namespace WebCore |
| OLD | NEW |