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" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "content/browser/download/download_resource_handler.h" | 12 #include "content/browser/download/download_resource_handler.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class DownloadManager; | 16 class DownloadManager; |
17 class WebContents; | 17 class WebContents; |
18 | 18 |
19 // A handle used by the download system for operations on the URLRequest | 19 // A handle used by the download system for operations on the URLRequest |
20 // or objects conditional on it (e.g. WebContentsImpl). | 20 // or objects conditional on it (e.g. WebContentsImpl). |
21 // This class needs to be copyable, so we can pass it across threads and not | 21 // This class needs to be copyable, so we can pass it across threads and not |
22 // worry about lifetime or const-ness. | 22 // worry about lifetime or const-ness. |
23 // | 23 // |
24 // DownloadRequestHandleInterface is defined for mocking purposes. | 24 // DownloadRequestHandleInterface is defined for mocking purposes. |
25 class CONTENT_EXPORT DownloadRequestHandleInterface { | 25 class CONTENT_EXPORT DownloadRequestHandleInterface { |
26 public: | 26 public: |
27 virtual ~DownloadRequestHandleInterface() {} | 27 virtual ~DownloadRequestHandleInterface(); |
28 | 28 |
29 // These functions must be called on the UI thread. | 29 // These functions must be called on the UI thread. |
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. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 int request_id_; | 84 int request_id_; |
85 | 85 |
86 // PlzNavigate | 86 // PlzNavigate |
87 // The ID of the FrameTreeNode that started the download. | 87 // The ID of the FrameTreeNode that started the download. |
88 int frame_tree_node_id_; | 88 int frame_tree_node_id_; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace content | 91 } // namespace content |
92 | 92 |
93 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ | 93 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ |
OLD | NEW |