Commit d9bcf70c authored by kinaba@chromium.org's avatar kinaba@chromium.org

Remove drive::file_system::Operations.

BUG=245147

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203100 0039d316-1c4b-4281-b951-d872f2087c98
parent b8be36d1
......@@ -17,6 +17,15 @@
#include "chrome/browser/chromeos/drive/change_list_processor.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/file_cache.h"
#include "chrome/browser/chromeos/drive/file_system/copy_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_file_operation.h"
#include "chrome/browser/chromeos/drive/file_system/download_operation.h"
#include "chrome/browser/chromeos/drive/file_system/move_operation.h"
#include "chrome/browser/chromeos/drive/file_system/remove_operation.h"
#include "chrome/browser/chromeos/drive/file_system/search_operation.h"
#include "chrome/browser/chromeos/drive/file_system/touch_operation.h"
#include "chrome/browser/chromeos/drive/file_system/update_operation.h"
#include "chrome/browser/chromeos/drive/file_system_observer.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/drive/job_scheduler.h"
......@@ -93,15 +102,7 @@ void FileSystem::Initialize() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SetupChangeListLoader();
// Allocate the file system operation handlers.
operations_.Init(this, // OperationObserver
scheduler_,
resource_metadata_,
cache_,
this, // FileSystemInterface
drive_service_,
blocking_task_runner_);
SetupOperations();
PrefService* pref_service = profile_->GetPrefs();
hide_hosted_docs_ = pref_service->GetBoolean(prefs::kDisableDriveHostedFiles);
......@@ -130,6 +131,34 @@ void FileSystem::SetupChangeListLoader() {
change_list_loader_->AddObserver(this);
}
void FileSystem::SetupOperations() {
file_system::OperationObserver* observer = this;
copy_operation_.reset(
new file_system::CopyOperation(blocking_task_runner_,
observer,
scheduler_,
resource_metadata_,
cache_,
this,
drive_service_));
create_directory_operation_.reset(new file_system::CreateDirectoryOperation(
blocking_task_runner_, observer, scheduler_, resource_metadata_));
create_file_operation_.reset(new file_system::CreateFileOperation(
blocking_task_runner_, observer, scheduler_, resource_metadata_, cache_));
move_operation_.reset(new file_system::MoveOperation(
observer, scheduler_, resource_metadata_));
remove_operation_.reset(new file_system::RemoveOperation(
observer, scheduler_, resource_metadata_, cache_));
touch_operation_.reset(new file_system::TouchOperation(
blocking_task_runner_, observer, scheduler_, resource_metadata_));
download_operation_.reset(new file_system::DownloadOperation(
blocking_task_runner_, observer, scheduler_, resource_metadata_, cache_));
update_operation_.reset(new file_system::UpdateOperation(
blocking_task_runner_, observer, scheduler_, resource_metadata_, cache_));
search_operation_.reset(new file_system::SearchOperation(
blocking_task_runner_, scheduler_, resource_metadata_));
}
void FileSystem::CheckForUpdates() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DVLOG(1) << "CheckForUpdates";
......@@ -200,20 +229,22 @@ void FileSystem::TransferFileFromRemoteToLocal(
const base::FilePath& remote_src_file_path,
const base::FilePath& local_dest_file_path,
const FileOperationCallback& callback) {
operations_.TransferFileFromRemoteToLocal(remote_src_file_path,
local_dest_file_path,
callback);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
copy_operation_->TransferFileFromRemoteToLocal(remote_src_file_path,
local_dest_file_path,
callback);
}
void FileSystem::TransferFileFromLocalToRemote(
const base::FilePath& local_src_file_path,
const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback) {
operations_.TransferFileFromLocalToRemote(local_src_file_path,
remote_dest_file_path,
callback);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
copy_operation_->TransferFileFromLocalToRemote(local_src_file_path,
remote_dest_file_path,
callback);
}
void FileSystem::Copy(const base::FilePath& src_file_path,
......@@ -221,7 +252,7 @@ void FileSystem::Copy(const base::FilePath& src_file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
operations_.Copy(src_file_path, dest_file_path, callback);
copy_operation_->Copy(src_file_path, dest_file_path, callback);
}
void FileSystem::Move(const base::FilePath& src_file_path,
......@@ -229,7 +260,7 @@ void FileSystem::Move(const base::FilePath& src_file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
operations_.Move(src_file_path, dest_file_path, callback);
move_operation_->Move(src_file_path, dest_file_path, callback);
}
void FileSystem::Remove(const base::FilePath& file_path,
......@@ -237,7 +268,7 @@ void FileSystem::Remove(const base::FilePath& file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
operations_.Remove(file_path, is_recursive, callback);
remove_operation_->Remove(file_path, is_recursive, callback);
}
void FileSystem::CreateDirectory(
......@@ -269,7 +300,7 @@ void FileSystem::CreateDirectoryAfterLoad(
return;
}
operations_.CreateDirectory(
create_directory_operation_->CreateDirectory(
directory_path, is_exclusive, is_recursive, callback);
}
......@@ -278,8 +309,7 @@ void FileSystem::CreateFile(const base::FilePath& file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
operations_.CreateFile(file_path, is_exclusive, callback);
create_file_operation_->CreateFile(file_path, is_exclusive, callback);
}
void FileSystem::TouchFile(const base::FilePath& file_path,
......@@ -290,8 +320,7 @@ void FileSystem::TouchFile(const base::FilePath& file_path,
DCHECK(!last_access_time.is_null());
DCHECK(!last_modified_time.is_null());
DCHECK(!callback.is_null());
operations_.TouchFile(
touch_operation_->TouchFile(
file_path, last_access_time, last_modified_time, callback);
}
......@@ -365,7 +394,7 @@ void FileSystem::GetFileByPath(const base::FilePath& file_path,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
operations_.EnsureFileDownloadedByPath(
download_operation_->EnsureFileDownloadedByPath(
file_path,
ClientContext(USER_INITIATED),
GetFileContentInitializedCallback(),
......@@ -382,7 +411,7 @@ void FileSystem::GetFileByResourceId(
DCHECK(!resource_id.empty());
DCHECK(!get_file_callback.is_null());
operations_.EnsureFileDownloadedByResourceId(
download_operation_->EnsureFileDownloadedByResourceId(
resource_id,
context,
GetFileContentInitializedCallback(),
......@@ -400,7 +429,7 @@ void FileSystem::GetFileContentByPath(
DCHECK(!get_content_callback.is_null());
DCHECK(!completion_callback.is_null());
operations_.EnsureFileDownloadedByPath(
download_operation_->EnsureFileDownloadedByPath(
file_path,
ClientContext(USER_INITIATED),
initialized_callback,
......@@ -633,8 +662,7 @@ void FileSystem::UpdateFileByResourceId(
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
operations_.UpdateFileByResourceId(resource_id, context, callback);
update_operation_->UpdateFileByResourceId(resource_id, context, callback);
}
void FileSystem::GetAvailableSpace(
......@@ -672,8 +700,7 @@ void FileSystem::Search(const std::string& search_query,
const SearchCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
operations_.Search(search_query, next_feed, callback);
search_operation_->Search(search_query, next_feed, callback);
}
void FileSystem::SearchMetadata(const std::string& query,
......@@ -847,7 +874,7 @@ void FileSystem::OpenFile(const base::FilePath& file_path,
}
open_files_.insert(file_path);
operations_.EnsureFileDownloadedByPath(
download_operation_->EnsureFileDownloadedByPath(
file_path,
ClientContext(USER_INITIATED),
GetFileContentInitializedCallback(),
......
......@@ -13,7 +13,6 @@
#include "base/observer_list.h"
#include "chrome/browser/chromeos/drive/change_list_loader_observer.h"
#include "chrome/browser/chromeos/drive/file_system/operation_observer.h"
#include "chrome/browser/chromeos/drive/file_system/operations.h"
#include "chrome/browser/chromeos/drive/file_system_interface.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/drive/job_list.h"
......@@ -44,6 +43,19 @@ class ChangeListLoader;
class ResourceMetadata;
} // namespace internal
namespace file_system {
class CopyOperation;
class CreateDirectoryOperation;
class CreateFileOperation;
class DownloadOperation;
class MoveOperation;
class OperationObserver;
class RemoveOperation;
class SearchOperation;
class TouchOperation;
class UpdateOperation;
} // namespace file_system
// The production implementation of FileSystemInterface.
class FileSystem : public FileSystemInterface,
public internal::ChangeListLoaderObserver,
......@@ -175,6 +187,9 @@ class FileSystem : public FileSystemInterface,
// Sets up ChangeListLoader.
void SetupChangeListLoader();
// Sets up file_system::XXXOperation instances.
void SetupOperations();
// Called on preference change.
void OnDisableDriveHostedFilesChanged();
......@@ -366,7 +381,16 @@ class FileSystem : public FileSystemInterface,
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
file_system::Operations operations_;
// Implementation of each file system operation.
scoped_ptr<file_system::CopyOperation> copy_operation_;
scoped_ptr<file_system::CreateDirectoryOperation> create_directory_operation_;
scoped_ptr<file_system::CreateFileOperation> create_file_operation_;
scoped_ptr<file_system::MoveOperation> move_operation_;
scoped_ptr<file_system::RemoveOperation> remove_operation_;
scoped_ptr<file_system::TouchOperation> touch_operation_;
scoped_ptr<file_system::DownloadOperation> download_operation_;
scoped_ptr<file_system::UpdateOperation> update_operation_;
scoped_ptr<file_system::SearchOperation> search_operation_;
// Polling interval for checking updates in seconds.
int polling_interval_sec_;
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/drive/file_system/operations.h"
#include "base/callback.h"
#include "chrome/browser/chromeos/drive/file_system/copy_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_file_operation.h"
#include "chrome/browser/chromeos/drive/file_system/download_operation.h"
#include "chrome/browser/chromeos/drive/file_system/move_operation.h"
#include "chrome/browser/chromeos/drive/file_system/remove_operation.h"
#include "chrome/browser/chromeos/drive/file_system/search_operation.h"
#include "chrome/browser/chromeos/drive/file_system/touch_operation.h"
#include "chrome/browser/chromeos/drive/file_system/update_operation.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
namespace drive {
namespace file_system {
Operations::Operations() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
Operations::~Operations() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
void Operations::Init(OperationObserver* observer,
JobScheduler* scheduler,
internal::ResourceMetadata* metadata,
internal::FileCache* cache,
FileSystemInterface* file_system,
google_apis::DriveServiceInterface* drive_service,
base::SequencedTaskRunner* blocking_task_runner) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
copy_operation_.reset(new file_system::CopyOperation(blocking_task_runner,
observer,
scheduler,
metadata,
cache,
file_system,
drive_service));
create_directory_operation_.reset(new CreateDirectoryOperation(
blocking_task_runner,
observer,
scheduler,
metadata));
create_file_operation_.reset(new CreateFileOperation(blocking_task_runner,
observer,
scheduler,
metadata,
cache));
move_operation_.reset(
new MoveOperation(observer, scheduler, metadata));
remove_operation_.reset(
new RemoveOperation(observer, scheduler, metadata, cache));
touch_operation_.reset(
new TouchOperation(blocking_task_runner, observer, scheduler, metadata));
download_operation_.reset(new DownloadOperation(
blocking_task_runner, observer, scheduler, metadata, cache));
update_operation_.reset(new UpdateOperation(blocking_task_runner,
observer,
scheduler,
metadata,
cache));
search_operation_.reset(
new SearchOperation(blocking_task_runner, scheduler, metadata));
}
void Operations::Copy(const base::FilePath& src_file_path,
const base::FilePath& dest_file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
copy_operation_->Copy(src_file_path, dest_file_path, callback);
}
void Operations::TransferFileFromRemoteToLocal(
const base::FilePath& remote_src_file_path,
const base::FilePath& local_dest_file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
copy_operation_->TransferFileFromRemoteToLocal(remote_src_file_path,
local_dest_file_path,
callback);
}
void Operations::TransferFileFromLocalToRemote(
const base::FilePath& local_src_file_path,
const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
copy_operation_->TransferFileFromLocalToRemote(local_src_file_path,
remote_dest_file_path,
callback);
}
void Operations::CreateDirectory(const base::FilePath& directory_path,
bool is_exclusive,
bool is_recursive,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
create_directory_operation_->CreateDirectory(
directory_path, is_exclusive, is_recursive, callback);
}
void Operations::CreateFile(const base::FilePath& remote_file_path,
bool is_exclusive,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
create_file_operation_->CreateFile(remote_file_path, is_exclusive, callback);
}
void Operations::Move(const base::FilePath& src_file_path,
const base::FilePath& dest_file_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
move_operation_->Move(src_file_path, dest_file_path, callback);
}
void Operations::Remove(const base::FilePath& file_path,
bool is_recursive,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
remove_operation_->Remove(file_path, is_recursive, callback);
}
void Operations::TouchFile(const base::FilePath& file_path,
const base::Time& last_access_time,
const base::Time& last_modified_time,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!last_access_time.is_null());
DCHECK(!last_modified_time.is_null());
DCHECK(!callback.is_null());
touch_operation_->TouchFile(
file_path, last_access_time, last_modified_time, callback);
}
void Operations::EnsureFileDownloadedByResourceId(
const std::string& resource_id,
const ClientContext& context,
const GetFileContentInitializedCallback& initialized_callback,
const google_apis::GetContentCallback& get_content_callback,
const GetFileCallback& completion_callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!completion_callback.is_null());
download_operation_->EnsureFileDownloadedByResourceId(
resource_id, context, initialized_callback, get_content_callback,
completion_callback);
}
void Operations::EnsureFileDownloadedByPath(
const base::FilePath& file_path,
const ClientContext& context,
const GetFileContentInitializedCallback& initialized_callback,
const google_apis::GetContentCallback& get_content_callback,
const GetFileCallback& completion_callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!completion_callback.is_null());
download_operation_->EnsureFileDownloadedByPath(
file_path, context, initialized_callback, get_content_callback,
completion_callback);
}
void Operations::UpdateFileByResourceId(
const std::string& resource_id,
const ClientContext& context,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
update_operation_->UpdateFileByResourceId(resource_id, context, callback);
}
void Operations::Search(const std::string& search_query,
const GURL& next_feed,
const SearchOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
search_operation_->Search(search_query, next_feed, callback);
}
} // namespace file_system
} // namespace drive
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/drive/file_system_interface.h"
namespace base {
class FilePath;
class SequencedTaskRunner;
class Time;
} // namespace base
namespace google_apis {
class DriveServiceInterface;
} // namespace google_apis
namespace drive {
class JobScheduler;
namespace internal {
class FileCache;
class ResourceMetadata;
} // namespace internal
namespace file_system {
class CopyOperation;
class CreateDirectoryOperation;
class CreateFileOperation;
class DownloadOperation;
class MoveOperation;
class OperationObserver;
class RemoveOperation;
class SearchOperation;
class TouchOperation;
class UpdateOperation;
// Callback for Operations::Search.
// On success, |error| is FILE_ERROR_OK, and remaining arguments are valid to
// use.
// |next_feed| is the URL to fetch the remaining result from the server. Maybe
// empty if there is no more results.
// On error, |error| is set to other than FILE_ERROR_OK, and the caller
// shouldn't use remaining arguments.
typedef base::Callback<void(FileError error,
const GURL& next_feed,
scoped_ptr<std::vector<SearchResultInfo> > result)>
SearchOperationCallback;
// This class is just a bundle of file system operation handlers which
// perform the actual operations. The class is introduced to make it easy to
// initialize the operation handlers.
class Operations {
public:
Operations();
~Operations();
// Allocates the operation objects and initializes the operation pointers.
void Init(OperationObserver* observer,
JobScheduler* scheduler,
internal::ResourceMetadata* metadata,
internal::FileCache* cache,
FileSystemInterface* file_system,
google_apis::DriveServiceInterface* drive_service,
base::SequencedTaskRunner* blocking_task_runner);
// Wrapper function for create_directory_operation_.
// |callback| must not be null.
void CreateDirectory(const base::FilePath& directory_path,
bool is_exclusive,
bool is_recursive,
const FileOperationCallback& callback);
// Wrapper function for create_file_operation_.
// |callback| must not be null.
void CreateFile(const base::FilePath& remote_file_path,
bool is_exclusive,
const FileOperationCallback& callback);
// Wrapper function for copy_operation_.
// |callback| must not be null.
void Copy(const base::FilePath& src_file_path,
const base::FilePath& dest_file_path,
const FileOperationCallback& callback);
// Wrapper function for copy_operation_.
// |callback| must not be null.
void TransferFileFromRemoteToLocal(const base::FilePath& remote_src_file_path,
const base::FilePath& local_dest_file_path,
const FileOperationCallback& callback);
// Wrapper function for copy_operation_.
// |callback| must not be null.
void TransferFileFromLocalToRemote(
const base::FilePath& local_src_file_path,
const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback);
// Wrapper function for move_operation_.
// |callback| must not be null.
void Move(const base::FilePath& src_file_path,
const base::FilePath& dest_file_path,
const FileOperationCallback& callback);
// Wrapper function for remove_operation_.
// |callback| must not be null.
void Remove(const base::FilePath& file_path,
bool is_recursive,
const FileOperationCallback& callback);
// Wrapper function for touch_operation_.
// |callback| must not be null.
void TouchFile(const base::FilePath& file_path,
const base::Time& last_access_time,
const base::Time& last_modified_time,
const FileOperationCallback& callback);
// Wrapper function for download_operation_.
// |completion_callback| must not be null.
void EnsureFileDownloadedByResourceId(
const std::string& resource_id,
const ClientContext& context,
const GetFileContentInitializedCallback& initialized_callback,
const google_apis::GetContentCallback& get_content_callback,
const GetFileCallback& completion_callback);
// Wrapper function for download_operation_.
// |completion_callback| must not be null.
void EnsureFileDownloadedByPath(
const base::FilePath& file_path,
const ClientContext& context,
const GetFileContentInitializedCallback& initialized_callback,
const google_apis::GetContentCallback& get_content_callback,
const GetFileCallback& completion_callback);
// Wrapper function for update_operation_.
// |callback| must not be null.
void UpdateFileByResourceId(const std::string& resource_id,
const ClientContext& context,
const FileOperationCallback& callback);
// Wrapper function for search_operation_.
// |callback| must not be null.
void Search(const std::string& search_query,
const GURL& next_feed,
const SearchOperationCallback& callback);
private:
scoped_ptr<CopyOperation> copy_operation_;
scoped_ptr<CreateDirectoryOperation> create_directory_operation_;
scoped_ptr<CreateFileOperation> create_file_operation_;
scoped_ptr<MoveOperation> move_operation_;
scoped_ptr<RemoveOperation> remove_operation_;
scoped_ptr<TouchOperation> touch_operation_;
scoped_ptr<DownloadOperation> download_operation_;
scoped_ptr<UpdateOperation> update_operation_;
scoped_ptr<SearchOperation> search_operation_;
};
} // namespace file_system
} // namespace drive
#endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_
......@@ -85,7 +85,7 @@ SearchOperation::~SearchOperation() {
void SearchOperation::Search(const std::string& search_query,
const GURL& next_feed,
const SearchOperationCallback& callback) {
const SearchCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
......@@ -105,7 +105,7 @@ void SearchOperation::Search(const std::string& search_query,
}
void SearchOperation::SearchAfterGetResourceList(
const SearchOperationCallback& callback,
const SearchCallback& callback,
google_apis::GDataErrorCode gdata_error,
scoped_ptr<google_apis::ResourceList> resource_list) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
......@@ -150,7 +150,7 @@ void SearchOperation::SearchAfterGetResourceList(
}
void SearchOperation::SearchAfterRefreshEntry(
const SearchOperationCallback& callback,
const SearchCallback& callback,
const GURL& next_feed,
scoped_ptr<std::vector<SearchResultInfo> > result,
FileError error) {
......
......@@ -11,7 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
#include "chrome/browser/chromeos/drive/file_errors.h"
#include "chrome/browser/chromeos/drive/file_system/operations.h"
#include "chrome/browser/chromeos/drive/file_system_interface.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
class GURL;
......@@ -47,20 +47,20 @@ class SearchOperation {
// |callback| must not be null.
void Search(const std::string& search_query,
const GURL& next_feed,
const SearchOperationCallback& callback);
const SearchCallback& callback);
private:
// Part of Search(). This is called after the ResourceList is fetched from
// the server.
void SearchAfterGetResourceList(
const SearchOperationCallback& callback,
const SearchCallback& callback,
google_apis::GDataErrorCode gdata_error,
scoped_ptr<google_apis::ResourceList> resource_list);
// Part of Search(). This is called after the RefreshEntryOnBlockingPool
// is completed.
void SearchAfterRefreshEntry(
const SearchOperationCallback& callback,
const SearchCallback& callback,
const GURL& next_feed,
scoped_ptr<std::vector<SearchResultInfo> > result,
FileError error);
......
......@@ -248,8 +248,6 @@
'browser/chromeos/drive/file_system/move_operation.cc',
'browser/chromeos/drive/file_system/move_operation.h',
'browser/chromeos/drive/file_system/operation_observer.h',
'browser/chromeos/drive/file_system/operations.cc',
'browser/chromeos/drive/file_system/operations.h',
'browser/chromeos/drive/file_system/remove_operation.cc',
'browser/chromeos/drive/file_system/remove_operation.h',
'browser/chromeos/drive/file_system/search_operation.cc',
......
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