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

Unified Diff: content/common/service_worker/service_worker_event_status_struct_traits.cc

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
Index: content/common/service_worker/service_worker_event_status_struct_traits.cc
diff --git a/content/common/service_worker/service_worker_event_status_struct_traits.cc b/content/common/service_worker/service_worker_event_status_struct_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e77db5ec86802e286c68d25443f4e4159a9536b9
--- /dev/null
+++ b/content/common/service_worker/service_worker_event_status_struct_traits.cc
@@ -0,0 +1,38 @@
+// Copyright 2015 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 "content/common/service_worker/service_worker_event_status_struct_traits.h"
+
+namespace mojo {
+
+blink::mojom::ServiceWorkerEventStatus
+EnumTraits<blink::mojom::ServiceWorkerEventStatus,
+ content::ServiceWorkerStatusCode>::
+ ToMojom(content::ServiceWorkerStatusCode input) {
+ NOTIMPLEMENTED();
+ return blink::mojom::ServiceWorkerEventStatus::ABORTED;
+}
+
+bool EnumTraits<blink::mojom::ServiceWorkerEventStatus,
+ content::ServiceWorkerStatusCode>::
+ FromMojom(blink::mojom::ServiceWorkerEventStatus input,
+ content::ServiceWorkerStatusCode* output) {
+ switch (status) {
+ case blink::mojom::ServiceWorkerEventStatus::COMPLETED:
+ *output = content::SERVICE_WORKER_OK;
+ return true;
+ case blink::mojom::ServiceWorkerEventStatus::REJECTED:
+ *output = content::SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED;
+ return true;
+ case blink::mojom::ServiceWorkerEventStatus::ABORTED:
+ *output = content::SERVICE_WORKER_ERROR_ABORT;
+ return true;
+ }
+ // We received an unexpected value back. This can theoretically happen as
+ // mojo doesn't validate enum values.
+ *output = content::SERVICE_WORKER_ERROR_IPC_FAILED;
+ return false;
+}
+
+} // namespace mojo
« no previous file with comments | « content/common/service_worker/service_worker_event_status_struct_traits.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698