Chromium Code Reviews| Index: chrome/browser/local_discovery/storage/privet_filesystem_backend.h |
| diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_backend.h b/chrome/browser/local_discovery/storage/privet_filesystem_backend.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..83ec8bfc566477e08690740d078b6dea1df6afb1 |
| --- /dev/null |
| +++ b/chrome/browser/local_discovery/storage/privet_filesystem_backend.h |
| @@ -0,0 +1,83 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_BACKEND_H_ |
| +#define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_BACKEND_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "webkit/browser/blob/file_stream_reader.h" |
| +#include "webkit/browser/fileapi/external_mount_points.h" |
| +#include "webkit/browser/fileapi/file_stream_writer.h" |
| +#include "webkit/browser/fileapi/file_system_backend.h" |
| + |
| +namespace local_discovery { |
| + |
| +class PrivetFileSystemAsyncUtil; |
| + |
| +class PrivetFileSystemBackend : public fileapi::ExternalFileSystemBackend { |
| + public: |
| + explicit PrivetFileSystemBackend(fileapi::ExternalMountPoints* mount_points); |
| + virtual ~PrivetFileSystemBackend(); |
| + |
| + // FileSystemBackend implementation. |
| + virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; |
| + virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; |
| + |
| + virtual void OpenFileSystem( |
| + const GURL& origin_url, |
| + fileapi::FileSystemType type, |
| + fileapi::OpenFileSystemMode mode, |
| + const OpenFileSystemCallback& callback) OVERRIDE; |
| + |
| + virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( |
| + fileapi::FileSystemType type) OVERRIDE; |
| + virtual fileapi::CopyOrMoveFileValidatorFactory* |
| + GetCopyOrMoveFileValidatorFactory( |
| + fileapi::FileSystemType type, |
| + base::PlatformFileError* error_code) OVERRIDE; |
| + |
| + virtual fileapi::FileSystemOperation* CreateFileSystemOperation( |
| + const fileapi::FileSystemURL& url, |
| + fileapi::FileSystemContext* context, |
| + base::PlatformFileError* error_code) const OVERRIDE; |
| + |
| + virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( |
| + const fileapi::FileSystemURL& url, |
| + int64 offset, |
| + const base::Time& expected_modification_time, |
| + fileapi::FileSystemContext* context) const OVERRIDE; |
| + |
| + virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( |
| + const fileapi::FileSystemURL& url, |
| + int64 offset, |
| + fileapi::FileSystemContext* context) const OVERRIDE; |
| + |
| + virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; |
| + |
| + // ExternalFileSystemBackend implementation. |
|
kinuko
2014/01/09 04:27:41
It's a bit sad to have more filesystems that depen
Noam Samuel
2014/01/09 18:59:15
Hm, on second look this might not be needed. When
|
| + virtual bool IsAccessAllowed( |
| + const fileapi::FileSystemURL& url) const OVERRIDE; |
| + virtual std::vector<base::FilePath> GetRootDirectories() const OVERRIDE; |
| + virtual void GrantFullAccessToExtension( |
| + const std::string& extension_id) OVERRIDE; |
| + virtual void GrantFileAccessToExtension( |
| + const std::string& extension_id, |
| + const base::FilePath& virtual_path) OVERRIDE; |
| + virtual void RevokeAccessForExtension( |
| + const std::string& extension_id) OVERRIDE; |
| + virtual bool GetVirtualPath(const base::FilePath& file_system_path, |
| + base::FilePath* virtual_path) OVERRIDE; |
| + |
| + private: |
| + // User mount points. |
| + scoped_refptr<fileapi::ExternalMountPoints> mount_points_; |
| + scoped_ptr<PrivetFileSystemAsyncUtil> async_util_; |
| +}; |
| + |
| +} // namespace local_discovery |
| + |
| +#endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_BACKEND_H_ |