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 94909c9ce3a43031f442883034b844b2108b4945..1570f508af5bf2dde8a66e71033fb94b22e7c9ca 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc |
@@ -552,7 +552,6 @@ void GDataFileSystem::CheckForUpdates() { |
feed_loader_->ReloadFromServerIfNeeded( |
initial_origin, |
directory_service_->largest_changestamp(), |
- directory_service_->root()->GetFilePath(), |
base::Bind(&GDataFileSystem::OnUpdateChecked, |
ui_weak_ptr_, |
initial_origin)); |
@@ -560,13 +559,11 @@ void GDataFileSystem::CheckForUpdates() { |
} |
void GDataFileSystem::OnUpdateChecked(ContentOrigin initial_origin, |
- GDataFileError error, |
- GDataEntry* /* entry */) { |
+ GDataFileError error) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- if (error != GDATA_FILE_OK) { |
+ if (error != GDATA_FILE_OK) |
directory_service_->set_origin(initial_origin); |
- } |
} |
GDataFileSystem::~GDataFileSystem() { |
@@ -685,10 +682,10 @@ void GDataFileSystem::FindEntryByPathAsyncOnUIThread( |
directory_service_->set_origin(INITIALIZING); |
feed_loader_->LoadFromCache( |
true, // should_load_from_server |
- search_file_path, |
// This is the initial load, hence we'll notify when it's done. |
- base::Bind(&GDataFileSystem::RunAndNotifyInitialLoadFinished, |
+ base::Bind(&GDataFileSystem::FindAndNotifyInitialLoadFinished, |
ui_weak_ptr_, |
+ search_file_path, |
callback)); |
return; |
} |
@@ -2006,22 +2003,22 @@ void GDataFileSystem::RequestDirectoryRefreshOnUIThreadAfterGetEntryInfo( |
0, // Not delta feed. |
0, // Not used. |
achuithb
2012/08/15 00:13:15
Can we say what this param is?
satorux1
2012/08/15 00:26:29
Will do
satorux1
2012/08/15 01:26:23
Done.
|
true, // multiple feeds |
- file_path, |
std::string(), // No search query |
GURL(), /* feed not explicitly set */ |
achuithb
2012/08/15 00:13:15
Can we use // style comment here instead?
satorux1
2012/08/15 00:26:29
Will do
satorux1
2012/08/15 01:26:23
Done.
|
- entry_proto->resource_id(), |
- FindEntryCallback(), // Not used. |
+ entry_proto->resource_id(), // Load the feed for this directory. |
+ FileOperationCallback(), // Not used. |
base::Bind(&GDataFileSystem::OnRequestDirectoryRefresh, |
- ui_weak_ptr_)); |
+ ui_weak_ptr_, |
+ file_path)); |
} |
void GDataFileSystem::OnRequestDirectoryRefresh( |
+ const FilePath& directory_path, |
GetDocumentsParams* params, |
GDataFileError error) { |
DCHECK(params); |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- const FilePath& directory_path = params->search_file_path; |
if (error != GDATA_FILE_OK) { |
LOG(ERROR) << "Failed to refresh directory: " << directory_path.value() |
<< ": " << error; |
@@ -2455,11 +2452,10 @@ void GDataFileSystem::SearchAsyncOnUIThread( |
false, // Stop fetching search results after first feed |
// chunk to avoid displaying huge number of search |
// results (especially since we don't cache them). |
- FilePath(), // Not used. |
search_query, |
next_feed, |
std::string(), // No directory resource ID. |
- FindEntryCallback(), // Not used. |
+ FileOperationCallback(), // Not used. |
base::Bind(&GDataFileSystem::OnSearch, ui_weak_ptr_, callback)); |
} |
@@ -2489,9 +2485,7 @@ void GDataFileSystem::LoadRootFeedFromCacheForTesting() { |
feed_loader_->LoadFromCache( |
false, // should_load_from_server. |
- // search_path doesn't matter if FindEntryCallback parameter is null . |
- FilePath(), |
- FindEntryCallback()); |
+ FileOperationCallback()); |
} |
GDataFileError GDataFileSystem::UpdateFromFeedForTesting( |
@@ -2841,14 +2835,15 @@ void GDataFileSystem::NotifyFileSystemToBeUnmounted() { |
OnFileSystemBeingUnmounted()); |
} |
-void GDataFileSystem::RunAndNotifyInitialLoadFinished( |
+void GDataFileSystem::FindAndNotifyInitialLoadFinished( |
+ const FilePath& search_file_path, |
const FindEntryCallback& callback, |
- GDataFileError error, |
- GDataEntry* entry) { |
+ GDataFileError error) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!callback.is_null()); |
- callback.Run(error, entry); |
+ // TODO(satorux): Remove this: crbug.com/141196. |
+ directory_service_->FindEntryByPathAndRunSync(search_file_path, callback); |
DVLOG(1) << "RunAndNotifyInitialLoadFinished"; |