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_service.h" | 5 #include "chrome/browser/google_apis/drive_api_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 598 |
599 void DriveAPIService::ResumeUpload( | 599 void DriveAPIService::ResumeUpload( |
600 UploadMode upload_mode, | 600 UploadMode upload_mode, |
601 const base::FilePath& drive_file_path, | 601 const base::FilePath& drive_file_path, |
602 const GURL& upload_url, | 602 const GURL& upload_url, |
603 int64 start_position, | 603 int64 start_position, |
604 int64 end_position, | 604 int64 end_position, |
605 int64 content_length, | 605 int64 content_length, |
606 const std::string& content_type, | 606 const std::string& content_type, |
607 const scoped_refptr<net::IOBuffer>& buf, | 607 const scoped_refptr<net::IOBuffer>& buf, |
608 const UploadRangeCallback& callback) { | 608 const UploadRangeCallback& callback, |
| 609 const ProgressCallback& progress_callback) { |
609 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 610 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
610 DCHECK(!callback.is_null()); | 611 DCHECK(!callback.is_null()); |
611 | 612 |
612 runner_->StartOperationWithRetry( | 613 runner_->StartOperationWithRetry( |
613 new drive::ResumeUploadOperation( | 614 new drive::ResumeUploadOperation( |
614 operation_registry(), | 615 operation_registry(), |
615 url_request_context_getter_, | 616 url_request_context_getter_, |
616 upload_mode, | 617 upload_mode, |
617 drive_file_path, | 618 drive_file_path, |
618 upload_url, | 619 upload_url, |
619 start_position, | 620 start_position, |
620 end_position, | 621 end_position, |
621 content_length, | 622 content_length, |
622 content_type, | 623 content_type, |
623 buf, | 624 buf, |
624 base::Bind(&ParseResourceEntryForUploadRangeAndRun, callback))); | 625 base::Bind(&ParseResourceEntryForUploadRangeAndRun, callback), |
| 626 progress_callback)); |
625 } | 627 } |
626 | 628 |
627 void DriveAPIService::GetUploadStatus( | 629 void DriveAPIService::GetUploadStatus( |
628 UploadMode upload_mode, | 630 UploadMode upload_mode, |
629 const base::FilePath& drive_file_path, | 631 const base::FilePath& drive_file_path, |
630 const GURL& upload_url, | 632 const GURL& upload_url, |
631 int64 content_length, | 633 int64 content_length, |
632 const UploadRangeCallback& callback) { | 634 const UploadRangeCallback& callback) { |
633 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 635 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
634 DCHECK(!callback.is_null()); | 636 DCHECK(!callback.is_null()); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 } | 699 } |
698 | 700 |
699 void DriveAPIService::OnProgressUpdate( | 701 void DriveAPIService::OnProgressUpdate( |
700 const OperationProgressStatusList& list) { | 702 const OperationProgressStatusList& list) { |
701 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 703 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
702 FOR_EACH_OBSERVER( | 704 FOR_EACH_OBSERVER( |
703 DriveServiceObserver, observers_, OnProgressUpdate(list)); | 705 DriveServiceObserver, observers_, OnProgressUpdate(list)); |
704 } | 706 } |
705 | 707 |
706 } // namespace google_apis | 708 } // namespace google_apis |
OLD | NEW |