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

Unified Diff: content/child/background_sync/background_sync_type_converters.h

Issue 1106193002: Add Mojo types and service definitions for Background Sync API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/child/background_sync/background_sync_type_converters.h
diff --git a/content/child/background_sync/background_sync_type_converters.h b/content/child/background_sync/background_sync_type_converters.h
new file mode 100644
index 0000000000000000000000000000000000000000..fd70daca2bb9ad63ae2f66069ba49ee18c999463
--- /dev/null
+++ b/content/child/background_sync/background_sync_type_converters.h
@@ -0,0 +1,85 @@
+// 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.
+
+#ifndef CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_TYPE_CONVERTERS_H_
+#define CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_TYPE_CONVERTERS_H_
+
+#include "content/common/background_sync_service.mojom.h"
+#include "third_party/WebKit/public/platform/modules/background_sync/WebSyncError.h"
+#include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegistration.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/type_converter.h"
+
+namespace mojo {
+
+// blink::WebSyngRegistration::Periodicity <=>
+// content::background_sync::SyncPeriodicity
+
+template <>
+struct TypeConverter<blink::WebSyncRegistration::Periodicity,
+ content::background_sync::SyncPeriodicity> {
+ static blink::WebSyncRegistration::Periodicity Convert(
+ content::background_sync::SyncPeriodicity input);
+};
+
+template <>
+struct TypeConverter<content::background_sync::SyncPeriodicity,
+ blink::WebSyncRegistration::Periodicity> {
+ static content::background_sync::SyncPeriodicity Convert(
+ blink::WebSyncRegistration::Periodicity input);
+};
+
+// blink::WebSyncRegistration::NetworkState <=>
+// content::background_sync::SyncNetworkState
+
+template <>
+struct TypeConverter<blink::WebSyncRegistration::NetworkState,
+ content::background_sync::SyncNetworkState> {
+ static blink::WebSyncRegistration::NetworkState Convert(
+ content::background_sync::SyncNetworkState input);
+};
+
+template <>
+struct TypeConverter<content::background_sync::SyncNetworkState,
+ blink::WebSyncRegistration::NetworkState> {
+ static content::background_sync::SyncNetworkState Convert(
+ blink::WebSyncRegistration::NetworkState input);
+};
+
+// blink::WebSyncRegistration::PowerState <=>
+// content::background_sync::SyncPowerState
+
+template <>
+struct TypeConverter<blink::WebSyncRegistration::PowerState,
+ content::background_sync::SyncPowerState> {
+ static blink::WebSyncRegistration::PowerState Convert(
+ content::background_sync::SyncPowerState input);
+};
+
+template <>
+struct TypeConverter<content::background_sync::SyncPowerState,
+ blink::WebSyncRegistration::PowerState> {
+ static content::background_sync::SyncPowerState Convert(
+ blink::WebSyncRegistration::PowerState input);
+};
+
+// blink::WebSyncRegistration <=>
+// content::background_sync::SyncRegistration
+
+template <>
+struct TypeConverter<blink::WebSyncRegistration *,
+ content::background_sync::SyncRegistrationPtr> {
+ static blink::WebSyncRegistration* Convert(
+ const content::background_sync::SyncRegistrationPtr& input);
+};
+
+template <>
+struct TypeConverter<content::background_sync::SyncRegistrationPtr,
+ blink::WebSyncRegistration> {
+ static content::background_sync::SyncRegistrationPtr Convert(
+ const blink::WebSyncRegistration& input);
+};
+
+} // namespace mojo
jkarlin 2015/04/27 18:25:11 two spaces between code and comment
iclelland 2015/04/28 12:41:29 Done.
+
+#endif // CONTENT_CHILD_BACKGROUND_SYNC_BACKGROUND_SYNC_TYPE_CONVERTERS_H_

Powered by Google App Engine
This is Rietveld 408576698