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

Unified Diff: content/common/service_worker/service_worker_provider_struct_traits.h

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Rebase Created 3 years, 10 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_provider_struct_traits.h
diff --git a/content/common/service_worker/service_worker_provider_struct_traits.h b/content/common/service_worker/service_worker_provider_struct_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..e8cff4489863a3888cde974be2c1b58e6f822972
--- /dev/null
+++ b/content/common/service_worker/service_worker_provider_struct_traits.h
@@ -0,0 +1,40 @@
+// Copyright 2017 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.
+
+#ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_STRUCT_TRAITS_H_
+#define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_STRUCT_TRAITS_H_
+
+#include "content/common/service_worker/service_worker_provider.mojom.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<content::mojom::ServiceWorkerProviderHostInfoDataView,
+ content::ServiceWorkerProviderHostInfo> {
+ static int32_t provider_id(
+ const content::ServiceWorkerProviderHostInfo& info) {
+ return info.provider_id;
+ }
+
+ static int32_t route_id(const content::ServiceWorkerProviderHostInfo& info) {
+ return info.route_id;
+ }
+
+ static content::ServiceWorkerProviderType type(
+ const content::ServiceWorkerProviderHostInfo& info) {
+ return info.type;
+ }
+
+ static bool is_parent_frame_secure(
+ const content::ServiceWorkerProviderHostInfo& info) {
+ return info.is_parent_frame_secure;
+ }
+
+ static bool Read(content::mojom::ServiceWorkerProviderHostInfoDataView in,
+ content::ServiceWorkerProviderHostInfo* out);
+};
+
+} // namespace mojo
+
+#endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_STRUCT_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698