| 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 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 // The parameters for the request. See ResumeUploadParams for the details. | 558 // The parameters for the request. See ResumeUploadParams for the details. |
| 559 const int64 start_position_; | 559 const int64 start_position_; |
| 560 const int64 end_position_; | 560 const int64 end_position_; |
| 561 const int64 content_length_; | 561 const int64 content_length_; |
| 562 const std::string content_type_; | 562 const std::string content_type_; |
| 563 const scoped_refptr<net::IOBuffer> buf_; | 563 const scoped_refptr<net::IOBuffer> buf_; |
| 564 | 564 |
| 565 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); | 565 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); |
| 566 }; | 566 }; |
| 567 | 567 |
| 568 //========================== GetUploadStatusOperation ========================== |
| 569 |
| 570 // This class performs the operation for getting the current upload status |
| 571 // of a file. |
| 572 // This operation calls |callback| with: |
| 573 // - HTTP_RESUME_INCOMPLETE and the range of previously uploaded data, |
| 574 // if a file has been partially uploaded. |new_entry| of the |callback| is |
| 575 // not used. |
| 576 // - HTTP_SUCCESS or HTTP_CREATED (up to the upload mode) and |new_entry| |
| 577 // for the uploaded data, if a file has been completely uploaded. |
| 578 // |range| of the |callback| is not used. |
| 579 // See also UploadRangeOperationBase. |
| 580 class GetUploadStatusOperation : public UploadRangeOperationBase { |
| 581 public: |
| 582 // |callback| must not be null. See also UploadRangeOperationBase's |
| 583 // constructor for more details. |
| 584 // |content_length| is the whole data size to be uploaded. |
| 585 GetUploadStatusOperation( |
| 586 OperationRegistry* registry, |
| 587 net::URLRequestContextGetter* url_request_context_getter, |
| 588 const UploadRangeCallback& callback, |
| 589 UploadMode upload_mode, |
| 590 const FilePath& drive_file_path, |
| 591 const GURL& upload_url, |
| 592 int64 content_length); |
| 593 virtual ~GetUploadStatusOperation(); |
| 594 |
| 595 protected: |
| 596 // UrlFetchOperationBase overrides. |
| 597 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
| 598 |
| 599 private: |
| 600 const int64 content_length_; |
| 601 |
| 602 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation); |
| 603 }; |
| 604 |
| 568 } // namespace google_apis | 605 } // namespace google_apis |
| 569 | 606 |
| 570 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ | 607 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
| OLD | NEW |