Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: webkit/browser/fileapi/syncable/sync_file_system_backend.h

Issue 18668003: SyncFS: Introduce SyncFileSystemBackend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_BROWSER_FILEAPI_SYNCABLE_SYNC_FILE_SYSTEM_BACKEND_H_
6 #define WEBKIT_BROWSER_FILEAPI_SYNCABLE_SYNC_FILE_SYSTEM_BACKEND_H_
7
8 #include "webkit/browser/fileapi/sandbox_file_system_backend.h"
9 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h"
10 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h"
11
12 namespace sync_file_system {
13
14 class WEBKIT_STORAGE_BROWSER_EXPORT SyncFileSystemBackend
15 : public fileapi::SandboxFileSystemBackend {
16 public:
17 SyncFileSystemBackend(
18 base::SequencedTaskRunner* file_task_runner,
19 const fileapi::FileSystemOptions& file_system_options);
20 virtual ~SyncFileSystemBackend();
21
22 // FileSystemBackend overrides.
23 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE;
24 virtual void InitializeFileSystem(
25 const GURL& origin_url,
26 fileapi::FileSystemType type,
27 fileapi::OpenFileSystemMode mode,
28 fileapi::FileSystemContext* context,
29 const InitializeFileSystemCallback& callback) OVERRIDE;
30 virtual fileapi::FileSystemFileUtil* GetFileUtil(
31 fileapi::FileSystemType type,
32 const fileapi::FileSystemContext* context) OVERRIDE;
33 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil(
34 fileapi::FileSystemType type,
35 const fileapi::FileSystemContext* context) OVERRIDE;
36 virtual fileapi::FileSystemOperation* CreateFileSystemOperation(
37 const fileapi::FileSystemURL& url,
38 fileapi::FileSystemContext* context,
39 base::PlatformFileError* error_code) const OVERRIDE;
40
41 // FileSystemQuotaUtil overrides.
42 virtual void GetOriginsForTypeOnFileThread(
43 fileapi::FileSystemType type,
44 std::set<GURL>* origins) OVERRIDE;
45 virtual void AddFileUpdateObserver(
46 fileapi::FileSystemType type,
47 fileapi::FileUpdateObserver* observer,
48 base::SequencedTaskRunner* task_runner) OVERRIDE;
49 virtual void AddFileChangeObserver(
50 fileapi::FileSystemType type,
51 fileapi::FileChangeObserver* observer,
52 base::SequencedTaskRunner* task_runner) OVERRIDE;
53 virtual const fileapi::UpdateObserverList* GetUpdateObservers(
54 fileapi::FileSystemType type) const OVERRIDE;
55 virtual const fileapi::ChangeObserverList* GetChangeObservers(
56 fileapi::FileSystemType type) const OVERRIDE;
57
58 static SyncFileSystemBackend* GetBackend(
59 const fileapi::FileSystemContext* file_system_context);
60
61 LocalFileChangeTracker* change_tracker() { return change_tracker_.get(); }
62 void set_change_tracker(scoped_ptr<LocalFileChangeTracker> tracker);
63
64 LocalFileSyncContext* sync_context() { return sync_context_.get(); }
65 void set_sync_context(sync_file_system::LocalFileSyncContext* sync_context);
66
67 private:
68 friend class CannedSyncableFileSystem;
69
70 // This initialization method is lazily called the first time
71 // FileSystemContext is given.
72 void LazyInitialize(fileapi::SandboxContext* sandbox_context_);
73
74 fileapi::UpdateObserverList syncable_update_observers_;
75 fileapi::ChangeObserverList syncable_change_observers_;
76
77 scoped_ptr<LocalFileChangeTracker> change_tracker_;
78 scoped_refptr<sync_file_system::LocalFileSyncContext> sync_context_;
79
80 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemBackend);
81 };
82
83 } // namespace sync_file_system
84
85 #endif // WEBKIT_BROWSER_FILEAPI_SYNCABLE_SYNC_FILE_SYSTEM_BACKEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698