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

Unified Diff: mojo/common/common_custom_types_struct_traits.h

Issue 2517223002: Move content/renderer/background_sync to Blink (Closed)
Patch Set: Fix broken WebEmbeddedWorker test Created 4 years, 1 month 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 | « mojo/common/common_custom_types.mojom ('k') | third_party/WebKit/Source/modules/background_sync/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/common_custom_types_struct_traits.h
diff --git a/mojo/common/common_custom_types_struct_traits.h b/mojo/common/common_custom_types_struct_traits.h
index b99e15ffc9d803ff7e0aea30cfc60d671f01b007..45fc6fd17becdbf94fbdb8588958faea0092f38c 100644
--- a/mojo/common/common_custom_types_struct_traits.h
+++ b/mojo/common/common_custom_types_struct_traits.h
@@ -56,6 +56,16 @@ struct StructTraits<common::mojom::UnguessableTokenDataView,
};
template <>
+struct StructTraits<common::mojom::TimeDataView, base::Time> {
+ static double seconds(const base::Time& time) { return time.ToDoubleT(); }
+
+ static bool Read(common::mojom::TimeDataView data, base::Time* time) {
+ *time = base::Time::FromDoubleT(data.seconds());
+ return true;
+ }
+};
+
+template <>
struct StructTraits<common::mojom::TimeDeltaDataView, base::TimeDelta> {
static int64_t microseconds(const base::TimeDelta& delta) {
return delta.InMicroseconds();
« no previous file with comments | « mojo/common/common_custom_types.mojom ('k') | third_party/WebKit/Source/modules/background_sync/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698