OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_BACKEND_H_ | |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_BACKEND_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/memory/ref_counted.h" | |
12 #include "content/public/browser/browser_context.h" | |
13 #include "webkit/browser/blob/file_stream_reader.h" | |
14 #include "webkit/browser/fileapi/external_mount_points.h" | |
15 #include "webkit/browser/fileapi/file_stream_writer.h" | |
16 #include "webkit/browser/fileapi/file_system_backend.h" | |
17 | |
18 namespace local_discovery { | |
19 | |
20 class PrivetFileSystemAsyncUtil; | |
21 | |
22 class PrivetFileSystemBackend : public storage::FileSystemBackend { | |
23 public: | |
24 PrivetFileSystemBackend(storage::ExternalMountPoints* mount_points, | |
25 content::BrowserContext* browser_context); | |
26 virtual ~PrivetFileSystemBackend(); | |
27 | |
28 // FileSystemBackend implementation. | |
29 virtual bool CanHandleType(storage::FileSystemType type) const OVERRIDE; | |
30 virtual void Initialize(storage::FileSystemContext* context) OVERRIDE; | |
31 | |
32 virtual void ResolveURL(const storage::FileSystemURL& url, | |
33 storage::OpenFileSystemMode mode, | |
34 const OpenFileSystemCallback& callback) OVERRIDE; | |
35 | |
36 virtual storage::AsyncFileUtil* GetAsyncFileUtil( | |
37 storage::FileSystemType type) OVERRIDE; | |
38 virtual storage::WatcherManager* GetWatcherManager( | |
39 storage::FileSystemType type) OVERRIDE; | |
40 virtual storage::CopyOrMoveFileValidatorFactory* | |
41 GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, | |
42 base::File::Error* error_code) OVERRIDE; | |
43 | |
44 virtual storage::FileSystemOperation* CreateFileSystemOperation( | |
45 const storage::FileSystemURL& url, | |
46 storage::FileSystemContext* context, | |
47 base::File::Error* error_code) const OVERRIDE; | |
48 | |
49 virtual bool SupportsStreaming( | |
50 const storage::FileSystemURL& url) const OVERRIDE; | |
51 | |
52 virtual bool HasInplaceCopyImplementation( | |
53 storage::FileSystemType type) const OVERRIDE; | |
54 | |
55 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | |
56 const storage::FileSystemURL& url, | |
57 int64 offset, | |
58 const base::Time& expected_modification_time, | |
59 storage::FileSystemContext* context) const OVERRIDE; | |
60 | |
61 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( | |
62 const storage::FileSystemURL& url, | |
63 int64 offset, | |
64 storage::FileSystemContext* context) const OVERRIDE; | |
65 | |
66 virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | |
67 | |
68 private: | |
69 // User mount points. | |
70 scoped_refptr<storage::ExternalMountPoints> mount_points_; | |
71 scoped_ptr<PrivetFileSystemAsyncUtil> async_util_; | |
72 }; | |
73 | |
74 } // namespace local_discovery | |
75 | |
76 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_BACKEND_H_ | |
OLD | NEW |