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

Side by Side Diff: prefs.h

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 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_PREFS_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_PREFS_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_PREFS_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_PREFS_H__
7 7
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "gtest/gtest_prod.h" // for FRIEND_TEST 9 #include "gtest/gtest_prod.h" // for FRIEND_TEST
10 #include "update_engine/prefs_interface.h" 10 #include "update_engine/prefs_interface.h"
11 11
12 namespace chromeos_update_engine { 12 namespace chromeos_update_engine {
13 13
14 // Implements a preference store by storing the value associated with 14 // Implements a preference store by storing the value associated with
15 // a key in a separate file named after the key under a preference 15 // a key in a separate file named after the key under a preference
16 // store directory. 16 // store directory.
17 17
18 class Prefs : public PrefsInterface { 18 class Prefs : public PrefsInterface {
19 public: 19 public:
20 Prefs() {}
21
20 // Initializes the store by associating this object with |prefs_dir| 22 // Initializes the store by associating this object with |prefs_dir|
21 // as the preference store directory. Returns true on success, false 23 // as the preference store directory. Returns true on success, false
22 // otherwise. 24 // otherwise.
23 bool Init(const FilePath& prefs_dir); 25 bool Init(const FilePath& prefs_dir);
24 26
25 // PrefsInterface methods. 27 // PrefsInterface methods.
26 bool GetString(const std::string& key, std::string* value); 28 bool GetString(const std::string& key, std::string* value);
27 bool SetString(const std::string& key, const std::string& value); 29 bool SetString(const std::string& key, const std::string& value);
28 bool GetInt64(const std::string& key, int64_t* value); 30 bool GetInt64(const std::string& key, int64_t* value);
29 bool SetInt64(const std::string& key, const int64_t value); 31 bool SetInt64(const std::string& key, const int64_t value);
30 32
31 private: 33 private:
32 FRIEND_TEST(PrefsTest, GetFileNameForKey); 34 FRIEND_TEST(PrefsTest, GetFileNameForKey);
33 FRIEND_TEST(PrefsTest, GetFileNameForKeyBadCharacter); 35 FRIEND_TEST(PrefsTest, GetFileNameForKeyBadCharacter);
34 FRIEND_TEST(PrefsTest, GetFileNameForKeyEmpty); 36 FRIEND_TEST(PrefsTest, GetFileNameForKeyEmpty);
35 37
36 // Sets |filename| to the full path to the file containing the data 38 // Sets |filename| to the full path to the file containing the data
37 // associated with |key|. Returns true on success, false otherwise. 39 // associated with |key|. Returns true on success, false otherwise.
38 bool GetFileNameForKey(const std::string& key, FilePath* filename); 40 bool GetFileNameForKey(const std::string& key, FilePath* filename);
39 41
40 // Preference store directory. 42 // Preference store directory.
41 FilePath prefs_dir_; 43 FilePath prefs_dir_;
44
45 DISALLOW_COPY_AND_ASSIGN(Prefs);
42 }; 46 };
43 47
44 } // namespace chromeos_update_engine 48 } // namespace chromeos_update_engine
45 49
46 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PREFS_H__ 50 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PREFS_H__
OLDNEW
« omaha_request_action.h ('K') | « omaha_request_action_unittest.cc ('k') | prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698