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

Side by Side Diff: rlz/chromeos/lib/rlz_value_store_chromeos.cc

Issue 93263002: Move some more file utils to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "rlz/chromeos/lib/rlz_value_store_chromeos.h" 5 #include "rlz/chromeos/lib/rlz_value_store_chromeos.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/important_file_writer.h" 8 #include "base/files/important_file_writer.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 25 matching lines...) Expand all
36 // RLZ store lock filename 36 // RLZ store lock filename
37 const base::FilePath::CharType kRLZLockFileName[] = 37 const base::FilePath::CharType kRLZLockFileName[] =
38 FILE_PATH_LITERAL("RLZ Data.lock"); 38 FILE_PATH_LITERAL("RLZ Data.lock");
39 39
40 // RLZ store path for testing. 40 // RLZ store path for testing.
41 base::FilePath g_testing_rlz_store_path_; 41 base::FilePath g_testing_rlz_store_path_;
42 42
43 // Returns file path of the RLZ storage. 43 // Returns file path of the RLZ storage.
44 base::FilePath GetRlzStorePath() { 44 base::FilePath GetRlzStorePath() {
45 return g_testing_rlz_store_path_.empty() ? 45 return g_testing_rlz_store_path_.empty() ?
46 file_util::GetHomeDir().Append(kRLZDataFileName) : 46 base::GetHomeDir().Append(kRLZDataFileName) :
47 g_testing_rlz_store_path_.Append(kRLZDataFileName); 47 g_testing_rlz_store_path_.Append(kRLZDataFileName);
48 } 48 }
49 49
50 // Returns file path of the RLZ storage lock file. 50 // Returns file path of the RLZ storage lock file.
51 base::FilePath GetRlzStoreLockPath() { 51 base::FilePath GetRlzStoreLockPath() {
52 return g_testing_rlz_store_path_.empty() ? 52 return g_testing_rlz_store_path_.empty() ?
53 file_util::GetHomeDir().Append(kRLZLockFileName) : 53 base::GetHomeDir().Append(kRLZLockFileName) :
54 g_testing_rlz_store_path_.Append(kRLZLockFileName); 54 g_testing_rlz_store_path_.Append(kRLZLockFileName);
55 } 55 }
56 56
57 // Returns the dictionary key for storing access point-related prefs. 57 // Returns the dictionary key for storing access point-related prefs.
58 std::string GetKeyName(std::string key, AccessPoint access_point) { 58 std::string GetKeyName(std::string key, AccessPoint access_point) {
59 std::string brand = SupplementaryBranding::GetBrand(); 59 std::string brand = SupplementaryBranding::GetBrand();
60 if (brand.empty()) 60 if (brand.empty())
61 brand = kNoSupplementaryBrand; 61 brand = kNoSupplementaryBrand;
62 return key + "." + GetAccessPointName(access_point) + "." + brand; 62 return key + "." + GetAccessPointName(access_point) + "." + brand;
63 } 63 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 g_testing_rlz_store_path_ = directory; 326 g_testing_rlz_store_path_ = directory;
327 } 327 }
328 328
329 std::string RlzStoreFilenameStr() { 329 std::string RlzStoreFilenameStr() {
330 return GetRlzStorePath().value(); 330 return GetRlzStorePath().value();
331 } 331 }
332 332
333 } // namespace testing 333 } // namespace testing
334 334
335 } // namespace rlz_lib 335 } // namespace rlz_lib
OLDNEW
« no previous file with comments | « remoting/host/setup/daemon_controller_delegate_mac.mm ('k') | webkit/browser/fileapi/native_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698