| 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 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "content/common/content_export.h" |
| 12 |
| 11 class DownloadManager; | 13 class DownloadManager; |
| 12 class ResourceDispatcherHost; | 14 class ResourceDispatcherHost; |
| 13 class TabContents; | 15 class TabContents; |
| 14 | 16 |
| 15 // A handle used by the download system for operations on the URLRequest | 17 // A handle used by the download system for operations on the URLRequest |
| 16 // or objects conditional on it (e.g. TabContents). | 18 // or objects conditional on it (e.g. TabContents). |
| 17 // This class needs to be copyable, so we can pass it across threads and not | 19 // This class needs to be copyable, so we can pass it across threads and not |
| 18 // worry about lifetime or const-ness. | 20 // worry about lifetime or const-ness. |
| 19 class DownloadRequestHandle { | 21 class CONTENT_EXPORT DownloadRequestHandle { |
| 20 public: | 22 public: |
| 21 // Create a null DownloadRequestHandle: getters will return null, and | 23 // Create a null DownloadRequestHandle: getters will return null, and |
| 22 // all actions are no-ops. | 24 // all actions are no-ops. |
| 23 // TODO(rdsmith): Ideally, actions would be forbidden rather than | 25 // TODO(rdsmith): Ideally, actions would be forbidden rather than |
| 24 // no-ops, to confirm that no non-testing code actually uses | 26 // no-ops, to confirm that no non-testing code actually uses |
| 25 // a null DownloadRequestHandle. But for now, we need the no-op | 27 // a null DownloadRequestHandle. But for now, we need the no-op |
| 26 // behavior for unit tests. Long-term, this should be fixed by | 28 // behavior for unit tests. Long-term, this should be fixed by |
| 27 // allowing mocking of ResourceDispatcherHost in unit tests. | 29 // allowing mocking of ResourceDispatcherHost in unit tests. |
| 28 DownloadRequestHandle(); | 30 DownloadRequestHandle(); |
| 29 | 31 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 54 int child_id_; | 56 int child_id_; |
| 55 | 57 |
| 56 // The ID of the render view that started the download. | 58 // The ID of the render view that started the download. |
| 57 int render_view_id_; | 59 int render_view_id_; |
| 58 | 60 |
| 59 // The ID associated with the request used for the download. | 61 // The ID associated with the request used for the download. |
| 60 int request_id_; | 62 int request_id_; |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ | 65 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_HANDLE_H_ |
| OLD | NEW |