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_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Constructing from persistent store: | 52 // Constructing from persistent store: |
53 // |bound_net_log| is constructed externally for our use. | 53 // |bound_net_log| is constructed externally for our use. |
54 DownloadItemImpl(DownloadItemImplDelegate* delegate, | 54 DownloadItemImpl(DownloadItemImplDelegate* delegate, |
55 const std::string& guid, | 55 const std::string& guid, |
56 uint32_t id, | 56 uint32_t id, |
57 const base::FilePath& current_path, | 57 const base::FilePath& current_path, |
58 const base::FilePath& target_path, | 58 const base::FilePath& target_path, |
59 const std::vector<GURL>& url_chain, | 59 const std::vector<GURL>& url_chain, |
60 const GURL& referrer_url, | 60 const GURL& referrer_url, |
| 61 const GURL& site_url, |
61 const GURL& tab_url, | 62 const GURL& tab_url, |
62 const GURL& tab_referrer_url, | 63 const GURL& tab_referrer_url, |
63 const std::string& mime_type, | 64 const std::string& mime_type, |
64 const std::string& original_mime_type, | 65 const std::string& original_mime_type, |
65 const base::Time& start_time, | 66 const base::Time& start_time, |
66 const base::Time& end_time, | 67 const base::Time& end_time, |
67 const std::string& etag, | 68 const std::string& etag, |
68 const std::string& last_modified, | 69 const std::string& last_modified, |
69 int64_t received_bytes, | 70 int64_t received_bytes, |
70 int64_t total_bytes, | 71 int64_t total_bytes, |
71 const std::string& hash, | 72 const std::string& hash, |
72 DownloadItem::DownloadState state, | 73 DownloadItem::DownloadState state, |
73 DownloadDangerType danger_type, | 74 DownloadDangerType danger_type, |
74 DownloadInterruptReason interrupt_reason, | 75 DownloadInterruptReason interrupt_reason, |
75 bool opened, | 76 bool opened, |
76 const net::BoundNetLog& bound_net_log); | 77 const net::BoundNetLog& bound_net_log); |
77 | 78 |
78 // Constructing for a regular download. | 79 // Constructing for a regular download. |
79 // |bound_net_log| is constructed externally for our use. | 80 // |bound_net_log| is constructed externally for our use. |
80 // TODO(asanka): Get rid of the DownloadCreateInfo parameter since active | |
81 // downloads end up at Start() immediately after creation. | |
82 DownloadItemImpl(DownloadItemImplDelegate* delegate, | 81 DownloadItemImpl(DownloadItemImplDelegate* delegate, |
83 uint32_t id, | 82 uint32_t id, |
84 const DownloadCreateInfo& info, | 83 const DownloadCreateInfo& info, |
85 const net::BoundNetLog& bound_net_log); | 84 const net::BoundNetLog& bound_net_log); |
86 | 85 |
87 // Constructing for the "Save Page As..." feature: | 86 // Constructing for the "Save Page As..." feature: |
88 // |bound_net_log| is constructed externally for our use. | 87 // |bound_net_log| is constructed externally for our use. |
89 DownloadItemImpl( | 88 DownloadItemImpl( |
90 DownloadItemImplDelegate* delegate, | 89 DownloadItemImplDelegate* delegate, |
91 uint32_t id, | 90 uint32_t id, |
(...skipping 22 matching lines...) Expand all Loading... |
114 DownloadState GetState() const override; | 113 DownloadState GetState() const override; |
115 DownloadInterruptReason GetLastReason() const override; | 114 DownloadInterruptReason GetLastReason() const override; |
116 bool IsPaused() const override; | 115 bool IsPaused() const override; |
117 bool IsTemporary() const override; | 116 bool IsTemporary() const override; |
118 bool CanResume() const override; | 117 bool CanResume() const override; |
119 bool IsDone() const override; | 118 bool IsDone() const override; |
120 const GURL& GetURL() const override; | 119 const GURL& GetURL() const override; |
121 const std::vector<GURL>& GetUrlChain() const override; | 120 const std::vector<GURL>& GetUrlChain() const override; |
122 const GURL& GetOriginalUrl() const override; | 121 const GURL& GetOriginalUrl() const override; |
123 const GURL& GetReferrerUrl() const override; | 122 const GURL& GetReferrerUrl() const override; |
| 123 const GURL& GetSiteUrl() const override; |
124 const GURL& GetTabUrl() const override; | 124 const GURL& GetTabUrl() const override; |
125 const GURL& GetTabReferrerUrl() const override; | 125 const GURL& GetTabReferrerUrl() const override; |
126 std::string GetSuggestedFilename() const override; | 126 std::string GetSuggestedFilename() const override; |
127 std::string GetContentDisposition() const override; | 127 std::string GetContentDisposition() const override; |
128 std::string GetMimeType() const override; | 128 std::string GetMimeType() const override; |
129 std::string GetOriginalMimeType() const override; | 129 std::string GetOriginalMimeType() const override; |
130 std::string GetRemoteAddress() const override; | 130 std::string GetRemoteAddress() const override; |
131 bool HasUserGesture() const override; | 131 bool HasUserGesture() const override; |
132 ui::PageTransition GetTransitionType() const override; | 132 ui::PageTransition GetTransitionType() const override; |
133 const std::string& GetLastModifiedTime() const override; | 133 const std::string& GetLastModifiedTime() const override; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 519 |
520 // Whether the target should be overwritten, uniquified or prompted for. | 520 // Whether the target should be overwritten, uniquified or prompted for. |
521 TargetDisposition target_disposition_ = TARGET_DISPOSITION_OVERWRITE; | 521 TargetDisposition target_disposition_ = TARGET_DISPOSITION_OVERWRITE; |
522 | 522 |
523 // The chain of redirects that leading up to and including the final URL. | 523 // The chain of redirects that leading up to and including the final URL. |
524 std::vector<GURL> url_chain_; | 524 std::vector<GURL> url_chain_; |
525 | 525 |
526 // The URL of the page that initiated the download. | 526 // The URL of the page that initiated the download. |
527 GURL referrer_url_; | 527 GURL referrer_url_; |
528 | 528 |
| 529 // Site URL for the site instance that initiated this download. |
| 530 GURL site_url_; |
| 531 |
529 // The URL of the tab that initiated the download. | 532 // The URL of the tab that initiated the download. |
530 GURL tab_url_; | 533 GURL tab_url_; |
531 | 534 |
532 // The URL of the referrer of the tab that initiated the download. | 535 // The URL of the referrer of the tab that initiated the download. |
533 GURL tab_referrer_url_; | 536 GURL tab_referrer_url_; |
534 | 537 |
535 // Filename suggestion from DownloadSaveInfo. It could, among others, be the | 538 // Filename suggestion from DownloadSaveInfo. It could, among others, be the |
536 // suggested filename in 'download' attribute of an anchor. Details: | 539 // suggested filename in 'download' attribute of an anchor. Details: |
537 // http://www.whatwg.org/specs/web-apps/current-work/#downloading-hyperlinks | 540 // http://www.whatwg.org/specs/web-apps/current-work/#downloading-hyperlinks |
538 std::string suggested_filename_; | 541 std::string suggested_filename_; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 const net::BoundNetLog bound_net_log_; | 677 const net::BoundNetLog bound_net_log_; |
675 | 678 |
676 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 679 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
677 | 680 |
678 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 681 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
679 }; | 682 }; |
680 | 683 |
681 } // namespace content | 684 } // namespace content |
682 | 685 |
683 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 686 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
OLD | NEW |