OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |