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 <utility> | 10 #include <utility> |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 285 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
286 base::Bind(callback, SERVICE_WORKER_ERROR_ABORT)); | 286 base::Bind(callback, SERVICE_WORKER_ERROR_ABORT)); |
287 return; | 287 return; |
288 } | 288 } |
289 context_core_->storage()->FindRegistrationForPattern( | 289 context_core_->storage()->FindRegistrationForPattern( |
290 net::SimplifyUrlForRequest(pattern), | 290 net::SimplifyUrlForRequest(pattern), |
291 base::Bind(&StartActiveWorkerOnIO, callback)); | 291 base::Bind(&StartActiveWorkerOnIO, callback)); |
292 } | 292 } |
293 | 293 |
294 void ServiceWorkerContextWrapper::SetForceUpdateOnPageLoad( | 294 void ServiceWorkerContextWrapper::SetForceUpdateOnPageLoad( |
295 int64_t registration_id, | |
296 bool force_update_on_page_load) { | 295 bool force_update_on_page_load) { |
297 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 296 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
298 BrowserThread::PostTask( | 297 BrowserThread::PostTask( |
299 BrowserThread::IO, FROM_HERE, | 298 BrowserThread::IO, FROM_HERE, |
300 base::Bind(&ServiceWorkerContextWrapper::SetForceUpdateOnPageLoad, this, | 299 base::Bind(&ServiceWorkerContextWrapper::SetForceUpdateOnPageLoad, this, |
301 registration_id, force_update_on_page_load)); | 300 force_update_on_page_load)); |
302 return; | 301 return; |
303 } | 302 } |
304 if (!context_core_) | 303 if (!context_core_) |
305 return; | 304 return; |
306 context_core_->SetForceUpdateOnPageLoad(registration_id, | 305 context_core_->set_force_update_on_page_load(force_update_on_page_load); |
307 force_update_on_page_load); | |
308 } | 306 } |
309 | 307 |
310 void ServiceWorkerContextWrapper::GetAllOriginsInfo( | 308 void ServiceWorkerContextWrapper::GetAllOriginsInfo( |
311 const GetUsageInfoCallback& callback) { | 309 const GetUsageInfoCallback& callback) { |
312 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 310 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
313 if (!context_core_) { | 311 if (!context_core_) { |
314 BrowserThread::PostTask( | 312 BrowserThread::PostTask( |
315 BrowserThread::IO, | 313 BrowserThread::IO, |
316 FROM_HERE, | 314 FROM_HERE, |
317 base::Bind(callback, std::vector<ServiceWorkerUsageInfo>())); | 315 base::Bind(callback, std::vector<ServiceWorkerUsageInfo>())); |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 observer_list_->Notify(FROM_HERE, | 715 observer_list_->Notify(FROM_HERE, |
718 &ServiceWorkerContextObserver::OnStorageWiped); | 716 &ServiceWorkerContextObserver::OnStorageWiped); |
719 } | 717 } |
720 | 718 |
721 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 719 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
722 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 720 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
723 return context_core_.get(); | 721 return context_core_.get(); |
724 } | 722 } |
725 | 723 |
726 } // namespace content | 724 } // namespace content |
OLD | NEW |