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