| Index: webkit/browser/fileapi/syncable/syncable_file_system_util.cc
|
| diff --git a/webkit/browser/fileapi/syncable/syncable_file_system_util.cc b/webkit/browser/fileapi/syncable/syncable_file_system_util.cc
|
| index 84ae92f3b5887d59c6a4cfbd92b29a124b8253c8..6ad547eb3c6172257cfb8384a0219f67c4941fd8 100644
|
| --- a/webkit/browser/fileapi/syncable/syncable_file_system_util.cc
|
| +++ b/webkit/browser/fileapi/syncable/syncable_file_system_util.cc
|
| @@ -26,41 +26,33 @@ namespace {
|
| const char kEnableSyncFSDirectoryOperation[] =
|
| "enable-syncfs-directory-operation";
|
|
|
| +const char kSyncableMountName[] = "syncfs";
|
| +
|
| bool is_directory_operation_enabled = false;
|
|
|
| }
|
|
|
| -bool RegisterSyncableFileSystem(const std::string& service_name) {
|
| - return ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
|
| - service_name, fileapi::kFileSystemTypeSyncable, base::FilePath());
|
| +void RegisterSyncableFileSystem() {
|
| + ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
|
| + kSyncableMountName,
|
| + fileapi::kFileSystemTypeSyncable,
|
| + base::FilePath());
|
| }
|
|
|
| -bool RevokeSyncableFileSystem(const std::string& service_name) {
|
| - return ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(
|
| - service_name);
|
| +void RevokeSyncableFileSystem() {
|
| + ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(
|
| + kSyncableMountName);
|
| }
|
|
|
| -GURL GetSyncableFileSystemRootURI(const GURL& origin,
|
| - const std::string& service_name) {
|
| - const GURL url = GetFileSystemRootURI(origin,
|
| - fileapi::kFileSystemTypeExternal);
|
| - const std::string path = service_name + "/";
|
| - url_canon::Replacements<char> replacements;
|
| - replacements.SetPath(path.c_str(), url_parse::Component(0, path.length()));
|
| - return url.ReplaceComponents(replacements);
|
| +GURL GetSyncableFileSystemRootURI(const GURL& origin) {
|
| + return GURL(fileapi::GetExternalFileSystemRootURIString(
|
| + origin, kSyncableMountName));
|
| }
|
|
|
| FileSystemURL CreateSyncableFileSystemURL(const GURL& origin,
|
| - const std::string& service_name,
|
| const base::FilePath& path) {
|
| - // Avoid using FilePath::Append as path may be an absolute path.
|
| - base::FilePath::StringType virtual_path =
|
| - base::FilePath::FromUTF8Unsafe(service_name + "/").value() +
|
| - path.value();
|
| - return ExternalMountPoints::GetSystemInstance()->CreateCrackedFileSystemURL(
|
| - origin,
|
| - fileapi::kFileSystemTypeExternal,
|
| - base::FilePath(virtual_path));
|
| + return ExternalMountPoints::GetSystemInstance()->CreateExternalFileSystemURL(
|
| + origin, kSyncableMountName, path);
|
| }
|
|
|
| bool SerializeSyncableFileSystemURL(const FileSystemURL& url,
|
| @@ -68,7 +60,7 @@ bool SerializeSyncableFileSystemURL(const FileSystemURL& url,
|
| if (!url.is_valid() || url.type() != fileapi::kFileSystemTypeSyncable)
|
| return false;
|
| *serialized_url =
|
| - GetSyncableFileSystemRootURI(url.origin(), url.filesystem_id()).spec() +
|
| + GetSyncableFileSystemRootURI(url.origin()).spec() +
|
| url.path().AsUTF8Unsafe();
|
| return true;
|
| }
|
|
|