Index: storage/common/fileapi/file_system_util.h |
diff --git a/webkit/common/fileapi/file_system_util.h b/storage/common/fileapi/file_system_util.h |
similarity index 71% |
rename from webkit/common/fileapi/file_system_util.h |
rename to storage/common/fileapi/file_system_util.h |
index 9bf84244f4214a6dc2ad07b0ca9f9d96903b6841..8c74dd73dbc5fae7b23637e5663796b6381ee48e 100644 |
--- a/webkit/common/fileapi/file_system_util.h |
+++ b/storage/common/fileapi/file_system_util.h |
@@ -12,22 +12,22 @@ |
#include "base/files/file_path.h" |
#include "third_party/WebKit/public/platform/WebFileError.h" |
#include "third_party/WebKit/public/platform/WebFileSystemType.h" |
-#include "webkit/common/fileapi/file_system_info.h" |
-#include "webkit/common/fileapi/file_system_types.h" |
-#include "webkit/common/quota/quota_types.h" |
-#include "webkit/common/webkit_storage_common_export.h" |
+#include "storage/common/fileapi/file_system_info.h" |
+#include "storage/common/fileapi/file_system_types.h" |
+#include "storage/common/quota/quota_types.h" |
+#include "storage/common/storage_export.h" |
class GURL; |
-namespace fileapi { |
+namespace storage { |
-WEBKIT_STORAGE_COMMON_EXPORT extern const char kPersistentDir[]; |
-WEBKIT_STORAGE_COMMON_EXPORT extern const char kTemporaryDir[]; |
-WEBKIT_STORAGE_COMMON_EXPORT extern const char kExternalDir[]; |
-WEBKIT_STORAGE_COMMON_EXPORT extern const char kIsolatedDir[]; |
-WEBKIT_STORAGE_COMMON_EXPORT extern const char kTestDir[]; |
+STORAGE_EXPORT extern const char kPersistentDir[]; |
+STORAGE_EXPORT extern const char kTemporaryDir[]; |
+STORAGE_EXPORT extern const char kExternalDir[]; |
+STORAGE_EXPORT extern const char kIsolatedDir[]; |
+STORAGE_EXPORT extern const char kTestDir[]; |
-class WEBKIT_STORAGE_COMMON_EXPORT VirtualPath { |
+class STORAGE_EXPORT VirtualPath { |
public: |
static const base::FilePath::CharType kRoot[]; |
static const base::FilePath::CharType kSeparator; |
@@ -50,8 +50,8 @@ class WEBKIT_STORAGE_COMMON_EXPORT VirtualPath { |
const base::FilePath& path, |
std::vector<base::FilePath::StringType>* components); |
- static void GetComponentsUTF8Unsafe( |
- const base::FilePath& path, std::vector<std::string>* components); |
+ static void GetComponentsUTF8Unsafe(const base::FilePath& path, |
+ std::vector<std::string>* components); |
// Returns a path name ensuring that it begins with kRoot and all path |
// separators are forward slashes /. |
@@ -69,11 +69,10 @@ class WEBKIT_STORAGE_COMMON_EXPORT VirtualPath { |
// Example: For a URL 'filesystem:http://foo.com/temporary/foo/bar', |
// |origin_url| is set to 'http://foo.com', |type| is set to |
// kFileSystemTypeTemporary, and |virtual_path| is set to 'foo/bar'. |
-WEBKIT_STORAGE_COMMON_EXPORT bool ParseFileSystemSchemeURL( |
- const GURL& url, |
- GURL* origin_url, |
- FileSystemType* type, |
- base::FilePath* virtual_path); |
+STORAGE_EXPORT bool ParseFileSystemSchemeURL(const GURL& url, |
+ GURL* origin_url, |
+ FileSystemType* type, |
+ base::FilePath* virtual_path); |
// Returns the root URI of the filesystem that can be specified by a pair of |
// |origin_url| and |type|. The returned URI can be used as a root path |
@@ -84,8 +83,8 @@ WEBKIT_STORAGE_COMMON_EXPORT bool ParseFileSystemSchemeURL( |
// returns URL without the filesystem ID. |
// |
// |type| needs to be public type as the returned URI is given to the renderer. |
-WEBKIT_STORAGE_COMMON_EXPORT GURL GetFileSystemRootURI(const GURL& origin_url, |
- FileSystemType type); |
+STORAGE_EXPORT GURL |
+ GetFileSystemRootURI(const GURL& origin_url, FileSystemType type); |
// Returns the name for the filesystem that is specified by a pair of |
// |origin_url| and |type|. |
@@ -98,29 +97,27 @@ WEBKIT_STORAGE_COMMON_EXPORT GURL GetFileSystemRootURI(const GURL& origin_url, |
// Example: |
// The name for a TEMPORARY filesystem of "http://www.example.com:80/" |
// should look like: "http_www.example.host_80:temporary" |
-WEBKIT_STORAGE_COMMON_EXPORT std::string |
-GetFileSystemName(const GURL& origin_url, FileSystemType type); |
+STORAGE_EXPORT std::string GetFileSystemName(const GURL& origin_url, |
+ FileSystemType type); |
// Converts FileSystemType |type| to/from the StorageType |storage_type| that |
// is used for the unified quota system. |
// (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem |
// type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.) |
-WEBKIT_STORAGE_COMMON_EXPORT FileSystemType |
-QuotaStorageTypeToFileSystemType(quota::StorageType storage_type); |
+STORAGE_EXPORT FileSystemType |
+ QuotaStorageTypeToFileSystemType(quota::StorageType storage_type); |
-WEBKIT_STORAGE_COMMON_EXPORT quota::StorageType |
-FileSystemTypeToQuotaStorageType(FileSystemType type); |
+STORAGE_EXPORT quota::StorageType FileSystemTypeToQuotaStorageType( |
+ FileSystemType type); |
// Returns the string representation of the given filesystem |type|. |
// Returns an empty string if the |type| is invalid. |
-WEBKIT_STORAGE_COMMON_EXPORT std::string |
-GetFileSystemTypeString(FileSystemType type); |
+STORAGE_EXPORT std::string GetFileSystemTypeString(FileSystemType type); |
// Sets type to FileSystemType enum that corresponds to the string name. |
// Returns false if the |type_string| is invalid. |
-WEBKIT_STORAGE_COMMON_EXPORT bool GetFileSystemPublicType( |
- std::string type_string, |
- blink::WebFileSystemType* type); |
+STORAGE_EXPORT bool GetFileSystemPublicType(std::string type_string, |
+ blink::WebFileSystemType* type); |
// Encodes |file_path| to a string. |
// Following conditions should be held: |
@@ -130,20 +127,19 @@ WEBKIT_STORAGE_COMMON_EXPORT bool GetFileSystemPublicType( |
// |
// TODO(tzik): Replace CreateFilePath and FilePathToString in |
// third_party/leveldatabase/env_chromium.cc with them. |
-WEBKIT_STORAGE_COMMON_EXPORT std::string FilePathToString( |
- const base::FilePath& file_path); |
+STORAGE_EXPORT std::string FilePathToString(const base::FilePath& file_path); |
// Decode a file path from |file_path_string|. |
-WEBKIT_STORAGE_COMMON_EXPORT base::FilePath StringToFilePath( |
+STORAGE_EXPORT base::FilePath StringToFilePath( |
const std::string& file_path_string); |
// File error conversion |
-WEBKIT_STORAGE_COMMON_EXPORT blink::WebFileError |
-FileErrorToWebFileError(base::File::Error error_code); |
+STORAGE_EXPORT blink::WebFileError FileErrorToWebFileError( |
+ base::File::Error error_code); |
// Generate a file system name for the given arguments. Should only be used by |
// platform apps. |
-WEBKIT_STORAGE_COMMON_EXPORT std::string GetIsolatedFileSystemName( |
+STORAGE_EXPORT std::string GetIsolatedFileSystemName( |
const GURL& origin_url, |
const std::string& filesystem_id); |
@@ -151,32 +147,31 @@ WEBKIT_STORAGE_COMMON_EXPORT std::string GetIsolatedFileSystemName( |
// platform apps. This function will return false if the file system name is |
// not of the form {origin}:Isolated_{id}, and will also check that there is an |
// origin and id present. It will not check that the origin or id are valid. |
-WEBKIT_STORAGE_COMMON_EXPORT bool CrackIsolatedFileSystemName( |
+STORAGE_EXPORT bool CrackIsolatedFileSystemName( |
const std::string& filesystem_name, |
std::string* filesystem_id); |
// Validates the given isolated file system id. |
-WEBKIT_STORAGE_COMMON_EXPORT bool ValidateIsolatedFileSystemId( |
+STORAGE_EXPORT bool ValidateIsolatedFileSystemId( |
const std::string& filesystem_id); |
// Returns the root URI for an isolated filesystem for origin |origin_url| |
// and |filesystem_id|. If the |optional_root_name| is given the resulting |
// root URI will point to the subfolder within the isolated filesystem. |
-WEBKIT_STORAGE_COMMON_EXPORT std::string GetIsolatedFileSystemRootURIString( |
+STORAGE_EXPORT std::string GetIsolatedFileSystemRootURIString( |
const GURL& origin_url, |
const std::string& filesystem_id, |
const std::string& optional_root_name); |
// Returns the root URI for an external filesystem for origin |origin_url| |
// and |mount_name|. |
-WEBKIT_STORAGE_COMMON_EXPORT std::string GetExternalFileSystemRootURIString( |
+STORAGE_EXPORT std::string GetExternalFileSystemRootURIString( |
const GURL& origin_url, |
const std::string& mount_name); |
// Translates the net::Error to base::File::Error. |
-WEBKIT_STORAGE_COMMON_EXPORT base::File::Error |
-NetErrorToFileError(int error); |
+STORAGE_EXPORT base::File::Error NetErrorToFileError(int error); |
-} // namespace fileapi |
+} // namespace storage |
#endif // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ |