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

Side by Side 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: Rebase! 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 unified diff | Download patch
OLDNEW
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 minDelay,
23 : networkType(networkType) 23 unsigned long maxDelay, unsigned long minPeriod, NetworkType minRequired Network,
jochen (gone - plz use gerrit) 2015/03/17 12:25:35 even if the idl doesn't have units, I think we sho
iclelland 2015/03/19 13:13:43 I'll add this as "millis" (By analogy with Java's
24 bool allowOnBattery, bool idleRequired)
25 : id(registrationId)
26 , minDelay(minDelay)
27 , maxDelay(maxDelay)
28 , minPeriod(minPeriod)
29 , minRequiredNetwork(minRequiredNetwork)
24 , allowOnBattery(allowOnBattery) 30 , allowOnBattery(allowOnBattery)
25 , idleRequired(idleRequired) 31 , idleRequired(idleRequired)
26 { 32 {
jochen (gone - plz use gerrit) 2015/03/17 12:25:35 what about adding an assert that minDelay <= maxDe
iclelland 2015/03/19 13:13:43 I suppose the actual constraint would be (minDelay
27 } 33 }
28 34
29 NetworkType networkType; 35 WebString id;
36 unsigned long minDelay;
37 unsigned long maxDelay;
38 unsigned long minPeriod;
39 NetworkType minRequiredNetwork;
30 bool allowOnBattery; 40 bool allowOnBattery;
31 bool idleRequired; 41 bool idleRequired;
32 }; 42 };
33 43
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 44 } // namespace blink
47 45
48 #endif // WebSyncRegistration_h 46 #endif // WebSyncRegistration_h
OLDNEW
« public/platform/Platform.h ('K') | « 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