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

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

Issue 444463005: drive: Trigger "fast fetch" if remote update came during full loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix test. Created 6 years, 4 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/directory_loader.cc
diff --git a/chrome/browser/chromeos/drive/directory_loader.cc b/chrome/browser/chromeos/drive/directory_loader.cc
index d67d359cf6fd02b5c89975821ef79ab7c522dcdb..6844368e7da3eb08ded96171797e7be72a9234d0 100644
--- a/chrome/browser/chromeos/drive/directory_loader.cc
+++ b/chrome/browser/chromeos/drive/directory_loader.cc
@@ -396,9 +396,12 @@ void DirectoryLoader::ReadDirectoryAfterCheckLocalState(
DirectoryFetchInfo directory_fetch_info(
local_id, entry->resource_id(), remote_changestamp);
- // If the directory's changestamp is new enough, just schedule to run the
- // callback, as there is no need to fetch the directory.
- if (directory_changestamp + kMinimumChangestampGap > remote_changestamp) {
+ // If the directory's changestamp is up-to-date or the global changestamp of
+ // the metadata DB is new enough (which means the normal changelist loading
+ // should finish very soon), just schedule to run the callback, as there is no
+ // need to fetch the directory.
+ if (directory_changestamp >= remote_changestamp ||
+ *local_changestamp + kMinimumChangestampGap > remote_changestamp) {
OnDirectoryLoadComplete(local_id, FILE_ERROR_OK);
} else {
// Start fetching the directory content, and mark it with the changestamp
« no previous file with comments | « chrome/browser/chromeos/drive/change_list_loader_unittest.cc ('k') | chrome/browser/chromeos/drive/file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698