| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> |
| 12 #include <string> | 13 #include <string> |
| 13 | 14 |
| 14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 15 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/scoped_ptr.h" | |
| 19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 20 #include "chrome/browser/sync_file_system/file_change.h" | 20 #include "chrome/browser/sync_file_system/file_change.h" |
| 21 #include "chrome/browser/sync_file_system/sync_status_code.h" | 21 #include "chrome/browser/sync_file_system/sync_status_code.h" |
| 22 #include "storage/browser/fileapi/file_observers.h" | 22 #include "storage/browser/fileapi/file_observers.h" |
| 23 #include "storage/browser/fileapi/file_system_url.h" | 23 #include "storage/browser/fileapi/file_system_url.h" |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class SequencedTaskRunner; | 26 class SequencedTaskRunner; |
| 27 } | 27 } |
| 28 | 28 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 bool initialized_; | 172 bool initialized_; |
| 173 | 173 |
| 174 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | 174 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
| 175 | 175 |
| 176 FileChangeMap changes_; | 176 FileChangeMap changes_; |
| 177 ChangeSeqMap change_seqs_; | 177 ChangeSeqMap change_seqs_; |
| 178 | 178 |
| 179 FileChangeMap mirror_changes_; // For mirrors. | 179 FileChangeMap mirror_changes_; // For mirrors. |
| 180 FileChangeMap demoted_changes_; // For demoted changes. | 180 FileChangeMap demoted_changes_; // For demoted changes. |
| 181 | 181 |
| 182 scoped_ptr<TrackerDB> tracker_db_; | 182 std::unique_ptr<TrackerDB> tracker_db_; |
| 183 | 183 |
| 184 // Change sequence number. Briefly gives a hint about the order of changes, | 184 // Change sequence number. Briefly gives a hint about the order of changes, |
| 185 // but they are updated when a new change comes on the same file (as | 185 // but they are updated when a new change comes on the same file (as |
| 186 // well as Drive's changestamps). | 186 // well as Drive's changestamps). |
| 187 int64_t current_change_seq_number_; | 187 int64_t current_change_seq_number_; |
| 188 | 188 |
| 189 // This can be accessed on any threads (with num_changes_lock_). | 189 // This can be accessed on any threads (with num_changes_lock_). |
| 190 int64_t num_changes_; | 190 int64_t num_changes_; |
| 191 mutable base::Lock num_changes_lock_; | 191 mutable base::Lock num_changes_lock_; |
| 192 | 192 |
| 193 DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker); | 193 DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker); |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 } // namespace sync_file_system | 196 } // namespace sync_file_system |
| 197 | 197 |
| 198 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ | 198 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ |
| OLD | NEW |