Chromium Code Reviews| Index: content/browser/download/download_item_impl.cc |
| diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc |
| index 507dfe1692cbc5dd0da9e58ad25fe46649b23bfe..d9a7fda8cee85b0e8bfdc6f8c009da775d86cd4e 100644 |
| --- a/content/browser/download/download_item_impl.cc |
| +++ b/content/browser/download/download_item_impl.cc |
| @@ -896,6 +896,37 @@ DownloadItemImpl::ResumeMode DownloadItemImpl::GetResumeMode() const { |
| return mode; |
| } |
| +void DownloadItemImpl::MergeOriginInfoOnResume( |
| + const DownloadCreateInfo& new_create_info) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + DCHECK_EQ(RESUMING_INTERNAL, state_); |
| + DCHECK(!new_create_info.url_chain.empty()); |
| + |
| + // We are going to tack on any new redirects to our list of redirects. |
|
Randy Smith (Not in Mondays)
2013/11/18 22:15:56
So I can see two cases here: a) The validators mat
asanka
2013/11/19 23:54:19
For b) case, I chose not to overwrite the redirect
Randy Smith (Not in Mondays)
2013/11/20 22:32:18
When we resume, are we resuming from the URL at th
asanka
2013/11/21 18:11:08
We start from the end of the chain since that's th
|
| + std::vector<GURL>::const_iterator chain_iter = |
| + new_create_info.url_chain.begin(); |
| + if (*chain_iter == url_chain_.back()) |
| + ++chain_iter; |
| + url_chain_.insert( |
| + url_chain_.end(), chain_iter, new_create_info.url_chain.end()); |
| + // TODO(asanka): Measure how URL chains change with resumption. Resumption |
| + // requests are issued against the actual download URL and we don't expect any |
| + // redirects. |
| + |
| + // If the server precondition failed, then the download will be resumed |
| + // automatically without validators. |
| + etag_ = new_create_info.etag; |
| + last_modified_time_ = new_create_info.last_modified; |
| + content_disposition_ = new_create_info.content_disposition; |
| + // TODO(asanka): Measure how validators change with resumption. I.e. An ETag |
| + // should only change if we used it and the server responded with |
| + // HTTP_PRECONDITION_FAILED. |
| + |
| + // Don't update observers. This method is expected to be called just before a |
| + // DownloadFile is created and Start() is called. The observers will be |
| + // notified when the download transitions to the IN_PROGRESS state. |
| +} |
| + |
| void DownloadItemImpl::NotifyRemoved() { |
| FOR_EACH_OBSERVER(Observer, observers_, OnDownloadRemoved(this)); |
| } |