Commit 47d76c83 authored by kinaba@chromium.org's avatar kinaba@chromium.org

Remove DriveFileSystem::LoadIfNeeded().

It's now just calling ChangeListLoader::LoaderIfNeeded in exactly the
same list of arguments.

Along the way remove some unused forward references and #include.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/14328038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195209 0039d316-1c4b-4281-b951-d872f2087c98
parent de138bb4
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/file_util.h" #include "base/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/message_loop_proxy.h" #include "base/message_loop_proxy.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "base/platform_file.h" #include "base/platform_file.h"
...@@ -14,7 +13,6 @@ ...@@ -14,7 +13,6 @@
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "base/stringprintf.h" #include "base/stringprintf.h"
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "base/values.h"
#include "chrome/browser/chromeos/drive/change_list_loader.h" #include "chrome/browser/chromeos/drive/change_list_loader.h"
#include "chrome/browser/chromeos/drive/change_list_processor.h" #include "chrome/browser/chromeos/drive/change_list_processor.h"
#include "chrome/browser/chromeos/drive/drive.pb.h" #include "chrome/browser/chromeos/drive/drive.pb.h"
...@@ -343,15 +341,6 @@ void DriveFileSystem::GetEntryInfoByResourceIdAfterGetEntry( ...@@ -343,15 +341,6 @@ void DriveFileSystem::GetEntryInfoByResourceIdAfterGetEntry(
file_path)); file_path));
} }
void DriveFileSystem::LoadIfNeeded(
const DirectoryFetchInfo& directory_fetch_info,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
change_list_loader_->LoadIfNeeded(directory_fetch_info, callback);
}
void DriveFileSystem::TransferFileFromRemoteToLocal( void DriveFileSystem::TransferFileFromRemoteToLocal(
const base::FilePath& remote_src_file_path, const base::FilePath& remote_src_file_path,
const base::FilePath& local_dest_file_path, const base::FilePath& local_dest_file_path,
...@@ -639,11 +628,12 @@ void DriveFileSystem::GetEntryInfoByPathAfterGetEntry1( ...@@ -639,11 +628,12 @@ void DriveFileSystem::GetEntryInfoByPathAfterGetEntry1(
// Start loading if needed. Note that directory_fetch_info is empty here, // Start loading if needed. Note that directory_fetch_info is empty here,
// as we don't need to fetch the contents of a directory when we just need // as we don't need to fetch the contents of a directory when we just need
// to get an entry of the directory. // to get an entry of the directory.
LoadIfNeeded(DirectoryFetchInfo(), change_list_loader_->LoadIfNeeded(
base::Bind(&DriveFileSystem::GetEntryInfoByPathAfterLoad, DirectoryFetchInfo(),
weak_ptr_factory_.GetWeakPtr(), base::Bind(&DriveFileSystem::GetEntryInfoByPathAfterLoad,
file_path, weak_ptr_factory_.GetWeakPtr(),
callback)); file_path,
callback));
} }
void DriveFileSystem::GetEntryInfoByPathAfterLoad( void DriveFileSystem::GetEntryInfoByPathAfterLoad(
...@@ -708,11 +698,12 @@ void DriveFileSystem::ReadDirectoryByPathAfterGetEntry( ...@@ -708,11 +698,12 @@ void DriveFileSystem::ReadDirectoryByPathAfterGetEntry(
if (error != DRIVE_FILE_OK) { if (error != DRIVE_FILE_OK) {
// If we don't know about the directory, start loading. // If we don't know about the directory, start loading.
LoadIfNeeded(DirectoryFetchInfo(), change_list_loader_->LoadIfNeeded(
base::Bind(&DriveFileSystem::ReadDirectoryByPathAfterLoad, DirectoryFetchInfo(),
weak_ptr_factory_.GetWeakPtr(), base::Bind(&DriveFileSystem::ReadDirectoryByPathAfterLoad,
directory_path, weak_ptr_factory_.GetWeakPtr(),
callback)); directory_path,
callback));
return; return;
} }
...@@ -728,11 +719,12 @@ void DriveFileSystem::ReadDirectoryByPathAfterGetEntry( ...@@ -728,11 +719,12 @@ void DriveFileSystem::ReadDirectoryByPathAfterGetEntry(
DirectoryFetchInfo directory_fetch_info( DirectoryFetchInfo directory_fetch_info(
entry_proto->resource_id(), entry_proto->resource_id(),
entry_proto->directory_specific_info().changestamp()); entry_proto->directory_specific_info().changestamp());
LoadIfNeeded(directory_fetch_info, change_list_loader_->LoadIfNeeded(
base::Bind(&DriveFileSystem::ReadDirectoryByPathAfterLoad, directory_fetch_info,
weak_ptr_factory_.GetWeakPtr(), base::Bind(&DriveFileSystem::ReadDirectoryByPathAfterLoad,
directory_path, weak_ptr_factory_.GetWeakPtr(),
callback)); directory_path,
callback));
} }
void DriveFileSystem::ReadDirectoryByPathAfterLoad( void DriveFileSystem::ReadDirectoryByPathAfterLoad(
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "chrome/browser/chromeos/drive/change_list_loader.h"
#include "chrome/browser/chromeos/drive/change_list_loader_observer.h" #include "chrome/browser/chromeos/drive/change_list_loader_observer.h"
#include "chrome/browser/chromeos/drive/drive_file_system_interface.h" #include "chrome/browser/chromeos/drive/drive_file_system_interface.h"
#include "chrome/browser/chromeos/drive/drive_file_system_util.h" #include "chrome/browser/chromeos/drive/drive_file_system_util.h"
...@@ -37,18 +36,12 @@ namespace drive { ...@@ -37,18 +36,12 @@ namespace drive {
class DriveCacheEntry; class DriveCacheEntry;
class DriveFileSystemObserver; class DriveFileSystemObserver;
class DriveFunctionRemove;
class DriveResourceMetadata; class DriveResourceMetadata;
class DriveScheduler; class DriveScheduler;
class DriveWebAppsRegistry; class DriveWebAppsRegistry;
class ChangeList;
class ChangeListLoader; class ChangeListLoader;
namespace file_system {
class CopyOperation;
class MoveOperation;
class RemoveOperation;
}
// The production implementation of DriveFileSystemInterface. // The production implementation of DriveFileSystemInterface.
class DriveFileSystem : public DriveFileSystemInterface, class DriveFileSystem : public DriveFileSystemInterface,
public ChangeListLoaderObserver, public ChangeListLoaderObserver,
...@@ -380,12 +373,6 @@ class DriveFileSystem : public DriveFileSystemInterface, ...@@ -380,12 +373,6 @@ class DriveFileSystem : public DriveFileSystemInterface,
DriveFileError error, DriveFileError error,
const base::FilePath& cache_file); const base::FilePath& cache_file);
// Loads the file system from the cache or the server via change lists if
// the file system is not yet loaded. Runs |callback| upon the completion
// with the error code. |callback| must not be null.
void LoadIfNeeded(const DirectoryFetchInfo& directory_fetch_info,
const FileOperationCallback& callback);
// Part of GetEntryInfoByResourceId(). Called after // Part of GetEntryInfoByResourceId(). Called after
// DriveResourceMetadata::GetEntryInfoByResourceId() is complete. // DriveResourceMetadata::GetEntryInfoByResourceId() is complete.
// |callback| must not be null. // |callback| must not be null.
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "base/stringprintf.h" #include "base/stringprintf.h"
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/chromeos/drive/change_list_loader.h"
#include "chrome/browser/chromeos/drive/drive.pb.h" #include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/drive_file_system_util.h" #include "chrome/browser/chromeos/drive/drive_file_system_util.h"
#include "chrome/browser/chromeos/drive/drive_scheduler.h" #include "chrome/browser/chromeos/drive/drive_scheduler.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment