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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 10835031: gdata: Trigger delta feed when search results contained unknown entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 5 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 | chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_file_system.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc
index a2b77af9a30c0b3ac20ed09a9a7307c9e93887ff..a9a7c7ee97c625b7e10ae16902f959218a243c49 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
@@ -406,19 +406,26 @@ void RunTaskOnThread(scoped_refptr<base::MessageLoopProxy> relay_proxy,
// Callback for GetEntryByResourceIdAsync.
// Adds |entry| to |results|. Runs |callback| with |results| when
-// |run_callback| is true.
+// |run_callback| is true. When |entry| is not present in our local file system
+// snapshot, it is not added to |results|. Instead, |entry_skipped_callback| is
+// called.
void AddEntryToSearchResults(
std::vector<SearchResultInfo>* results,
const SearchCallback& callback,
+ const base::Closure& entry_skipped_callback,
GDataFileError error,
bool run_callback,
GDataEntry* entry) {
- // If a result is not present in our local file system snapshot, ignore it.
+ // If a result is not present in our local file system snapshot, invoke
+ // |entry_skipped_callback| and refreshes the snapshot with delta feed.
// For example, this may happen if the entry has recently been added to the
// drive (and we still haven't received its delta feed).
if (entry) {
const bool is_directory = entry->AsGDataDirectory() != NULL;
results->push_back(SearchResultInfo(entry->GetFilePath(), is_directory));
+ } else {
+ if (!entry_skipped_callback.is_null())
+ entry_skipped_callback.Run();
}
if (run_callback) {
@@ -2791,6 +2798,7 @@ void GDataFileSystem::OnSearch(const SearchCallback& callback,
base::Bind(&AddEntryToSearchResults,
results,
callback,
+ base::Bind(&GDataFileSystem::CheckForUpdates, ui_weak_ptr_),
error,
i+1 == feed->entries().size()));
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698