| 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 // File method ordering: Methods in this file are in the same order | 5 // File method ordering: Methods in this file are in the same order |
| 6 // as in download_item_impl.h, with the following exception: The public | 6 // as in download_item_impl.h, with the following exception: The public |
| 7 // interfaces DelayedDownloadOpened, OnDownloadTargetDetermined, and | 7 // interfaces DelayedDownloadOpened, OnDownloadTargetDetermined, and |
| 8 // OnDownloadCompleting are placed in chronological order with the other | 8 // OnDownloadCompleting are placed in chronological order with the other |
| 9 // (private) routines that together define a DownloadItem's state transitions | 9 // (private) routines that together define a DownloadItem's state transitions |
| 10 // as the download progresses. See "Download progression cascade" later in | 10 // as the download progresses. See "Download progression cascade" later in |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 void DownloadItemImpl::UpdateObservers() { | 313 void DownloadItemImpl::UpdateObservers() { |
| 314 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 314 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 315 | 315 |
| 316 FOR_EACH_OBSERVER(Observer, observers_, OnDownloadUpdated(this)); | 316 FOR_EACH_OBSERVER(Observer, observers_, OnDownloadUpdated(this)); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void DownloadItemImpl::DangerousDownloadValidated() { | 319 void DownloadItemImpl::DangerousDownloadValidated() { |
| 320 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 320 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 321 DCHECK_EQ(IN_PROGRESS, GetState()); |
| 321 DCHECK_EQ(DANGEROUS, GetSafetyState()); | 322 DCHECK_EQ(DANGEROUS, GetSafetyState()); |
| 322 | 323 |
| 324 if (GetState() != IN_PROGRESS) |
| 325 return; |
| 326 |
| 323 UMA_HISTOGRAM_ENUMERATION("Download.DangerousDownloadValidated", | 327 UMA_HISTOGRAM_ENUMERATION("Download.DangerousDownloadValidated", |
| 324 GetDangerType(), | 328 GetDangerType(), |
| 325 content::DOWNLOAD_DANGER_TYPE_MAX); | 329 content::DOWNLOAD_DANGER_TYPE_MAX); |
| 326 | 330 |
| 327 safety_state_ = DANGEROUS_BUT_VALIDATED; | 331 safety_state_ = DANGEROUS_BUT_VALIDATED; |
| 328 | 332 |
| 329 bound_net_log_.AddEvent( | 333 bound_net_log_.AddEvent( |
| 330 net::NetLog::TYPE_DOWNLOAD_ITEM_SAFETY_STATE_UPDATED, | 334 net::NetLog::TYPE_DOWNLOAD_ITEM_SAFETY_STATE_UPDATED, |
| 331 base::Bind(&download_net_logs::ItemCheckedCallback, | 335 base::Bind(&download_net_logs::ItemCheckedCallback, |
| 332 GetDangerType(), GetSafetyState())); | 336 GetDangerType(), GetSafetyState())); |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 | 1212 |
| 1209 bound_net_log_.AddEvent( | 1213 bound_net_log_.AddEvent( |
| 1210 net::NetLog::TYPE_DOWNLOAD_ITEM_RENAMED, | 1214 net::NetLog::TYPE_DOWNLOAD_ITEM_RENAMED, |
| 1211 base::Bind(&download_net_logs::ItemRenamedCallback, | 1215 base::Bind(&download_net_logs::ItemRenamedCallback, |
| 1212 ¤t_path_, &new_path)); | 1216 ¤t_path_, &new_path)); |
| 1213 } | 1217 } |
| 1214 | 1218 |
| 1215 | 1219 |
| 1216 | 1220 |
| 1217 | 1221 |
| OLD | NEW |