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

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: 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 ac2fd7a1cacf411f6c3d9c5a06f4e4a128b866b0..50ae92cdba193cde3eecd71ebf327715aa0b246f 100644
--- a/chrome/browser/chromeos/drive/change_list_processor.cc
+++ b/chrome/browser/chromeos/drive/change_list_processor.cc
@@ -109,21 +109,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.

Powered by Google App Engine
This is Rietveld 408576698