Index: storage/browser/fileapi/file_system_context.h |
diff --git a/webkit/browser/fileapi/file_system_context.h b/storage/browser/fileapi/file_system_context.h |
similarity index 84% |
rename from webkit/browser/fileapi/file_system_context.h |
rename to storage/browser/fileapi/file_system_context.h |
index 428ef601149e660da3b49cdb710d5704a26609ed..14682754e163e7b4639193eae26e867918eed1b3 100644 |
--- a/webkit/browser/fileapi/file_system_context.h |
+++ b/storage/browser/fileapi/file_system_context.h |
@@ -15,13 +15,13 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/scoped_vector.h" |
#include "base/sequenced_task_runner_helpers.h" |
-#include "webkit/browser/fileapi/file_system_url.h" |
-#include "webkit/browser/fileapi/open_file_system_mode.h" |
-#include "webkit/browser/fileapi/plugin_private_file_system_backend.h" |
-#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" |
-#include "webkit/browser/fileapi/task_runner_bound_observer_list.h" |
-#include "webkit/browser/webkit_storage_browser_export.h" |
-#include "webkit/common/fileapi/file_system_types.h" |
+#include "storage/browser/fileapi/file_system_url.h" |
+#include "storage/browser/fileapi/open_file_system_mode.h" |
+#include "storage/browser/fileapi/plugin_private_file_system_backend.h" |
+#include "storage/browser/fileapi/sandbox_file_system_backend_delegate.h" |
+#include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
+#include "storage/common/storage_export.h" |
+#include "storage/common/fileapi/file_system_types.h" |
namespace base { |
class FilePath; |
@@ -42,12 +42,12 @@ namespace net { |
class URLRequest; |
} |
-namespace webkit_blob { |
+namespace storage { |
class BlobURLRequestJobTest; |
class FileStreamReader; |
} |
-namespace fileapi { |
+namespace storage { |
class AsyncFileUtil; |
class CopyOrMoveFileValidatorFactory; |
@@ -74,16 +74,16 @@ struct FileSystemInfo; |
// and calls |callback| when the attempt is complete. If the auto mounter |
// does not recognize the URL, it returns false and does not call |callback|. |
// Called on the IO thread. |
-typedef base::Callback<bool( |
- const net::URLRequest* url_request, |
- const FileSystemURL& filesystem_url, |
- const std::string& storage_domain, |
- const base::Callback<void(base::File::Error result)>& callback)> |
- URLRequestAutoMountHandler; |
+typedef base::Callback< |
+ bool(const net::URLRequest* url_request, |
+ const FileSystemURL& filesystem_url, |
+ const std::string& storage_domain, |
+ const base::Callback<void(base::File::Error result)>& callback)> |
+ URLRequestAutoMountHandler; |
// This class keeps and provides a file system context for FileSystem API. |
// An instance of this class is created and owned by profile. |
-class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
+class STORAGE_EXPORT FileSystemContext |
: public base::RefCountedThreadSafe<FileSystemContext, |
DefaultContextDeleter> { |
public: |
@@ -155,13 +155,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// |type|. If |error_code| is File::FILE_OK and the result is NULL, |
// then no validator is required. |
CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( |
- FileSystemType type, base::File::Error* error_code) const; |
+ FileSystemType type, |
+ base::File::Error* error_code) const; |
// Returns the file system backend instance for the given |type|. |
// This may return NULL if it is given an invalid or unsupported filesystem |
// type. |
- FileSystemBackend* GetFileSystemBackend( |
- FileSystemType type) const; |
+ FileSystemBackend* GetFileSystemBackend(FileSystemType type) const; |
// Returns true for sandboxed filesystems. Currently this does |
// the same as GetQuotaUtil(type) != NULL. (In an assumption that |
@@ -182,9 +182,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
ExternalFileSystemBackend* external_backend() const; |
// Used for OpenFileSystem. |
- typedef base::Callback<void(const GURL& root, |
- const std::string& name, |
- base::File::Error result)> |
+ typedef base::Callback< |
+ void(const GURL& root, const std::string& name, base::File::Error result)> |
OpenFileSystemCallback; |
// Used for ResolveURL. |
@@ -206,11 +205,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// If |create| is true this may actually set up a filesystem instance |
// (e.g. by creating the root directory or initializing the database |
// entry etc). |
- void OpenFileSystem( |
- const GURL& origin_url, |
- FileSystemType type, |
- OpenFileSystemMode mode, |
- const OpenFileSystemCallback& callback); |
+ void OpenFileSystem(const GURL& origin_url, |
+ FileSystemType type, |
+ OpenFileSystemMode mode, |
+ const OpenFileSystemCallback& callback); |
// Opens the filesystem for the given |url| as read-only, if the filesystem |
// backend referred by the URL allows opening by resolveURL. Otherwise it |
@@ -218,9 +216,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// absent; in that case RESOLVED_ENTRY_NOT_FOUND type is returned to the |
// callback for indicating the absence. Can be called from any thread with |
// a message loop. |callback| is invoked on the caller thread. |
- void ResolveURL( |
- const FileSystemURL& url, |
- const ResolveURLCallback& callback); |
+ void ResolveURL(const FileSystemURL& url, const ResolveURLCallback& callback); |
// Attempts to mount the filesystem needed to satisfy |url_request| made |
// from |storage_domain|. If an appropriate file system is not found, |
@@ -231,10 +227,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// Deletes the filesystem for the given |origin_url| and |type|. This should |
// be called on the IO thread. |
- void DeleteFileSystem( |
- const GURL& origin_url, |
- FileSystemType type, |
- const StatusCallback& callback); |
+ void DeleteFileSystem(const GURL& origin_url, |
+ FileSystemType type, |
+ const StatusCallback& callback); |
// Creates new FileStreamReader instance to read a file pointed by the given |
// filesystem URL |url| starting from |offset|. |expected_modification_time| |
@@ -246,16 +241,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// FileSystemBackend for the URL and call the backend's CreateFileReader. |
// The resolved FileSystemBackend could perform further specialization |
// depending on the filesystem type pointed by the |url|. |
- scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( |
+ scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
const FileSystemURL& url, |
int64 offset, |
const base::Time& expected_modification_time); |
// Creates new FileStreamWriter instance to write into a file pointed by |
// |url| from |offset|. |
- scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
- const FileSystemURL& url, |
- int64 offset); |
+ scoped_ptr<FileStreamWriter> CreateFileStreamWriter(const FileSystemURL& url, |
+ int64 offset); |
// Creates a new FileSystemOperationRunner. |
scoped_ptr<FileSystemOperationRunner> CreateFileSystemOperationRunner(); |
@@ -297,17 +291,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// This must be used to open 'plugin private' filesystem. |
// See "plugin_private_file_system_backend.h" for more details. |
- void OpenPluginPrivateFileSystem( |
- const GURL& origin_url, |
- FileSystemType type, |
- const std::string& filesystem_id, |
- const std::string& plugin_id, |
- OpenFileSystemMode mode, |
- const StatusCallback& callback); |
+ void OpenPluginPrivateFileSystem(const GURL& origin_url, |
+ FileSystemType type, |
+ const std::string& filesystem_id, |
+ const std::string& plugin_id, |
+ OpenFileSystemMode mode, |
+ const StatusCallback& callback); |
private: |
- typedef std::map<FileSystemType, FileSystemBackend*> |
- FileSystemBackendMap; |
+ typedef std::map<FileSystemType, FileSystemBackend*> FileSystemBackendMap; |
// For CreateFileSystemOperation. |
friend class FileSystemOperationRunner; |
@@ -334,9 +326,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// depending on the filesystem type pointed by the |url|. |
// |
// Called by FileSystemOperationRunner. |
- FileSystemOperation* CreateFileSystemOperation( |
- const FileSystemURL& url, |
- base::File::Error* error_code); |
+ FileSystemOperation* CreateFileSystemOperation(const FileSystemURL& url, |
+ base::File::Error* error_code); |
// For non-cracked isolated and external mount points, returns a FileSystemURL |
// created by cracking |url|. The url is cracked using MountPoints registered |
@@ -351,12 +342,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext |
// the constructor. |
void RegisterBackend(FileSystemBackend* backend); |
- void DidOpenFileSystemForResolveURL( |
- const FileSystemURL& url, |
- const ResolveURLCallback& callback, |
- const GURL& filesystem_root, |
- const std::string& filesystem_name, |
- base::File::Error error); |
+ void DidOpenFileSystemForResolveURL(const FileSystemURL& url, |
+ const ResolveURLCallback& callback, |
+ const GURL& filesystem_root, |
+ const std::string& filesystem_name, |
+ base::File::Error error); |
// Returns a FileSystemBackend, used only by test code. |
SandboxFileSystemBackend* sandbox_backend() const { |
@@ -417,6 +407,6 @@ struct DefaultContextDeleter { |
} |
}; |
-} // namespace fileapi |
+} // namespace storage |
#endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |