Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: third_party/WebKit/Source/web/service_worker_types.typemap

Issue 2168513004: [DO NOT COMMIT] ServiceWorker: First touch of mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove an unnecessary file Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebServiceWorkerStructTraits.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/service_worker_types.typemap
diff --git a/third_party/WebKit/Source/web/service_worker_types.typemap b/third_party/WebKit/Source/web/service_worker_types.typemap
new file mode 100644
index 0000000000000000000000000000000000000000..7a7985b11c415e20e786dd1771e38782981ac411
--- /dev/null
+++ b/third_party/WebKit/Source/web/service_worker_types.typemap
@@ -0,0 +1,36 @@
+// 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 blink {
+
+// static
+mojom::blink::ServiceWorkerEventStatus EnumTraits<mojom::blink::ServiceWorkerEventStatus, ::blink::WebServiceWorkerEventResult>::ToMojom(WebServiceWorkerEventResult input)
+{
+ switch(input) {
+ case WebServiceWorkerEventResultCompleted:
+ return mojom::blink::ServiceWorkerEventStatus::COMPLETED;
+ case WebServiceWorkerEventResultRejected:
+ return mojom::blink::ServiceWorkerEventStatus::REJECTED;
+ }
+ NOTREACHED();
+ return mojom::blink::ServiceWorkerEventStatus::REJECTED;
+}
+
+// static
+bool EnumTraits<mojom::blink::ServiceWorkerEventStatus, ::blink::WebServiceWorkerEventResult>::FromMojom(mojom::blink::ServiceWorkerEventStatus input, WebServiceWorkerEventResult* output)
+{
+ switch(input) {
+ case mojom::blink::ServiceWorkerEventStatus::COMPLETED:
+ return WebServiceWorkerEventResultCompleted;
+ case mojom::blink::ServiceWorkerEventStatus::REJECTED:
+ case mojom::blink::ServiceWorkerEventStatus::ABORTED:
+ return WebServiceWorkerEventResultRejected;
+ }
+ NOTREACHED();
+ return false;
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/web/WebServiceWorkerStructTraits.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698