Index: content/common/service_worker/service_worker_types_struct_traits.cc |
diff --git a/content/common/service_worker/service_worker_types_struct_traits.cc b/content/common/service_worker/service_worker_types_struct_traits.cc |
index f88acbca35f1a491fca0542490316c04a3193143..3e40fd520d424eb7b8c1fe0d1cc4f52635ea2888 100644 |
--- a/content/common/service_worker/service_worker_types_struct_traits.cc |
+++ b/content/common/service_worker/service_worker_types_struct_traits.cc |
@@ -4,21 +4,55 @@ |
#include "content/common/service_worker/service_worker_types_struct_traits.h" |
+#include "base/logging.h" |
+ |
namespace mojo { |
-content::mojom::ServiceWorkerProviderType |
-EnumTraits<content::mojom::ServiceWorkerProviderType, |
- content::ServiceWorkerProviderType>:: |
+using content::mojom::ServiceWorkerProviderType; |
+ |
+ServiceWorkerProviderType |
+EnumTraits<ServiceWorkerProviderType, content::ServiceWorkerProviderType>:: |
ToMojom(content::ServiceWorkerProviderType input) { |
- return static_cast<content::mojom::ServiceWorkerProviderType>(input); |
+ switch (input) { |
+ case content::SERVICE_WORKER_PROVIDER_UNKNOWN: |
+ return ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_UNKNOWN; |
+ case content::SERVICE_WORKER_PROVIDER_FOR_WINDOW: |
+ return ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_FOR_WINDOW; |
+ case content::SERVICE_WORKER_PROVIDER_FOR_WORKER: |
+ return ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_FOR_WORKER; |
+ case content::SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER: |
+ return ServiceWorkerProviderType:: |
+ SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER; |
+ case content::SERVICE_WORKER_PROVIDER_FOR_CONTROLLER: |
+ return ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_FOR_CONTROLLER; |
+ } |
+ |
+ NOTREACHED(); |
+ return ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_UNKNOWN; |
} |
-bool EnumTraits<content::mojom::ServiceWorkerProviderType, |
- content::ServiceWorkerProviderType>:: |
- FromMojom(content::mojom::ServiceWorkerProviderType input, |
+bool EnumTraits<ServiceWorkerProviderType, content::ServiceWorkerProviderType>:: |
+ FromMojom(ServiceWorkerProviderType input, |
content::ServiceWorkerProviderType* out) { |
- *out = static_cast<content::ServiceWorkerProviderType>(input); |
- return true; |
+ switch (input) { |
+ case ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_UNKNOWN: |
+ *out = content::SERVICE_WORKER_PROVIDER_UNKNOWN; |
+ return true; |
+ case ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_FOR_WINDOW: |
+ *out = content::SERVICE_WORKER_PROVIDER_FOR_WINDOW; |
+ return true; |
+ case ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_FOR_WORKER: |
+ *out = content::SERVICE_WORKER_PROVIDER_FOR_WORKER; |
+ return true; |
+ case ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER: |
+ *out = content::SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER; |
+ return true; |
+ case ServiceWorkerProviderType::SERVICE_WORKER_PROVIDER_FOR_CONTROLLER: |
+ *out = content::SERVICE_WORKER_PROVIDER_FOR_CONTROLLER; |
+ return true; |
+ } |
+ |
+ return false; |
} |
} // namespace mojo |