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

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

Issue 13927002: Add callback for upload progress in Drive service and operation layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 // Performs the operation for resuming the upload of a file. 429 // Performs the operation for resuming the upload of a file.
430 class ResumeUploadOperation : public ResumeUploadOperationBase { 430 class ResumeUploadOperation : public ResumeUploadOperationBase {
431 public: 431 public:
432 // See also ResumeUploadOperationBase's comment for parameters meaining. 432 // See also ResumeUploadOperationBase's comment for parameters meaining.
433 // |callback| must not be null. 433 // |callback| must not be null.
434 ResumeUploadOperation( 434 ResumeUploadOperation(
435 OperationRegistry* registry, 435 OperationRegistry* registry,
436 net::URLRequestContextGetter* url_request_context_getter, 436 net::URLRequestContextGetter* url_request_context_getter,
437 const UploadRangeCallback& callback, 437 const UploadRangeCallback& callback,
438 const ProgressCallback& progress_callback,
438 UploadMode upload_mode, 439 UploadMode upload_mode,
439 const base::FilePath& drive_file_path, 440 const base::FilePath& drive_file_path,
440 const GURL& upload_location, 441 const GURL& upload_location,
441 int64 start_position, 442 int64 start_position,
442 int64 end_position, 443 int64 end_position,
443 int64 content_length, 444 int64 content_length,
444 const std::string& content_type, 445 const std::string& content_type,
445 const scoped_refptr<net::IOBuffer>& buf); 446 const scoped_refptr<net::IOBuffer>& buf);
446 virtual ~ResumeUploadOperation(); 447 virtual ~ResumeUploadOperation();
447 448
448 protected: 449 protected:
449 // UploadRangeOperationBase overrides. 450 // UploadRangeOperationBase overrides.
450 virtual void OnRangeOperationComplete( 451 virtual void OnRangeOperationComplete(
451 const UploadRangeResponse& response, 452 const UploadRangeResponse& response,
452 scoped_ptr<base::Value> value) OVERRIDE; 453 scoped_ptr<base::Value> value) OVERRIDE;
453 454
454 private: 455 private:
455 const UploadRangeCallback callback_; 456 const UploadRangeCallback callback_;
457 const ProgressCallback progress_callback_;
456 458
457 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); 459 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation);
458 }; 460 };
459 461
460 //========================== GetUploadStatusOperation ========================== 462 //========================== GetUploadStatusOperation ==========================
461 463
462 // This class performs the operation for getting the current upload status 464 // This class performs the operation for getting the current upload status
463 // of a file. 465 // of a file.
464 // This operation calls |callback| with: 466 // This operation calls |callback| with:
465 // - HTTP_RESUME_INCOMPLETE and the range of previously uploaded data, 467 // - HTTP_RESUME_INCOMPLETE and the range of previously uploaded data,
(...skipping 30 matching lines...) Expand all
496 private: 498 private:
497 const UploadRangeCallback callback_; 499 const UploadRangeCallback callback_;
498 const int64 content_length_; 500 const int64 content_length_;
499 501
500 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation); 502 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation);
501 }; 503 };
502 504
503 } // namespace google_apis 505 } // namespace google_apis
504 506
505 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ 507 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/fake_drive_service_unittest.cc ('k') | chrome/browser/google_apis/gdata_wapi_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698