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 WEBKIT_BROWSER_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // Represents local file sync status. | 23 // Represents local file sync status. |
24 // This class is supposed to run only on IO thread. | 24 // This class is supposed to run only on IO thread. |
25 // | 25 // |
26 // This class manages two important synchronization flags: writing (counter) | 26 // This class manages two important synchronization flags: writing (counter) |
27 // and syncing (flag). Writing counter keeps track of which URL is in | 27 // and syncing (flag). Writing counter keeps track of which URL is in |
28 // writing and syncing flag indicates which URL is in syncing. | 28 // writing and syncing flag indicates which URL is in syncing. |
29 // | 29 // |
30 // An entry can have multiple writers but sync is exclusive and cannot overwrap | 30 // An entry can have multiple writers but sync is exclusive and cannot overwrap |
31 // with any writes or syncs. | 31 // with any writes or syncs. |
32 class WEBKIT_STORAGE_EXPORT LocalFileSyncStatus : public base::NonThreadSafe { | 32 class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileSyncStatus |
| 33 : public base::NonThreadSafe { |
33 public: | 34 public: |
34 class WEBKIT_STORAGE_EXPORT Observer { | 35 class WEBKIT_STORAGE_BROWSER_EXPORT Observer { |
35 public: | 36 public: |
36 Observer() {} | 37 Observer() {} |
37 virtual ~Observer() {} | 38 virtual ~Observer() {} |
38 virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) = 0; | 39 virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) = 0; |
39 virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) = 0; | 40 virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) = 0; |
40 private: | 41 private: |
41 DISALLOW_COPY_AND_ASSIGN(Observer); | 42 DISALLOW_COPY_AND_ASSIGN(Observer); |
42 }; | 43 }; |
43 | 44 |
44 LocalFileSyncStatus(); | 45 LocalFileSyncStatus(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 fileapi::FileSystemURLSet syncing_; | 86 fileapi::FileSystemURLSet syncing_; |
86 | 87 |
87 ObserverList<Observer> observer_list_; | 88 ObserverList<Observer> observer_list_; |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncStatus); | 90 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncStatus); |
90 }; | 91 }; |
91 | 92 |
92 } // namespace sync_file_system | 93 } // namespace sync_file_system |
93 | 94 |
94 #endif // WEBKIT_BROWSER_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ | 95 #endif // WEBKIT_BROWSER_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ |
OLD | NEW |