| 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/google_apis/gdata_wapi_operations.h" | 5 #include "chrome/browser/google_apis/gdata_wapi_operations.h" |
| 6 | 6 |
| 7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 headers.push_back(util::GenerateIfMatchHeader(etag_)); | 649 headers.push_back(util::GenerateIfMatchHeader(etag_)); |
| 650 return headers; | 650 return headers; |
| 651 } | 651 } |
| 652 | 652 |
| 653 //============================ ResumeUploadOperation =========================== | 653 //============================ ResumeUploadOperation =========================== |
| 654 | 654 |
| 655 ResumeUploadOperation::ResumeUploadOperation( | 655 ResumeUploadOperation::ResumeUploadOperation( |
| 656 OperationRegistry* registry, | 656 OperationRegistry* registry, |
| 657 net::URLRequestContextGetter* url_request_context_getter, | 657 net::URLRequestContextGetter* url_request_context_getter, |
| 658 const UploadRangeCallback& callback, | 658 const UploadRangeCallback& callback, |
| 659 const ProgressCallback& progress_callback, |
| 659 UploadMode upload_mode, | 660 UploadMode upload_mode, |
| 660 const base::FilePath& drive_file_path, | 661 const base::FilePath& drive_file_path, |
| 661 const GURL& upload_location, | 662 const GURL& upload_location, |
| 662 int64 start_position, | 663 int64 start_position, |
| 663 int64 end_position, | 664 int64 end_position, |
| 664 int64 content_length, | 665 int64 content_length, |
| 665 const std::string& content_type, | 666 const std::string& content_type, |
| 666 const scoped_refptr<net::IOBuffer>& buf) | 667 const scoped_refptr<net::IOBuffer>& buf) |
| 667 : ResumeUploadOperationBase(registry, | 668 : ResumeUploadOperationBase(registry, |
| 668 url_request_context_getter, | 669 url_request_context_getter, |
| 669 upload_mode, | 670 upload_mode, |
| 670 drive_file_path, | 671 drive_file_path, |
| 671 upload_location, | 672 upload_location, |
| 672 start_position, | 673 start_position, |
| 673 end_position, | 674 end_position, |
| 674 content_length, | 675 content_length, |
| 675 content_type, | 676 content_type, |
| 676 buf), | 677 buf), |
| 677 callback_(callback) { | 678 callback_(callback), |
| 679 progress_callback_(progress_callback) { |
| 678 DCHECK(!callback_.is_null()); | 680 DCHECK(!callback_.is_null()); |
| 679 } | 681 } |
| 680 | 682 |
| 681 ResumeUploadOperation::~ResumeUploadOperation() {} | 683 ResumeUploadOperation::~ResumeUploadOperation() {} |
| 682 | 684 |
| 683 void ResumeUploadOperation::OnRangeOperationComplete( | 685 void ResumeUploadOperation::OnRangeOperationComplete( |
| 684 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { | 686 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { |
| 685 callback_.Run(response, ParseResourceEntry(value.Pass())); | 687 callback_.Run(response, ParseResourceEntry(value.Pass())); |
| 686 } | 688 } |
| 687 | 689 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 base::Int64ToString(content_length_)); | 721 base::Int64ToString(content_length_)); |
| 720 return headers; | 722 return headers; |
| 721 } | 723 } |
| 722 | 724 |
| 723 void GetUploadStatusOperation::OnRangeOperationComplete( | 725 void GetUploadStatusOperation::OnRangeOperationComplete( |
| 724 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { | 726 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { |
| 725 callback_.Run(response, ParseResourceEntry(value.Pass())); | 727 callback_.Run(response, ParseResourceEntry(value.Pass())); |
| 726 } | 728 } |
| 727 | 729 |
| 728 } // namespace google_apis | 730 } // namespace google_apis |
| OLD | NEW |