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

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

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Glorious Post-Blink Merge Rebase Created 5 years, 2 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 // 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 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 return; 264 return;
265 } 265 }
266 if (!context_core_) 266 if (!context_core_)
267 return; 267 return;
268 context_core_->storage()->FindRegistrationForPattern( 268 context_core_->storage()->FindRegistrationForPattern(
269 net::SimplifyUrlForRequest(pattern), 269 net::SimplifyUrlForRequest(pattern),
270 base::Bind(&ServiceWorkerContextWrapper::DidFindRegistrationForUpdate, 270 base::Bind(&ServiceWorkerContextWrapper::DidFindRegistrationForUpdate,
271 this)); 271 this));
272 } 272 }
273 273
274 void ServiceWorkerContextWrapper::RegisterBrowserProviderHost(
275 scoped_ptr<ServiceWorkerProviderHost> provider_host) {
276 DCHECK_CURRENTLY_ON(BrowserThread::IO);
277 context()->RegisterBrowserProviderHost(provider_host.Pass());
278 }
279
274 void ServiceWorkerContextWrapper::StartServiceWorker( 280 void ServiceWorkerContextWrapper::StartServiceWorker(
275 const GURL& pattern, 281 const GURL& pattern,
276 const StatusCallback& callback) { 282 const StatusCallback& callback) {
277 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { 283 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
278 BrowserThread::PostTask( 284 BrowserThread::PostTask(
279 BrowserThread::IO, FROM_HERE, 285 BrowserThread::IO, FROM_HERE,
280 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, 286 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this,
281 pattern, callback)); 287 pattern, callback));
282 return; 288 return;
283 } 289 }
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 observer_list_->Notify(FROM_HERE, 702 observer_list_->Notify(FROM_HERE,
697 &ServiceWorkerContextObserver::OnStorageWiped); 703 &ServiceWorkerContextObserver::OnStorageWiped);
698 } 704 }
699 705
700 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { 706 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
701 DCHECK_CURRENTLY_ON(BrowserThread::IO); 707 DCHECK_CURRENTLY_ON(BrowserThread::IO);
702 return context_core_.get(); 708 return context_core_.get();
703 } 709 }
704 710
705 } // namespace content 711 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698