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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 }; | 67 }; |
68 | 68 |
69 typedef base::Callback<void(SyncStatusCode status, | 69 typedef base::Callback<void(SyncStatusCode status, |
70 bool has_pending_changes)> | 70 bool has_pending_changes)> |
71 HasPendingLocalChangeCallback; | 71 HasPendingLocalChangeCallback; |
72 | 72 |
73 static scoped_ptr<LocalFileSyncService> Create(Profile* profile); | 73 static scoped_ptr<LocalFileSyncService> Create(Profile* profile); |
74 static scoped_ptr<LocalFileSyncService> CreateForTesting( | 74 static scoped_ptr<LocalFileSyncService> CreateForTesting( |
75 Profile* profile, | 75 Profile* profile, |
76 leveldb::Env* env_override); | 76 leveldb::Env* env_override); |
77 virtual ~LocalFileSyncService(); | 77 ~LocalFileSyncService() override; |
78 | 78 |
79 void Shutdown(); | 79 void Shutdown(); |
80 | 80 |
81 void MaybeInitializeFileSystemContext( | 81 void MaybeInitializeFileSystemContext( |
82 const GURL& app_origin, | 82 const GURL& app_origin, |
83 storage::FileSystemContext* file_system_context, | 83 storage::FileSystemContext* file_system_context, |
84 const SyncStatusCallback& callback); | 84 const SyncStatusCallback& callback); |
85 | 85 |
86 void AddChangeObserver(Observer* observer); | 86 void AddChangeObserver(Observer* observer); |
87 | 87 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void HasPendingLocalChanges(const storage::FileSystemURL& url, | 122 void HasPendingLocalChanges(const storage::FileSystemURL& url, |
123 const HasPendingLocalChangeCallback& callback); | 123 const HasPendingLocalChangeCallback& callback); |
124 | 124 |
125 void PromoteDemotedChanges(const base::Closure& callback); | 125 void PromoteDemotedChanges(const base::Closure& callback); |
126 | 126 |
127 // Returns the metadata of a remote file pointed by |url|. | 127 // Returns the metadata of a remote file pointed by |url|. |
128 virtual void GetLocalFileMetadata(const storage::FileSystemURL& url, | 128 virtual void GetLocalFileMetadata(const storage::FileSystemURL& url, |
129 const SyncFileMetadataCallback& callback); | 129 const SyncFileMetadataCallback& callback); |
130 | 130 |
131 // RemoteChangeProcessor overrides. | 131 // RemoteChangeProcessor overrides. |
132 virtual void PrepareForProcessRemoteChange( | 132 void PrepareForProcessRemoteChange( |
133 const storage::FileSystemURL& url, | 133 const storage::FileSystemURL& url, |
134 const PrepareChangeCallback& callback) override; | 134 const PrepareChangeCallback& callback) override; |
135 virtual void ApplyRemoteChange(const FileChange& change, | 135 void ApplyRemoteChange(const FileChange& change, |
136 const base::FilePath& local_path, | 136 const base::FilePath& local_path, |
137 const storage::FileSystemURL& url, | 137 const storage::FileSystemURL& url, |
138 const SyncStatusCallback& callback) override; | 138 const SyncStatusCallback& callback) override; |
139 virtual void FinalizeRemoteSync( | 139 void FinalizeRemoteSync(const storage::FileSystemURL& url, |
140 const storage::FileSystemURL& url, | 140 bool clear_local_changes, |
141 bool clear_local_changes, | 141 const base::Closure& completion_callback) override; |
142 const base::Closure& completion_callback) override; | 142 void RecordFakeLocalChange(const storage::FileSystemURL& url, |
143 virtual void RecordFakeLocalChange( | 143 const FileChange& change, |
144 const storage::FileSystemURL& url, | 144 const SyncStatusCallback& callback) override; |
145 const FileChange& change, | |
146 const SyncStatusCallback& callback) override; | |
147 | 145 |
148 // LocalOriginChangeObserver override. | 146 // LocalOriginChangeObserver override. |
149 virtual void OnChangesAvailableInOrigins( | 147 void OnChangesAvailableInOrigins(const std::set<GURL>& origins) override; |
150 const std::set<GURL>& origins) override; | |
151 | 148 |
152 // Called when a particular origin (app) is disabled/enabled while | 149 // Called when a particular origin (app) is disabled/enabled while |
153 // the service is running. This may be called for origins/apps that | 150 // the service is running. This may be called for origins/apps that |
154 // are not initialized for the service. | 151 // are not initialized for the service. |
155 void SetOriginEnabled(const GURL& origin, bool enabled); | 152 void SetOriginEnabled(const GURL& origin, bool enabled); |
156 | 153 |
157 private: | 154 private: |
158 typedef std::map<GURL, storage::FileSystemContext*> OriginToContext; | 155 typedef std::map<GURL, storage::FileSystemContext*> OriginToContext; |
159 friend class OriginChangeMapTest; | 156 friend class OriginChangeMapTest; |
160 | 157 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 GetLocalChangeProcessorCallback get_local_change_processor_; | 236 GetLocalChangeProcessorCallback get_local_change_processor_; |
240 | 237 |
241 ObserverList<Observer> change_observers_; | 238 ObserverList<Observer> change_observers_; |
242 | 239 |
243 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncService); | 240 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncService); |
244 }; | 241 }; |
245 | 242 |
246 } // namespace sync_file_system | 243 } // namespace sync_file_system |
247 | 244 |
248 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_SERVICE_H_ | 245 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_SERVICE_H_ |
OLD | NEW |