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

Unified Diff: webkit/fileapi/syncable/local_file_change_tracker.h

Issue 10966003: Add LocalFileChangeTracker database to record non-synced dirty files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webkit/fileapi/syncable/local_file_change_tracker.h
diff --git a/webkit/fileapi/syncable/local_file_change_tracker.h b/webkit/fileapi/syncable/local_file_change_tracker.h
index 14e1bf2f2d77c8a4c76c75d80ed1cb178b7a42d8..262fa86077accc5bbe9b55e930e920d8727fe27e 100644
--- a/webkit/fileapi/syncable/local_file_change_tracker.h
+++ b/webkit/fileapi/syncable/local_file_change_tracker.h
@@ -6,6 +6,7 @@
#define WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_CHANGE_TRACKER_H_
#include <map>
+#include <string>
#include <vector>
#include "base/basictypes.h"
@@ -41,6 +42,7 @@ class FILEAPI_EXPORT LocalFileChangeTracker
// (So that we can make sure DB operations are done before actual update
// happens)
LocalFileChangeTracker(LocalFileSyncStatus* sync_status,
+ const FilePath& profile_path,
base::SequencedTaskRunner* file_task_runner);
virtual ~LocalFileChangeTracker();
@@ -75,12 +77,18 @@ class FILEAPI_EXPORT LocalFileChangeTracker
void CollectLastDirtyChanges(FileChangeMap* changes);
private:
+ class TrackerDB;
+ friend class LocalFileChangeTrackerTest;
+
void RecordChange(const FileSystemURL& url, const FileChange& change);
// Database related methods.
void MarkDirtyOnDatabase(const FileSystemURL& url);
void ClearDirtyOnDatabase(const FileSystemURL& url);
+ std::string SerializeExternalFileSystemURL(const FileSystemURL& url);
+ FileSystemURL DeserializeExternalFileSystemURL(const std::string& url);
+
// Not owned; this must have the same lifetime with us (both owned
// by FileSystemContext).
LocalFileSyncStatus *sync_status_;
@@ -89,6 +97,8 @@ class FILEAPI_EXPORT LocalFileChangeTracker
FileChangeMap changes_;
+ scoped_ptr<TrackerDB> tracker_db_;
+
DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker);
};

Powered by Google App Engine
This is Rietveld 408576698