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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 registration->suspendIfNeeded(); | 137 registration->suspendIfNeeded(); |
138 return registration; | 138 return registration; |
139 } | 139 } |
140 | 140 |
141 ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution Context, PassOwnPtr<WebServiceWorkerRegistration> outerRegistration) | 141 ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution Context, PassOwnPtr<WebServiceWorkerRegistration> outerRegistration) |
142 : ActiveDOMObject(executionContext) | 142 : ActiveDOMObject(executionContext) |
143 , m_outerRegistration(outerRegistration) | 143 , m_outerRegistration(outerRegistration) |
144 , m_provider(0) | 144 , m_provider(0) |
145 , m_stopped(false) | 145 , m_stopped(false) |
146 { | 146 { |
147 WILL_REGISTER_PREFINALIZER(this); | |
147 ASSERT(m_outerRegistration); | 148 ASSERT(m_outerRegistration); |
148 | 149 |
149 if (!executionContext) | 150 if (!executionContext) |
150 return; | 151 return; |
151 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro m(executionContext)) | 152 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro m(executionContext)) |
152 m_provider = client->provider(); | 153 m_provider = client->provider(); |
153 m_outerRegistration->setProxy(this); | 154 m_outerRegistration->setProxy(this); |
154 } | 155 } |
155 | 156 |
156 void ServiceWorkerRegistration::trace(Visitor* visitor) | 157 void ServiceWorkerRegistration::trace(Visitor* visitor) |
(...skipping 12 matching lines...) Expand all Loading... | |
169 } | 170 } |
170 | 171 |
171 void ServiceWorkerRegistration::stop() | 172 void ServiceWorkerRegistration::stop() |
172 { | 173 { |
173 if (m_stopped) | 174 if (m_stopped) |
174 return; | 175 return; |
175 m_stopped = true; | 176 m_stopped = true; |
176 m_outerRegistration->proxyStopped(); | 177 m_outerRegistration->proxyStopped(); |
177 } | 178 } |
178 | 179 |
180 void ServiceWorkerRegistration::dispose() | |
181 { | |
182 // See ServiceWorker::dispose() comment why this explicit dispose() action i s needed. | |
183 m_outerRegistration.clear(); | |
haraken
2015/01/26 01:39:42
Can we add ASSERT(!m_outerRegistration) to ~Servic
sof
2015/01/26 10:06:57
Done.
| |
184 } | |
185 | |
186 | |
179 } // namespace blink | 187 } // namespace blink |
OLD | NEW |