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_DRIVE_API_REQUESTS_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 class InitiateUploadNewFileRequest : public InitiateUploadRequestBase { | 429 class InitiateUploadNewFileRequest : public InitiateUploadRequestBase { |
430 public: | 430 public: |
431 // |parent_resource_id| should be the resource id of the parent directory. | 431 // |parent_resource_id| should be the resource id of the parent directory. |
432 // |title| should be set. | 432 // |title| should be set. |
433 // See also the comments of InitiateUploadRequestBase for more details | 433 // See also the comments of InitiateUploadRequestBase for more details |
434 // about the other parameters. | 434 // about the other parameters. |
435 InitiateUploadNewFileRequest( | 435 InitiateUploadNewFileRequest( |
436 RequestSender* runner, | 436 RequestSender* runner, |
437 net::URLRequestContextGetter* url_request_context_getter, | 437 net::URLRequestContextGetter* url_request_context_getter, |
438 const DriveApiUrlGenerator& url_generator, | 438 const DriveApiUrlGenerator& url_generator, |
439 const base::FilePath& drive_file_path, | |
440 const std::string& content_type, | 439 const std::string& content_type, |
441 int64 content_length, | 440 int64 content_length, |
442 const std::string& parent_resource_id, | 441 const std::string& parent_resource_id, |
443 const std::string& title, | 442 const std::string& title, |
444 const InitiateUploadCallback& callback); | 443 const InitiateUploadCallback& callback); |
445 virtual ~InitiateUploadNewFileRequest(); | 444 virtual ~InitiateUploadNewFileRequest(); |
446 | 445 |
447 protected: | 446 protected: |
448 // UrlFetchRequestBase overrides. | 447 // UrlFetchRequestBase overrides. |
449 virtual GURL GetURL() const OVERRIDE; | 448 virtual GURL GetURL() const OVERRIDE; |
(...skipping 18 matching lines...) Expand all Loading... |
468 public: | 467 public: |
469 // |upload_url| should be the upload_url() of the file | 468 // |upload_url| should be the upload_url() of the file |
470 // (resumable-create-media URL) | 469 // (resumable-create-media URL) |
471 // |etag| should be set if it is available to detect the upload confliction. | 470 // |etag| should be set if it is available to detect the upload confliction. |
472 // See also the comments of InitiateUploadRequestBase for more details | 471 // See also the comments of InitiateUploadRequestBase for more details |
473 // about the other parameters. | 472 // about the other parameters. |
474 InitiateUploadExistingFileRequest( | 473 InitiateUploadExistingFileRequest( |
475 RequestSender* runner, | 474 RequestSender* runner, |
476 net::URLRequestContextGetter* url_request_context_getter, | 475 net::URLRequestContextGetter* url_request_context_getter, |
477 const DriveApiUrlGenerator& url_generator, | 476 const DriveApiUrlGenerator& url_generator, |
478 const base::FilePath& drive_file_path, | |
479 const std::string& content_type, | 477 const std::string& content_type, |
480 int64 content_length, | 478 int64 content_length, |
481 const std::string& resource_id, | 479 const std::string& resource_id, |
482 const std::string& etag, | 480 const std::string& etag, |
483 const InitiateUploadCallback& callback); | 481 const InitiateUploadCallback& callback); |
484 virtual ~InitiateUploadExistingFileRequest(); | 482 virtual ~InitiateUploadExistingFileRequest(); |
485 | 483 |
486 protected: | 484 protected: |
487 // UrlFetchRequestBase overrides. | 485 // UrlFetchRequestBase overrides. |
488 virtual GURL GetURL() const OVERRIDE; | 486 virtual GURL GetURL() const OVERRIDE; |
(...skipping 16 matching lines...) Expand all Loading... |
505 //============================ ResumeUploadRequest =========================== | 503 //============================ ResumeUploadRequest =========================== |
506 | 504 |
507 // Performs the request for resuming the upload of a file. | 505 // Performs the request for resuming the upload of a file. |
508 class ResumeUploadRequest : public ResumeUploadRequestBase { | 506 class ResumeUploadRequest : public ResumeUploadRequestBase { |
509 public: | 507 public: |
510 // See also ResumeUploadRequestBase's comment for parameters meaning. | 508 // See also ResumeUploadRequestBase's comment for parameters meaning. |
511 // |callback| must not be null. |progress_callback| may be null. | 509 // |callback| must not be null. |progress_callback| may be null. |
512 ResumeUploadRequest( | 510 ResumeUploadRequest( |
513 RequestSender* runner, | 511 RequestSender* runner, |
514 net::URLRequestContextGetter* url_request_context_getter, | 512 net::URLRequestContextGetter* url_request_context_getter, |
515 const base::FilePath& drive_file_path, | |
516 const GURL& upload_location, | 513 const GURL& upload_location, |
517 int64 start_position, | 514 int64 start_position, |
518 int64 end_position, | 515 int64 end_position, |
519 int64 content_length, | 516 int64 content_length, |
520 const std::string& content_type, | 517 const std::string& content_type, |
521 const base::FilePath& local_file_path, | 518 const base::FilePath& local_file_path, |
522 const UploadRangeCallback& callback, | 519 const UploadRangeCallback& callback, |
523 const ProgressCallback& progress_callback); | 520 const ProgressCallback& progress_callback); |
524 virtual ~ResumeUploadRequest(); | 521 virtual ~ResumeUploadRequest(); |
525 | 522 |
(...skipping 16 matching lines...) Expand all Loading... |
542 //========================== GetUploadStatusRequest ========================== | 539 //========================== GetUploadStatusRequest ========================== |
543 | 540 |
544 // Performs the request to fetch the current upload status of a file. | 541 // Performs the request to fetch the current upload status of a file. |
545 class GetUploadStatusRequest : public GetUploadStatusRequestBase { | 542 class GetUploadStatusRequest : public GetUploadStatusRequestBase { |
546 public: | 543 public: |
547 // See also GetUploadStatusRequestBase's comment for parameters meaning. | 544 // See also GetUploadStatusRequestBase's comment for parameters meaning. |
548 // |callback| must not be null. | 545 // |callback| must not be null. |
549 GetUploadStatusRequest( | 546 GetUploadStatusRequest( |
550 RequestSender* runner, | 547 RequestSender* runner, |
551 net::URLRequestContextGetter* url_request_context_getter, | 548 net::URLRequestContextGetter* url_request_context_getter, |
552 const base::FilePath& drive_file_path, | |
553 const GURL& upload_url, | 549 const GURL& upload_url, |
554 int64 content_length, | 550 int64 content_length, |
555 const UploadRangeCallback& callback); | 551 const UploadRangeCallback& callback); |
556 virtual ~GetUploadStatusRequest(); | 552 virtual ~GetUploadStatusRequest(); |
557 | 553 |
558 protected: | 554 protected: |
559 // UploadRangeRequestBase overrides. | 555 // UploadRangeRequestBase overrides. |
560 virtual void OnRangeRequestComplete( | 556 virtual void OnRangeRequestComplete( |
561 const UploadRangeResponse& response, | 557 const UploadRangeResponse& response, |
562 scoped_ptr<base::Value> value) OVERRIDE; | 558 scoped_ptr<base::Value> value) OVERRIDE; |
563 | 559 |
564 private: | 560 private: |
565 const UploadRangeCallback callback_; | 561 const UploadRangeCallback callback_; |
566 | 562 |
567 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusRequest); | 563 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusRequest); |
568 }; | 564 }; |
569 | 565 |
570 | 566 |
571 } // namespace drive | 567 } // namespace drive |
572 } // namespace google_apis | 568 } // namespace google_apis |
573 | 569 |
574 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ | 570 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ |
OLD | NEW |