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

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: Fixed migration unit test 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const std::string& etag, 139 const std::string& etag,
140 const std::string& last_modified, 140 const std::string& last_modified,
141 int64_t received_bytes, 141 int64_t received_bytes,
142 int64_t total_bytes, 142 int64_t total_bytes,
143 const std::string& hash, 143 const std::string& hash,
144 DownloadItem::DownloadState state, 144 DownloadItem::DownloadState state,
145 DownloadDangerType danger_type, 145 DownloadDangerType danger_type,
146 DownloadInterruptReason interrupt_reason, 146 DownloadInterruptReason interrupt_reason,
147 bool opened, 147 bool opened,
148 const base::Time& last_access_time, 148 const base::Time& last_access_time,
149 bool visible,
149 const std::vector<DownloadItem::ReceivedSlice>& received_slices, 150 const std::vector<DownloadItem::ReceivedSlice>& received_slices,
150 const net::NetLogWithSource& net_log) 151 const net::NetLogWithSource& net_log)
151 : guid_(base::ToUpperASCII(guid)), 152 : guid_(base::ToUpperASCII(guid)),
152 download_id_(download_id), 153 download_id_(download_id),
153 target_path_(target_path), 154 target_path_(target_path),
154 url_chain_(url_chain), 155 url_chain_(url_chain),
155 referrer_url_(referrer_url), 156 referrer_url_(referrer_url),
156 site_url_(site_url), 157 site_url_(site_url),
157 tab_url_(tab_url), 158 tab_url_(tab_url),
158 tab_referrer_url_(tab_refererr_url), 159 tab_referrer_url_(tab_refererr_url),
159 mime_type_(mime_type), 160 mime_type_(mime_type),
160 original_mime_type_(original_mime_type), 161 original_mime_type_(original_mime_type),
161 total_bytes_(total_bytes), 162 total_bytes_(total_bytes),
162 last_reason_(interrupt_reason), 163 last_reason_(interrupt_reason),
163 start_tick_(base::TimeTicks()), 164 start_tick_(base::TimeTicks()),
164 state_(ExternalToInternalState(state)), 165 state_(ExternalToInternalState(state)),
165 danger_type_(danger_type), 166 danger_type_(danger_type),
166 start_time_(start_time), 167 start_time_(start_time),
167 end_time_(end_time), 168 end_time_(end_time),
168 delegate_(delegate), 169 delegate_(delegate),
169 opened_(opened), 170 opened_(opened),
170 last_access_time_(last_access_time), 171 last_access_time_(last_access_time),
172 visible_(visible),
171 current_path_(current_path), 173 current_path_(current_path),
172 received_bytes_(received_bytes), 174 received_bytes_(received_bytes),
173 all_data_saved_(state == COMPLETE), 175 all_data_saved_(state == COMPLETE),
174 hash_(hash), 176 hash_(hash),
175 last_modified_time_(last_modified), 177 last_modified_time_(last_modified),
176 etag_(etag), 178 etag_(etag),
177 received_slices_(received_slices), 179 received_slices_(received_slices),
178 net_log_(net_log), 180 net_log_(net_log),
179 weak_ptr_factory_(this) { 181 weak_ptr_factory_(this) {
180 delegate_->Attach(); 182 delegate_->Attach();
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 } 773 }
772 774
773 bool DownloadItemImpl::GetOpened() const { 775 bool DownloadItemImpl::GetOpened() const {
774 return opened_; 776 return opened_;
775 } 777 }
776 778
777 base::Time DownloadItemImpl::GetLastAccessTime() const { 779 base::Time DownloadItemImpl::GetLastAccessTime() const {
778 return last_access_time_; 780 return last_access_time_;
779 } 781 }
780 782
783 bool DownloadItemImpl::IsVisible() const {
784 return visible_;
vitaliii 2017/03/07 07:58:56 Could you add any comment on when IsVisible is fal
shaktisahu 2017/03/08 06:51:30 Comments are usually found above the method declar
dgn 2017/03/08 13:12:04 All right, but there is no context to why this is
785 }
786
781 BrowserContext* DownloadItemImpl::GetBrowserContext() const { 787 BrowserContext* DownloadItemImpl::GetBrowserContext() const {
782 return delegate_->GetBrowserContext(); 788 return delegate_->GetBrowserContext();
783 } 789 }
784 790
785 WebContents* DownloadItemImpl::GetWebContents() const { 791 WebContents* DownloadItemImpl::GetWebContents() const {
786 // TODO(rdsmith): Remove null check after removing GetWebContents() from 792 // TODO(rdsmith): Remove null check after removing GetWebContents() from
787 // paths that might be used by DownloadItems created from history import. 793 // paths that might be used by DownloadItems created from history import.
788 // Currently such items have null request_handle_s, where other items 794 // Currently such items have null request_handle_s, where other items
789 // (regular and SavePackage downloads) have actual objects off the pointer. 795 // (regular and SavePackage downloads) have actual objects off the pointer.
790 if (request_handle_) 796 if (request_handle_)
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 case RESUME_MODE_USER_CONTINUE: 2146 case RESUME_MODE_USER_CONTINUE:
2141 return "USER_CONTINUE"; 2147 return "USER_CONTINUE";
2142 case RESUME_MODE_USER_RESTART: 2148 case RESUME_MODE_USER_RESTART:
2143 return "USER_RESTART"; 2149 return "USER_RESTART";
2144 } 2150 }
2145 NOTREACHED() << "Unknown resume mode " << mode; 2151 NOTREACHED() << "Unknown resume mode " << mode;
2146 return "unknown"; 2152 return "unknown";
2147 } 2153 }
2148 2154
2149 } // namespace content 2155 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698