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

Side by Side Diff: prefs.cc

Issue 2856070: Don't send machine and user ID to Omaha anymore. Send a/r pings instead. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Address review comments. Created 10 years, 4 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
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_util.h" 9 #include "base/string_util.h"
10 #include "update_engine/utils.h" 10 #include "update_engine/utils.h"
11 11
12 using std::string; 12 using std::string;
13 13
14 namespace chromeos_update_engine { 14 namespace chromeos_update_engine {
15 15
16 const char kPrefsLastActivePingDay[] = "last-active-ping-day";
17 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day";
18
16 bool Prefs::Init(const FilePath& prefs_dir) { 19 bool Prefs::Init(const FilePath& prefs_dir) {
17 prefs_dir_ = prefs_dir; 20 prefs_dir_ = prefs_dir;
18 return true; 21 return true;
19 } 22 }
20 23
21 bool Prefs::GetString(const string& key, string* value) { 24 bool Prefs::GetString(const string& key, string* value) {
22 LOG(INFO) << "Getting key \"" << key << "\""; 25 LOG(INFO) << "Getting key \"" << key << "\"";
23 FilePath filename; 26 FilePath filename;
24 TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename)); 27 TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename));
25 TEST_AND_RETURN_FALSE(file_util::ReadFileToString(filename, value)); 28 TEST_AND_RETURN_FALSE(file_util::ReadFileToString(filename, value));
(...skipping 30 matching lines...) Expand all
56 for (size_t i = 0; i < key.size(); ++i) { 59 for (size_t i = 0; i < key.size(); ++i) {
57 char c = key.at(i); 60 char c = key.at(i);
58 TEST_AND_RETURN_FALSE(IsAsciiAlpha(c) || IsAsciiDigit(c) || 61 TEST_AND_RETURN_FALSE(IsAsciiAlpha(c) || IsAsciiDigit(c) ||
59 c == '_' || c == '-'); 62 c == '_' || c == '-');
60 } 63 }
61 *filename = prefs_dir_.Append(key); 64 *filename = prefs_dir_.Append(key);
62 return true; 65 return true;
63 } 66 }
64 67
65 } // namespace chromeos_update_engine 68 } // namespace chromeos_update_engine
OLDNEW
« omaha_request_action.h ('K') | « prefs.h ('k') | prefs_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698