Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: content/browser/download/download_item_impl.cc

Issue 2720613002: Downloads: Added transient flag to download item and download database (Closed)
Patch Set: fix tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // File method ordering: Methods in this file are in the same order as 5 // File method ordering: Methods in this file are in the same order as
6 // in download_item_impl.h, with the following exception: The public 6 // in download_item_impl.h, with the following exception: The public
7 // interface Start is placed in chronological order with the other 7 // interface Start is placed in chronological order with the other
8 // (private) routines that together define a DownloadItem's state 8 // (private) routines that together define a DownloadItem's state
9 // transitions as the download progresses. See "Download progression 9 // transitions as the download progresses. See "Download progression
10 // cascade" later in this file. 10 // cascade" later in this file.
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 const std::string& etag, 142 const std::string& etag,
143 const std::string& last_modified, 143 const std::string& last_modified,
144 int64_t received_bytes, 144 int64_t received_bytes,
145 int64_t total_bytes, 145 int64_t total_bytes,
146 const std::string& hash, 146 const std::string& hash,
147 DownloadItem::DownloadState state, 147 DownloadItem::DownloadState state,
148 DownloadDangerType danger_type, 148 DownloadDangerType danger_type,
149 DownloadInterruptReason interrupt_reason, 149 DownloadInterruptReason interrupt_reason,
150 bool opened, 150 bool opened,
151 base::Time last_access_time, 151 base::Time last_access_time,
152 bool visible,
152 const std::vector<DownloadItem::ReceivedSlice>& received_slices, 153 const std::vector<DownloadItem::ReceivedSlice>& received_slices,
153 const net::NetLogWithSource& net_log) 154 const net::NetLogWithSource& net_log)
154 : guid_(base::ToUpperASCII(guid)), 155 : guid_(base::ToUpperASCII(guid)),
155 download_id_(download_id), 156 download_id_(download_id),
156 target_path_(target_path), 157 target_path_(target_path),
157 url_chain_(url_chain), 158 url_chain_(url_chain),
158 referrer_url_(referrer_url), 159 referrer_url_(referrer_url),
159 site_url_(site_url), 160 site_url_(site_url),
160 tab_url_(tab_url), 161 tab_url_(tab_url),
161 tab_referrer_url_(tab_refererr_url), 162 tab_referrer_url_(tab_refererr_url),
162 mime_type_(mime_type), 163 mime_type_(mime_type),
163 original_mime_type_(original_mime_type), 164 original_mime_type_(original_mime_type),
164 total_bytes_(total_bytes), 165 total_bytes_(total_bytes),
165 last_reason_(interrupt_reason), 166 last_reason_(interrupt_reason),
166 start_tick_(base::TimeTicks()), 167 start_tick_(base::TimeTicks()),
167 state_(ExternalToInternalState(state)), 168 state_(ExternalToInternalState(state)),
168 danger_type_(danger_type), 169 danger_type_(danger_type),
169 start_time_(start_time), 170 start_time_(start_time),
170 end_time_(end_time), 171 end_time_(end_time),
171 delegate_(delegate), 172 delegate_(delegate),
172 opened_(opened), 173 opened_(opened),
173 last_access_time_(last_access_time), 174 last_access_time_(last_access_time),
175 visible_(visible),
174 current_path_(current_path), 176 current_path_(current_path),
175 received_bytes_(received_bytes), 177 received_bytes_(received_bytes),
176 all_data_saved_(state == COMPLETE), 178 all_data_saved_(state == COMPLETE),
177 hash_(hash), 179 hash_(hash),
178 last_modified_time_(last_modified), 180 last_modified_time_(last_modified),
179 etag_(etag), 181 etag_(etag),
180 received_slices_(received_slices), 182 received_slices_(received_slices),
181 net_log_(net_log), 183 net_log_(net_log),
182 weak_ptr_factory_(this) { 184 weak_ptr_factory_(this) {
183 delegate_->Attach(); 185 delegate_->Attach();
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 } 776 }
775 777
776 bool DownloadItemImpl::GetOpened() const { 778 bool DownloadItemImpl::GetOpened() const {
777 return opened_; 779 return opened_;
778 } 780 }
779 781
780 base::Time DownloadItemImpl::GetLastAccessTime() const { 782 base::Time DownloadItemImpl::GetLastAccessTime() const {
781 return last_access_time_; 783 return last_access_time_;
782 } 784 }
783 785
786 bool DownloadItemImpl::IsVisible() const {
787 return visible_;
788 }
789
784 BrowserContext* DownloadItemImpl::GetBrowserContext() const { 790 BrowserContext* DownloadItemImpl::GetBrowserContext() const {
785 return delegate_->GetBrowserContext(); 791 return delegate_->GetBrowserContext();
786 } 792 }
787 793
788 WebContents* DownloadItemImpl::GetWebContents() const { 794 WebContents* DownloadItemImpl::GetWebContents() const {
789 // TODO(rdsmith): Remove null check after removing GetWebContents() from 795 // TODO(rdsmith): Remove null check after removing GetWebContents() from
790 // paths that might be used by DownloadItems created from history import. 796 // paths that might be used by DownloadItems created from history import.
791 // Currently such items have null request_handle_s, where other items 797 // Currently such items have null request_handle_s, where other items
792 // (regular and SavePackage downloads) have actual objects off the pointer. 798 // (regular and SavePackage downloads) have actual objects off the pointer.
793 if (job_) 799 if (job_)
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 case RESUME_MODE_USER_CONTINUE: 2170 case RESUME_MODE_USER_CONTINUE:
2165 return "USER_CONTINUE"; 2171 return "USER_CONTINUE";
2166 case RESUME_MODE_USER_RESTART: 2172 case RESUME_MODE_USER_RESTART:
2167 return "USER_RESTART"; 2173 return "USER_RESTART";
2168 } 2174 }
2169 NOTREACHED() << "Unknown resume mode " << mode; 2175 NOTREACHED() << "Unknown resume mode " << mode;
2170 return "unknown"; 2176 return "unknown";
2171 } 2177 }
2172 2178
2173 } // namespace content 2179 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698