| 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_impl.h" | 5 #include "content/browser/download/download_file_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "content/browser/download/download_create_info.h" | 10 #include "content/browser/download/download_create_info.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/download_manager.h" | 12 #include "content/public/browser/download_manager.h" |
| 13 | 13 |
| 14 using content::BrowserThread; | 14 using content::BrowserThread; |
| 15 using content::DownloadId; | 15 using content::DownloadId; |
| 16 using content::DownloadManager; | 16 using content::DownloadManager; |
| 17 | 17 |
| 18 DownloadFileImpl::DownloadFileImpl( | 18 DownloadFileImpl::DownloadFileImpl( |
| 19 const DownloadCreateInfo* info, | 19 const DownloadCreateInfo* info, |
| 20 DownloadRequestHandleInterface* request_handle, | 20 DownloadRequestHandleInterface* request_handle, |
| 21 DownloadManager* download_manager, | 21 DownloadManager* download_manager, |
| 22 bool calculate_hash) | 22 bool calculate_hash) |
| 23 : file_(info->save_info.file_path, | 23 : file_(info->save_info.file_path, |
| 24 info->url(), | 24 info->url(), |
| 25 info->referrer_url, | 25 info->referrer_url, |
| 26 info->received_bytes, | 26 info->received_bytes, |
| 27 calculate_hash, | 27 calculate_hash, |
| 28 info->save_info.hash_state, | 28 info->save_info.hash_state, |
| 29 info->save_info.file_stream, | 29 info->save_info.file_stream, |
| 30 net::BoundNetLog()), | 30 info->bound_net_log), |
| 31 id_(info->download_id), | 31 id_(info->download_id), |
| 32 request_handle_(request_handle), | 32 request_handle_(request_handle), |
| 33 download_manager_(download_manager) { | 33 download_manager_(download_manager) { |
| 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 35 } | 35 } |
| 36 | 36 |
| 37 DownloadFileImpl::~DownloadFileImpl() { | 37 DownloadFileImpl::~DownloadFileImpl() { |
| 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 39 } | 39 } |
| 40 | 40 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 std::string DownloadFileImpl::DebugString() const { | 114 std::string DownloadFileImpl::DebugString() const { |
| 115 return base::StringPrintf("{" | 115 return base::StringPrintf("{" |
| 116 " id_ = " "%d" | 116 " id_ = " "%d" |
| 117 " request_handle = %s" | 117 " request_handle = %s" |
| 118 " Base File = %s" | 118 " Base File = %s" |
| 119 " }", | 119 " }", |
| 120 id_.local(), | 120 id_.local(), |
| 121 request_handle_->DebugString().c_str(), | 121 request_handle_->DebugString().c_str(), |
| 122 file_.DebugString().c_str()); | 122 file_.DebugString().c_str()); |
| 123 } | 123 } |
| OLD | NEW |