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