| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 all_data_saved_ = true; | 193 all_data_saved_ = true; |
| 194 Init(false /* not actively downloading */); | 194 Init(false /* not actively downloading */); |
| 195 } | 195 } |
| 196 | 196 |
| 197 // Constructing for a regular download: | 197 // Constructing for a regular download: |
| 198 DownloadItemImpl::DownloadItemImpl( | 198 DownloadItemImpl::DownloadItemImpl( |
| 199 Delegate* delegate, | 199 Delegate* delegate, |
| 200 const DownloadCreateInfo& info, | 200 const DownloadCreateInfo& info, |
| 201 DownloadRequestHandleInterface* request_handle, | 201 DownloadRequestHandleInterface* request_handle, |
| 202 bool is_otr) | 202 bool is_otr) |
| 203 : state_info_(info.original_name, info.save_info.file_path, | 203 : state_info_(info.save_info.file_path, |
| 204 info.has_user_gesture, info.transition_type, | 204 info.has_user_gesture, info.transition_type, |
| 205 info.prompt_user_for_save_location), | 205 info.prompt_user_for_save_location), |
| 206 request_handle_(request_handle), | 206 request_handle_(request_handle), |
| 207 download_id_(info.download_id), | 207 download_id_(info.download_id), |
| 208 full_path_(info.path), | |
| 209 url_chain_(info.url_chain), | 208 url_chain_(info.url_chain), |
| 210 referrer_url_(info.referrer_url), | 209 referrer_url_(info.referrer_url), |
| 211 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), | 210 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), |
| 212 content_disposition_(info.content_disposition), | 211 content_disposition_(info.content_disposition), |
| 213 mime_type_(info.mime_type), | 212 mime_type_(info.mime_type), |
| 214 original_mime_type_(info.original_mime_type), | 213 original_mime_type_(info.original_mime_type), |
| 215 referrer_charset_(info.referrer_charset), | 214 referrer_charset_(info.referrer_charset), |
| 216 remote_address_(info.remote_address), | 215 remote_address_(info.remote_address), |
| 217 total_bytes_(info.total_bytes), | 216 total_bytes_(info.total_bytes), |
| 218 received_bytes_(0), | 217 received_bytes_(0), |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 std::map<const void*, ExternalData*>::iterator it = | 1000 std::map<const void*, ExternalData*>::iterator it = |
| 1002 external_data_map_.find(key); | 1001 external_data_map_.find(key); |
| 1003 | 1002 |
| 1004 if (it == external_data_map_.end()) { | 1003 if (it == external_data_map_.end()) { |
| 1005 external_data_map_[key] = data; | 1004 external_data_map_[key] = data; |
| 1006 } else if (it->second != data) { | 1005 } else if (it->second != data) { |
| 1007 delete it->second; | 1006 delete it->second; |
| 1008 it->second = data; | 1007 it->second = data; |
| 1009 } | 1008 } |
| 1010 } | 1009 } |
| OLD | NEW |