OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |