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

Unified Diff: chrome/browser/sync/util/user_settings.cc

Issue 340055: String cleanup in sync code (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/util/user_settings.h ('k') | chrome/browser/sync/util/user_settings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/user_settings.cc
===================================================================
--- chrome/browser/sync/util/user_settings.cc (revision 30948)
+++ chrome/browser/sync/util/user_settings.cc (working copy)
@@ -84,12 +84,12 @@
"SELECT share_name, file_name FROM shares"));
int query_result = sqlite3_step(share_query.get());
CHECK(SQLITE_ROW == query_result);
- PathString share_name, file_name;
+ FilePath::StringType share_name, file_name;
GetColumn(share_query.get(), 0, &share_name);
GetColumn(share_query.get(), 1, &file_name);
if (!file_util::Move(FilePath(file_name),
- FilePath(DirectoryManager::GetSyncDataDatabaseFilename()))) {
+ DirectoryManager::GetSyncDataDatabaseFilename())) {
LOG(WARNING) << "Unable to upgrade UserSettings from v10";
return;
}
@@ -128,12 +128,12 @@
Generate128BitRandomHexString());
}
-bool UserSettings::Init(const PathString& settings_path) {
- { // Scope the handle
+bool UserSettings::Init(const FilePath& settings_path) {
+ { // Scope the handle.
ScopedDBHandle dbhandle(this);
if (dbhandle_)
sqlite3_close(dbhandle_);
- CHECK(SQLITE_OK == SqliteOpen(settings_path.c_str(), &dbhandle_));
+ CHECK(SQLITE_OK == SqliteOpen(settings_path, &dbhandle_));
// In the worst case scenario, the user may hibernate his computer during
// one of our transactions.
sqlite3_busy_timeout(dbhandle_, numeric_limits<int>::max());
@@ -183,9 +183,9 @@
#if defined(OS_WIN)
// Do not index this file. Scanning can occur every time we close the file,
// which causes long delays in SQLite's file locking.
- const DWORD attrs = GetFileAttributes(settings_path.c_str());
+ const DWORD attrs = GetFileAttributes(settings_path.value().c_str());
const BOOL attrs_set =
- SetFileAttributes(settings_path.c_str(),
+ SetFileAttributes(settings_path.value().c_str(),
attrs | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
#endif
return true;
« no previous file with comments | « chrome/browser/sync/util/user_settings.h ('k') | chrome/browser/sync/util/user_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698