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

Unified Diff: chrome/browser/chromeos/drive/change_list_processor.cc

Issue 13866009: Remove root resource id aliasing from DriveResourceMetadata. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove other resource id check. Created 7 years, 8 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: chrome/browser/chromeos/drive/change_list_processor.cc
diff --git a/chrome/browser/chromeos/drive/change_list_processor.cc b/chrome/browser/chromeos/drive/change_list_processor.cc
index bbd064b85de184781df9de1faedfc9d005897e25..850101dc12fc1da70af0948f5c1132593da7bd85 100644
--- a/chrome/browser/chromeos/drive/change_list_processor.cc
+++ b/chrome/browser/chromeos/drive/change_list_processor.cc
@@ -118,21 +118,28 @@ void ChangeListProcessor::ApplyFeeds(
NOTREACHED();
}
- ApplyEntryProtoMap(is_delta_feed);
+ ApplyEntryProtoMap(is_delta_feed, about_resource.Pass());
// Shouldn't record histograms when processing delta feeds.
if (!is_delta_feed)
uma_stats.UpdateFileCountUmaHistograms();
}
-void ChangeListProcessor::ApplyEntryProtoMap(bool is_delta_feed) {
+void ChangeListProcessor::ApplyEntryProtoMap(
+ bool is_delta_feed,
+ scoped_ptr<google_apis::AboutResource> about_resource) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!is_delta_feed) { // Full update.
+ DCHECK(about_resource);
+ changed_dirs_.insert(util::GetDriveGrandRootPath());
changed_dirs_.insert(util::GetDriveMyDriveRootPath());
+ // After all nodes are cleared, create the MyDrive root directory at first.
resource_metadata_->RemoveAll(
- base::Bind(&ChangeListProcessor::ApplyNextEntryProtoAsync,
- weak_ptr_factory_.GetWeakPtr()));
+ base::Bind(
+ &ChangeListProcessor::ApplyEntryProto,
+ weak_ptr_factory_.GetWeakPtr(),
+ util::CreateMyDriveRootEntry(about_resource->root_folder_id())));
} else {
// Go through all entries generated by the feed and apply them to the local
// snapshot of the file system.
« no previous file with comments | « chrome/browser/chromeos/drive/change_list_processor.h ('k') | chrome/browser/chromeos/drive/drive_file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698