| OLD | NEW |
| 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 #ifndef WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_CHANGE_TRACKER_H_ | 5 #ifndef WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_CHANGE_TRACKER_H_ |
| 6 #define WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_CHANGE_TRACKER_H_ | 6 #define WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_CHANGE_TRACKER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "webkit/fileapi/file_observers.h" | 17 #include "webkit/fileapi/file_observers.h" |
| 18 #include "webkit/fileapi/file_system_url.h" | 18 #include "webkit/fileapi/file_system_url.h" |
| 19 #include "webkit/fileapi/fileapi_export.h" | |
| 20 #include "webkit/fileapi/syncable/file_change.h" | 19 #include "webkit/fileapi/syncable/file_change.h" |
| 21 #include "webkit/fileapi/syncable/sync_status_code.h" | 20 #include "webkit/fileapi/syncable/sync_status_code.h" |
| 21 #include "webkit/storage/storage_export.h" |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class SequencedTaskRunner; | 24 class SequencedTaskRunner; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace fileapi { | 27 namespace fileapi { |
| 28 | 28 |
| 29 // Tracks local file changes for cloud-backed file systems. | 29 // Tracks local file changes for cloud-backed file systems. |
| 30 // All methods must be called on the file_task_runner given to the constructor. | 30 // All methods must be called on the file_task_runner given to the constructor. |
| 31 // Owned by FileSystemContext. | 31 // Owned by FileSystemContext. |
| 32 class FILEAPI_EXPORT LocalFileChangeTracker | 32 class STORAGE_EXPORT LocalFileChangeTracker |
| 33 : public FileUpdateObserver, | 33 : public FileUpdateObserver, |
| 34 public FileChangeObserver { | 34 public FileChangeObserver { |
| 35 public: | 35 public: |
| 36 typedef std::map<FileSystemURL, FileChangeList, FileSystemURL::Comparator> | 36 typedef std::map<FileSystemURL, FileChangeList, FileSystemURL::Comparator> |
| 37 FileChangeMap; | 37 FileChangeMap; |
| 38 | 38 |
| 39 // |file_task_runner| must be the one where the observee file operations run. | 39 // |file_task_runner| must be the one where the observee file operations run. |
| 40 // (So that we can make sure DB operations are done before actual update | 40 // (So that we can make sure DB operations are done before actual update |
| 41 // happens) | 41 // happens) |
| 42 LocalFileChangeTracker(const FilePath& base_path, | 42 LocalFileChangeTracker(const FilePath& base_path, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 FileChangeMap changes_; | 88 FileChangeMap changes_; |
| 89 | 89 |
| 90 scoped_ptr<TrackerDB> tracker_db_; | 90 scoped_ptr<TrackerDB> tracker_db_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker); | 92 DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace fileapi | 95 } // namespace fileapi |
| 96 | 96 |
| 97 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_CHANGE_TRACKER_H_ | 97 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_CHANGE_TRACKER_H_ |
| OLD | NEW |