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 CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_FILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_FILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_FILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_FILE_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 bool has_pending_changes)> | 59 bool has_pending_changes)> |
60 HasPendingLocalChangeCallback; | 60 HasPendingLocalChangeCallback; |
61 | 61 |
62 explicit LocalFileSyncService(Profile* profile); | 62 explicit LocalFileSyncService(Profile* profile); |
63 virtual ~LocalFileSyncService(); | 63 virtual ~LocalFileSyncService(); |
64 | 64 |
65 void Shutdown(); | 65 void Shutdown(); |
66 | 66 |
67 void MaybeInitializeFileSystemContext( | 67 void MaybeInitializeFileSystemContext( |
68 const GURL& app_origin, | 68 const GURL& app_origin, |
69 const std::string& service_name, | |
70 fileapi::FileSystemContext* file_system_context, | 69 fileapi::FileSystemContext* file_system_context, |
71 const SyncStatusCallback& callback); | 70 const SyncStatusCallback& callback); |
72 | 71 |
73 void AddChangeObserver(Observer* observer); | 72 void AddChangeObserver(Observer* observer); |
74 | 73 |
75 // Registers |url| to wait until sync is enabled for |url|. | 74 // Registers |url| to wait until sync is enabled for |url|. |
76 // |on_syncable_callback| is to be called when |url| becomes syncable | 75 // |on_syncable_callback| is to be called when |url| becomes syncable |
77 // (i.e. when we have no pending writes and the file is successfully locked | 76 // (i.e. when we have no pending writes and the file is successfully locked |
78 // for sync). | 77 // for sync). |
79 // Calling this method again while this already has another URL waiting | 78 // Calling this method again while this already has another URL waiting |
(...skipping 22 matching lines...) Expand all Loading... |
102 void ClearSyncFlagForURL(const fileapi::FileSystemURL& url); | 101 void ClearSyncFlagForURL(const fileapi::FileSystemURL& url); |
103 | 102 |
104 // Returns the metadata of a remote file pointed by |url|. | 103 // Returns the metadata of a remote file pointed by |url|. |
105 virtual void GetLocalFileMetadata( | 104 virtual void GetLocalFileMetadata( |
106 const fileapi::FileSystemURL& url, | 105 const fileapi::FileSystemURL& url, |
107 const SyncFileMetadataCallback& callback); | 106 const SyncFileMetadataCallback& callback); |
108 | 107 |
109 // RemoteChangeProcessor overrides. | 108 // RemoteChangeProcessor overrides. |
110 virtual void PrepareForProcessRemoteChange( | 109 virtual void PrepareForProcessRemoteChange( |
111 const fileapi::FileSystemURL& url, | 110 const fileapi::FileSystemURL& url, |
112 const std::string& service_name, | |
113 const PrepareChangeCallback& callback) OVERRIDE; | 111 const PrepareChangeCallback& callback) OVERRIDE; |
114 virtual void ApplyRemoteChange( | 112 virtual void ApplyRemoteChange( |
115 const FileChange& change, | 113 const FileChange& change, |
116 const base::FilePath& local_path, | 114 const base::FilePath& local_path, |
117 const fileapi::FileSystemURL& url, | 115 const fileapi::FileSystemURL& url, |
118 const SyncStatusCallback& callback) OVERRIDE; | 116 const SyncStatusCallback& callback) OVERRIDE; |
119 virtual void ClearLocalChanges( | 117 virtual void ClearLocalChanges( |
120 const fileapi::FileSystemURL& url, | 118 const fileapi::FileSystemURL& url, |
121 const base::Closure& completion_callback) OVERRIDE; | 119 const base::Closure& completion_callback) OVERRIDE; |
122 virtual void RecordFakeLocalChange( | 120 virtual void RecordFakeLocalChange( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 std::set<GURL> disabled_origins_; | 162 std::set<GURL> disabled_origins_; |
165 }; | 163 }; |
166 | 164 |
167 void DidInitializeFileSystemContext( | 165 void DidInitializeFileSystemContext( |
168 const GURL& app_origin, | 166 const GURL& app_origin, |
169 fileapi::FileSystemContext* file_system_context, | 167 fileapi::FileSystemContext* file_system_context, |
170 const SyncStatusCallback& callback, | 168 const SyncStatusCallback& callback, |
171 SyncStatusCode status); | 169 SyncStatusCode status); |
172 void DidInitializeForRemoteSync( | 170 void DidInitializeForRemoteSync( |
173 const fileapi::FileSystemURL& url, | 171 const fileapi::FileSystemURL& url, |
174 const std::string& service_name, | |
175 fileapi::FileSystemContext* file_system_context, | 172 fileapi::FileSystemContext* file_system_context, |
176 const PrepareChangeCallback& callback, | 173 const PrepareChangeCallback& callback, |
177 SyncStatusCode status); | 174 SyncStatusCode status); |
178 | 175 |
179 // Runs local_sync_callback_ and resets it. | 176 // Runs local_sync_callback_ and resets it. |
180 void RunLocalSyncCallback( | 177 void RunLocalSyncCallback( |
181 SyncStatusCode status, | 178 SyncStatusCode status, |
182 const fileapi::FileSystemURL& url); | 179 const fileapi::FileSystemURL& url); |
183 | 180 |
184 // Callbacks for ProcessLocalChange. | 181 // Callbacks for ProcessLocalChange. |
(...skipping 28 matching lines...) Expand all Loading... |
213 LocalChangeProcessor* local_change_processor_; | 210 LocalChangeProcessor* local_change_processor_; |
214 | 211 |
215 ObserverList<Observer> change_observers_; | 212 ObserverList<Observer> change_observers_; |
216 | 213 |
217 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncService); | 214 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncService); |
218 }; | 215 }; |
219 | 216 |
220 } // namespace sync_file_system | 217 } // namespace sync_file_system |
221 | 218 |
222 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_FILE_SYNC_SERVICE_H_ | 219 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_FILE_SYNC_SERVICE_H_ |
OLD | NEW |