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

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

Issue 1977623002: Updates to DownloadUrlParameters in preparation for OOPIF changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 7 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 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 1907
1908 StoragePartition* storage_partition = 1908 StoragePartition* storage_partition =
1909 BrowserContext::GetStoragePartitionForSite(GetBrowserContext(), 1909 BrowserContext::GetStoragePartitionForSite(GetBrowserContext(),
1910 site_url_); 1910 site_url_);
1911 1911
1912 // Avoid using the WebContents even if it's still around. Resumption requests 1912 // Avoid using the WebContents even if it's still around. Resumption requests
1913 // are consistently routed through the no-renderer code paths so that the 1913 // are consistently routed through the no-renderer code paths so that the
1914 // request will not be dropped if the WebContents (and by extension, the 1914 // request will not be dropped if the WebContents (and by extension, the
1915 // associated renderer) goes away before a response is received. 1915 // associated renderer) goes away before a response is received.
1916 std::unique_ptr<DownloadUrlParameters> download_params( 1916 std::unique_ptr<DownloadUrlParameters> download_params(
1917 new DownloadUrlParameters(GetURL(), -1, -1, -1, 1917 new DownloadUrlParameters(GetURL(),
1918 storage_partition->GetURLRequestContext())); 1918 storage_partition->GetURLRequestContext()));
1919 download_params->set_file_path(GetFullPath()); 1919 download_params->set_file_path(GetFullPath());
1920 download_params->set_offset(GetReceivedBytes()); 1920 download_params->set_offset(GetReceivedBytes());
1921 download_params->set_last_modified(GetLastModifiedTime()); 1921 download_params->set_last_modified(GetLastModifiedTime());
1922 download_params->set_etag(GetETag()); 1922 download_params->set_etag(GetETag());
1923 download_params->set_hash_of_partial_file(hash_); 1923 download_params->set_hash_of_partial_file(hash_);
1924 download_params->set_hash_state(std::move(hash_state_)); 1924 download_params->set_hash_state(std::move(hash_state_));
1925 1925
1926 // Note that resumed downloads disallow redirects. Hence the referrer URL 1926 // Note that resumed downloads disallow redirects. Hence the referrer URL
1927 // (which is the contents of the Referer header for the last download request) 1927 // (which is the contents of the Referer header for the last download request)
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 case RESUME_MODE_USER_CONTINUE: 2105 case RESUME_MODE_USER_CONTINUE:
2106 return "USER_CONTINUE"; 2106 return "USER_CONTINUE";
2107 case RESUME_MODE_USER_RESTART: 2107 case RESUME_MODE_USER_RESTART:
2108 return "USER_RESTART"; 2108 return "USER_RESTART";
2109 } 2109 }
2110 NOTREACHED() << "Unknown resume mode " << mode; 2110 NOTREACHED() << "Unknown resume mode " << mode;
2111 return "unknown"; 2111 return "unknown";
2112 } 2112 }
2113 2113
2114 } // namespace content 2114 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698