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

Unified Diff: content/browser/download/download_manager.cc

Issue 8399001: Use a DownloadRequestHandle pointer in construction to allow mocking for tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to TOT. Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_item.cc ('k') | content/browser/download/download_request_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_manager.cc
diff --git a/content/browser/download/download_manager.cc b/content/browser/download/download_manager.cc
index 5cdf0065083262566f8ca7e91ae9278dbcc77af0..caa3804d9b8c7f69a45db8c090f6d1302e636ae6 100644
--- a/content/browser/download/download_manager.cc
+++ b/content/browser/download/download_manager.cc
@@ -294,8 +294,7 @@ void DownloadManager::RestartDownload(
if (download->prompt_user_for_save_location()) {
// We must ask the user for the place to put the download.
- DownloadRequestHandle request_handle = download->request_handle();
- TabContents* contents = request_handle.GetTabContents();
+ TabContents* contents = download->GetTabContents();
// |id_ptr| will be deleted in either FileSelected() or
// FileSelectionCancelled().
@@ -317,9 +316,9 @@ void DownloadManager::CreateDownloadItem(
DownloadCreateInfo* info, const DownloadRequestHandle& request_handle) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DownloadItem* download = new DownloadItem(this, *info,
- request_handle,
- browser_context_->IsOffTheRecord());
+ DownloadItem* download = new DownloadItem(
+ this, *info, new DownloadRequestHandle(request_handle),
+ browser_context_->IsOffTheRecord());
int32 download_id = info->download_id.local();
DCHECK(!ContainsKey(in_progress_, download_id));
@@ -916,8 +915,7 @@ void DownloadManager::OnDownloadItemAddedToPersistentStore(int32 download_id,
void DownloadManager::ShowDownloadInBrowser(DownloadItem* download) {
// The 'contents' may no longer exist if the user closed the tab before we
// get this start completion event.
- DownloadRequestHandle request_handle = download->request_handle();
- TabContents* content = request_handle.GetTabContents();
+ TabContents* content = download->GetTabContents();
// If the contents no longer exists, we ask the embedder to suggest another
// tab.
« no previous file with comments | « content/browser/download/download_item.cc ('k') | content/browser/download/download_request_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698