Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: content/browser/download/download_item_impl.cc

Issue 10912183: Remove DownloadManager::GetDownloadItem in favor of GetDownload() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 314
315 void DownloadItemImpl::UpdateObservers() { 315 void DownloadItemImpl::UpdateObservers() {
316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
317 317
318 FOR_EACH_OBSERVER(Observer, observers_, OnDownloadUpdated(this)); 318 FOR_EACH_OBSERVER(Observer, observers_, OnDownloadUpdated(this));
319 } 319 }
320 320
321 void DownloadItemImpl::DangerousDownloadValidated() { 321 void DownloadItemImpl::DangerousDownloadValidated() {
322 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 322 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
323 DCHECK_EQ(IN_PROGRESS, GetState());
323 DCHECK_EQ(DANGEROUS, GetSafetyState()); 324 DCHECK_EQ(DANGEROUS, GetSafetyState());
324 325
326 if (GetState() != IN_PROGRESS)
327 return;
328
325 UMA_HISTOGRAM_ENUMERATION("Download.DangerousDownloadValidated", 329 UMA_HISTOGRAM_ENUMERATION("Download.DangerousDownloadValidated",
326 GetDangerType(), 330 GetDangerType(),
327 content::DOWNLOAD_DANGER_TYPE_MAX); 331 content::DOWNLOAD_DANGER_TYPE_MAX);
328 332
329 safety_state_ = DANGEROUS_BUT_VALIDATED; 333 safety_state_ = DANGEROUS_BUT_VALIDATED;
330 334
331 bound_net_log_.AddEvent( 335 bound_net_log_.AddEvent(
332 net::NetLog::TYPE_DOWNLOAD_ITEM_SAFETY_STATE_UPDATED, 336 net::NetLog::TYPE_DOWNLOAD_ITEM_SAFETY_STATE_UPDATED,
333 base::Bind(&download_net_logs::ItemCheckedCallback, 337 base::Bind(&download_net_logs::ItemCheckedCallback,
334 GetDangerType(), GetSafetyState())); 338 GetDangerType(), GetSafetyState()));
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 1247
1244 bound_net_log_.AddEvent( 1248 bound_net_log_.AddEvent(
1245 net::NetLog::TYPE_DOWNLOAD_ITEM_RENAMED, 1249 net::NetLog::TYPE_DOWNLOAD_ITEM_RENAMED,
1246 base::Bind(&download_net_logs::ItemRenamedCallback, 1250 base::Bind(&download_net_logs::ItemRenamedCallback,
1247 &current_path_, &new_path)); 1251 &current_path_, &new_path));
1248 } 1252 }
1249 1253
1250 1254
1251 1255
1252 1256
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698