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