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/drive_api_operations.h" | 5 #include "chrome/browser/google_apis/drive_api_operations.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 OperationRegistry* registry, | 515 OperationRegistry* registry, |
516 net::URLRequestContextGetter* url_request_context_getter, | 516 net::URLRequestContextGetter* url_request_context_getter, |
517 UploadMode upload_mode, | 517 UploadMode upload_mode, |
518 const base::FilePath& drive_file_path, | 518 const base::FilePath& drive_file_path, |
519 const GURL& upload_location, | 519 const GURL& upload_location, |
520 int64 start_position, | 520 int64 start_position, |
521 int64 end_position, | 521 int64 end_position, |
522 int64 content_length, | 522 int64 content_length, |
523 const std::string& content_type, | 523 const std::string& content_type, |
524 const scoped_refptr<net::IOBuffer>& buf, | 524 const scoped_refptr<net::IOBuffer>& buf, |
525 const UploadRangeCallback& callback) | 525 const UploadRangeCallback& callback, |
| 526 const ProgressCallback& progress_callback) |
526 : ResumeUploadOperationBase(registry, | 527 : ResumeUploadOperationBase(registry, |
527 url_request_context_getter, | 528 url_request_context_getter, |
528 upload_mode, | 529 upload_mode, |
529 drive_file_path, | 530 drive_file_path, |
530 upload_location, | 531 upload_location, |
531 start_position, | 532 start_position, |
532 end_position, | 533 end_position, |
533 content_length, | 534 content_length, |
534 content_type, | 535 content_type, |
535 buf), | 536 buf), |
536 callback_(callback) { | 537 callback_(callback), |
| 538 progress_callback_(progress_callback) { |
537 DCHECK(!callback_.is_null()); | 539 DCHECK(!callback_.is_null()); |
538 } | 540 } |
539 | 541 |
540 ResumeUploadOperation::~ResumeUploadOperation() {} | 542 ResumeUploadOperation::~ResumeUploadOperation() {} |
541 | 543 |
542 void ResumeUploadOperation::OnRangeOperationComplete( | 544 void ResumeUploadOperation::OnRangeOperationComplete( |
543 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { | 545 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { |
544 ParseFileResourceWithUploadRangeAndRun(callback_, response, value.Pass()); | 546 ParseFileResourceWithUploadRangeAndRun(callback_, response, value.Pass()); |
545 } | 547 } |
546 | 548 |
547 } // namespace drive | 549 } // namespace drive |
548 } // namespace google_apis | 550 } // namespace google_apis |
OLD | NEW |