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

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: Fixed compile error. 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
Index: content/browser/download/download_manager.cc
diff --git a/content/browser/download/download_manager.cc b/content/browser/download/download_manager.cc
index 890c9bc65c03aa361b3f18f770e408cec6abf0ff..6e9c23d47414913be696a7ef5dc816a3548557e8 100644
--- a/content/browser/download/download_manager.cc
+++ b/content/browser/download/download_manager.cc
@@ -306,8 +306,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().
@@ -329,9 +328,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;
DCHECK(!ContainsKey(in_progress_, download_id));
@@ -931,8 +930,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.

Powered by Google App Engine
This is Rietveld 408576698