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

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

Issue 10950015: Shift "commit point" for when a download will no longer accept cancels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR. Created 8 years, 3 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_file_manager.cc
diff --git a/content/browser/download/download_file_manager.cc b/content/browser/download/download_file_manager.cc
index 7bebd92ef3970f5544759752c5048d4642fe2bef..7577208cf20139e4b2942b230b6cc5bc71d5b035 100644
--- a/content/browser/download/download_file_manager.cc
+++ b/content/browser/download/download_file_manager.cc
@@ -31,43 +31,10 @@ using content::DownloadFile;
using content::DownloadId;
using content::DownloadManager;
-namespace {
-
-class DownloadFileFactoryImpl
- : public DownloadFileManager::DownloadFileFactory {
- public:
- DownloadFileFactoryImpl() {}
-
- virtual content::DownloadFile* CreateFile(
- DownloadCreateInfo* info,
- scoped_ptr<content::ByteStreamReader> stream,
- DownloadManager* download_manager,
- bool calculate_hash,
- const net::BoundNetLog& bound_net_log) OVERRIDE;
-};
-
-DownloadFile* DownloadFileFactoryImpl::CreateFile(
- DownloadCreateInfo* info,
- scoped_ptr<content::ByteStreamReader> stream,
- DownloadManager* download_manager,
- bool calculate_hash,
- const net::BoundNetLog& bound_net_log) {
- return new DownloadFileImpl(
- info, stream.Pass(), new DownloadRequestHandle(info->request_handle),
- download_manager, calculate_hash,
- scoped_ptr<content::PowerSaveBlocker>(
- new content::PowerSaveBlocker(
- content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
- "Download in progress")).Pass(),
- bound_net_log);
-}
-
-} // namespace
-
-DownloadFileManager::DownloadFileManager(DownloadFileFactory* factory)
+DownloadFileManager::DownloadFileManager(content::DownloadFileFactory* factory)
: download_file_factory_(factory) {
if (download_file_factory_ == NULL)
- download_file_factory_.reset(new DownloadFileFactoryImpl);
+ download_file_factory_.reset(new content::DownloadFileFactory);
}
DownloadFileManager::~DownloadFileManager() {
@@ -147,20 +114,9 @@ void DownloadFileManager::CompleteDownload(
<< " id = " << global_id
<< " download_file = " << download_file->DebugString();
- // Done here on Windows so that anti-virus scanners invoked by
- // the attachment service actually see the data; see
- // http://crbug.com/127999.
- // Done here for mac because we only want to do this once; see
- // http://crbug.com/13120 for details.
- // Other platforms don't currently do source annotation.
- download_file->AnnotateWithSourceInformation();
-
- download_file->Detach();
+ download_file->Detach(callback);
EraseDownload(global_id);
-
- // Notify our caller we've let it go.
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
}
void DownloadFileManager::OnDownloadManagerShutdown(DownloadManager* manager) {
« no previous file with comments | « content/browser/download/download_file_manager.h ('k') | content/browser/download/download_file_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698