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

Unified Diff: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchStructTraits.h

Issue 2772893002: Experiment with typemaps in Blink Modules
Patch Set: Experiment with typemaps in Blink Modules Created 3 years, 9 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: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchStructTraits.h
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchStructTraits.h b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchStructTraits.h
new file mode 100644
index 0000000000000000000000000000000000000000..c51cd21dc6aea3436845eb3d43a5f49ac9b09f5e
--- /dev/null
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchStructTraits.h
@@ -0,0 +1,34 @@
+// 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 BackgroundFetchStructTraits_h
+#define BackgroundFetchStructTraits_h
+
+#include "public/platform/modules/background_fetch/background_fetch.mojom-blink.h"
+#include "wtf/text/WTFString.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<blink::mojom::IconDefinitionDataView,
+ blink::IconDefinition> {
+ static WTF::String src(const blink::IconDefinition& definition) {
+ return definition.src();
+ }
+
+ static WTF::String sizes(const blink::IconDefinition& definition) {
+ return definition.sizes();
+ }
+
+ static WTF::String type(const blink::IconDefinition& definition) {
+ return definition.type();
+ }
+
+ static bool Read(blink::mojom::IconDefinitionDataView input,
+ blink::IconDefinition* out);
+};
+
+} // namespace mojo
+
+#endif // BackgroundFetchStructTraits_h

Powered by Google App Engine
This is Rietveld 408576698