summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/syncable/syncable.h
diff options
context:
space:
mode:
authormunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 18:33:53 +0000
committermunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 18:33:53 +0000
commit055aedeb2134e49c10c3b3a3593cb8df768d737c (patch)
tree4961da84e3e38e7c6a3edb68bb96e031f8856604 /chrome/browser/sync/syncable/syncable.h
parent46e9f9d97ec029189618f8ff2089948b950e67e7 (diff)
downloadchromium_src-055aedeb2134e49c10c3b3a3593cb8df768d737c.zip
chromium_src-055aedeb2134e49c10c3b3a3593cb8df768d737c.tar.gz
chromium_src-055aedeb2134e49c10c3b3a3593cb8df768d737c.tar.bz2
Clean up the strings for sync code:
- Use FilePath for real file paths. - Use std::string for PathString on Windows as well TODO in a separate CL: - Get rid of PathString typedef completely and directly use std::string everywhere. - Use wchar_t in syncapi.h/.cc and get rid of sync_char16. TEST=Existing tests are sufficient since this CL does a lot of code refactoring. BUG=26342 Review URL: http://codereview.chromium.org/340055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/syncable/syncable.h')
-rw-r--r--chrome/browser/sync/syncable/syncable.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h
index 5c6195e..c92ea7b 100644
--- a/chrome/browser/sync/syncable/syncable.h
+++ b/chrome/browser/sync/syncable/syncable.h
@@ -15,6 +15,7 @@
#include "base/atomicops.h"
#include "base/basictypes.h"
+#include "base/file_path.h"
#include "base/lock.h"
#include "base/time.h"
#include "chrome/browser/sync/syncable/blob.h"
@@ -22,7 +23,6 @@
#include "chrome/browser/sync/syncable/directory_event.h"
#include "chrome/browser/sync/syncable/path_name_cmp.h"
#include "chrome/browser/sync/syncable/syncable_id.h"
-#include "chrome/browser/sync/util/compat_file.h"
#include "chrome/browser/sync/util/dbgq.h"
#include "chrome/browser/sync/util/event_sys.h"
#include "chrome/browser/sync/util/path_helpers.h"
@@ -319,6 +319,9 @@ class SyncName {
PathString& value() { return value_; }
const PathString& non_unique_value() const { return non_unique_value_; }
PathString& non_unique_value() { return non_unique_value_; }
+ void set_non_unique_value(const PathString& value) {
+ non_unique_value_ = value;
+ }
inline bool operator==(const SyncName& right_hand_side) const {
return value_ == right_hand_side.value_ &&
@@ -886,7 +889,7 @@ class Directory {
Directory();
virtual ~Directory();
- DirOpenResult Open(const PathString& file_path, const PathString& name);
+ DirOpenResult Open(const FilePath& file_path, const PathString& name);
void Close();
@@ -895,7 +898,7 @@ class Directory {
// by the server only.
Id NextId();
- PathString file_path() const { return kernel_->db_path; }
+ const FilePath& file_path() const { return kernel_->db_path; }
bool good() const { return NULL != store_; }
// The sync timestamp is an index into the list of changes for an account.
@@ -938,7 +941,7 @@ class Directory {
// Overridden by tests.
virtual DirectoryBackingStore* CreateBackingStore(
const PathString& dir_name,
- const PathString& backing_filepath);
+ const FilePath& backing_filepath);
private:
// These private versions expect the kernel lock to already be held
@@ -951,7 +954,7 @@ class Directory {
const PathString& name,
ScopedKernelLock* const lock);
- DirOpenResult OpenImpl(const PathString& file_path, const PathString& name);
+ DirOpenResult OpenImpl(const FilePath& file_path, const PathString& name);
struct DirectoryEventTraits {
typedef DirectoryEvent EventType;
@@ -1086,12 +1089,12 @@ class Directory {
private:
struct Kernel {
- Kernel(const PathString& db_path, const PathString& name,
+ Kernel(const FilePath& db_path, const PathString& name,
const KernelLoadInfo& info);
~Kernel();
- PathString const db_path;
+ FilePath const db_path;
// TODO(timsteele): audit use of the member and remove if possible
volatile base::subtle::AtomicWord refcount;
void AddRef(); // For convenience.
@@ -1254,12 +1257,6 @@ int64 Now();
// Does wildcard processing.
BOOL PathNameMatch(const PathString& pathname, const PathString& pathspec);
-PathString GetFullPath(BaseTransaction* trans, const Entry& e);
-
-inline void ReverseAppend(const PathString& s, PathString* target) {
- target->append(s.rbegin(), s.rend());
-}
-
class ExtendedAttribute {
public:
ExtendedAttribute(BaseTransaction* trans, GetByHandle,