Index: webkit/fileapi/file_system_context.h |
diff --git a/webkit/fileapi/file_system_context.h b/webkit/fileapi/file_system_context.h |
index 0225a219ba320a311b780d4df1481d3e4ae64b4a..95e736a9c95e861df1e383e45fb8805ab651dc5a 100644 |
--- a/webkit/fileapi/file_system_context.h |
+++ b/webkit/fileapi/file_system_context.h |
@@ -12,6 +12,7 @@ |
#include "base/callback.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/scoped_vector.h" |
#include "base/platform_file.h" |
#include "base/sequenced_task_runner_helpers.h" |
#include "webkit/fileapi/file_system_types.h" |
@@ -77,11 +78,17 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext |
// ChromeOS, it will be passed to external_mount_point_provider. |
// |external_mount_points| may be NULL only on platforms different from |
// ChromeOS (i.e. platforms that don't use external_mount_point_provider). |
+ // |
+ // |additional_providers| are added to the internal provider map |
+ // to serve filesystem requests for non-regular types. |
+ // If none is given, this context only handles HTML5 Sandbox FileSystem |
+ // and Drag-and-drop Isolated FileSystem requests. |
FileSystemContext( |
scoped_ptr<FileSystemTaskRunners> task_runners, |
ExternalMountPoints* external_mount_points, |
quota::SpecialStoragePolicy* special_storage_policy, |
quota::QuotaManagerProxy* quota_manager_proxy, |
+ ScopedVector<FileSystemMountPointProvider> additional_providers, |
const base::FilePath& partition_path, |
const FileSystemOptions& options); |
@@ -192,11 +199,6 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext |
const FileSystemURL& url, |
int64 offset); |
- // Register a filesystem provider. The ownership of |provider| is |
- // transferred to this instance. |
- void RegisterMountPointProvider(FileSystemType type, |
- FileSystemMountPointProvider* provider); |
- |
FileSystemTaskRunners* task_runners() { return task_runners_.get(); } |
sync_file_system::LocalFileChangeTracker* change_tracker() { |
@@ -221,6 +223,9 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext |
const base::FilePath& path) const; |
private: |
+ typedef std::map<FileSystemType, FileSystemMountPointProvider*> |
+ MountPointProviderMap; |
+ |
// Friended for GetFileUtil. |
// These classes know the target filesystem (i.e. sandbox filesystem) |
// supports synchronous FileUtil. |
@@ -260,6 +265,10 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext |
// does not support synchronous file operations. |
FileSystemFileUtil* GetFileUtil(FileSystemType type) const; |
+ // For initial provider_map construction. This must be called only from |
+ // the constructor. |
+ void RegisterMountPointProvider(FileSystemMountPointProvider* provider); |
+ |
scoped_ptr<FileSystemTaskRunners> task_runners_; |
scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
@@ -269,9 +278,14 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext |
scoped_ptr<IsolatedMountPointProvider> isolated_provider_; |
scoped_ptr<ExternalFileSystemMountPointProvider> external_provider_; |
- // Registered mount point providers. |
- std::map<FileSystemType, FileSystemMountPointProvider*> provider_map_; |
+ // Additional mount point providers. |
+ ScopedVector<FileSystemMountPointProvider> additional_providers_; |
+ // Registered mount point providers. |
+ // The map must be constructed in the constructor since it can be accessed |
+ // on multiple threads. |
+ // The ownership of each provider is held by mount_point_providers_. |
+ MountPointProviderMap provider_map_; |
// External mount points visible in the file system context (excluding system |
// external mount points). |
scoped_refptr<ExternalMountPoints> external_mount_points_; |