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

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

Issue 8487002: Basic tests for DownloadUrl/DownloadUrlToFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed early setting of info->path to avoid assertion. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "content/browser/download/download_file_manager.h" 5 #include "content/browser/download/download_file_manager.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
129 DCHECK(info); 129 DCHECK(info);
130 130
131 DownloadManager* manager = request_handle.GetDownloadManager(); 131 DownloadManager* manager = request_handle.GetDownloadManager();
132 if (!manager) { 132 if (!manager) {
133 request_handle.CancelRequest(); 133 request_handle.CancelRequest();
134 delete info; 134 delete info;
135 return; 135 return;
136 } 136 }
137 137
138 // TODO(phajdan.jr): fix the duplication of path info below.
139 info->path = info->save_info.file_path;
ahendrickson 2011/11/08 06:19:58 The only effect I can see of removing this line is
140
141 manager->CreateDownloadItem(info, request_handle); 138 manager->CreateDownloadItem(info, request_handle);
142 bool hash_needed = manager->delegate()->GenerateFileHash(); 139 bool hash_needed = manager->delegate()->GenerateFileHash();
143 140
144 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 141 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
145 base::Bind(&DownloadFileManager::CreateDownloadFile, this, 142 base::Bind(&DownloadFileManager::CreateDownloadFile, this,
146 info, request_handle, make_scoped_refptr(manager), 143 info, request_handle, make_scoped_refptr(manager),
147 hash_needed)); 144 hash_needed));
148 } 145 }
149 146
150 // We don't forward an update to the UI thread here, since we want to throttle 147 // We don't forward an update to the UI thread here, since we want to throttle
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 << " id = " << global_id 420 << " id = " << global_id
424 << " download_file = " << download_file->DebugString(); 421 << " download_file = " << download_file->DebugString();
425 422
426 downloads_.erase(global_id); 423 downloads_.erase(global_id);
427 424
428 delete download_file; 425 delete download_file;
429 426
430 if (downloads_.empty()) 427 if (downloads_.empty())
431 StopUpdateTimer(); 428 StopUpdateTimer();
432 } 429 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_test_observer.cc ('k') | content/browser/download/download_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698