| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 19 #include "webkit/fileapi/fileapi_export.h" | |
| 20 #include "webkit/fileapi/syncable/file_change.h" | 19 #include "webkit/fileapi/syncable/file_change.h" |
| 21 #include "webkit/fileapi/syncable/sync_status_code.h" | 20 #include "webkit/fileapi/syncable/sync_status_code.h" |
| 21 #include "webkit/storage/webkit_storage_export.h" |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class SingleThreadTaskRunner; | 24 class SingleThreadTaskRunner; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace fileapi { | 27 namespace fileapi { |
| 28 | 28 |
| 29 class FileSystemContext; | 29 class FileSystemContext; |
| 30 class LocalFileChangeTracker; | 30 class LocalFileChangeTracker; |
| 31 | 31 |
| 32 // This class works as a bridge between LocalFileSyncService (which is a | 32 // This class works as a bridge between LocalFileSyncService (which is a |
| 33 // per-profile object) and FileSystemContext's (which is a per-storage-partition | 33 // per-profile object) and FileSystemContext's (which is a per-storage-partition |
| 34 // object and may exist multiple in a profile). | 34 // object and may exist multiple in a profile). |
| 35 // An instance of this class is shared by FileSystemContexts and outlives | 35 // An instance of this class is shared by FileSystemContexts and outlives |
| 36 // LocalFileSyncService. | 36 // LocalFileSyncService. |
| 37 class FILEAPI_EXPORT LocalFileSyncContext | 37 class WEBKIT_STORAGE_EXPORT LocalFileSyncContext |
| 38 : public base::RefCountedThreadSafe<LocalFileSyncContext> { | 38 : public base::RefCountedThreadSafe<LocalFileSyncContext> { |
| 39 public: | 39 public: |
| 40 typedef base::Callback<void(SyncStatusCode status)> StatusCallback; | 40 typedef base::Callback<void(SyncStatusCode status)> StatusCallback; |
| 41 | 41 |
| 42 LocalFileSyncContext(base::SingleThreadTaskRunner* ui_task_runner, | 42 LocalFileSyncContext(base::SingleThreadTaskRunner* ui_task_runner, |
| 43 base::SingleThreadTaskRunner* io_task_runner); | 43 base::SingleThreadTaskRunner* io_task_runner); |
| 44 | 44 |
| 45 // Initializes |file_system_context| for syncable file operations and | 45 // Initializes |file_system_context| for syncable file operations and |
| 46 // registers the it into the internal map. | 46 // registers the it into the internal map. |
| 47 // Calling this multiple times for the same file_system_context is valid. | 47 // Calling this multiple times for the same file_system_context is valid. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Origin to context map. (Assuming that as far as we're in the same | 94 // Origin to context map. (Assuming that as far as we're in the same |
| 95 // profile single origin wouldn't belong to multiple FileSystemContexts.) | 95 // profile single origin wouldn't belong to multiple FileSystemContexts.) |
| 96 std::map<GURL, FileSystemContext*> origin_to_contexts_; | 96 std::map<GURL, FileSystemContext*> origin_to_contexts_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncContext); | 98 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncContext); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace fileapi | 101 } // namespace fileapi |
| 102 | 102 |
| 103 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ | 103 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_CONTEXT_H_ |
| OLD | NEW |