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 const net::BoundNetLog& bound_net_log) |
23 : file_(info->save_info.file_path, | 24 : file_(info->save_info.file_path, |
24 info->url(), | 25 info->url(), |
25 info->referrer_url, | 26 info->referrer_url, |
26 info->received_bytes, | 27 info->received_bytes, |
27 calculate_hash, | 28 calculate_hash, |
28 info->save_info.hash_state, | 29 info->save_info.hash_state, |
29 info->save_info.file_stream, | 30 info->save_info.file_stream, |
30 net::BoundNetLog()), | 31 bound_net_log), |
31 id_(info->download_id), | 32 id_(info->download_id), |
32 request_handle_(request_handle), | 33 request_handle_(request_handle), |
33 download_manager_(download_manager) { | 34 download_manager_(download_manager) { |
34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
35 } | 36 } |
36 | 37 |
37 DownloadFileImpl::~DownloadFileImpl() { | 38 DownloadFileImpl::~DownloadFileImpl() { |
38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
39 } | 40 } |
40 | 41 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 std::string DownloadFileImpl::DebugString() const { | 115 std::string DownloadFileImpl::DebugString() const { |
115 return base::StringPrintf("{" | 116 return base::StringPrintf("{" |
116 " id_ = " "%d" | 117 " id_ = " "%d" |
117 " request_handle = %s" | 118 " request_handle = %s" |
118 " Base File = %s" | 119 " Base File = %s" |
119 " }", | 120 " }", |
120 id_.local(), | 121 id_.local(), |
121 request_handle_->DebugString().c_str(), | 122 request_handle_->DebugString().c_str(), |
122 file_.DebugString().c_str()); | 123 file_.DebugString().c_str()); |
123 } | 124 } |
OLD | NEW |