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 "ServiceWorkerRegistration.h" | 6 #include "ServiceWorkerRegistration.h" |
7 | 7 |
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 WebServiceWorkerRegistrationProxy* proxy = outerRegistration->proxy(); | 128 WebServiceWorkerRegistrationProxy* proxy = outerRegistration->proxy(); |
129 if (proxy) { | 129 if (proxy) { |
130 ServiceWorkerRegistration* existingRegistration = *proxy; | 130 ServiceWorkerRegistration* existingRegistration = *proxy; |
131 if (existingRegistration) { | 131 if (existingRegistration) { |
132 ASSERT(existingRegistration->executionContext() == executionContext)
; | 132 ASSERT(existingRegistration->executionContext() == executionContext)
; |
133 return existingRegistration; | 133 return existingRegistration; |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 ServiceWorkerRegistration* registration = adoptRefCountedGarbageCollectedWil
lBeNoop(new ServiceWorkerRegistration(executionContext, adoptPtr(outerRegistrati
on))); | 137 ServiceWorkerRegistration* registration = new ServiceWorkerRegistration(exec
utionContext, adoptPtr(outerRegistration)); |
138 registration->suspendIfNeeded(); | 138 registration->suspendIfNeeded(); |
139 return registration; | 139 return registration; |
140 } | 140 } |
141 | 141 |
142 ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution
Context, PassOwnPtr<WebServiceWorkerRegistration> outerRegistration) | 142 ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution
Context, PassOwnPtr<WebServiceWorkerRegistration> outerRegistration) |
143 : ActiveDOMObject(executionContext) | 143 : ActiveDOMObject(executionContext) |
144 , WebServiceWorkerRegistrationProxy(this) | 144 , WebServiceWorkerRegistrationProxy(this) |
145 , m_outerRegistration(outerRegistration) | 145 , m_outerRegistration(outerRegistration) |
146 , m_provider(0) | 146 , m_provider(0) |
147 , m_stopped(false) | 147 , m_stopped(false) |
(...skipping 22 matching lines...) Expand all Loading... |
170 | 170 |
171 void ServiceWorkerRegistration::stop() | 171 void ServiceWorkerRegistration::stop() |
172 { | 172 { |
173 if (m_stopped) | 173 if (m_stopped) |
174 return; | 174 return; |
175 m_stopped = true; | 175 m_stopped = true; |
176 m_outerRegistration->proxyStopped(); | 176 m_outerRegistration->proxyStopped(); |
177 } | 177 } |
178 | 178 |
179 } // namespace blink | 179 } // namespace blink |
OLD | NEW |