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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 if (!context_core_.get()) { | 257 if (!context_core_.get()) { |
258 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive."; | 258 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive."; |
259 return; | 259 return; |
260 } | 260 } |
261 context_core_->storage()->FindRegistrationForPattern( | 261 context_core_->storage()->FindRegistrationForPattern( |
262 net::SimplifyUrlForRequest(pattern), | 262 net::SimplifyUrlForRequest(pattern), |
263 base::Bind(&ServiceWorkerContextWrapper::DidFindRegistrationForUpdate, | 263 base::Bind(&ServiceWorkerContextWrapper::DidFindRegistrationForUpdate, |
264 this)); | 264 this)); |
265 } | 265 } |
266 | 266 |
| 267 void ServiceWorkerContextWrapper::RegisterBrowserProviderHost( |
| 268 scoped_ptr<ServiceWorkerProviderHost> provider_host) { |
| 269 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 270 context()->RegisterBrowserProviderHost(provider_host.Pass()); |
| 271 } |
| 272 |
267 void ServiceWorkerContextWrapper::StartServiceWorker( | 273 void ServiceWorkerContextWrapper::StartServiceWorker( |
268 const GURL& pattern, | 274 const GURL& pattern, |
269 const StatusCallback& callback) { | 275 const StatusCallback& callback) { |
270 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 276 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
271 BrowserThread::PostTask( | 277 BrowserThread::PostTask( |
272 BrowserThread::IO, FROM_HERE, | 278 BrowserThread::IO, FROM_HERE, |
273 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, | 279 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, |
274 pattern, callback)); | 280 pattern, callback)); |
275 return; | 281 return; |
276 } | 282 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 observer_list_->Notify(FROM_HERE, | 649 observer_list_->Notify(FROM_HERE, |
644 &ServiceWorkerContextObserver::OnStorageWiped); | 650 &ServiceWorkerContextObserver::OnStorageWiped); |
645 } | 651 } |
646 | 652 |
647 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 653 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
648 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 654 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
649 return context_core_.get(); | 655 return context_core_.get(); |
650 } | 656 } |
651 | 657 |
652 } // namespace content | 658 } // namespace content |
OLD | NEW |