Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: webkit/fileapi/file_system_context.h

Issue 14096022: Make MountPointProvider pluggable from outside webkit/fileapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix etc Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/fileapi/copy_or_move_file_validator_unittest.cc ('k') | webkit/fileapi/file_system_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « webkit/fileapi/copy_or_move_file_validator_unittest.cc ('k') | webkit/fileapi/file_system_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698