| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 class DownloadManager; | 9 class DownloadManager; |
| 10 class ResourceDispatcherHost; | 10 class ResourceDispatcherHost; |
| 11 class TabContents; | 11 class TabContents; |
| 12 class TabContentsWrapper; |
| 12 | 13 |
| 13 // A handle used by the download system for operations on external | 14 // A handle used by the download system for operations on external |
| 14 // objects associated with the download (e.g. URLRequest, TabContents, | 15 // objects associated with the download (e.g. URLRequest, TabContents, |
| 15 // DownloadManager). | 16 // DownloadManager). |
| 16 // This class needs to be copyable, so we can pass it across threads and not | 17 // This class needs to be copyable, so we can pass it across threads and not |
| 17 // worry about lifetime or const-ness. | 18 // worry about lifetime or const-ness. |
| 18 class DownloadProcessHandle { | 19 class DownloadProcessHandle { |
| 19 public: | 20 public: |
| 20 DownloadProcessHandle(); | 21 DownloadProcessHandle(); |
| 21 DownloadProcessHandle(int child_id, int render_view_id, int request_id); | 22 DownloadProcessHandle(int child_id, int render_view_id, int request_id); |
| 22 | 23 |
| 23 // These functions must be called on the UI thread. | 24 // These functions must be called on the UI thread. |
| 24 TabContents* GetTabContents(); | 25 TabContents* GetTabContents(); |
| 26 TabContentsWrapper* GetTabContentsWrapper(); |
| 25 DownloadManager* GetDownloadManager(); | 27 DownloadManager* GetDownloadManager(); |
| 26 | 28 |
| 27 int child_id() const { return child_id_; } | 29 int child_id() const { return child_id_; } |
| 28 int render_view_id() const { return render_view_id_; } | 30 int render_view_id() const { return render_view_id_; } |
| 29 int request_id() const { return request_id_; } | 31 int request_id() const { return request_id_; } |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 // The ID of the child process that started the download. | 34 // The ID of the child process that started the download. |
| 33 int child_id_; | 35 int child_id_; |
| 34 | 36 |
| 35 // The ID of the render view that started the download. | 37 // The ID of the render view that started the download. |
| 36 int render_view_id_; | 38 int render_view_id_; |
| 37 | 39 |
| 38 // The ID associated with the request used for the download. | 40 // The ID associated with the request used for the download. |
| 39 int request_id_; | 41 int request_id_; |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_ | 44 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_ |
| OLD | NEW |