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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 return; | 252 return; |
253 } | 253 } |
254 if (!context_core_) | 254 if (!context_core_) |
255 return; | 255 return; |
256 context_core_->storage()->FindRegistrationForPattern( | 256 context_core_->storage()->FindRegistrationForPattern( |
257 net::SimplifyUrlForRequest(pattern), | 257 net::SimplifyUrlForRequest(pattern), |
258 base::Bind(&ServiceWorkerContextWrapper::DidFindRegistrationForUpdate, | 258 base::Bind(&ServiceWorkerContextWrapper::DidFindRegistrationForUpdate, |
259 this)); | 259 this)); |
260 } | 260 } |
261 | 261 |
| 262 void ServiceWorkerContextWrapper::RegisterBrowserProviderHost( |
| 263 scoped_ptr<ServiceWorkerProviderHost> provider_host) { |
| 264 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 265 context()->RegisterBrowserProviderHost(provider_host.Pass()); |
| 266 } |
| 267 |
262 void ServiceWorkerContextWrapper::StartServiceWorker( | 268 void ServiceWorkerContextWrapper::StartServiceWorker( |
263 const GURL& pattern, | 269 const GURL& pattern, |
264 const StatusCallback& callback) { | 270 const StatusCallback& callback) { |
265 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 271 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
266 BrowserThread::PostTask( | 272 BrowserThread::PostTask( |
267 BrowserThread::IO, FROM_HERE, | 273 BrowserThread::IO, FROM_HERE, |
268 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, | 274 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, |
269 pattern, callback)); | 275 pattern, callback)); |
270 return; | 276 return; |
271 } | 277 } |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 observer_list_->Notify(FROM_HERE, | 636 observer_list_->Notify(FROM_HERE, |
631 &ServiceWorkerContextObserver::OnStorageWiped); | 637 &ServiceWorkerContextObserver::OnStorageWiped); |
632 } | 638 } |
633 | 639 |
634 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 640 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
635 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 641 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
636 return context_core_.get(); | 642 return context_core_.get(); |
637 } | 643 } |
638 | 644 |
639 } // namespace content | 645 } // namespace content |
OLD | NEW |