| 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 1b28c4392af7fe39a3fa7abd5fe115d5a10cc290..245af9b9db5c73e9df8d835a37d48a4ca8931d2b 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| +++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| @@ -579,7 +579,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));
|
| @@ -587,13 +586,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() {
|
| @@ -712,10 +709,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;
|
| }
|
| @@ -2030,25 +2027,25 @@ void GDataFileSystem::RequestDirectoryRefreshOnUIThreadAfterGetEntryInfo(
|
|
|
| feed_loader_->LoadFromServer(
|
| directory_service_->origin(),
|
| - 0, // Not delta feed.
|
| - 0, // Not used.
|
| + 0, // start_changestamp - Not a delta feed.
|
| + 0, // root_feed_changestamp - Not used.
|
| true, // multiple feeds
|
| - file_path,
|
| std::string(), // No search query
|
| - GURL(), /* feed not explicitly set */
|
| - entry_proto->resource_id(),
|
| - FindEntryCallback(), // Not used.
|
| + GURL(), // feed_to_load - Feed not explicitly set
|
| + entry_proto->resource_id(), // Load the feed for this directory.
|
| + FileOperationCallback(), // load_finished_callback.
|
| 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;
|
| @@ -2448,11 +2445,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));
|
| }
|
|
|
| @@ -2482,9 +2478,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(
|
| @@ -2847,14 +2841,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";
|
|
|
|
|