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

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

Issue 11348030: Revert 164876 - Set root resource ID upon full feed update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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/drive_feed_loader.cc
===================================================================
--- chrome/browser/chromeos/drive/drive_feed_loader.cc (revision 164882)
+++ chrome/browser/chromeos/drive/drive_feed_loader.cc (working copy)
@@ -377,11 +377,8 @@
}
int64 largest_changestamp = about_resource->largest_change_id();
+ resource_metadata_->InitializeRootEntry(about_resource->root_folder_id());
- // Copy the root resource ID for use in UpdateFromFeed().
- params->root_resource_id = about_resource->root_folder_id();
- DCHECK(!params->root_resource_id.empty());
-
if (local_changestamp >= largest_changestamp) {
if (local_changestamp > largest_changestamp) {
LOG(WARNING) << "Cached client feed is fresher than server, client = "
@@ -479,8 +476,7 @@
if (error == DRIVE_FILE_OK) {
UpdateFromFeed(params->feed_list,
params->start_changestamp,
- params->root_feed_changestamp,
- params->root_resource_id);
+ params->root_feed_changestamp);
}
refreshing_ = false;
@@ -852,25 +848,12 @@
void DriveFeedLoader::UpdateFromFeed(
const ScopedVector<google_apis::DocumentFeed>& feed_list,
int64 start_changestamp,
- int64 root_feed_changestamp,
- const std::string& root_resource_id) {
+ int64 root_feed_changestamp) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DVLOG(1) << "Updating directory with a feed";
std::set<FilePath> changed_dirs;
- if (start_changestamp == 0) {
- // This is a full fetch and on full fetch the root has to be initialized
- // before children are added by DriveFeedProcessor.
- if (google_apis::util::IsDriveV2ApiEnabled()) {
- DCHECK(!root_resource_id.empty());
- resource_metadata_->InitializeRootEntry(root_resource_id);
- } else {
- // Use fixed root resource ID for WAPI.
- resource_metadata_->InitializeRootEntry(kWAPIRootDirectoryResourceId);
- }
- }
-
DriveFeedProcessor feed_processor(resource_metadata_);
feed_processor.ApplyFeeds(
feed_list,
« no previous file with comments | « chrome/browser/chromeos/drive/drive_feed_loader.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