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

Side by Side Diff: content/browser/service_worker/service_worker_context_wrapper.cc

Issue 653633004: Shutdown Service Workers before the profile is destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 6 years, 1 month 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/service_worker/service_worker_context_wrapper.h" 5 #include "content/browser/service_worker/service_worker_context_wrapper.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 FROM_HERE, 148 FROM_HERE,
149 base::Bind(continuation, false)); 149 base::Bind(continuation, false));
150 return; 150 return;
151 } 151 }
152 152
153 context()->UnregisterServiceWorker( 153 context()->UnregisterServiceWorker(
154 pattern, 154 pattern,
155 base::Bind(&FinishUnregistrationOnIO, continuation)); 155 base::Bind(&FinishUnregistrationOnIO, continuation));
156 } 156 }
157 157
158 void ServiceWorkerContextWrapper::Terminate() {
159 DCHECK_CURRENTLY_ON(BrowserThread::UI);
160 process_manager_->Shutdown();
161 }
162
163 void ServiceWorkerContextWrapper::GetAllOriginsInfo( 158 void ServiceWorkerContextWrapper::GetAllOriginsInfo(
164 const GetUsageInfoCallback& callback) { 159 const GetUsageInfoCallback& callback) {
165 DCHECK_CURRENTLY_ON(BrowserThread::IO); 160 DCHECK_CURRENTLY_ON(BrowserThread::IO);
166 if (!context_core_.get()) { 161 if (!context_core_.get()) {
167 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive."; 162 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
168 BrowserThread::PostTask( 163 BrowserThread::PostTask(
169 BrowserThread::IO, 164 BrowserThread::IO,
170 FROM_HERE, 165 FROM_HERE,
171 base::Bind(callback, std::vector<ServiceWorkerUsageInfo>())); 166 base::Bind(callback, std::vector<ServiceWorkerUsageInfo>()));
172 return; 167 return;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 DCHECK_CURRENTLY_ON(BrowserThread::IO); 300 DCHECK_CURRENTLY_ON(BrowserThread::IO);
306 if (status != SERVICE_WORKER_OK) { 301 if (status != SERVICE_WORKER_OK) {
307 context_core_.reset(); 302 context_core_.reset();
308 return; 303 return;
309 } 304 }
310 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); 305 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this));
311 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; 306 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully.";
312 } 307 }
313 308
314 } // namespace content 309 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698