| OLD | NEW |
| 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 #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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 DownloadFile* DownloadFileFactoryImpl::CreateFile( | 50 DownloadFile* DownloadFileFactoryImpl::CreateFile( |
| 51 DownloadCreateInfo* info, | 51 DownloadCreateInfo* info, |
| 52 scoped_ptr<content::ByteStreamReader> stream, | 52 scoped_ptr<content::ByteStreamReader> stream, |
| 53 const DownloadRequestHandle& request_handle, | 53 const DownloadRequestHandle& request_handle, |
| 54 DownloadManager* download_manager, | 54 DownloadManager* download_manager, |
| 55 bool calculate_hash, | 55 bool calculate_hash, |
| 56 const net::BoundNetLog& bound_net_log) { | 56 const net::BoundNetLog& bound_net_log) { |
| 57 return new DownloadFileImpl( | 57 return new DownloadFileImpl( |
| 58 info, stream.Pass(), new DownloadRequestHandle(request_handle), | 58 info, stream.Pass(), new DownloadRequestHandle(request_handle), |
| 59 download_manager, calculate_hash, | 59 download_manager, calculate_hash, |
| 60 scoped_ptr<PowerSaveBlocker>( | 60 scoped_ptr<content::PowerSaveBlocker>( |
| 61 new PowerSaveBlocker( | 61 new content::PowerSaveBlocker( |
| 62 PowerSaveBlocker::kPowerSaveBlockPreventSystemSleep)).Pass(), | 62 content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, |
| 63 "Download in progress")).Pass(), |
| 63 bound_net_log); | 64 bound_net_log); |
| 64 } | 65 } |
| 65 | 66 |
| 66 } // namespace | 67 } // namespace |
| 67 | 68 |
| 68 DownloadFileManager::DownloadFileManager(DownloadFileFactory* factory) | 69 DownloadFileManager::DownloadFileManager(DownloadFileFactory* factory) |
| 69 : download_file_factory_(factory) { | 70 : download_file_factory_(factory) { |
| 70 if (download_file_factory_ == NULL) | 71 if (download_file_factory_ == NULL) |
| 71 download_file_factory_.reset(new DownloadFileFactoryImpl); | 72 download_file_factory_.reset(new DownloadFileFactoryImpl); |
| 72 } | 73 } |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 DownloadFile* download_file = downloads_[global_id]; | 392 DownloadFile* download_file = downloads_[global_id]; |
| 392 | 393 |
| 393 VLOG(20) << " " << __FUNCTION__ << "()" | 394 VLOG(20) << " " << __FUNCTION__ << "()" |
| 394 << " id = " << global_id | 395 << " id = " << global_id |
| 395 << " download_file = " << download_file->DebugString(); | 396 << " download_file = " << download_file->DebugString(); |
| 396 | 397 |
| 397 downloads_.erase(global_id); | 398 downloads_.erase(global_id); |
| 398 | 399 |
| 399 delete download_file; | 400 delete download_file; |
| 400 } | 401 } |
| OLD | NEW |