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_core.h" | 5 #include "content/browser/service_worker/service_worker_context_core.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 } | 759 } |
760 } | 760 } |
761 | 761 |
762 int ServiceWorkerContextCore::GetVersionFailureCount(int64_t version_id) { | 762 int ServiceWorkerContextCore::GetVersionFailureCount(int64_t version_id) { |
763 auto it = failure_counts_.find(version_id); | 763 auto it = failure_counts_.find(version_id); |
764 if (it == failure_counts_.end()) | 764 if (it == failure_counts_.end()) |
765 return 0; | 765 return 0; |
766 return it->second.count; | 766 return it->second.count; |
767 } | 767 } |
768 | 768 |
| 769 void ServiceWorkerContextCore::OnStorageWiped() { |
| 770 if (!observer_list_) |
| 771 return; |
| 772 observer_list_->Notify(FROM_HERE, |
| 773 &ServiceWorkerContextCoreObserver::OnStorageWiped); |
| 774 } |
| 775 |
769 void ServiceWorkerContextCore::OnRunningStateChanged( | 776 void ServiceWorkerContextCore::OnRunningStateChanged( |
770 ServiceWorkerVersion* version) { | 777 ServiceWorkerVersion* version) { |
771 if (!observer_list_) | 778 if (!observer_list_) |
772 return; | 779 return; |
773 observer_list_->Notify( | 780 observer_list_->Notify( |
774 FROM_HERE, &ServiceWorkerContextCoreObserver::OnRunningStateChanged, | 781 FROM_HERE, &ServiceWorkerContextCoreObserver::OnRunningStateChanged, |
775 version->version_id(), version->running_status()); | 782 version->version_id(), version->running_status()); |
776 } | 783 } |
777 | 784 |
778 void ServiceWorkerContextCore::OnVersionStateChanged( | 785 void ServiceWorkerContextCore::OnVersionStateChanged( |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 int service_worker_provider_id, | 923 int service_worker_provider_id, |
917 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo client_ptr_info) { | 924 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo client_ptr_info) { |
918 ServiceWorkerProviderHost* provider_host = | 925 ServiceWorkerProviderHost* provider_host = |
919 GetProviderHost(render_process_id, service_worker_provider_id); | 926 GetProviderHost(render_process_id, service_worker_provider_id); |
920 if (!provider_host) | 927 if (!provider_host) |
921 return; | 928 return; |
922 provider_host->BindWorkerFetchContext(std::move(client_ptr_info)); | 929 provider_host->BindWorkerFetchContext(std::move(client_ptr_info)); |
923 } | 930 } |
924 | 931 |
925 } // namespace content | 932 } // namespace content |
OLD | NEW |