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_SYNC_FILE_SYSTEM_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_FILE_SYSTEM_BACKEND_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_FILE_SYSTEM_BACKEND_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_FILE_SYSTEM_BACKEND_H_ |
7 | 7 |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/sync_file_system/sync_callbacks.h" | 9 #include "chrome/browser/sync_file_system/sync_callbacks.h" |
10 #include "chrome/browser/sync_file_system/sync_status_code.h" | 10 #include "chrome/browser/sync_file_system/sync_status_code.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class LocalFileSyncContext; | 21 class LocalFileSyncContext; |
22 | 22 |
23 class SyncFileSystemBackend : public storage::FileSystemBackend { | 23 class SyncFileSystemBackend : public storage::FileSystemBackend { |
24 public: | 24 public: |
25 explicit SyncFileSystemBackend(Profile* profile); | 25 explicit SyncFileSystemBackend(Profile* profile); |
26 virtual ~SyncFileSystemBackend(); | 26 virtual ~SyncFileSystemBackend(); |
27 | 27 |
28 static SyncFileSystemBackend* CreateForTesting(); | 28 static SyncFileSystemBackend* CreateForTesting(); |
29 | 29 |
30 // FileSystemBackend overrides. | 30 // FileSystemBackend overrides. |
31 virtual bool CanHandleType(storage::FileSystemType type) const OVERRIDE; | 31 virtual bool CanHandleType(storage::FileSystemType type) const override; |
32 virtual void Initialize(storage::FileSystemContext* context) OVERRIDE; | 32 virtual void Initialize(storage::FileSystemContext* context) override; |
33 virtual void ResolveURL(const storage::FileSystemURL& url, | 33 virtual void ResolveURL(const storage::FileSystemURL& url, |
34 storage::OpenFileSystemMode mode, | 34 storage::OpenFileSystemMode mode, |
35 const OpenFileSystemCallback& callback) OVERRIDE; | 35 const OpenFileSystemCallback& callback) override; |
36 virtual storage::AsyncFileUtil* GetAsyncFileUtil( | 36 virtual storage::AsyncFileUtil* GetAsyncFileUtil( |
37 storage::FileSystemType type) OVERRIDE; | 37 storage::FileSystemType type) override; |
38 virtual storage::WatcherManager* GetWatcherManager( | 38 virtual storage::WatcherManager* GetWatcherManager( |
39 storage::FileSystemType type) OVERRIDE; | 39 storage::FileSystemType type) override; |
40 virtual storage::CopyOrMoveFileValidatorFactory* | 40 virtual storage::CopyOrMoveFileValidatorFactory* |
41 GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, | 41 GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, |
42 base::File::Error* error_code) OVERRIDE; | 42 base::File::Error* error_code) override; |
43 virtual storage::FileSystemOperation* CreateFileSystemOperation( | 43 virtual storage::FileSystemOperation* CreateFileSystemOperation( |
44 const storage::FileSystemURL& url, | 44 const storage::FileSystemURL& url, |
45 storage::FileSystemContext* context, | 45 storage::FileSystemContext* context, |
46 base::File::Error* error_code) const OVERRIDE; | 46 base::File::Error* error_code) const override; |
47 virtual bool SupportsStreaming( | 47 virtual bool SupportsStreaming( |
48 const storage::FileSystemURL& url) const OVERRIDE; | 48 const storage::FileSystemURL& url) const override; |
49 virtual bool HasInplaceCopyImplementation( | 49 virtual bool HasInplaceCopyImplementation( |
50 storage::FileSystemType type) const OVERRIDE; | 50 storage::FileSystemType type) const override; |
51 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 51 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
52 const storage::FileSystemURL& url, | 52 const storage::FileSystemURL& url, |
53 int64 offset, | 53 int64 offset, |
54 int64 max_bytes_to_read, | 54 int64 max_bytes_to_read, |
55 const base::Time& expected_modification_time, | 55 const base::Time& expected_modification_time, |
56 storage::FileSystemContext* context) const OVERRIDE; | 56 storage::FileSystemContext* context) const override; |
57 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( | 57 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( |
58 const storage::FileSystemURL& url, | 58 const storage::FileSystemURL& url, |
59 int64 offset, | 59 int64 offset, |
60 storage::FileSystemContext* context) const OVERRIDE; | 60 storage::FileSystemContext* context) const override; |
61 virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | 61 virtual storage::FileSystemQuotaUtil* GetQuotaUtil() override; |
62 virtual const storage::UpdateObserverList* GetUpdateObservers( | 62 virtual const storage::UpdateObserverList* GetUpdateObservers( |
63 storage::FileSystemType type) const OVERRIDE; | 63 storage::FileSystemType type) const override; |
64 virtual const storage::ChangeObserverList* GetChangeObservers( | 64 virtual const storage::ChangeObserverList* GetChangeObservers( |
65 storage::FileSystemType type) const OVERRIDE; | 65 storage::FileSystemType type) const override; |
66 virtual const storage::AccessObserverList* GetAccessObservers( | 66 virtual const storage::AccessObserverList* GetAccessObservers( |
67 storage::FileSystemType type) const OVERRIDE; | 67 storage::FileSystemType type) const override; |
68 | 68 |
69 static SyncFileSystemBackend* GetBackend( | 69 static SyncFileSystemBackend* GetBackend( |
70 const storage::FileSystemContext* context); | 70 const storage::FileSystemContext* context); |
71 | 71 |
72 LocalFileChangeTracker* change_tracker() { return change_tracker_.get(); } | 72 LocalFileChangeTracker* change_tracker() { return change_tracker_.get(); } |
73 void SetLocalFileChangeTracker(scoped_ptr<LocalFileChangeTracker> tracker); | 73 void SetLocalFileChangeTracker(scoped_ptr<LocalFileChangeTracker> tracker); |
74 | 74 |
75 LocalFileSyncContext* sync_context() { return sync_context_.get(); } | 75 LocalFileSyncContext* sync_context() { return sync_context_.get(); } |
76 void set_sync_context(LocalFileSyncContext* sync_context); | 76 void set_sync_context(LocalFileSyncContext* sync_context); |
77 | 77 |
78 private: | 78 private: |
79 class ProfileHolder : public content::NotificationObserver { | 79 class ProfileHolder : public content::NotificationObserver { |
80 public: | 80 public: |
81 explicit ProfileHolder(Profile* profile); | 81 explicit ProfileHolder(Profile* profile); |
82 | 82 |
83 // NotificationObserver override. | 83 // NotificationObserver override. |
84 virtual void Observe(int type, | 84 virtual void Observe(int type, |
85 const content::NotificationSource& source, | 85 const content::NotificationSource& source, |
86 const content::NotificationDetails& details) OVERRIDE; | 86 const content::NotificationDetails& details) override; |
87 | 87 |
88 Profile* GetProfile(); | 88 Profile* GetProfile(); |
89 | 89 |
90 private: | 90 private: |
91 content::NotificationRegistrar registrar_; | 91 content::NotificationRegistrar registrar_; |
92 Profile* profile_; | 92 Profile* profile_; |
93 }; | 93 }; |
94 | 94 |
95 // Not owned. | 95 // Not owned. |
96 storage::FileSystemContext* context_; | 96 storage::FileSystemContext* context_; |
(...skipping 20 matching lines...) Expand all Loading... |
117 storage::OpenFileSystemMode mode, | 117 storage::OpenFileSystemMode mode, |
118 const OpenFileSystemCallback& callback, | 118 const OpenFileSystemCallback& callback, |
119 SyncStatusCode status); | 119 SyncStatusCode status); |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemBackend); | 121 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemBackend); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace sync_file_system | 124 } // namespace sync_file_system |
125 | 125 |
126 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_FILE_SYSTEM_BACKEND_H_ | 126 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |