| 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 <string> | 10 #include <string> |
| (...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(DownloadItemImplDelegate* delegate, | 88 DownloadItemImpl(DownloadItemImplDelegate* delegate, |
| 90 uint32_t id, | 89 uint32_t id, |
| 91 const base::FilePath& path, | 90 const base::FilePath& path, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 113 DownloadState GetState() const override; | 112 DownloadState GetState() const override; |
| 114 DownloadInterruptReason GetLastReason() const override; | 113 DownloadInterruptReason GetLastReason() const override; |
| 115 bool IsPaused() const override; | 114 bool IsPaused() const override; |
| 116 bool IsTemporary() const override; | 115 bool IsTemporary() const override; |
| 117 bool CanResume() const override; | 116 bool CanResume() const override; |
| 118 bool IsDone() const override; | 117 bool IsDone() const override; |
| 119 const GURL& GetURL() const override; | 118 const GURL& GetURL() const override; |
| 120 const std::vector<GURL>& GetUrlChain() const override; | 119 const std::vector<GURL>& GetUrlChain() const override; |
| 121 const GURL& GetOriginalUrl() const override; | 120 const GURL& GetOriginalUrl() const override; |
| 122 const GURL& GetReferrerUrl() const override; | 121 const GURL& GetReferrerUrl() const override; |
| 122 const GURL& GetSiteUrl() const override; |
| 123 const GURL& GetTabUrl() const override; | 123 const GURL& GetTabUrl() const override; |
| 124 const GURL& GetTabReferrerUrl() const override; | 124 const GURL& GetTabReferrerUrl() const override; |
| 125 std::string GetSuggestedFilename() const override; | 125 std::string GetSuggestedFilename() const override; |
| 126 std::string GetContentDisposition() const override; | 126 std::string GetContentDisposition() const override; |
| 127 std::string GetMimeType() const override; | 127 std::string GetMimeType() const override; |
| 128 std::string GetOriginalMimeType() const override; | 128 std::string GetOriginalMimeType() const override; |
| 129 std::string GetRemoteAddress() const override; | 129 std::string GetRemoteAddress() const override; |
| 130 bool HasUserGesture() const override; | 130 bool HasUserGesture() const override; |
| 131 ui::PageTransition GetTransitionType() const override; | 131 ui::PageTransition GetTransitionType() const override; |
| 132 const std::string& GetLastModifiedTime() const override; | 132 const std::string& GetLastModifiedTime() const override; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 516 |
| 517 // Whether the target should be overwritten, uniquified or prompted for. | 517 // Whether the target should be overwritten, uniquified or prompted for. |
| 518 TargetDisposition target_disposition_ = TARGET_DISPOSITION_OVERWRITE; | 518 TargetDisposition target_disposition_ = TARGET_DISPOSITION_OVERWRITE; |
| 519 | 519 |
| 520 // The chain of redirects that leading up to and including the final URL. | 520 // The chain of redirects that leading up to and including the final URL. |
| 521 std::vector<GURL> url_chain_; | 521 std::vector<GURL> url_chain_; |
| 522 | 522 |
| 523 // The URL of the page that initiated the download. | 523 // The URL of the page that initiated the download. |
| 524 GURL referrer_url_; | 524 GURL referrer_url_; |
| 525 | 525 |
| 526 // Site URL for the site instance that initiated this download. |
| 527 GURL site_url_; |
| 528 |
| 526 // The URL of the tab that initiated the download. | 529 // The URL of the tab that initiated the download. |
| 527 GURL tab_url_; | 530 GURL tab_url_; |
| 528 | 531 |
| 529 // The URL of the referrer of the tab that initiated the download. | 532 // The URL of the referrer of the tab that initiated the download. |
| 530 GURL tab_referrer_url_; | 533 GURL tab_referrer_url_; |
| 531 | 534 |
| 532 // Filename suggestion from DownloadSaveInfo. It could, among others, be the | 535 // Filename suggestion from DownloadSaveInfo. It could, among others, be the |
| 533 // suggested filename in 'download' attribute of an anchor. Details: | 536 // suggested filename in 'download' attribute of an anchor. Details: |
| 534 // http://www.whatwg.org/specs/web-apps/current-work/#downloading-hyperlinks | 537 // http://www.whatwg.org/specs/web-apps/current-work/#downloading-hyperlinks |
| 535 std::string suggested_filename_; | 538 std::string suggested_filename_; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 const net::BoundNetLog bound_net_log_; | 674 const net::BoundNetLog bound_net_log_; |
| 672 | 675 |
| 673 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 676 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
| 674 | 677 |
| 675 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 678 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
| 676 }; | 679 }; |
| 677 | 680 |
| 678 } // namespace content | 681 } // namespace content |
| 679 | 682 |
| 680 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 683 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| OLD | NEW |