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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 is_otr_(is_otr), | 235 is_otr_(is_otr), |
236 is_temporary_(!info.save_info.file_path.empty()), | 236 is_temporary_(!info.save_info.file_path.empty()), |
237 all_data_saved_(false), | 237 all_data_saved_(false), |
238 opened_(false), | 238 opened_(false), |
239 open_enabled_(true), | 239 open_enabled_(true), |
240 delegate_delayed_complete_(false), | 240 delegate_delayed_complete_(false), |
241 bound_net_log_(bound_net_log) { | 241 bound_net_log_(bound_net_log) { |
242 delegate_->Attach(); | 242 delegate_->Attach(); |
243 Init(true /* actively downloading */, | 243 Init(true /* actively downloading */, |
244 download_net_logs::SRC_NEW_DOWNLOAD); | 244 download_net_logs::SRC_NEW_DOWNLOAD); |
| 245 |
| 246 // Link the event sources. |
| 247 bound_net_log_.AddEvent( |
| 248 net::NetLog::TYPE_DOWNLOAD_URL_REQUEST, |
| 249 make_scoped_refptr(new net::NetLogSourceParameter( |
| 250 "source_dependency", |
| 251 info.request_bound_net_log.source()))); |
| 252 |
| 253 info.request_bound_net_log.AddEvent( |
| 254 net::NetLog::TYPE_DOWNLOAD_STARTED, |
| 255 make_scoped_refptr(new net::NetLogSourceParameter( |
| 256 "source_dependency", |
| 257 bound_net_log_.source()))); |
245 } | 258 } |
246 | 259 |
247 // Constructing for the "Save Page As..." feature: | 260 // Constructing for the "Save Page As..." feature: |
248 DownloadItemImpl::DownloadItemImpl(Delegate* delegate, | 261 DownloadItemImpl::DownloadItemImpl(Delegate* delegate, |
249 const FilePath& path, | 262 const FilePath& path, |
250 const GURL& url, | 263 const GURL& url, |
251 bool is_otr, | 264 bool is_otr, |
252 DownloadId download_id, | 265 DownloadId download_id, |
253 const net::BoundNetLog& bound_net_log) | 266 const net::BoundNetLog& bound_net_log) |
254 : request_handle_(new NullDownloadRequestHandle()), | 267 : request_handle_(new NullDownloadRequestHandle()), |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 std::map<const void*, ExternalData*>::iterator it = | 1131 std::map<const void*, ExternalData*>::iterator it = |
1119 external_data_map_.find(key); | 1132 external_data_map_.find(key); |
1120 | 1133 |
1121 if (it == external_data_map_.end()) { | 1134 if (it == external_data_map_.end()) { |
1122 external_data_map_[key] = data; | 1135 external_data_map_[key] = data; |
1123 } else if (it->second != data) { | 1136 } else if (it->second != data) { |
1124 delete it->second; | 1137 delete it->second; |
1125 it->second = data; | 1138 it->second = data; |
1126 } | 1139 } |
1127 } | 1140 } |
OLD | NEW |