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

Unified Diff: chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util.cc

Issue 374843002: [SyncFS] [Refactoring] Change RemovePrefix() to return bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util.cc b/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util.cc
index 62e08a69355a380a5f87b81c3ed885dbb7389d0d..d33e0c6c7c01c7a0a49d660fe115d985fe88562a 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util.cc
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util.cc
@@ -82,10 +82,11 @@ std::string AddWapiIdPrefix(const std::string& resource_id,
}
std::string RemoveWapiIdPrefix(const std::string& resource_id) {
- if (StartsWithASCII(resource_id, kWapiFileIdPrefix, true))
- return RemovePrefix(resource_id, kWapiFileIdPrefix);
- if (StartsWithASCII(resource_id, kWapiFolderIdPrefix, true))
- return RemovePrefix(resource_id, kWapiFolderIdPrefix);
+ std::string value;
+ if (RemovePrefix(resource_id, kWapiFileIdPrefix, &value))
+ return value;
+ if (RemovePrefix(resource_id, kWapiFolderIdPrefix, &value))
+ return value;
return resource_id;
}
@@ -141,7 +142,8 @@ SyncStatusCode MigrateDatabaseFromV0ToV1(leveldb::DB* db) {
std::string key = itr->key().ToString();
if (!StartsWithASCII(key, kDriveMetadataKeyPrefix, true))
break;
- std::string serialized_url(RemovePrefix(key, kDriveMetadataKeyPrefix));
+ std::string serialized_url;
+ RemovePrefix(key, kDriveMetadataKeyPrefix, &serialized_url);
GURL origin;
base::FilePath path;
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698