| 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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 virtual content::WebContents* GetWebContents() const = 0; | 31 virtual content::WebContents* GetWebContents() const = 0; |
| 32 virtual content::DownloadManager* GetDownloadManager() const = 0; | 32 virtual content::DownloadManager* GetDownloadManager() const = 0; |
| 33 | 33 |
| 34 // Pauses or resumes the matching URL request. | 34 // Pauses or resumes the matching URL request. |
| 35 virtual void PauseRequest() const = 0; | 35 virtual void PauseRequest() const = 0; |
| 36 virtual void ResumeRequest() const = 0; | 36 virtual void ResumeRequest() const = 0; |
| 37 | 37 |
| 38 // Cancels the request. | 38 // Cancels the request. |
| 39 virtual void CancelRequest() const = 0; | 39 virtual void CancelRequest() const = 0; |
| 40 | 40 |
| 41 // Describe the object. | 41 // Sets the request ID when resuming a download. |
| 42 virtual void SetRequestId(int new_request_id) = 0; |
| 43 |
| 44 // Gets the request ID for resuming a download. |
| 45 virtual int RequestId() const = 0; |
| 46 |
| 47 // Describes the object. |
| 42 virtual std::string DebugString() const = 0; | 48 virtual std::string DebugString() const = 0; |
| 43 }; | 49 }; |
| 44 | 50 |
| 45 | 51 |
| 46 class CONTENT_EXPORT DownloadRequestHandle | 52 class CONTENT_EXPORT DownloadRequestHandle |
| 47 : public DownloadRequestHandleInterface { | 53 : public DownloadRequestHandleInterface { |
| 48 public: | 54 public: |
| 49 virtual ~DownloadRequestHandle(); | 55 virtual ~DownloadRequestHandle(); |
| 50 | 56 |
| 51 // Create a null DownloadRequestHandle: getters will return null, and | 57 // Create a null DownloadRequestHandle: getters will return null, and |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 int child_id, | 68 int child_id, |
| 63 int render_view_id, | 69 int render_view_id, |
| 64 int request_id); | 70 int request_id); |
| 65 | 71 |
| 66 // Implement DownloadRequestHandleInterface interface. | 72 // Implement DownloadRequestHandleInterface interface. |
| 67 virtual content::WebContents* GetWebContents() const OVERRIDE; | 73 virtual content::WebContents* GetWebContents() const OVERRIDE; |
| 68 virtual content::DownloadManager* GetDownloadManager() const OVERRIDE; | 74 virtual content::DownloadManager* GetDownloadManager() const OVERRIDE; |
| 69 virtual void PauseRequest() const OVERRIDE; | 75 virtual void PauseRequest() const OVERRIDE; |
| 70 virtual void ResumeRequest() const OVERRIDE; | 76 virtual void ResumeRequest() const OVERRIDE; |
| 71 virtual void CancelRequest() const OVERRIDE; | 77 virtual void CancelRequest() const OVERRIDE; |
| 78 virtual void SetRequestId(int new_request_id) OVERRIDE; |
| 79 virtual int RequestId() const OVERRIDE; |
| 72 virtual std::string DebugString() const OVERRIDE; | 80 virtual std::string DebugString() const OVERRIDE; |
| 73 | 81 |
| 74 private: | 82 private: |
| 75 base::WeakPtr<DownloadResourceHandler> handler_; | 83 base::WeakPtr<DownloadResourceHandler> handler_; |
| 76 | 84 |
| 77 // The ID of the child process that started the download. | 85 // The ID of the child process that started the download. |
| 78 int child_id_; | 86 int child_id_; |
| 79 | 87 |
| 80 // The ID of the render view that started the download. | 88 // The ID of the render view that started the download. |
| 81 int render_view_id_; | 89 int render_view_id_; |
| 82 | 90 |
| 83 // The ID associated with the request used for the download. | 91 // The ID associated with the request used for the download. |
| 84 int request_id_; | 92 int request_id_; |
| 85 }; | 93 }; |
| 86 | 94 |
| 87 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ | 95 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ |
| OLD | NEW |