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 // The DownloadItemFactory is used to produce different DownloadItems. | 5 // The DownloadItemFactory is used to produce different DownloadItems. |
6 // It is separate from the DownloadManager to allow download manager | 6 // It is separate from the DownloadManager to allow download manager |
7 // unit tests to control the items produced. | 7 // unit tests to control the items produced. |
8 | 8 |
9 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ | 9 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ |
10 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ | 10 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ |
11 | 11 |
| 12 #include <stdint.h> |
| 13 |
12 #include <string> | 14 #include <string> |
13 #include <vector> | 15 #include <vector> |
14 | 16 |
15 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
16 #include "content/public/browser/download_item.h" | 18 #include "content/public/browser/download_item.h" |
17 | 19 |
18 class GURL; | 20 class GURL; |
19 | 21 |
20 namespace base { | 22 namespace base { |
21 class FilePath; | 23 class FilePath; |
(...skipping 10 matching lines...) Expand all Loading... |
32 class DownloadItemImplDelegate; | 34 class DownloadItemImplDelegate; |
33 class DownloadRequestHandleInterface; | 35 class DownloadRequestHandleInterface; |
34 struct DownloadCreateInfo; | 36 struct DownloadCreateInfo; |
35 | 37 |
36 class DownloadItemFactory { | 38 class DownloadItemFactory { |
37 public: | 39 public: |
38 virtual ~DownloadItemFactory() {} | 40 virtual ~DownloadItemFactory() {} |
39 | 41 |
40 virtual DownloadItemImpl* CreatePersistedItem( | 42 virtual DownloadItemImpl* CreatePersistedItem( |
41 DownloadItemImplDelegate* delegate, | 43 DownloadItemImplDelegate* delegate, |
42 uint32 download_id, | 44 uint32_t download_id, |
43 const base::FilePath& current_path, | 45 const base::FilePath& current_path, |
44 const base::FilePath& target_path, | 46 const base::FilePath& target_path, |
45 const std::vector<GURL>& url_chain, | 47 const std::vector<GURL>& url_chain, |
46 const GURL& referrer_url, | 48 const GURL& referrer_url, |
47 const std::string& mime_type, | 49 const std::string& mime_type, |
48 const std::string& original_mime_type, | 50 const std::string& original_mime_type, |
49 const base::Time& start_time, | 51 const base::Time& start_time, |
50 const base::Time& end_time, | 52 const base::Time& end_time, |
51 const std::string& etag, | 53 const std::string& etag, |
52 const std::string& last_modified, | 54 const std::string& last_modified, |
53 int64 received_bytes, | 55 int64_t received_bytes, |
54 int64 total_bytes, | 56 int64_t total_bytes, |
55 DownloadItem::DownloadState state, | 57 DownloadItem::DownloadState state, |
56 DownloadDangerType danger_type, | 58 DownloadDangerType danger_type, |
57 DownloadInterruptReason interrupt_reason, | 59 DownloadInterruptReason interrupt_reason, |
58 bool opened, | 60 bool opened, |
59 const net::BoundNetLog& bound_net_log) = 0; | 61 const net::BoundNetLog& bound_net_log) = 0; |
60 | 62 |
61 virtual DownloadItemImpl* CreateActiveItem( | 63 virtual DownloadItemImpl* CreateActiveItem( |
62 DownloadItemImplDelegate* delegate, | 64 DownloadItemImplDelegate* delegate, |
63 uint32 download_id, | 65 uint32_t download_id, |
64 const DownloadCreateInfo& info, | 66 const DownloadCreateInfo& info, |
65 const net::BoundNetLog& bound_net_log) = 0; | 67 const net::BoundNetLog& bound_net_log) = 0; |
66 | 68 |
67 virtual DownloadItemImpl* CreateSavePageItem( | 69 virtual DownloadItemImpl* CreateSavePageItem( |
68 DownloadItemImplDelegate* delegate, | 70 DownloadItemImplDelegate* delegate, |
69 uint32 download_id, | 71 uint32_t download_id, |
70 const base::FilePath& path, | 72 const base::FilePath& path, |
71 const GURL& url, | 73 const GURL& url, |
72 const std::string& mime_type, | 74 const std::string& mime_type, |
73 scoped_ptr<DownloadRequestHandleInterface> request_handle, | 75 scoped_ptr<DownloadRequestHandleInterface> request_handle, |
74 const net::BoundNetLog& bound_net_log) = 0; | 76 const net::BoundNetLog& bound_net_log) = 0; |
75 }; | 77 }; |
76 | 78 |
77 } // namespace content | 79 } // namespace content |
78 | 80 |
79 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ | 81 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_ |
OLD | NEW |