| 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 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { | 1100 void ServiceWorkerVersion::CountFeature(uint32_t feature) { |
| 1101 if (!used_features_.insert(feature).second) | 1101 if (!used_features_.insert(feature).second) |
| 1102 return; | 1102 return; |
| 1103 for (auto provider_host_by_uuid : controllee_map_) | 1103 for (auto provider_host_by_uuid : controllee_map_) |
| 1104 provider_host_by_uuid.second->CountFeature(feature); | 1104 provider_host_by_uuid.second->CountFeature(feature); |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 void ServiceWorkerVersion::OnSimpleEventResponse( | |
| 1108 int request_id, | |
| 1109 blink::WebServiceWorkerEventResult result, | |
| 1110 base::Time dispatch_event_time) { | |
| 1111 ServiceWorkerStatusCode status = SERVICE_WORKER_OK; | |
| 1112 if (result == blink::WebServiceWorkerEventResultRejected) | |
| 1113 status = SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED; | |
| 1114 OnSimpleEventFinished(request_id, status, dispatch_event_time); | |
| 1115 } | |
| 1116 | |
| 1117 void ServiceWorkerVersion::OnOpenWindow(int request_id, GURL url) { | 1107 void ServiceWorkerVersion::OnOpenWindow(int request_id, GURL url) { |
| 1118 // Just abort if we are shutting down. | 1108 // Just abort if we are shutting down. |
| 1119 if (!context_) | 1109 if (!context_) |
| 1120 return; | 1110 return; |
| 1121 | 1111 |
| 1122 if (!url.is_valid()) { | 1112 if (!url.is_valid()) { |
| 1123 DVLOG(1) << "Received unexpected invalid URL from renderer process."; | 1113 DVLOG(1) << "Received unexpected invalid URL from renderer process."; |
| 1124 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 1114 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 1125 base::Bind(&KillEmbeddedWorkerProcess, | 1115 base::Bind(&KillEmbeddedWorkerProcess, |
| 1126 embedded_worker_->process_id(), | 1116 embedded_worker_->process_id(), |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 | 1877 |
| 1888 void ServiceWorkerVersion::CleanUpExternalRequest( | 1878 void ServiceWorkerVersion::CleanUpExternalRequest( |
| 1889 const std::string& request_uuid, | 1879 const std::string& request_uuid, |
| 1890 ServiceWorkerStatusCode status) { | 1880 ServiceWorkerStatusCode status) { |
| 1891 if (status == SERVICE_WORKER_OK) | 1881 if (status == SERVICE_WORKER_OK) |
| 1892 return; | 1882 return; |
| 1893 external_request_uuid_to_request_id_.erase(request_uuid); | 1883 external_request_uuid_to_request_id_.erase(request_uuid); |
| 1894 } | 1884 } |
| 1895 | 1885 |
| 1896 } // namespace content | 1886 } // namespace content |
| OLD | NEW |