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

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

Issue 2581943002: Make sure that ServiceWorkerContainer::m_navigator is not null (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 ServiceWorkerContainer::~ServiceWorkerContainer() { 132 ServiceWorkerContainer::~ServiceWorkerContainer() {
133 ASSERT(!m_provider); 133 ASSERT(!m_provider);
134 } 134 }
135 135
136 void ServiceWorkerContainer::contextDestroyed() { 136 void ServiceWorkerContainer::contextDestroyed() {
137 if (m_provider) { 137 if (m_provider) {
138 m_provider->setClient(0); 138 m_provider->setClient(0);
139 m_provider = nullptr; 139 m_provider = nullptr;
140 } 140 }
141 if (m_navigator) 141 m_navigator->clearServiceWorker();
142 m_navigator->clearServiceWorker();
143 } 142 }
144 143
145 DEFINE_TRACE(ServiceWorkerContainer) { 144 DEFINE_TRACE(ServiceWorkerContainer) {
146 visitor->trace(m_controller); 145 visitor->trace(m_controller);
147 visitor->trace(m_ready); 146 visitor->trace(m_ready);
148 visitor->trace(m_navigator); 147 visitor->trace(m_navigator);
149 EventTargetWithInlineData::trace(visitor); 148 EventTargetWithInlineData::trace(visitor);
150 ContextLifecycleObserver::trace(visitor); 149 ContextLifecycleObserver::trace(visitor);
151 } 150 }
152 151
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 473
475 if (ServiceWorkerContainerClient* client = 474 if (ServiceWorkerContainerClient* client =
476 ServiceWorkerContainerClient::from(executionContext)) { 475 ServiceWorkerContainerClient::from(executionContext)) {
477 m_provider = client->provider(); 476 m_provider = client->provider();
478 if (m_provider) 477 if (m_provider)
479 m_provider->setClient(this); 478 m_provider->setClient(this);
480 } 479 }
481 } 480 }
482 481
483 } // namespace blink 482 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698