diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-21 02:32:15 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-21 02:32:15 +0000 |
commit | e6ba52b54d2616d5ed32f96c89a53fea1d159bc1 (patch) | |
tree | 0b303175debe4a07e6c7dd5b53114f000b76b138 | |
parent | fdfc3fd8ac9d4094aee393a054701ed05c9d0fca (diff) | |
download | chromium_src-e6ba52b54d2616d5ed32f96c89a53fea1d159bc1.zip chromium_src-e6ba52b54d2616d5ed32f96c89a53fea1d159bc1.tar.gz chromium_src-e6ba52b54d2616d5ed32f96c89a53fea1d159bc1.tar.bz2 |
Get rid of RequestRegistry (part 4): remove Drive path from everywhere.
They are used as an identifier to cancel each operation, but the cancellation
feature has gone from RequestRegistry.
BUG=164098
R=hashimoto@chromium.org, tzik@chromium.org
Review URL: https://codereview.chromium.org/17446002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207672 0039d316-1c4b-4281-b951-d872f2087c98
21 files changed, 18 insertions, 167 deletions
diff --git a/chrome/browser/chromeos/drive/fake_file_system.cc b/chrome/browser/chromeos/drive/fake_file_system.cc index 014877a..a99fc1a 100644 --- a/chrome/browser/chromeos/drive/fake_file_system.cc +++ b/chrome/browser/chromeos/drive/fake_file_system.cc @@ -163,7 +163,7 @@ void FakeFileSystem::GetFileContentByPath( file_path, base::Bind(&FakeFileSystem::GetFileContentByPathAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), - file_path, initialized_callback, get_content_callback, + initialized_callback, get_content_callback, completion_callback)); } @@ -274,7 +274,6 @@ void FakeFileSystem::GetResourceEntryByIdAfterGetResourceEntry( // Implementation of GetFileContentByPath. void FakeFileSystem::GetFileContentByPathAfterGetResourceEntry( - const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, const FileOperationCallback& completion_callback, @@ -300,14 +299,12 @@ void FakeFileSystem::GetFileContentByPathAfterGetResourceEntry( base::Bind( &FakeFileSystem::GetFileContentByPathAfterGetWapiResourceEntry, weak_ptr_factory_.GetWeakPtr(), - file_path, initialized_callback, get_content_callback, completion_callback)); } void FakeFileSystem::GetFileContentByPathAfterGetWapiResourceEntry( - const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, const FileOperationCallback& completion_callback, @@ -338,7 +335,6 @@ void FakeFileSystem::GetFileContentByPathAfterGetWapiResourceEntry( initialized_callback.Run(FILE_ERROR_OK, entry.Pass(), base::FilePath(), base::Bind(&base::DoNothing)); drive_service_->DownloadFile( - file_path, cache_path, GURL(gdata_entry->download_url()), base::Bind(&FakeFileSystem::GetFileContentByPathAfterDownloadFile, diff --git a/chrome/browser/chromeos/drive/fake_file_system.h b/chrome/browser/chromeos/drive/fake_file_system.h index 558b37f..3693a60f 100644 --- a/chrome/browser/chromeos/drive/fake_file_system.h +++ b/chrome/browser/chromeos/drive/fake_file_system.h @@ -152,14 +152,12 @@ class FakeFileSystem : public FileSystemInterface { // 3) Otherwise start DownloadFile. // 4) Runs the |completion_callback| upon the download completion. void GetFileContentByPathAfterGetResourceEntry( - const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, const FileOperationCallback& completion_callback, FileError error, scoped_ptr<ResourceEntry> entry); void GetFileContentByPathAfterGetWapiResourceEntry( - const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, const FileOperationCallback& completion_callback, diff --git a/chrome/browser/chromeos/drive/job_scheduler.cc b/chrome/browser/chromeos/drive/job_scheduler.cc index 7c59f68..75f28a8 100644 --- a/chrome/browser/chromeos/drive/job_scheduler.cc +++ b/chrome/browser/chromeos/drive/job_scheduler.cc @@ -30,7 +30,6 @@ const int kMaxRetryCount = kMaxThrottleCount - 1; // Parameter struct for RunUploadNewFile. struct UploadNewFileParams { std::string parent_resource_id; - base::FilePath drive_file_path; base::FilePath local_file_path; std::string title; std::string content_type; @@ -43,7 +42,6 @@ google_apis::CancelCallback RunUploadNewFile( DriveUploaderInterface* uploader, const UploadNewFileParams& params) { return uploader->UploadNewFile(params.parent_resource_id, - params.drive_file_path, params.local_file_path, params.title, params.content_type, @@ -54,7 +52,6 @@ google_apis::CancelCallback RunUploadNewFile( // Parameter struct for RunUploadExistingFile. struct UploadExistingFileParams { std::string resource_id; - base::FilePath drive_file_path; base::FilePath local_file_path; std::string content_type; std::string etag; @@ -67,7 +64,6 @@ google_apis::CancelCallback RunUploadExistingFile( DriveUploaderInterface* uploader, const UploadExistingFileParams& params) { return uploader->UploadExistingFile(params.resource_id, - params.drive_file_path, params.local_file_path, params.content_type, params.etag, @@ -78,7 +74,6 @@ google_apis::CancelCallback RunUploadExistingFile( // Parameter struct for RunResumeUploadFile. struct ResumeUploadFileParams { GURL upload_location; - base::FilePath drive_file_path; base::FilePath local_file_path; std::string content_type; UploadCompletionCallback callback; @@ -90,7 +85,6 @@ google_apis::CancelCallback RunResumeUploadFile( DriveUploaderInterface* uploader, const ResumeUploadFileParams& params) { return uploader->ResumeUploadFile(params.upload_location, - params.drive_file_path, params.local_file_path, params.content_type, params.callback, @@ -503,7 +497,6 @@ JobID JobScheduler::DownloadFile( new_job->task = base::Bind( &DriveServiceInterface::DownloadFile, base::Unretained(drive_service_), - virtual_path, local_cache_path, download_url, base::Bind(&JobScheduler::OnDownloadActionJobDone, @@ -535,13 +528,11 @@ void JobScheduler::UploadNewFile( UploadNewFileParams params; params.parent_resource_id = parent_resource_id; - params.drive_file_path = drive_file_path; params.local_file_path = local_file_path; params.title = title; params.content_type = content_type; ResumeUploadParams resume_params; - resume_params.drive_file_path = params.drive_file_path; resume_params.local_file_path = params.local_file_path; resume_params.content_type = params.content_type; @@ -574,13 +565,11 @@ void JobScheduler::UploadExistingFile( UploadExistingFileParams params; params.resource_id = resource_id; - params.drive_file_path = drive_file_path; params.local_file_path = local_file_path; params.content_type = content_type; params.etag = etag; ResumeUploadParams resume_params; - resume_params.drive_file_path = params.drive_file_path; resume_params.local_file_path = params.local_file_path; resume_params.content_type = params.content_type; @@ -614,13 +603,11 @@ void JobScheduler::CreateFile( UploadNewFileParams params; params.parent_resource_id = parent_resource_id; - params.drive_file_path = drive_file_path; params.local_file_path = kDevNull; // Upload an empty file. params.title = title; params.content_type = content_type; ResumeUploadParams resume_params; - resume_params.drive_file_path = params.drive_file_path; resume_params.local_file_path = params.local_file_path; resume_params.content_type = params.content_type; @@ -884,7 +871,6 @@ void JobScheduler::OnUploadCompletionJobDone( ResumeUploadFileParams params; params.upload_location = upload_location; - params.drive_file_path = resume_params.drive_file_path; params.local_file_path = resume_params.local_file_path; params.content_type = resume_params.content_type; params.callback = base::Bind(&JobScheduler::OnUploadCompletionJobDone, diff --git a/chrome/browser/drive/drive_api_service.cc b/chrome/browser/drive/drive_api_service.cc index 06f0c4c..40e1c6d 100644 --- a/chrome/browser/drive/drive_api_service.cc +++ b/chrome/browser/drive/drive_api_service.cc @@ -479,7 +479,6 @@ CancelCallback DriveAPIService::GetAppList(const GetAppListCallback& callback) { } CancelCallback DriveAPIService::DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const DownloadActionCallback& download_action_callback, @@ -641,7 +640,6 @@ CancelCallback DriveAPIService::RemoveResourceFromDirectory( } CancelCallback DriveAPIService::InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -663,7 +661,6 @@ CancelCallback DriveAPIService::InitiateUploadNewFile( } CancelCallback DriveAPIService::InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -685,7 +682,6 @@ CancelCallback DriveAPIService::InitiateUploadExistingFile( } CancelCallback DriveAPIService::ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -712,7 +708,6 @@ CancelCallback DriveAPIService::ResumeUpload( } CancelCallback DriveAPIService::GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const UploadRangeCallback& callback) { diff --git a/chrome/browser/drive/drive_api_service.h b/chrome/browser/drive/drive_api_service.h index 8ed11b8..036b8acd 100644 --- a/chrome/browser/drive/drive_api_service.h +++ b/chrome/browser/drive/drive_api_service.h @@ -88,7 +88,6 @@ class DriveAPIService : public DriveServiceInterface, const std::string& etag, const google_apis::EntryActionCallback& callback) OVERRIDE; virtual google_apis::CancelCallback DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const google_apis::DownloadActionCallback& download_action_callback, @@ -125,21 +124,18 @@ class DriveAPIService : public DriveServiceInterface, const std::string& directory_name, const google_apis::GetResourceEntryCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, const std::string& title, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, const std::string& etag, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -149,7 +145,6 @@ class DriveAPIService : public DriveServiceInterface, const google_apis::UploadRangeCallback& callback, const google_apis::ProgressCallback& progress_callback) OVERRIDE; virtual google_apis::CancelCallback GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const google_apis::UploadRangeCallback& callback) OVERRIDE; diff --git a/chrome/browser/drive/drive_service_interface.h b/chrome/browser/drive/drive_service_interface.h index ea3b56d..e978b8c 100644 --- a/chrome/browser/drive/drive_service_interface.h +++ b/chrome/browser/drive/drive_service_interface.h @@ -261,7 +261,6 @@ class DriveServiceInterface { // |download_action_callback| must not be null. // |get_content_callback| and |progress_callback| may be null. virtual google_apis::CancelCallback DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const google_apis::DownloadActionCallback& download_action_callback, @@ -273,7 +272,6 @@ class DriveServiceInterface { // uploaded. // |callback| must not be null. virtual google_apis::CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -285,7 +283,6 @@ class DriveServiceInterface { // uploaded. // |callback| must not be null. virtual google_apis::CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -295,7 +292,6 @@ class DriveServiceInterface { // Resumes uploading of a document/file on the calling thread. // |callback| must not be null. |progress_callback| may be null. virtual google_apis::CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -310,7 +306,6 @@ class DriveServiceInterface { // which is used for ResumeUpload. // |callback| must not be null. virtual google_apis::CancelCallback GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const google_apis::UploadRangeCallback& callback) = 0; diff --git a/chrome/browser/drive/drive_uploader.cc b/chrome/browser/drive/drive_uploader.cc index f728313..c96d72d 100644 --- a/chrome/browser/drive/drive_uploader.cc +++ b/chrome/browser/drive/drive_uploader.cc @@ -38,13 +38,11 @@ namespace drive { // Structure containing current upload information of file, passed between // DriveServiceInterface methods and callbacks. struct DriveUploader::UploadFileInfo { - UploadFileInfo(const base::FilePath& drive_path, - const base::FilePath& local_path, + UploadFileInfo(const base::FilePath& local_path, const std::string& content_type, const UploadCompletionCallback& callback, const ProgressCallback& progress_callback) - : drive_path(drive_path), - file_path(local_path), + : file_path(local_path), content_type(content_type), completion_callback(callback), progress_callback(progress_callback), @@ -64,7 +62,6 @@ struct DriveUploader::UploadFileInfo { return "file_path=[" + file_path.AsUTF8Unsafe() + "], content_type=[" + content_type + "], content_length=[" + base::UintToString(content_length) + - "], drive_path=[" + drive_path.AsUTF8Unsafe() + "]"; } @@ -73,9 +70,6 @@ struct DriveUploader::UploadFileInfo { return base::Bind(&UploadFileInfo::Cancel, weak_ptr_factory_.GetWeakPtr()); } - // Final path in gdata. Looks like /special/drive/MyFolder/MyFile. - const base::FilePath drive_path; - // The local file path of the file to be uploaded. const base::FilePath file_path; @@ -128,7 +122,6 @@ DriveUploader::~DriveUploader() {} CancelCallback DriveUploader::UploadNewFile( const std::string& parent_resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& title, const std::string& content_type, @@ -136,15 +129,13 @@ CancelCallback DriveUploader::UploadNewFile( const ProgressCallback& progress_callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!parent_resource_id.empty()); - DCHECK(!drive_file_path.empty()); DCHECK(!local_file_path.empty()); DCHECK(!title.empty()); DCHECK(!content_type.empty()); DCHECK(!callback.is_null()); return StartUploadFile( - scoped_ptr<UploadFileInfo>(new UploadFileInfo(drive_file_path, - local_file_path, + scoped_ptr<UploadFileInfo>(new UploadFileInfo(local_file_path, content_type, callback, progress_callback)), @@ -156,7 +147,6 @@ CancelCallback DriveUploader::UploadNewFile( CancelCallback DriveUploader::UploadExistingFile( const std::string& resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const std::string& etag, @@ -164,14 +154,12 @@ CancelCallback DriveUploader::UploadExistingFile( const ProgressCallback& progress_callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!resource_id.empty()); - DCHECK(!drive_file_path.empty()); DCHECK(!local_file_path.empty()); DCHECK(!content_type.empty()); DCHECK(!callback.is_null()); return StartUploadFile( - scoped_ptr<UploadFileInfo>(new UploadFileInfo(drive_file_path, - local_file_path, + scoped_ptr<UploadFileInfo>(new UploadFileInfo(local_file_path, content_type, callback, progress_callback)), @@ -183,19 +171,17 @@ CancelCallback DriveUploader::UploadExistingFile( CancelCallback DriveUploader::ResumeUploadFile( const GURL& upload_location, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const UploadCompletionCallback& callback, const ProgressCallback& progress_callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK(!drive_file_path.empty()); DCHECK(!local_file_path.empty()); DCHECK(!content_type.empty()); DCHECK(!callback.is_null()); scoped_ptr<UploadFileInfo> upload_file_info(new UploadFileInfo( - drive_file_path, local_file_path, content_type, + local_file_path, content_type, callback, progress_callback)); upload_file_info->upload_location = upload_location; @@ -251,7 +237,6 @@ void DriveUploader::StartInitiateUploadNewFile( UploadFileInfo* info_ptr = upload_file_info.get(); info_ptr->cancel_callback = drive_service_->InitiateUploadNewFile( - info_ptr->drive_path, info_ptr->content_type, info_ptr->content_length, parent_resource_id, @@ -269,7 +254,6 @@ void DriveUploader::StartInitiateUploadExistingFile( UploadFileInfo* info_ptr = upload_file_info.get(); info_ptr->cancel_callback = drive_service_->InitiateUploadExistingFile( - info_ptr->drive_path, info_ptr->content_type, info_ptr->content_length, resource_id, @@ -286,7 +270,7 @@ void DriveUploader::OnUploadLocationReceived( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DVLOG(1) << "Got upload location [" << upload_location.spec() - << "] for [" << upload_file_info->drive_path.value() << "]"; + << "] for [" << upload_file_info->file_path.value() << "]"; if (code != HTTP_SUCCESS) { // TODO(achuith): Handle error codes from Google Docs server. @@ -310,7 +294,6 @@ void DriveUploader::StartGetUploadStatus( UploadFileInfo* info_ptr = upload_file_info.get(); info_ptr->cancel_callback = drive_service_->GetUploadStatus( - info_ptr->drive_path, info_ptr->upload_location, info_ptr->content_length, base::Bind(&DriveUploader::OnUploadRangeResponseReceived, @@ -333,7 +316,6 @@ void DriveUploader::UploadNextChunk( UploadFileInfo* info_ptr = upload_file_info.get(); info_ptr->cancel_callback = drive_service_->ResumeUpload( - info_ptr->drive_path, info_ptr->upload_location, start_position, info_ptr->content_length, @@ -367,7 +349,7 @@ void DriveUploader::OnUploadRangeResponseReceived( // TODO(hidehiko): Upload metadata only for empty files, after GData WAPI // code is gone. DVLOG(1) << "Successfully created uploaded file=[" - << upload_file_info->drive_path.value() << "]"; + << upload_file_info->file_path.value() << "]"; // Done uploading. upload_file_info->completion_callback.Run( @@ -398,7 +380,7 @@ void DriveUploader::OnUploadRangeResponseReceived( DVLOG(1) << "Received range " << response.start_position_received << "-" << response.end_position_received - << " for [" << upload_file_info->drive_path.value() << "]"; + << " for [" << upload_file_info->file_path.value() << "]"; UploadNextChunk(upload_file_info.Pass(), response.end_position_received); } diff --git a/chrome/browser/drive/drive_uploader.h b/chrome/browser/drive/drive_uploader.h index e46e677..89e18a1 100644 --- a/chrome/browser/drive/drive_uploader.h +++ b/chrome/browser/drive/drive_uploader.h @@ -47,9 +47,6 @@ class DriveUploaderInterface { // parent_resource_id: // resource id of the destination directory. // - // drive_file_path: - // The destination path like "drive/foo/bar.txt". - // // local_file_path: // The path to the local file to be uploaded. // @@ -68,7 +65,6 @@ class DriveUploaderInterface { // May be null if the information is not needed. virtual google_apis::CancelCallback UploadNewFile( const std::string& parent_resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& title, const std::string& content_type, @@ -88,7 +84,6 @@ class DriveUploaderInterface { // If |etag| is empty, the test is skipped. virtual google_apis::CancelCallback UploadExistingFile( const std::string& resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const std::string& etag, @@ -103,7 +98,6 @@ class DriveUploaderInterface { // See comments at UploadNewFile about common parameters and the return value. virtual google_apis::CancelCallback ResumeUploadFile( const GURL& upload_location, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const UploadCompletionCallback& callback, @@ -118,7 +112,6 @@ class DriveUploader : public DriveUploaderInterface { // DriveUploaderInterface overrides. virtual google_apis::CancelCallback UploadNewFile( const std::string& parent_resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& title, const std::string& content_type, @@ -126,7 +119,6 @@ class DriveUploader : public DriveUploaderInterface { const google_apis::ProgressCallback& progress_callback) OVERRIDE; virtual google_apis::CancelCallback UploadExistingFile( const std::string& resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const std::string& etag, @@ -134,7 +126,6 @@ class DriveUploader : public DriveUploaderInterface { const google_apis::ProgressCallback& progress_callback) OVERRIDE; virtual google_apis::CancelCallback ResumeUploadFile( const GURL& upload_location, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const UploadCompletionCallback& callback, diff --git a/chrome/browser/drive/drive_uploader_unittest.cc b/chrome/browser/drive/drive_uploader_unittest.cc index ac83c53..2ce1287 100644 --- a/chrome/browser/drive/drive_uploader_unittest.cc +++ b/chrome/browser/drive/drive_uploader_unittest.cc @@ -43,7 +43,6 @@ namespace { const char kTestDummyId[] = "file:dummy_id"; const char kTestDocumentTitle[] = "Hello world"; -const char kTestDrivePath[] = "drive/dummy.txt"; const char kTestInitiateUploadParentResourceId[] = "parent_resource_id"; const char kTestInitiateUploadResourceId[] = "resource_id"; const char kTestMimeType[] = "text/plain"; @@ -78,7 +77,6 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { // DriveServiceInterface overrides. // Handles a request for obtaining an upload location URL. virtual CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -97,7 +95,6 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { } virtual CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -122,7 +119,6 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { // Handles a request for uploading a chunk of bytes. virtual CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_location, int64 start_position, int64 end_position, @@ -167,7 +163,6 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { // Handles a request to fetch the current upload status. virtual CancelCallback GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_location, int64 content_length, const UploadRangeCallback& callback) OVERRIDE { @@ -214,7 +209,6 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService { // Returns error. virtual CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -226,7 +220,6 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService { } virtual CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -239,7 +232,6 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService { // Should not be used. virtual CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -257,7 +249,6 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService { class MockDriveServiceNoConnectionAtResume : public DummyDriveService { // Succeeds and returns an upload location URL. virtual CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -269,7 +260,6 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService { } virtual CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -282,7 +272,6 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService { // Returns error. virtual CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -331,7 +320,6 @@ TEST_F(DriveUploaderTest, UploadExisting0KB) { std::vector<test_util::ProgressInfo> upload_progress_values; uploader.UploadExistingFile( kTestInitiateUploadResourceId, - base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, std::string(), // etag @@ -366,7 +354,6 @@ TEST_F(DriveUploaderTest, UploadExisting512KB) { std::vector<test_util::ProgressInfo> upload_progress_values; uploader.UploadExistingFile( kTestInitiateUploadResourceId, - base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, std::string(), // etag @@ -402,7 +389,6 @@ TEST_F(DriveUploaderTest, InitiateUploadFail) { DriveUploader uploader(&mock_service); uploader.UploadExistingFile( kTestInitiateUploadResourceId, - base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, std::string(), // etag @@ -430,7 +416,6 @@ TEST_F(DriveUploaderTest, InitiateUploadNoConflict) { DriveUploader uploader(&mock_service); uploader.UploadExistingFile( kTestInitiateUploadResourceId, - base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, kTestETag, @@ -458,7 +443,6 @@ TEST_F(DriveUploaderTest, InitiateUploadConflict) { DriveUploader uploader(&mock_service); uploader.UploadExistingFile( kTestInitiateUploadResourceId, - base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, kDestinationETag, @@ -485,7 +469,6 @@ TEST_F(DriveUploaderTest, ResumeUploadFail) { DriveUploader uploader(&mock_service); uploader.UploadExistingFile( kTestInitiateUploadResourceId, - base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, std::string(), // etag @@ -506,7 +489,6 @@ TEST_F(DriveUploaderTest, NonExistingSourceFile) { DriveUploader uploader(NULL); // NULL, the service won't be used. uploader.UploadExistingFile( kTestInitiateUploadResourceId, - base::FilePath::FromUTF8Unsafe(kTestDrivePath), temp_dir_.path().AppendASCII("_this_path_should_not_exist_"), kTestMimeType, std::string(), // etag @@ -539,7 +521,6 @@ TEST_F(DriveUploaderTest, ResumeUpload) { std::vector<test_util::ProgressInfo> upload_progress_values; uploader.ResumeUploadFile( GURL(kTestUploadExistingFileURL), - base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, test_util::CreateCopyResultCallback( diff --git a/chrome/browser/drive/dummy_drive_service.cc b/chrome/browser/drive/dummy_drive_service.cc index 7ba5151..0d4b090 100644 --- a/chrome/browser/drive/dummy_drive_service.cc +++ b/chrome/browser/drive/dummy_drive_service.cc @@ -88,7 +88,6 @@ CancelCallback DummyDriveService::DeleteResource( const EntryActionCallback& callback) { return CancelCallback(); } CancelCallback DummyDriveService::DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const DownloadActionCallback& download_action_callback, @@ -133,7 +132,6 @@ CancelCallback DummyDriveService::AddNewDirectory( const GetResourceEntryCallback& callback) { return CancelCallback(); } CancelCallback DummyDriveService::InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -141,7 +139,6 @@ CancelCallback DummyDriveService::InitiateUploadNewFile( const InitiateUploadCallback& callback) { return CancelCallback(); } CancelCallback DummyDriveService::InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -149,7 +146,6 @@ CancelCallback DummyDriveService::InitiateUploadExistingFile( const InitiateUploadCallback& callback) { return CancelCallback(); } CancelCallback DummyDriveService::ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -160,7 +156,6 @@ CancelCallback DummyDriveService::ResumeUpload( const ProgressCallback& progress_callback) { return CancelCallback(); } CancelCallback DummyDriveService::GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const UploadRangeCallback& callback) { return CancelCallback(); } diff --git a/chrome/browser/drive/dummy_drive_service.h b/chrome/browser/drive/dummy_drive_service.h index 5e2d007..c63ee31 100644 --- a/chrome/browser/drive/dummy_drive_service.h +++ b/chrome/browser/drive/dummy_drive_service.h @@ -58,7 +58,6 @@ class DummyDriveService : public DriveServiceInterface { const std::string& etag, const google_apis::EntryActionCallback& callback) OVERRIDE; virtual google_apis::CancelCallback DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const google_apis::DownloadActionCallback& download_action_callback, @@ -95,21 +94,18 @@ class DummyDriveService : public DriveServiceInterface { const std::string& directory_name, const google_apis::GetResourceEntryCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, const std::string& title, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, const std::string& etag, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -119,7 +115,6 @@ class DummyDriveService : public DriveServiceInterface { const google_apis::UploadRangeCallback& callback, const google_apis::ProgressCallback& progress_callback) OVERRIDE; virtual google_apis::CancelCallback GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const google_apis::UploadRangeCallback& callback) OVERRIDE; diff --git a/chrome/browser/drive/fake_drive_service.cc b/chrome/browser/drive/fake_drive_service.cc index 32d9d2d..90fd132 100644 --- a/chrome/browser/drive/fake_drive_service.cc +++ b/chrome/browser/drive/fake_drive_service.cc @@ -518,7 +518,6 @@ CancelCallback FakeDriveService::DeleteResource( } CancelCallback FakeDriveService::DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const DownloadActionCallback& download_action_callback, @@ -876,7 +875,6 @@ CancelCallback FakeDriveService::AddNewDirectory( } CancelCallback FakeDriveService::InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -917,7 +915,6 @@ CancelCallback FakeDriveService::InitiateUploadNewFile( } CancelCallback FakeDriveService::InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -962,7 +959,6 @@ CancelCallback FakeDriveService::InitiateUploadExistingFile( } CancelCallback FakeDriveService::GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const UploadRangeCallback& callback) { @@ -972,7 +968,6 @@ CancelCallback FakeDriveService::GetUploadStatus( } CancelCallback FakeDriveService::ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, diff --git a/chrome/browser/drive/fake_drive_service.h b/chrome/browser/drive/fake_drive_service.h index f2b0fe4..6b63715 100644 --- a/chrome/browser/drive/fake_drive_service.h +++ b/chrome/browser/drive/fake_drive_service.h @@ -120,7 +120,6 @@ class FakeDriveService : public DriveServiceInterface { const std::string& etag, const google_apis::EntryActionCallback& callback) OVERRIDE; virtual google_apis::CancelCallback DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const google_apis::DownloadActionCallback& download_action_callback, @@ -159,21 +158,18 @@ class FakeDriveService : public DriveServiceInterface { const std::string& directory_name, const google_apis::GetResourceEntryCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, const std::string& title, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, const std::string& etag, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -183,7 +179,6 @@ class FakeDriveService : public DriveServiceInterface { const google_apis::UploadRangeCallback& callback, const google_apis::ProgressCallback& progress_callback) OVERRIDE; virtual google_apis::CancelCallback GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const google_apis::UploadRangeCallback& callback) OVERRIDE; diff --git a/chrome/browser/drive/fake_drive_service_unittest.cc b/chrome/browser/drive/fake_drive_service_unittest.cc index 6d45f15..41f0c45 100644 --- a/chrome/browser/drive/fake_drive_service_unittest.cc +++ b/chrome/browser/drive/fake_drive_service_unittest.cc @@ -798,7 +798,6 @@ TEST_F(FakeDriveServiceTest, DownloadFile_ExistingFile) { base::FilePath output_file_path; test_util::TestGetContentCallback get_content_callback; fake_service_.DownloadFile( - base::FilePath::FromUTF8Unsafe("/drive/whatever.txt"), // virtual path kOutputFilePath, kContentUrl, test_util::CreateCopyResultCallback(&error, &output_file_path), @@ -833,7 +832,6 @@ TEST_F(FakeDriveServiceTest, DownloadFile_NonexistingFile) { GDataErrorCode error = GDATA_OTHER_ERROR; base::FilePath output_file_path; fake_service_.DownloadFile( - base::FilePath::FromUTF8Unsafe("/drive/whatever.txt"), // virtual path kOutputFilePath, kContentUrl, test_util::CreateCopyResultCallback(&error, &output_file_path), @@ -858,7 +856,6 @@ TEST_F(FakeDriveServiceTest, DownloadFile_Offline) { GDataErrorCode error = GDATA_OTHER_ERROR; base::FilePath output_file_path; fake_service_.DownloadFile( - base::FilePath::FromUTF8Unsafe("/drive/whatever.txt"), // virtual path kOutputFilePath, kContentUrl, test_util::CreateCopyResultCallback(&error, &output_file_path), @@ -1510,7 +1507,6 @@ TEST_F(FakeDriveServiceTest, InitiateUploadNewFile_Offline) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadNewFile( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1")), "test/foo", 13, "folder:1_folder_resource_id", @@ -1529,7 +1525,6 @@ TEST_F(FakeDriveServiceTest, InitiateUploadNewFile_NotFound) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadNewFile( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1")), "test/foo", 13, "non_existent", @@ -1548,7 +1543,6 @@ TEST_F(FakeDriveServiceTest, InitiateUploadNewFile) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadNewFile( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1")), "test/foo", 13, "folder:1_folder_resource_id", @@ -1570,7 +1564,6 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_Offline) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadExistingFile( - base::FilePath(FILE_PATH_LITERAL("drive/File 1")), "test/foo", 13, "file:2_file_resource_id", @@ -1589,7 +1582,6 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_NotFound) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadExistingFile( - base::FilePath(FILE_PATH_LITERAL("drive/File 1")), "test/foo", 13, "non_existent", @@ -1608,7 +1600,6 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_WrongETag) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadExistingFile( - base::FilePath(FILE_PATH_LITERAL("drive/File 1.txt")), "text/plain", 13, "file:2_file_resource_id", @@ -1627,7 +1618,6 @@ TEST_F(FakeDriveServiceTest, InitiateUpload_ExistingFile) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadExistingFile( - base::FilePath(FILE_PATH_LITERAL("drive/File 1.txt")), "text/plain", 13, "file:2_file_resource_id", @@ -1647,7 +1637,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_Offline) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadNewFile( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1/new file.foo")), "test/foo", 15, "folder:1_folder_resource_id", @@ -1665,7 +1654,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_Offline) { UploadRangeResponse response; scoped_ptr<ResourceEntry> entry; fake_service_.ResumeUpload( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1/new file.foo")), upload_location, 0, 13, 15, "test/foo", base::FilePath(), @@ -1684,7 +1672,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_NotFound) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadNewFile( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1/new file.foo")), "test/foo", 15, "folder:1_folder_resource_id", @@ -1697,7 +1684,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_NotFound) { UploadRangeResponse response; scoped_ptr<ResourceEntry> entry; fake_service_.ResumeUpload( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1/new file.foo")), GURL("https://foo.com/"), 0, 13, 15, "test/foo", base::FilePath(), @@ -1716,7 +1702,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_ExistingFile) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadExistingFile( - base::FilePath(FILE_PATH_LITERAL("drive/File 1.txt")), "text/plain", 15, "file:2_file_resource_id", @@ -1730,7 +1715,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_ExistingFile) { scoped_ptr<ResourceEntry> entry; std::vector<test_util::ProgressInfo> upload_progress_values; fake_service_.ResumeUpload( - base::FilePath(FILE_PATH_LITERAL("drive/File 1.txt")), upload_location, 0, 13, 15, "text/plain", base::FilePath(), @@ -1748,7 +1732,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_ExistingFile) { upload_progress_values.clear(); fake_service_.ResumeUpload( - base::FilePath(FILE_PATH_LITERAL("drive/File 1.txt")), upload_location, 13, 15, 15, "text/plain", base::FilePath(), @@ -1774,7 +1757,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_NewFile) { GDataErrorCode error = GDATA_OTHER_ERROR; GURL upload_location; fake_service_.InitiateUploadNewFile( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1/new file.foo")), "test/foo", 15, "folder:1_folder_resource_id", @@ -1791,7 +1773,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_NewFile) { scoped_ptr<ResourceEntry> entry; std::vector<test_util::ProgressInfo> upload_progress_values; fake_service_.ResumeUpload( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1/new file.foo")), upload_location, 0, 13, 15, "test/foo", base::FilePath(), @@ -1809,7 +1790,6 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_NewFile) { upload_progress_values.clear(); fake_service_.ResumeUpload( - base::FilePath(FILE_PATH_LITERAL("drive/Directory 1/new file.foo")), upload_location, 13, 15, 15, "test/foo", base::FilePath(), diff --git a/chrome/browser/drive/gdata_wapi_service.cc b/chrome/browser/drive/gdata_wapi_service.cc index bcd0fca..9a991e7 100644 --- a/chrome/browser/drive/gdata_wapi_service.cc +++ b/chrome/browser/drive/gdata_wapi_service.cc @@ -344,7 +344,6 @@ CancelCallback GDataWapiService::GetAppList( } CancelCallback GDataWapiService::DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const DownloadActionCallback& download_action_callback, @@ -497,7 +496,6 @@ CancelCallback GDataWapiService::RemoveResourceFromDirectory( } CancelCallback GDataWapiService::InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, @@ -519,7 +517,6 @@ CancelCallback GDataWapiService::InitiateUploadNewFile( } CancelCallback GDataWapiService::InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, @@ -541,7 +538,6 @@ CancelCallback GDataWapiService::InitiateUploadExistingFile( } CancelCallback GDataWapiService::ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -567,7 +563,6 @@ CancelCallback GDataWapiService::ResumeUpload( } CancelCallback GDataWapiService::GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const UploadRangeCallback& callback) { diff --git a/chrome/browser/drive/gdata_wapi_service.h b/chrome/browser/drive/gdata_wapi_service.h index 23683ae..695bd3c 100644 --- a/chrome/browser/drive/gdata_wapi_service.h +++ b/chrome/browser/drive/gdata_wapi_service.h @@ -93,7 +93,6 @@ class GDataWapiService : public DriveServiceInterface, const std::string& etag, const google_apis::EntryActionCallback& callback) OVERRIDE; virtual google_apis::CancelCallback DownloadFile( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const google_apis::DownloadActionCallback& download_action_callback, @@ -130,21 +129,18 @@ class GDataWapiService : public DriveServiceInterface, const std::string& directory_name, const google_apis::GetResourceEntryCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadNewFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, const std::string& title, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback InitiateUploadExistingFile( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, const std::string& etag, const google_apis::InitiateUploadCallback& callback) OVERRIDE; virtual google_apis::CancelCallback ResumeUpload( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -154,7 +150,6 @@ class GDataWapiService : public DriveServiceInterface, const google_apis::UploadRangeCallback& callback, const google_apis::ProgressCallback& progress_callback) OVERRIDE; virtual google_apis::CancelCallback GetUploadStatus( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const google_apis::UploadRangeCallback& callback) OVERRIDE; diff --git a/chrome/browser/drive/mock_drive_service.cc b/chrome/browser/drive/mock_drive_service.cc index aff54ad..3632a7b 100644 --- a/chrome/browser/drive/mock_drive_service.cc +++ b/chrome/browser/drive/mock_drive_service.cc @@ -15,7 +15,6 @@ using ::testing::_; using ::testing::Invoke; -using ::testing::Return; using google_apis::CancelCallback; using google_apis::DownloadActionCallback; @@ -50,7 +49,7 @@ MockDriveService::MockDriveService() { Invoke(this, &MockDriveService::RemoveResourceFromDirectoryStub)); ON_CALL(*this, AddNewDirectory(_, _, _)) .WillByDefault(Invoke(this, &MockDriveService::CreateDirectoryStub)); - ON_CALL(*this, DownloadFile(_, _, _, _, _, _)) + ON_CALL(*this, DownloadFile(_, _, _, _, _)) .WillByDefault(Invoke(this, &MockDriveService::DownloadFileStub)); // Fill in the default values for mock data. @@ -138,7 +137,6 @@ CancelCallback MockDriveService::CreateDirectoryStub( } CancelCallback MockDriveService::DownloadFileStub( - const base::FilePath& virtual_path, const base::FilePath& local_tmp_path, const GURL& download_url, const DownloadActionCallback& download_action_callback, diff --git a/chrome/browser/drive/mock_drive_service.h b/chrome/browser/drive/mock_drive_service.h index 02dfcd3..836eb55 100644 --- a/chrome/browser/drive/mock_drive_service.h +++ b/chrome/browser/drive/mock_drive_service.h @@ -109,34 +109,30 @@ class MockDriveService : public DriveServiceInterface { const std::string& parent_resource_id, const std::string& directory_name, const google_apis::GetResourceEntryCallback& callback)); - MOCK_METHOD6( + MOCK_METHOD5( DownloadFile, google_apis::CancelCallback( - const base::FilePath& virtual_path, const base::FilePath& local_cache_path, const GURL& download_url, const google_apis::DownloadActionCallback& donwload_action_callback, const google_apis::GetContentCallback& get_content_callback, const google_apis::ProgressCallback& progress_callback)); - MOCK_METHOD6(InitiateUploadNewFile, + MOCK_METHOD5(InitiateUploadNewFile, google_apis::CancelCallback( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& parent_resource_id, const std::string& title, const google_apis::InitiateUploadCallback& callback)); - MOCK_METHOD6(InitiateUploadExistingFile, + MOCK_METHOD5(InitiateUploadExistingFile, google_apis::CancelCallback( - const base::FilePath& drive_file_path, const std::string& content_type, int64 content_length, const std::string& resource_id, const std::string& etag, const google_apis::InitiateUploadCallback& callback)); - MOCK_METHOD9(ResumeUpload, + MOCK_METHOD8(ResumeUpload, google_apis::CancelCallback( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 start_position, int64 end_position, @@ -145,9 +141,8 @@ class MockDriveService : public DriveServiceInterface { const base::FilePath& local_file_path, const google_apis::UploadRangeCallback& callback, const google_apis::ProgressCallback& progress_callback)); - MOCK_METHOD4(GetUploadStatus, + MOCK_METHOD3(GetUploadStatus, google_apis::CancelCallback( - const base::FilePath& drive_file_path, const GURL& upload_url, int64 content_length, const google_apis::UploadRangeCallback& callback)); @@ -216,7 +211,6 @@ class MockDriveService : public DriveServiceInterface { // portion of the URL as the temporary file path. If |file_data_| is not null, // |file_data_| is written to the temporary file. google_apis::CancelCallback DownloadFileStub( - const base::FilePath& virtual_path, const base::FilePath& local_tmp_path, const GURL& download_url, const google_apis::DownloadActionCallback& download_action_callback, diff --git a/chrome/browser/sync_file_system/drive/api_util.cc b/chrome/browser/sync_file_system/drive/api_util.cc index 05656ab..76d5c77 100644 --- a/chrome/browser/sync_file_system/drive/api_util.cc +++ b/chrome/browser/sync_file_system/drive/api_util.cc @@ -39,10 +39,6 @@ const char kSyncRootDirectoryName[] = "Chrome Syncable FileSystem"; const char kSyncRootDirectoryNameDev[] = "Chrome Syncable FileSystem Dev"; const char kMimeTypeOctetStream[] = "application/octet-stream"; -// This path is not actually used but is required by DriveUploaderInterface. -const base::FilePath::CharType kDummyDrivePath[] = - FILE_PATH_LITERAL("/dummy/drive/path"); - const char kFakeServerBaseUrl[] = "https://fake_server/"; void EmptyGDataErrorCodeCallback(google_apis::GDataErrorCode error) {} @@ -502,7 +498,6 @@ void APIUtil::UploadNewFile(const std::string& directory_resource_id, upload_key); drive_uploader_->UploadNewFile( directory_resource_id, - base::FilePath(kDummyDrivePath), local_file_path, title, mime_type, @@ -711,8 +706,7 @@ void APIUtil::DownloadFileInternal( DVLOG(2) << "Downloading file: " << entry->resource_id(); const GURL& download_url = entry->download_url(); - drive_service_->DownloadFile(base::FilePath(kDummyDrivePath), - local_file_path, + drive_service_->DownloadFile(local_file_path, download_url, base::Bind(&APIUtil::DidDownloadFile, AsWeakPtr(), @@ -837,7 +831,6 @@ void APIUtil::UploadExistingFileInternal( base::Bind(&APIUtil::DidUploadExistingFile, AsWeakPtr(), upload_key); drive_uploader_->UploadExistingFile( entry->resource_id(), - base::FilePath(kDummyDrivePath), local_file_path, mime_type, entry->etag(), diff --git a/chrome/browser/sync_file_system/drive/api_util_unittest.cc b/chrome/browser/sync_file_system/drive/api_util_unittest.cc index 05cb8c5..753a67a 100644 --- a/chrome/browser/sync_file_system/drive/api_util_unittest.cc +++ b/chrome/browser/sync_file_system/drive/api_util_unittest.cc @@ -179,7 +179,6 @@ class FakeDriveUploader : public DriveUploaderInterface { // resource entry to the caller. virtual google_apis::CancelCallback UploadNewFile( const std::string& parent_resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& title, const std::string& content_type, @@ -214,7 +213,6 @@ class FakeDriveUploader : public DriveUploaderInterface { // returns a resource entry to the caller. virtual google_apis::CancelCallback UploadExistingFile( const std::string& resource_id, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const std::string& etag, @@ -230,7 +228,6 @@ class FakeDriveUploader : public DriveUploaderInterface { // So this method shouldn't be reached. virtual google_apis::CancelCallback ResumeUploadFile( const GURL& upload_location, - const base::FilePath& drive_file_path, const base::FilePath& local_file_path, const std::string& content_type, const UploadCompletionCallback& callback, diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc index f56795d..d8502a2 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc @@ -210,7 +210,7 @@ ACTION(PrepareForRemoteChange_NotModified) { ACTION(InvokeDidDownloadFile) { base::MessageLoopProxy::current()->PostTask( - FROM_HERE, base::Bind(arg3, google_apis::HTTP_SUCCESS, arg1)); + FROM_HERE, base::Bind(arg2, google_apis::HTTP_SUCCESS, arg0)); return google_apis::CancelCallback(); } @@ -550,7 +550,7 @@ class DriveFileSyncServiceMockTest : public testing::Test { .RetiresOnSaturation(); EXPECT_CALL(*mock_drive_service(), - DownloadFile(_, _, GURL("https://file_content_url"), _, _, _)) + DownloadFile(_, GURL("https://file_content_url"), _, _, _)) .WillOnce(InvokeDidDownloadFile()) .RetiresOnSaturation(); } |