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

Side by Side Diff: chrome/browser/google_apis/drive_api_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
« no previous file with comments | « no previous file | chrome/browser/google_apis/drive_api_operations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DRIVE_API_OPERATIONS_H_ 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_
6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // Callback used for ResumeUpload() (and will be used for GetUploadStatus()). 440 // Callback used for ResumeUpload() (and will be used for GetUploadStatus()).
441 typedef base::Callback<void( 441 typedef base::Callback<void(
442 const UploadRangeResponse& response, 442 const UploadRangeResponse& response,
443 scoped_ptr<FileResource> new_resource)> UploadRangeCallback; 443 scoped_ptr<FileResource> new_resource)> UploadRangeCallback;
444 444
445 //============================ ResumeUploadOperation =========================== 445 //============================ ResumeUploadOperation ===========================
446 446
447 // Performs the operation for resuming the upload of a file. 447 // Performs the operation for resuming the upload of a file.
448 class ResumeUploadOperation : public ResumeUploadOperationBase { 448 class ResumeUploadOperation : public ResumeUploadOperationBase {
449 public: 449 public:
450 // See also ResumeUploadOperationBase's comment for parameters meaining. 450 // See also ResumeUploadOperationBase's comment for parameters meaning.
451 // |callback| must not be null. 451 // |callback| must not be null. |progress_callback| may be null.
452 ResumeUploadOperation( 452 ResumeUploadOperation(
453 OperationRegistry* registry, 453 OperationRegistry* registry,
454 net::URLRequestContextGetter* url_request_context_getter, 454 net::URLRequestContextGetter* url_request_context_getter,
455 UploadMode upload_mode, 455 UploadMode upload_mode,
456 const base::FilePath& drive_file_path, 456 const base::FilePath& drive_file_path,
457 const GURL& upload_location, 457 const GURL& upload_location,
458 int64 start_position, 458 int64 start_position,
459 int64 end_position, 459 int64 end_position,
460 int64 content_length, 460 int64 content_length,
461 const std::string& content_type, 461 const std::string& content_type,
462 const scoped_refptr<net::IOBuffer>& buf, 462 const scoped_refptr<net::IOBuffer>& buf,
463 const UploadRangeCallback& callback); 463 const UploadRangeCallback& callback,
464 const ProgressCallback& progress_callback);
464 virtual ~ResumeUploadOperation(); 465 virtual ~ResumeUploadOperation();
465 466
466 protected: 467 protected:
467 // UploadRangeOperationBase overrides. 468 // UploadRangeOperationBase overrides.
468 virtual void OnRangeOperationComplete( 469 virtual void OnRangeOperationComplete(
469 const UploadRangeResponse& response, 470 const UploadRangeResponse& response,
470 scoped_ptr<base::Value> value) OVERRIDE; 471 scoped_ptr<base::Value> value) OVERRIDE;
471 472
472 private: 473 private:
473 const UploadRangeCallback callback_; 474 const UploadRangeCallback callback_;
475 const ProgressCallback progress_callback_;
474 476
475 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); 477 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation);
476 }; 478 };
477 479
478 } // namespace drive 480 } // namespace drive
479 } // namespace google_apis 481 } // namespace google_apis
480 482
481 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ 483 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/google_apis/drive_api_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698