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::RegisterNavigationProviderHost( |
| 268 |
| 269 const GURL& response_stream_url, |
| 270 scoped_ptr<ServiceWorkerProviderHost> provider_host) { |
| 271 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 272 context()->RegisterNavigationProviderHost(response_stream_url, |
| 273 provider_host.Pass()); |
| 274 } |
| 275 |
267 void ServiceWorkerContextWrapper::StartServiceWorker( | 276 void ServiceWorkerContextWrapper::StartServiceWorker( |
268 const GURL& pattern, | 277 const GURL& pattern, |
269 const StatusCallback& callback) { | 278 const StatusCallback& callback) { |
270 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 279 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
271 BrowserThread::PostTask( | 280 BrowserThread::PostTask( |
272 BrowserThread::IO, FROM_HERE, | 281 BrowserThread::IO, FROM_HERE, |
273 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, | 282 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, |
274 pattern, callback)); | 283 pattern, callback)); |
275 return; | 284 return; |
276 } | 285 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 observer_list_->Notify(FROM_HERE, | 652 observer_list_->Notify(FROM_HERE, |
644 &ServiceWorkerContextObserver::OnStorageWiped); | 653 &ServiceWorkerContextObserver::OnStorageWiped); |
645 } | 654 } |
646 | 655 |
647 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 656 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
648 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 657 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
649 return context_core_.get(); | 658 return context_core_.get(); |
650 } | 659 } |
651 | 660 |
652 } // namespace content | 661 } // namespace content |
OLD | NEW |