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

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

Issue 12246002: Implement GetUploadStatusOperation on GData WAPI. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_create_base_operation
Patch Set: Update comments. 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
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. This operation calls |callback| given via the constructor
satorux1 2013/02/07 06:54:13 Let's drop " given via the constructor" as it's ob
hidehiko 2013/02/07 07:44:07 Done.
573 // with the range of the successfully uploaded data, or HTTP_SUCCESS or
satorux1 2013/02/07 06:54:13 maybe it's cleaner to describe the two case separa
hidehiko 2013/02/07 07:44:07 Updated a bit more. How about this?
574 // HTTP_CREATED if the whole data is uploaded successfully.
575 class GetUploadStatusOperation : public UploadRangeOperationBase {
576 public:
577 // |callback| must not be null. See also UploadRangeOperationBase's
578 // constructor for more details.
579 // |content_length| is the whole data size to be uploaded, or -1 if it is
580 // unknown.
581 GetUploadStatusOperation(
582 OperationRegistry* registry,
583 net::URLRequestContextGetter* url_request_context_getter,
584 const UploadRangeCallback& callback,
satorux1 2013/02/07 06:54:13 BTW, UploadRangeCallback takes scoped_ptr<Resource
hidehiko 2013/02/07 07:44:07 The ResourceEntry is used actually. Please see als
satorux1 2013/02/07 07:58:59 I thought ResourceEntry was necessary for ResumeUp
hidehiko 2013/02/07 08:37:56 Acknowledged.
585 UploadMode load_mode,
586 const FilePath& drive_file_path,
587 const GURL& upload_url,
588 int64 content_length);
589 virtual ~GetUploadStatusOperation();
590
591 protected:
592 // UrlFetchOperationBase overrides.
593 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE;
594
595 private:
596 const int64 content_length_;
597
598 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation);
599 };
600
569 } // namespace google_apis 601 } // namespace google_apis
570 602
571 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ 603 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698