| 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_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 base::FeatureList::OVERRIDE_DISABLE_FEATURE)) { | 1090 base::FeatureList::OVERRIDE_DISABLE_FEATURE)) { |
| 1091 return NavigationPreloadSupportStatus:: | 1091 return NavigationPreloadSupportStatus:: |
| 1092 NOT_SUPPORTED_DISABLED_BY_COMMAND_LINE; | 1092 NOT_SUPPORTED_DISABLED_BY_COMMAND_LINE; |
| 1093 } | 1093 } |
| 1094 if (base::FeatureList::IsEnabled(features::kServiceWorkerNavigationPreload)) { | 1094 if (base::FeatureList::IsEnabled(features::kServiceWorkerNavigationPreload)) { |
| 1095 return NavigationPreloadSupportStatus::SUPPORTED; | 1095 return NavigationPreloadSupportStatus::SUPPORTED; |
| 1096 } | 1096 } |
| 1097 return NavigationPreloadSupportStatus::NOT_SUPPORTED_FIELD_TRIAL_STOPPED; | 1097 return NavigationPreloadSupportStatus::NOT_SUPPORTED_FIELD_TRIAL_STOPPED; |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 void ServiceWorkerVersion::CountFeature(uint32_t feature) { |
| 1101 if (!used_features_.insert(feature).second) |
| 1102 return; |
| 1103 for (auto provider_host_by_uuid : controllee_map_) |
| 1104 provider_host_by_uuid.second->CountFeature(feature); |
| 1105 } |
| 1106 |
| 1100 void ServiceWorkerVersion::OnSimpleEventResponse( | 1107 void ServiceWorkerVersion::OnSimpleEventResponse( |
| 1101 int request_id, | 1108 int request_id, |
| 1102 blink::WebServiceWorkerEventResult result, | 1109 blink::WebServiceWorkerEventResult result, |
| 1103 base::Time dispatch_event_time) { | 1110 base::Time dispatch_event_time) { |
| 1104 ServiceWorkerStatusCode status = SERVICE_WORKER_OK; | 1111 ServiceWorkerStatusCode status = SERVICE_WORKER_OK; |
| 1105 if (result == blink::WebServiceWorkerEventResultRejected) | 1112 if (result == blink::WebServiceWorkerEventResultRejected) |
| 1106 status = SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED; | 1113 status = SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED; |
| 1107 OnSimpleEventFinished(request_id, status, dispatch_event_time); | 1114 OnSimpleEventFinished(request_id, status, dispatch_event_time); |
| 1108 } | 1115 } |
| 1109 | 1116 |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 | 1894 |
| 1888 void ServiceWorkerVersion::CleanUpExternalRequest( | 1895 void ServiceWorkerVersion::CleanUpExternalRequest( |
| 1889 const std::string& request_uuid, | 1896 const std::string& request_uuid, |
| 1890 ServiceWorkerStatusCode status) { | 1897 ServiceWorkerStatusCode status) { |
| 1891 if (status == SERVICE_WORKER_OK) | 1898 if (status == SERVICE_WORKER_OK) |
| 1892 return; | 1899 return; |
| 1893 external_request_uuid_to_request_id_.erase(request_uuid); | 1900 external_request_uuid_to_request_id_.erase(request_uuid); |
| 1894 } | 1901 } |
| 1895 | 1902 |
| 1896 } // namespace content | 1903 } // namespace content |
| OLD | NEW |