Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/google_apis/gdata_wapi_operations.h

Issue 12209035: Implement retry flow on DriveUploader. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_wapi_get_upload_status_operation_impl
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 // Struct for passing params needed for DriveServiceInterface::ResumeUpload() 503 // Struct for passing params needed for DriveServiceInterface::ResumeUpload()
504 // calls. 504 // calls.
505 struct ResumeUploadParams { 505 struct ResumeUploadParams {
506 ResumeUploadParams(UploadMode upload_mode, 506 ResumeUploadParams(UploadMode upload_mode,
507 int64 start_position, 507 int64 start_position,
508 int64 end_position, 508 int64 end_position,
509 int64 content_length, 509 int64 content_length,
510 const std::string& content_type, 510 const std::string& content_type,
511 scoped_refptr<net::IOBuffer> buf, 511 scoped_refptr<net::IOBuffer> buf,
512 int64 buf_offset,
512 const GURL& upload_location, 513 const GURL& upload_location,
513 const FilePath& drive_file_path); 514 const FilePath& drive_file_path);
514 ~ResumeUploadParams(); 515 ~ResumeUploadParams();
515 516
516 const UploadMode upload_mode; // Mode of the upload. 517 const UploadMode upload_mode; // Mode of the upload.
517 // Start of range of contents currently stored in |buf|. 518 // Start of range of contents currently stored in |buf|.
518 const int64 start_position; 519 const int64 start_position;
519 // End of range of contents currently stored in |buf|. This is exclusive. 520 // End of range of contents currently stored in |buf|. This is exclusive.
520 // For instance, if you are to upload the first 500 bytes of data, 521 // For instance, if you are to upload the first 500 bytes of data,
521 // |start_position| is 0 and |end_position| is 500. 522 // |start_position| is 0 and |end_position| is 500.
522 const int64 end_position; 523 const int64 end_position;
523 const int64 content_length; // File content-Length. 524 const int64 content_length; // File content-Length.
524 const std::string content_type; // Content-Type of file. 525 const std::string content_type; // Content-Type of file.
525 // Holds current content to be uploaded. 526 // Holds current content to be uploaded.
526 const scoped_refptr<net::IOBuffer> buf; 527 const scoped_refptr<net::IOBuffer> buf;
528 // The offset of the available data from the beginning of the buf.
529 const int64 buf_offset;
527 const GURL upload_location; // Url of where to upload the file to. 530 const GURL upload_location; // Url of where to upload the file to.
528 // Drive file path of the file seen in the UI. Not necessary for 531 // Drive file path of the file seen in the UI. Not necessary for
529 // resuming an upload, but used for adding an entry to OperationRegistry. 532 // resuming an upload, but used for adding an entry to OperationRegistry.
530 // TODO(satorux): Remove the drive file path hack. crbug.com/163296 533 // TODO(satorux): Remove the drive file path hack. crbug.com/163296
531 const FilePath drive_file_path; 534 const FilePath drive_file_path;
532 }; 535 };
533 536
534 // This class performs the operation for resuming the upload of a file. 537 // This class performs the operation for resuming the upload of a file.
535 // More specifically, this operation uploads a chunk of data carried in |buf| 538 // More specifically, this operation uploads a chunk of data carried in |buf|
536 // of ResumeUploadResponse. 539 // of ResumeUploadResponse.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 590
588 private: 591 private:
589 const int64 content_length_; 592 const int64 content_length_;
590 593
591 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation); 594 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation);
592 }; 595 };
593 596
594 } // namespace google_apis 597 } // namespace google_apis
595 598
596 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ 599 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698