| 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 WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ | 5 #ifndef WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ |
| 6 #define WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ | 6 #define WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
| 23 #include "webkit/fileapi/syncable/local_file_sync_status.h" | 23 #include "webkit/fileapi/syncable/local_file_sync_status.h" |
| 24 #include "webkit/fileapi/syncable/sync_callbacks.h" | 24 #include "webkit/fileapi/syncable/sync_callbacks.h" |
| 25 #include "webkit/fileapi/syncable/sync_status_code.h" | 25 #include "webkit/fileapi/syncable/sync_status_code.h" |
| 26 #include "webkit/storage/webkit_storage_export.h" | 26 #include "webkit/storage/webkit_storage_export.h" |
| 27 | 27 |
| 28 namespace base { | 28 namespace base { |
| 29 class SingleThreadTaskRunner; | 29 class SingleThreadTaskRunner; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace sync_file_system { |
| 33 class FileChange; |
| 34 } |
| 35 |
| 32 namespace fileapi { | 36 namespace fileapi { |
| 33 | 37 |
| 34 class FileChange; | |
| 35 class FileSystemContext; | 38 class FileSystemContext; |
| 36 class LocalFileChangeTracker; | 39 class LocalFileChangeTracker; |
| 37 struct LocalFileSyncInfo; | 40 struct LocalFileSyncInfo; |
| 38 class LocalOriginChangeObserver; | 41 class LocalOriginChangeObserver; |
| 39 class SyncableFileOperationRunner; | 42 class SyncableFileOperationRunner; |
| 40 | 43 |
| 41 // This class works as a bridge between LocalFileSyncService (which is a | 44 // This class works as a bridge between LocalFileSyncService (which is a |
| 42 // per-profile object) and FileSystemContext's (which is a per-storage-partition | 45 // per-profile object) and FileSystemContext's (which is a per-storage-partition |
| 43 // object and may exist multiple in a profile). | 46 // object and may exist multiple in a profile). |
| 44 // An instance of this class is shared by FileSystemContexts and outlives | 47 // An instance of this class is shared by FileSystemContexts and outlives |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // for sync will overwrite the previously registered URL. | 111 // for sync will overwrite the previously registered URL. |
| 109 // | 112 // |
| 110 // This method must be called on UI thread. | 113 // This method must be called on UI thread. |
| 111 void RegisterURLForWaitingSync(const FileSystemURL& url, | 114 void RegisterURLForWaitingSync(const FileSystemURL& url, |
| 112 const base::Closure& on_syncable_callback); | 115 const base::Closure& on_syncable_callback); |
| 113 | 116 |
| 114 // Applies a remote change. | 117 // Applies a remote change. |
| 115 // This method must be called on UI thread. | 118 // This method must be called on UI thread. |
| 116 void ApplyRemoteChange( | 119 void ApplyRemoteChange( |
| 117 FileSystemContext* file_system_context, | 120 FileSystemContext* file_system_context, |
| 118 const FileChange& change, | 121 const sync_file_system::FileChange& change, |
| 119 const base::FilePath& local_path, | 122 const base::FilePath& local_path, |
| 120 const FileSystemURL& url, | 123 const FileSystemURL& url, |
| 121 const SyncStatusCallback& callback); | 124 const SyncStatusCallback& callback); |
| 122 | 125 |
| 123 // Records a fake local change in the local change tracker. | 126 // Records a fake local change in the local change tracker. |
| 124 void RecordFakeLocalChange( | 127 void RecordFakeLocalChange( |
| 125 FileSystemContext* file_system_context, | 128 FileSystemContext* file_system_context, |
| 126 const fileapi::FileSystemURL& url, | 129 const fileapi::FileSystemURL& url, |
| 127 const fileapi::FileChange& change, | 130 const sync_file_system::FileChange& change, |
| 128 const fileapi::SyncStatusCallback& callback); | 131 const fileapi::SyncStatusCallback& callback); |
| 129 | 132 |
| 130 // This must be called on UI thread. | 133 // This must be called on UI thread. |
| 131 void GetFileMetadata( | 134 void GetFileMetadata( |
| 132 FileSystemContext* file_system_context, | 135 FileSystemContext* file_system_context, |
| 133 const FileSystemURL& url, | 136 const FileSystemURL& url, |
| 134 const SyncFileMetadataCallback& callback); | 137 const SyncFileMetadataCallback& callback); |
| 135 | 138 |
| 136 // Returns true via |callback| if the given file |url| has local pending | 139 // Returns true via |callback| if the given file |url| has local pending |
| 137 // changes. | 140 // changes. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 ObserverList<LocalOriginChangeObserver> origin_change_observers_; | 279 ObserverList<LocalOriginChangeObserver> origin_change_observers_; |
| 277 | 280 |
| 278 int mock_notify_changes_duration_in_sec_; | 281 int mock_notify_changes_duration_in_sec_; |
| 279 | 282 |
| 280 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncContext); | 283 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncContext); |
| 281 }; | 284 }; |
| 282 | 285 |
| 283 } // namespace fileapi | 286 } // namespace fileapi |
| 284 | 287 |
| 285 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ | 288 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ |
| OLD | NEW |