1 // Copyright (c) 2012 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.
5 #ifndef STORAGE_BROWSER_FILEAPI_ISOLATED_FILE_SYSTEM_BACKEND_H_
6 #define STORAGE_BROWSER_FILEAPI_ISOLATED_FILE_SYSTEM_BACKEND_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "storage/browser/fileapi/file_system_backend.h"
10 #include "storage/browser/fileapi/task_runner_bound_observer_list.h"
14 class AsyncFileUtilAdapter
;
16 class IsolatedFileSystemBackend
: public FileSystemBackend
{
18 IsolatedFileSystemBackend(bool use_for_type_native_local
,
19 bool use_for_type_platform_app
);
20 ~IsolatedFileSystemBackend() override
;
22 // FileSystemBackend implementation.
23 bool CanHandleType(FileSystemType type
) const override
;
24 void Initialize(FileSystemContext
* context
) override
;
25 void ResolveURL(const FileSystemURL
& url
,
26 OpenFileSystemMode mode
,
27 const OpenFileSystemCallback
& callback
) override
;
28 AsyncFileUtil
* GetAsyncFileUtil(FileSystemType type
) override
;
29 WatcherManager
* GetWatcherManager(FileSystemType type
) override
;
30 CopyOrMoveFileValidatorFactory
* GetCopyOrMoveFileValidatorFactory(
32 base::File::Error
* error_code
) override
;
33 FileSystemOperation
* CreateFileSystemOperation(
34 const FileSystemURL
& url
,
35 FileSystemContext
* context
,
36 base::File::Error
* error_code
) const override
;
37 bool SupportsStreaming(const FileSystemURL
& url
) const override
;
38 bool HasInplaceCopyImplementation(
39 storage::FileSystemType type
) const override
;
40 scoped_ptr
<storage::FileStreamReader
> CreateFileStreamReader(
41 const FileSystemURL
& url
,
43 int64 max_bytes_to_read
,
44 const base::Time
& expected_modification_time
,
45 FileSystemContext
* context
) const override
;
46 scoped_ptr
<FileStreamWriter
> CreateFileStreamWriter(
47 const FileSystemURL
& url
,
49 FileSystemContext
* context
) const override
;
50 FileSystemQuotaUtil
* GetQuotaUtil() override
;
51 const UpdateObserverList
* GetUpdateObservers(
52 FileSystemType type
) const override
;
53 const ChangeObserverList
* GetChangeObservers(
54 FileSystemType type
) const override
;
55 const AccessObserverList
* GetAccessObservers(
56 FileSystemType type
) const override
;
59 // Whether this object should handle native local filesystem types. Some
60 // platforms (e.g. Chrome OS) may provide a different FileSystemBackend to
61 // handle those types.
62 const bool use_for_type_native_local_
;
64 // As above but for platform webapps.
65 const bool use_for_type_platform_app_
;
67 scoped_ptr
<AsyncFileUtilAdapter
> isolated_file_util_
;
68 scoped_ptr
<AsyncFileUtilAdapter
> dragged_file_util_
;
69 scoped_ptr
<AsyncFileUtilAdapter
> transient_file_util_
;
72 } // namespace storage
74 #endif // STORAGE_BROWSER_FILEAPI_ISOLATED_FILE_SYSTEM_BACKEND_H_