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_item_impl.h" | 5 #include "content/browser/download/download_item_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 if (IsComplete()) | 202 if (IsComplete()) |
203 all_data_saved_ = true; | 203 all_data_saved_ = true; |
204 Init(false /* not actively downloading */, | 204 Init(false /* not actively downloading */, |
205 download_net_logs::SRC_HISTORY_IMPORT); | 205 download_net_logs::SRC_HISTORY_IMPORT); |
206 } | 206 } |
207 | 207 |
208 // Constructing for a regular download: | 208 // Constructing for a regular download: |
209 DownloadItemImpl::DownloadItemImpl( | 209 DownloadItemImpl::DownloadItemImpl( |
210 Delegate* delegate, | 210 Delegate* delegate, |
211 const DownloadCreateInfo& info, | 211 const DownloadCreateInfo& info, |
212 DownloadRequestHandleInterface* request_handle, | 212 scoped_ptr<DownloadRequestHandleInterface> request_handle, |
213 bool is_otr, | 213 bool is_otr, |
214 const net::BoundNetLog& bound_net_log) | 214 const net::BoundNetLog& bound_net_log) |
215 : request_handle_(request_handle), | 215 : request_handle_(request_handle.Pass()), |
216 download_id_(info.download_id), | 216 download_id_(info.download_id), |
217 target_disposition_( | 217 target_disposition_( |
218 (info.prompt_user_for_save_location) ? | 218 (info.prompt_user_for_save_location) ? |
219 TARGET_DISPOSITION_PROMPT : TARGET_DISPOSITION_OVERWRITE), | 219 TARGET_DISPOSITION_PROMPT : TARGET_DISPOSITION_OVERWRITE), |
220 url_chain_(info.url_chain), | 220 url_chain_(info.url_chain), |
221 referrer_url_(info.referrer_url), | 221 referrer_url_(info.referrer_url), |
222 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), | 222 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), |
223 forced_file_path_(info.save_info.file_path), | 223 forced_file_path_(info.save_info.file_path), |
224 transition_type_(info.transition_type), | 224 transition_type_(info.transition_type), |
225 has_user_gesture_(info.has_user_gesture), | 225 has_user_gesture_(info.has_user_gesture), |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 std::map<const void*, ExternalData*>::iterator it = | 1202 std::map<const void*, ExternalData*>::iterator it = |
1203 external_data_map_.find(key); | 1203 external_data_map_.find(key); |
1204 | 1204 |
1205 if (it == external_data_map_.end()) { | 1205 if (it == external_data_map_.end()) { |
1206 external_data_map_[key] = data; | 1206 external_data_map_[key] = data; |
1207 } else if (it->second != data) { | 1207 } else if (it->second != data) { |
1208 delete it->second; | 1208 delete it->second; |
1209 it->second = data; | 1209 it->second = data; |
1210 } | 1210 } |
1211 } | 1211 } |
OLD | NEW |