| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 "source_dependency", | 258 "source_dependency", |
| 259 bound_net_log_.source()))); | 259 bound_net_log_.source()))); |
| 260 } | 260 } |
| 261 | 261 |
| 262 // Constructing for the "Save Page As..." feature: | 262 // Constructing for the "Save Page As..." feature: |
| 263 DownloadItemImpl::DownloadItemImpl(Delegate* delegate, | 263 DownloadItemImpl::DownloadItemImpl(Delegate* delegate, |
| 264 const FilePath& path, | 264 const FilePath& path, |
| 265 const GURL& url, | 265 const GURL& url, |
| 266 bool is_otr, | 266 bool is_otr, |
| 267 DownloadId download_id, | 267 DownloadId download_id, |
| 268 const std::string& mime_type, |
| 268 const net::BoundNetLog& bound_net_log) | 269 const net::BoundNetLog& bound_net_log) |
| 269 : request_handle_(new NullDownloadRequestHandle()), | 270 : request_handle_(new NullDownloadRequestHandle()), |
| 270 download_id_(download_id), | 271 download_id_(download_id), |
| 271 full_path_(path), | 272 full_path_(path), |
| 272 url_chain_(1, url), | 273 url_chain_(1, url), |
| 273 referrer_url_(GURL()), | 274 referrer_url_(GURL()), |
| 275 mime_type_(mime_type), |
| 276 original_mime_type_(mime_type), |
| 274 total_bytes_(0), | 277 total_bytes_(0), |
| 275 received_bytes_(0), | 278 received_bytes_(0), |
| 276 bytes_per_sec_(0), | 279 bytes_per_sec_(0), |
| 277 last_reason_(content::DOWNLOAD_INTERRUPT_REASON_NONE), | 280 last_reason_(content::DOWNLOAD_INTERRUPT_REASON_NONE), |
| 278 start_tick_(base::TimeTicks::Now()), | 281 start_tick_(base::TimeTicks::Now()), |
| 279 state_(IN_PROGRESS), | 282 state_(IN_PROGRESS), |
| 280 start_time_(base::Time::Now()), | 283 start_time_(base::Time::Now()), |
| 281 db_handle_(DownloadItem::kUninitializedHandle), | 284 db_handle_(DownloadItem::kUninitializedHandle), |
| 282 delegate_(delegate), | 285 delegate_(delegate), |
| 283 is_paused_(false), | 286 is_paused_(false), |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 std::map<const void*, ExternalData*>::iterator it = | 1133 std::map<const void*, ExternalData*>::iterator it = |
| 1131 external_data_map_.find(key); | 1134 external_data_map_.find(key); |
| 1132 | 1135 |
| 1133 if (it == external_data_map_.end()) { | 1136 if (it == external_data_map_.end()) { |
| 1134 external_data_map_[key] = data; | 1137 external_data_map_[key] = data; |
| 1135 } else if (it->second != data) { | 1138 } else if (it->second != data) { |
| 1136 delete it->second; | 1139 delete it->second; |
| 1137 it->second = data; | 1140 it->second = data; |
| 1138 } | 1141 } |
| 1139 } | 1142 } |
| OLD | NEW |