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

Unified Diff: device/wake_lock/public/interfaces/wake_lock_param_traits.h

Issue 2867303003: Generalize the API of WakeLockContext mojo interface. (Closed)
Patch Set: Created 3 years, 7 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: device/wake_lock/public/interfaces/wake_lock_param_traits.h
diff --git a/device/wake_lock/public/interfaces/wake_lock_param_traits.h b/device/wake_lock/public/interfaces/wake_lock_param_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..862fdc1d2342726edb9a1e2015d1ce0502086542
--- /dev/null
+++ b/device/wake_lock/public/interfaces/wake_lock_param_traits.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 DEVICE_WAKE_LOCK_PUBLIC_INTERFACES_WAKE_LOCK_PARAM_TRAITS_H_
+#define DEVICE_WAKE_LOCK_PUBLIC_INTERFACES_WAKE_LOCK_PARAM_TRAITS_H_
+
+#include <stddef.h>
+
+#include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h"
+
+namespace mojo {
+
+template <>
+struct EnumTraits<device::mojom::WakeLockType,
+ device::PowerSaveBlocker::PowerSaveBlockerType> {
+ static device::mojom::WakeLockType ToMojom(
+ device::PowerSaveBlocker::PowerSaveBlockerType input);
+ static bool FromMojom(device::mojom::WakeLockType input,
+ device::PowerSaveBlocker::PowerSaveBlockerType* output);
+};
+
+template <>
+struct EnumTraits<device::mojom::WakeLockReason,
+ device::PowerSaveBlocker::Reason> {
+ static device::mojom::WakeLockReason ToMojom(
+ device::PowerSaveBlocker::Reason input);
+ static bool FromMojom(device::mojom::WakeLockReason input,
+ device::PowerSaveBlocker::Reason* output);
+};
+
+} // namespace mojo
+
+#endif // DEVICE_WAKE_LOCK_PUBLIC_INTERFACES_WAKE_LOCK_PARAM_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698