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