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

Unified Diff: webkit/browser/fileapi/syncable/syncable_file_system_util.cc

Issue 16109008: Cleanup: Deprecate DriveFileSyncService::kServiceName (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698