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