| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebSyncRegistration_h | 5 #ifndef WebSyncRegistration_h |
| 6 #define WebSyncRegistration_h | 6 #define WebSyncRegistration_h |
| 7 | 7 |
| 8 #include "public/platform/WebPrivatePtr.h" | 8 #include "public/platform/WebPrivatePtr.h" |
| 9 #include "public/platform/WebString.h" | 9 #include "public/platform/WebString.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 struct WebSyncRegistrationOptions { | 13 struct WebSyncRegistration { |
| 14 enum NetworkType { | 14 enum NetworkType { |
| 15 NetworkTypeAny = 0, | 15 NetworkTypeAny = 0, |
| 16 NetworkTypeOffline, | 16 NetworkTypeOffline, |
| 17 NetworkTypeOnline, | 17 NetworkTypeOnline, |
| 18 NetworkTypeNonMobile, | 18 NetworkTypeNonMobile, |
| 19 NetworkTypeLast = NetworkTypeNonMobile | 19 NetworkTypeLast = NetworkTypeNonMobile |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 WebSyncRegistrationOptions(NetworkType networkType, bool allowOnBattery, boo
l idleRequired) | 22 WebSyncRegistration(const WebString& registrationId, unsigned long minDelayM
s, |
| 23 : networkType(networkType) | 23 unsigned long maxDelayMs, unsigned long minPeriodMs, NetworkType minRequ
iredNetwork, |
| 24 bool allowOnBattery, bool idleRequired) |
| 25 : id(registrationId) |
| 26 , minDelayMs(minDelayMs) |
| 27 , maxDelayMs(maxDelayMs) |
| 28 , minPeriodMs(minPeriodMs) |
| 29 , minRequiredNetwork(minRequiredNetwork) |
| 24 , allowOnBattery(allowOnBattery) | 30 , allowOnBattery(allowOnBattery) |
| 25 , idleRequired(idleRequired) | 31 , idleRequired(idleRequired) |
| 26 { | 32 { |
| 27 } | 33 } |
| 28 | 34 |
| 29 NetworkType networkType; | 35 WebString id; |
| 36 |
| 37 /* Minimum delay before sync event (or first sync event, if periodic,) in |
| 38 * milliseconds. */ |
| 39 unsigned long minDelayMs; |
| 40 |
| 41 /* Maximum delay before sync event (or first sync event, if periodic,) in |
| 42 * milliseconds. 0 means no maximum delay. If this value is greater than 0, |
| 43 * then it should not be less than minDelayMs for the registration to be |
| 44 * meaningful. |
| 45 */ |
| 46 unsigned long maxDelayMs; |
| 47 |
| 48 /* Minimum time between periodic sync events, in milliseconds. A 0 value |
| 49 * here means that the event is a one-shot (not periodic.) |
| 50 */ |
| 51 unsigned long minPeriodMs; |
| 52 |
| 53 NetworkType minRequiredNetwork; |
| 30 bool allowOnBattery; | 54 bool allowOnBattery; |
| 31 bool idleRequired; | 55 bool idleRequired; |
| 32 }; | 56 }; |
| 33 | 57 |
| 34 | |
| 35 struct WebSyncRegistration { | |
| 36 WebSyncRegistration(const WebString& registrationId, const WebSyncRegistrati
onOptions& options) | |
| 37 : id(registrationId) | |
| 38 , options(options) | |
| 39 { | |
| 40 } | |
| 41 | |
| 42 WebString id; | |
| 43 WebSyncRegistrationOptions options; | |
| 44 }; | |
| 45 | |
| 46 } // namespace blink | 58 } // namespace blink |
| 47 | 59 |
| 48 #endif // WebSyncRegistration_h | 60 #endif // WebSyncRegistration_h |
| OLD | NEW |