| 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_SYNC_STATUS_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_STATUS_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_STATUS_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_STATUS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 #include <set> | 11 #include <set> |
| 10 | 12 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" |
| 14 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 15 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
| 16 #include "storage/browser/fileapi/file_system_url.h" | 18 #include "storage/browser/fileapi/file_system_url.h" |
| 17 | 19 |
| 18 namespace storage { | 20 namespace storage { |
| 19 class FileSystemURL; | 21 class FileSystemURL; |
| 20 } | 22 } |
| 21 | 23 |
| 22 namespace sync_file_system { | 24 namespace sync_file_system { |
| 23 | 25 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void AddObserver(Observer* observer); | 78 void AddObserver(Observer* observer); |
| 77 void RemoveObserver(Observer* observer); | 79 void RemoveObserver(Observer* observer); |
| 78 | 80 |
| 79 private: | 81 private: |
| 80 FRIEND_TEST_ALL_PREFIXES(LocalFileSyncStatusTest, WritingOnPathsWithPeriod); | 82 FRIEND_TEST_ALL_PREFIXES(LocalFileSyncStatusTest, WritingOnPathsWithPeriod); |
| 81 FRIEND_TEST_ALL_PREFIXES(LocalFileSyncStatusTest, SyncingOnPathsWithPeriod); | 83 FRIEND_TEST_ALL_PREFIXES(LocalFileSyncStatusTest, SyncingOnPathsWithPeriod); |
| 82 | 84 |
| 83 typedef std::set<base::FilePath> PathSet; | 85 typedef std::set<base::FilePath> PathSet; |
| 84 typedef std::map<OriginAndType, PathSet> URLSet; | 86 typedef std::map<OriginAndType, PathSet> URLSet; |
| 85 | 87 |
| 86 typedef std::map<base::FilePath, int64> PathBucket; | 88 typedef std::map<base::FilePath, int64_t> PathBucket; |
| 87 typedef std::map<OriginAndType, PathBucket> URLBucket; | 89 typedef std::map<OriginAndType, PathBucket> URLBucket; |
| 88 | 90 |
| 89 bool IsChildOrParentWriting(const storage::FileSystemURL& url) const; | 91 bool IsChildOrParentWriting(const storage::FileSystemURL& url) const; |
| 90 bool IsChildOrParentSyncing(const storage::FileSystemURL& url) const; | 92 bool IsChildOrParentSyncing(const storage::FileSystemURL& url) const; |
| 91 | 93 |
| 92 // If this count is non-zero positive there're ongoing write operations. | 94 // If this count is non-zero positive there're ongoing write operations. |
| 93 URLBucket writing_; | 95 URLBucket writing_; |
| 94 | 96 |
| 95 // If this flag is set sync process is running on the file. | 97 // If this flag is set sync process is running on the file. |
| 96 URLSet syncing_; | 98 URLSet syncing_; |
| 97 | 99 |
| 98 base::ObserverList<Observer> observer_list_; | 100 base::ObserverList<Observer> observer_list_; |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncStatus); | 102 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncStatus); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace sync_file_system | 105 } // namespace sync_file_system |
| 104 | 106 |
| 105 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_STATUS_H_ | 107 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_STATUS_H_ |
| OLD | NEW |