Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp

Issue 2144213002: ServiceWorkerContainer should override contextDestroyed and clear m_provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ServiceWorkerContainer* ServiceWorkerContainer::create(ExecutionContext* executi onContext) 175 ServiceWorkerContainer* ServiceWorkerContainer::create(ExecutionContext* executi onContext)
176 { 176 {
177 return new ServiceWorkerContainer(executionContext); 177 return new ServiceWorkerContainer(executionContext);
178 } 178 }
179 179
180 ServiceWorkerContainer::~ServiceWorkerContainer() 180 ServiceWorkerContainer::~ServiceWorkerContainer()
181 { 181 {
182 ASSERT(!m_provider); 182 ASSERT(!m_provider);
183 } 183 }
184 184
185 void ServiceWorkerContainer::willBeDetachedFromFrame() 185 void ServiceWorkerContainer::contextDestroyed()
186 { 186 {
187 if (m_provider) { 187 if (m_provider) {
188 m_provider->setClient(0); 188 m_provider->setClient(0);
189 m_provider = nullptr; 189 m_provider = nullptr;
190 } 190 }
191 } 191 }
192 192
193 DEFINE_TRACE(ServiceWorkerContainer) 193 DEFINE_TRACE(ServiceWorkerContainer)
194 { 194 {
195 visitor->trace(m_controller); 195 visitor->trace(m_controller);
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 return; 420 return;
421 421
422 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro m(executionContext)) { 422 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro m(executionContext)) {
423 m_provider = client->provider(); 423 m_provider = client->provider();
424 if (m_provider) 424 if (m_provider)
425 m_provider->setClient(this); 425 m_provider->setClient(this);
426 } 426 }
427 } 427 }
428 428
429 } // namespace blink 429 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698