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

Side by Side Diff: prefs.cc

Issue 3617002: AU: Fall back to full updates after a number of failed delta update attempts. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: remove leftover log 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 | « no previous file | 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 #include "update_engine/utils.h" 12 #include "update_engine/utils.h"
12 13
13 using std::string; 14 using std::string;
14 15
15 namespace chromeos_update_engine { 16 namespace chromeos_update_engine {
16 17
18 const char kPrefsDeltaUpdateFailures[] = "delta-update-failures";
17 const char kPrefsLastActivePingDay[] = "last-active-ping-day"; 19 const char kPrefsLastActivePingDay[] = "last-active-ping-day";
18 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day"; 20 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day";
19 21
20 bool Prefs::Init(const FilePath& prefs_dir) { 22 bool Prefs::Init(const FilePath& prefs_dir) {
21 prefs_dir_ = prefs_dir; 23 prefs_dir_ = prefs_dir;
22 return true; 24 return true;
23 } 25 }
24 26
25 bool Prefs::GetString(const string& key, string* value) { 27 bool Prefs::GetString(const string& key, string* value) {
26 LOG(INFO) << "Getting key \"" << key << "\""; 28 LOG(INFO) << "Getting key \"" << key << "\"";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 for (size_t i = 0; i < key.size(); ++i) { 62 for (size_t i = 0; i < key.size(); ++i) {
61 char c = key.at(i); 63 char c = key.at(i);
62 TEST_AND_RETURN_FALSE(IsAsciiAlpha(c) || IsAsciiDigit(c) || 64 TEST_AND_RETURN_FALSE(IsAsciiAlpha(c) || IsAsciiDigit(c) ||
63 c == '_' || c == '-'); 65 c == '_' || c == '-');
64 } 66 }
65 *filename = prefs_dir_.Append(key); 67 *filename = prefs_dir_.Append(key);
66 return true; 68 return true;
67 } 69 }
68 70
69 } // namespace chromeos_update_engine 71 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « no previous file | prefs_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698