| Index: third_party/WebKit/Source/web/WebServiceWorkerStructTraits.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebServiceWorkerStructTraits.cpp b/third_party/WebKit/Source/web/WebServiceWorkerStructTraits.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..84fa69c8fc21221978a5c3252d7589fc24c9b235
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/web/WebServiceWorkerStructTraits.cpp
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "public/platform/modules/serviceworker/WebServiceWorkerStructTraits.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +// static
|
| +blink::mojom::blink::ServiceWorkerEventStatus EnumTraits<blink::mojom::blink::ServiceWorkerEventStatus, blink::WebServiceWorkerEventResult>::ToMojom(blink::WebServiceWorkerEventResult input)
|
| +{
|
| + switch(input) {
|
| + case blink::WebServiceWorkerEventResultCompleted:
|
| + return blink::mojom::blink::ServiceWorkerEventStatus::COMPLETED;
|
| + case blink::WebServiceWorkerEventResultRejected:
|
| + return blink::mojom::blink::ServiceWorkerEventStatus::REJECTED;
|
| + case blink::WebServiceWorkerEventResultAborted:
|
| + return blink::mojom::blink::ServiceWorkerEventStatus::ABORTED;
|
| + }
|
| + NOTREACHED();
|
| + return blink::mojom::blink::ServiceWorkerEventStatus::REJECTED;
|
| +}
|
| +
|
| +// static
|
| +bool EnumTraits<blink::mojom::blink::ServiceWorkerEventStatus, blink::WebServiceWorkerEventResult>::FromMojom(blink::mojom::blink::ServiceWorkerEventStatus input, blink::WebServiceWorkerEventResult* output)
|
| +{
|
| + switch(input) {
|
| + case blink::mojom::blink::ServiceWorkerEventStatus::COMPLETED:
|
| + *output = blink::WebServiceWorkerEventResultCompleted;
|
| + return true;
|
| + case blink::mojom::blink::ServiceWorkerEventStatus::REJECTED:
|
| + *output = blink::WebServiceWorkerEventResultRejected;
|
| + return true;
|
| + case blink::mojom::blink::ServiceWorkerEventStatus::ABORTED:
|
| + *output = blink::WebServiceWorkerEventResultAborted;
|
| + return true;
|
| + }
|
| + NOTREACHED();
|
| + return false;
|
| +}
|
| +
|
| +} // namespace mojo
|
|
|