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

Unified Diff: public/platform/modules/background_sync/WebSyncRegistration.h

Issue 963683002: Add IDL and initial Blink API for Background Sync (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing serviceWorkerRegistration.syncManager to interface tests Created 5 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
« no previous file with comments | « public/platform/modules/background_sync/WebSyncProvider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/modules/background_sync/WebSyncRegistration.h
diff --git a/public/platform/modules/background_sync/WebSyncRegistration.h b/public/platform/modules/background_sync/WebSyncRegistration.h
index cd9cdc20013d995560e2105f8801a593c0b844d8..970584837fd816619b0e69b109f712595d2f395d 100644
--- a/public/platform/modules/background_sync/WebSyncRegistration.h
+++ b/public/platform/modules/background_sync/WebSyncRegistration.h
@@ -10,7 +10,7 @@
namespace blink {
-struct WebSyncRegistrationOptions {
+struct WebSyncRegistration {
enum NetworkType {
NetworkTypeAny = 0,
NetworkTypeOffline,
@@ -19,28 +19,40 @@ struct WebSyncRegistrationOptions {
NetworkTypeLast = NetworkTypeNonMobile
};
- WebSyncRegistrationOptions(NetworkType networkType, bool allowOnBattery, bool idleRequired)
- : networkType(networkType)
+ WebSyncRegistration(const WebString& registrationId, unsigned long minDelayMs,
+ unsigned long maxDelayMs, unsigned long minPeriodMs, NetworkType minRequiredNetwork,
+ bool allowOnBattery, bool idleRequired)
+ : id(registrationId)
+ , minDelayMs(minDelayMs)
+ , maxDelayMs(maxDelayMs)
+ , minPeriodMs(minPeriodMs)
+ , minRequiredNetwork(minRequiredNetwork)
, allowOnBattery(allowOnBattery)
, idleRequired(idleRequired)
{
}
- NetworkType networkType;
- bool allowOnBattery;
- bool idleRequired;
-};
+ WebString id;
+ /* Minimum delay before sync event (or first sync event, if periodic,) in
+ * milliseconds. */
+ unsigned long minDelayMs;
-struct WebSyncRegistration {
- WebSyncRegistration(const WebString& registrationId, const WebSyncRegistrationOptions& options)
- : id(registrationId)
- , options(options)
- {
- }
+ /* Maximum delay before sync event (or first sync event, if periodic,) in
+ * milliseconds. 0 means no maximum delay. If this value is greater than 0,
+ * then it should not be less than minDelayMs for the registration to be
+ * meaningful.
+ */
+ unsigned long maxDelayMs;
- WebString id;
- WebSyncRegistrationOptions options;
+ /* Minimum time between periodic sync events, in milliseconds. A 0 value
+ * here means that the event is a one-shot (not periodic.)
+ */
+ unsigned long minPeriodMs;
+
+ NetworkType minRequiredNetwork;
+ bool allowOnBattery;
+ bool idleRequired;
};
} // namespace blink
« no previous file with comments | « public/platform/modules/background_sync/WebSyncProvider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698