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

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: 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
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..77721c9207b105bf4f6b05e5d8f64a97da15b596 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"
@@ -72,16 +73,18 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
// returns false if the current task is not running on the thread that allows
// blocking file operations (like SequencedWorkerPool implementation does).
//
- // |external_mount_points| contains non-system external mount points available
- // in the context. If not NULL, it will be used during URL cracking. On
- // 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.
+ //
+ // |additional_mount_points| is used to crack FileSystemURL in
+ // CrackFileSystemURL() (in addition to default system-wide mount points).
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 std::vector<MountPoints*>& additional_mount_points,
const base::FilePath& partition_path,
const FileSystemOptions& options);
@@ -193,9 +196,10 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
int64 offset);
// Register a filesystem provider. The ownership of |provider| is
- // transferred to this instance.
- void RegisterMountPointProvider(FileSystemType type,
- FileSystemMountPointProvider* provider);
+ // transferred to this instance. This must be used only for testing.
+ void RegisterMountPointProviderForTesting(
+ FileSystemType type,
+ FileSystemMountPointProvider* provider);
FileSystemTaskRunners* task_runners() { return task_runners_.get(); }
@@ -260,6 +264,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_;
@@ -267,15 +275,16 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
// Regular mount point providers.
scoped_ptr<SandboxMountPointProvider> sandbox_provider_;
scoped_ptr<IsolatedMountPointProvider> isolated_provider_;
- scoped_ptr<ExternalFileSystemMountPointProvider> external_provider_;
+
+ // Additional mount point providers.
+ ScopedVector<FileSystemMountPointProvider> additional_providers_;
// Registered mount point providers.
+ // The map must be constructed in the constructor (other than for testing)
+ // since it can be accessed on multiple threads.
+ // The ownership of each provider is held by mount_point_providers_.
std::map<FileSystemType, FileSystemMountPointProvider*> provider_map_;
- // External mount points visible in the file system context (excluding system
- // external mount points).
- scoped_refptr<ExternalMountPoints> external_mount_points_;
-
// MountPoints used to crack FileSystemURLs. The MountPoints are ordered
// in order they should try to crack a FileSystemURL.
std::vector<MountPoints*> url_crackers_;

Powered by Google App Engine
This is Rietveld 408576698