Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: chrome/browser/sync_file_system/drive_file_sync_client.cc

Issue 14215003: Add ProgressCallback to DriveServiceInterface::DownloadFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync_file_system/drive_file_sync_client.h" 5 #include "chrome/browser/sync_file_system/drive_file_sync_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <sstream> 9 #include <sstream>
10 #include <string> 10 #include <string>
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 return; 619 return;
620 } 620 }
621 621
622 DVLOG(2) << "Downloading file: " << entry->resource_id(); 622 DVLOG(2) << "Downloading file: " << entry->resource_id();
623 drive_service_->DownloadFile( 623 drive_service_->DownloadFile(
624 base::FilePath(kDummyDrivePath), 624 base::FilePath(kDummyDrivePath),
625 local_file_path, 625 local_file_path,
626 entry->download_url(), 626 entry->download_url(),
627 base::Bind(&DriveFileSyncClient::DidDownloadFile, 627 base::Bind(&DriveFileSyncClient::DidDownloadFile,
628 AsWeakPtr(), entry->file_md5(), callback), 628 AsWeakPtr(), entry->file_md5(), callback),
629 google_apis::GetContentCallback()); 629 google_apis::GetContentCallback(),
630 google_apis::ProgressCallback());
630 } 631 }
631 632
632 void DriveFileSyncClient::DidDownloadFile( 633 void DriveFileSyncClient::DidDownloadFile(
633 const std::string& downloaded_file_md5, 634 const std::string& downloaded_file_md5,
634 const DownloadFileCallback& callback, 635 const DownloadFileCallback& callback,
635 google_apis::GDataErrorCode error, 636 google_apis::GDataErrorCode error,
636 const base::FilePath& downloaded_file_path) { 637 const base::FilePath& downloaded_file_path) {
637 DCHECK(CalledOnValidThread()); 638 DCHECK(CalledOnValidThread());
638 if (error == google_apis::HTTP_SUCCESS) 639 if (error == google_apis::HTTP_SUCCESS)
639 DVLOG(2) << "Download completed"; 640 DVLOG(2) << "Download completed";
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 return; 969 return;
969 for (UploadCallbackMap::iterator iter = upload_callback_map_.begin(); 970 for (UploadCallbackMap::iterator iter = upload_callback_map_.begin();
970 iter != upload_callback_map_.end(); ++iter) { 971 iter != upload_callback_map_.end(); ++iter) {
971 iter->second.Run(error, std::string(), std::string()); 972 iter->second.Run(error, std::string(), std::string());
972 } 973 }
973 upload_callback_map_.clear(); 974 upload_callback_map_.clear();
974 drive_uploader_.reset(new google_apis::DriveUploader(drive_service_.get())); 975 drive_uploader_.reset(new google_apis::DriveUploader(drive_service_.get()));
975 } 976 }
976 977
977 } // namespace sync_file_system 978 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/test_util.cc ('k') | chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698