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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_service.cc

Issue 14655012: SyncFS: Always normalize paths with FileSystemURL's ctor *and* GetNormalizedFilePath (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
« no previous file with comments | « no previous file | 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_file_sync_service.cc
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_file_sync_service.cc
index e64398da4fbe71899a349304191d39b2d0c08b9a..85adbf80760b215eb42e1b230973976715230f94 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_service.cc
@@ -1982,6 +1982,11 @@ bool DriveFileSyncService::AppendRemoteChangeInternal(
CreateSyncableFileSystemURL(origin, kServiceName, path));
DCHECK(url.is_valid());
+ // Note that we create a normalized path from url.path() rather than
+ // path here (as FileSystemURL does extra normalization).
+ base::FilePath::StringType normalized_path =
+ fileapi::VirtualPath::GetNormalizedFilePath(url.path());
+
std::string local_resource_id;
std::string local_file_md5;
@@ -1995,8 +2000,7 @@ bool DriveFileSyncService::AppendRemoteChangeInternal(
}
PathToChangeMap* path_to_change = &origin_to_changes_map_[origin];
- PathToChangeMap::iterator found =
- path_to_change->find(fileapi::VirtualPath::GetNormalizedFilePath(path));
+ PathToChangeMap::iterator found = path_to_change->find(normalized_path);
PendingChangeQueue::iterator overridden_queue_item = pending_changes_.end();
if (found != path_to_change->end()) {
if (found->second.changestamp >= changestamp)
@@ -2061,7 +2065,7 @@ bool DriveFileSyncService::AppendRemoteChangeInternal(
pending_changes_.insert(ChangeQueueItem(changestamp, sync_type, url));
DCHECK(inserted_to_queue.second);
- (*path_to_change)[fileapi::VirtualPath::GetNormalizedFilePath(path)] =
+ (*path_to_change)[normalized_path] =
RemoteChange(
changestamp, remote_resource_id, remote_file_md5,
updated_time, sync_type, url, file_change,
@@ -2069,6 +2073,7 @@ bool DriveFileSyncService::AppendRemoteChangeInternal(
}
DVLOG(3) << "Append remote change: " << path.value()
+ << " (" << normalized_path << ")"
<< "@" << changestamp << " "
<< file_change.DebugString();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698