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 8a58515fd61042604cdf8369d4999c8195d46556..ba49eb0afb1445860f4ef18b76d90979e609b021 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc |
@@ -448,19 +448,26 @@ void RemoveStaleEntryOnUpload(const std::string& resource_id, |
// 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) { |
@@ -2752,6 +2759,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())); |
} |