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

Side by Side Diff: google_apis/gcm/engine/gservices_settings.h

Issue 252933002: [GCM] fixing G-settings initialization from an empty store (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Exposing GServicesSettings::kMinimumCheckinInterval. Applying feedback Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | google_apis/gcm/engine/gservices_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_
6 #define GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "google_apis/gcm/base/gcm_export.h" 12 #include "google_apis/gcm/base/gcm_export.h"
13 #include "google_apis/gcm/engine/gcm_store.h" 13 #include "google_apis/gcm/engine/gcm_store.h"
14 #include "google_apis/gcm/protocol/checkin.pb.h" 14 #include "google_apis/gcm/protocol/checkin.pb.h"
15 15
16 namespace gcm { 16 namespace gcm {
17 17
18 // Class responsible for handling G-services settings. It takes care of 18 // Class responsible for handling G-services settings. It takes care of
19 // extracting them from checkin response and storing in GCMStore. 19 // extracting them from checkin response and storing in GCMStore.
20 class GCM_EXPORT GServicesSettings { 20 class GCM_EXPORT GServicesSettings {
21 public: 21 public:
22 // Minimum periodic checkin interval in seconds.
23 static const int64 kMinimumCheckinInterval;
24
22 // Create an instance of GServicesSettings class. |gcm_store| is used to store 25 // Create an instance of GServicesSettings class. |gcm_store| is used to store
23 // the settings after they are extracted from checkin response. 26 // the settings after they are extracted from checkin response.
24 explicit GServicesSettings(GCMStore* gcm_store); 27 explicit GServicesSettings(GCMStore* gcm_store);
25 ~GServicesSettings(); 28 ~GServicesSettings();
26 29
27 // Udpates the settings based on |checkin_response|. 30 // Udpates the settings based on |checkin_response|.
28 void UpdateFromCheckinResponse( 31 void UpdateFromCheckinResponse(
29 const checkin_proto::AndroidCheckinResponse& checkin_response); 32 const checkin_proto::AndroidCheckinResponse& checkin_response);
30 33
31 // Updates the settings based on |load_result|. 34 // Updates the settings based on |load_result|.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 83
81 // Factory for creating references in callbacks. 84 // Factory for creating references in callbacks.
82 base::WeakPtrFactory<GServicesSettings> weak_ptr_factory_; 85 base::WeakPtrFactory<GServicesSettings> weak_ptr_factory_;
83 86
84 DISALLOW_COPY_AND_ASSIGN(GServicesSettings); 87 DISALLOW_COPY_AND_ASSIGN(GServicesSettings);
85 }; 88 };
86 89
87 } // namespace gcm 90 } // namespace gcm
88 91
89 #endif // GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_ 92 #endif // GOOGLE_APIS_GCM_ENGINE_GSERVICES_SETTINGS_H_
OLDNEW
« no previous file with comments | « no previous file | google_apis/gcm/engine/gservices_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698