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

Side by Side Diff: components/update_client/persisted_data.h

Issue 1899043002: Implement ping_freshness for update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/update_client/persisted_data.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ 5 #ifndef COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_
6 #define COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ 6 #define COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 20 matching lines...) Expand all
31 // The |pref_service| must outlive the entire update_client. 31 // The |pref_service| must outlive the entire update_client.
32 explicit PersistedData(PrefService* pref_service); 32 explicit PersistedData(PrefService* pref_service);
33 33
34 ~PersistedData(); 34 ~PersistedData();
35 35
36 // Returns the DateLastRollCall (the server-localized calendar date number the 36 // Returns the DateLastRollCall (the server-localized calendar date number the
37 // |id| was last checked by this client on) for the specified |id|. 37 // |id| was last checked by this client on) for the specified |id|.
38 // -2 indicates that there is no recorded date number for the |id|. 38 // -2 indicates that there is no recorded date number for the |id|.
39 int GetDateLastRollCall(const std::string& id) const; 39 int GetDateLastRollCall(const std::string& id) const;
40 40
41 // Returns the PingFreshness (a random token that is written into the profile
42 // data whenever the DateLastRollCall it is modified) for the specified |id|.
43 // "" indicates that there is no recorded freshness value for the |id|.
44 std::string GetPingFreshness(const std::string& id) const;
45
41 // Records the DateLastRollCall for the specified |ids|. |datenum| must be a 46 // Records the DateLastRollCall for the specified |ids|. |datenum| must be a
42 // non-negative integer: calls with a negative |datenum| are simply ignored. 47 // non-negative integer: calls with a negative |datenum| are simply ignored.
43 // Calls to SetDateLastRollCall that occur prior to the persisted data store 48 // Calls to SetDateLastRollCall that occur prior to the persisted data store
44 // has been fully initialized are ignored. 49 // has been fully initialized are ignored. Also sets the PingFreshness.
45 void SetDateLastRollCall(const std::vector<std::string>& ids, 50 void SetDateLastRollCall(const std::vector<std::string>& ids, int datenum);
46 int datenum) const;
47 51
48 // This is called only via update_client's RegisterUpdateClientPreferences. 52 // This is called only via update_client's RegisterUpdateClientPreferences.
49 static void RegisterPrefs(PrefRegistrySimple* registry); 53 static void RegisterPrefs(PrefRegistrySimple* registry);
50 54
51 private: 55 private:
52 base::ThreadChecker thread_checker_; 56 base::ThreadChecker thread_checker_;
53 PrefService* pref_service_; 57 PrefService* pref_service_;
54 58
55 DISALLOW_COPY_AND_ASSIGN(PersistedData); 59 DISALLOW_COPY_AND_ASSIGN(PersistedData);
56 }; 60 };
57 61
58 } // namespace update_client 62 } // namespace update_client
59 63
60 #endif // COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ 64 #endif // COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | components/update_client/persisted_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698