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

Side by Side Diff: prefs.cc

Issue 3575024: AU: Fall back to a new update after a certain number of failed resume attempts. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 2 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 | « delta_performer.cc ('k') | prefs_interface.h » ('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 (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 #include "update_engine/prefs.h" 5 #include "update_engine/prefs.h"
6 6
7 #include <base/file_util.h> 7 #include <base/file_util.h>
8 #include <base/logging.h> 8 #include <base/logging.h>
9 #include <base/string_number_conversions.h> 9 #include <base/string_number_conversions.h>
10 #include <base/string_util.h> 10 #include <base/string_util.h>
11 11
12 #include "update_engine/utils.h" 12 #include "update_engine/utils.h"
13 13
14 using std::string; 14 using std::string;
15 15
16 namespace chromeos_update_engine { 16 namespace chromeos_update_engine {
17 17
18 const char kPrefsDeltaUpdateFailures[] = "delta-update-failures"; 18 const char kPrefsDeltaUpdateFailures[] = "delta-update-failures";
19 const char kPrefsLastActivePingDay[] = "last-active-ping-day"; 19 const char kPrefsLastActivePingDay[] = "last-active-ping-day";
20 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day"; 20 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day";
21 const char kPrefsManifestMetadataSize[] = "manifest-metadata-size"; 21 const char kPrefsManifestMetadataSize[] = "manifest-metadata-size";
22 const char kPrefsResumedUpdateFailures[] = "resumed-update-failures";
22 const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash"; 23 const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash";
23 const char kPrefsUpdateStateNextDataOffset[] = "update-state-next-data-offset"; 24 const char kPrefsUpdateStateNextDataOffset[] = "update-state-next-data-offset";
24 const char kPrefsUpdateStateNextOperation[] = "update-state-next-operation"; 25 const char kPrefsUpdateStateNextOperation[] = "update-state-next-operation";
25 const char kPrefsUpdateStateSHA256Context[] = "update-state-sha-256-context"; 26 const char kPrefsUpdateStateSHA256Context[] = "update-state-sha-256-context";
26 const char kPrefsUpdateStateSignedSHA256Context[] = 27 const char kPrefsUpdateStateSignedSHA256Context[] =
27 "update-state-signed-sha-256-context"; 28 "update-state-signed-sha-256-context";
28 29
29 bool Prefs::Init(const FilePath& prefs_dir) { 30 bool Prefs::Init(const FilePath& prefs_dir) {
30 prefs_dir_ = prefs_dir; 31 prefs_dir_ = prefs_dir;
31 return true; 32 return true;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 for (size_t i = 0; i < key.size(); ++i) { 67 for (size_t i = 0; i < key.size(); ++i) {
67 char c = key.at(i); 68 char c = key.at(i);
68 TEST_AND_RETURN_FALSE(IsAsciiAlpha(c) || IsAsciiDigit(c) || 69 TEST_AND_RETURN_FALSE(IsAsciiAlpha(c) || IsAsciiDigit(c) ||
69 c == '_' || c == '-'); 70 c == '_' || c == '-');
70 } 71 }
71 *filename = prefs_dir_.Append(key); 72 *filename = prefs_dir_.Append(key);
72 return true; 73 return true;
73 } 74 }
74 75
75 } // namespace chromeos_update_engine 76 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « delta_performer.cc ('k') | prefs_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698