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 "webkit/browser/blob/file_stream_reader.h" |
| 13 #include "webkit/browser/fileapi/external_mount_points.h" |
| 14 #include "webkit/browser/fileapi/file_stream_writer.h" |
| 15 #include "webkit/browser/fileapi/file_system_backend.h" |
| 16 |
| 17 namespace local_discovery { |
| 18 |
| 19 class PrivetFileSystemAsyncUtil; |
| 20 |
| 21 class PrivetFileSystemBackend : public fileapi::FileSystemBackend { |
| 22 public: |
| 23 explicit PrivetFileSystemBackend(fileapi::ExternalMountPoints* mount_points); |
| 24 virtual ~PrivetFileSystemBackend(); |
| 25 |
| 26 // FileSystemBackend implementation. |
| 27 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; |
| 28 virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; |
| 29 |
| 30 virtual void OpenFileSystem( |
| 31 const GURL& origin_url, |
| 32 fileapi::FileSystemType type, |
| 33 fileapi::OpenFileSystemMode mode, |
| 34 const OpenFileSystemCallback& callback) OVERRIDE; |
| 35 |
| 36 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( |
| 37 fileapi::FileSystemType type) OVERRIDE; |
| 38 virtual fileapi::CopyOrMoveFileValidatorFactory* |
| 39 GetCopyOrMoveFileValidatorFactory( |
| 40 fileapi::FileSystemType type, |
| 41 base::PlatformFileError* error_code) OVERRIDE; |
| 42 |
| 43 virtual fileapi::FileSystemOperation* CreateFileSystemOperation( |
| 44 const fileapi::FileSystemURL& url, |
| 45 fileapi::FileSystemContext* context, |
| 46 base::PlatformFileError* error_code) const OVERRIDE; |
| 47 |
| 48 virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( |
| 49 const fileapi::FileSystemURL& url, |
| 50 int64 offset, |
| 51 const base::Time& expected_modification_time, |
| 52 fileapi::FileSystemContext* context) const OVERRIDE; |
| 53 |
| 54 virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( |
| 55 const fileapi::FileSystemURL& url, |
| 56 int64 offset, |
| 57 fileapi::FileSystemContext* context) const OVERRIDE; |
| 58 |
| 59 virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; |
| 60 |
| 61 private: |
| 62 // User mount points. |
| 63 scoped_refptr<fileapi::ExternalMountPoints> mount_points_; |
| 64 scoped_ptr<PrivetFileSystemAsyncUtil> async_util_; |
| 65 }; |
| 66 |
| 67 } // namespace local_discovery |
| 68 |
| 69 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_BACKEND_H_ |
OLD | NEW |