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

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

Issue 7749013: Made the cancel from CancelDownloadOnRename go through the full cancel path, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Got rid of unnecessary local variable. Created 9 years, 4 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) 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_file_manager.h" 5 #include "content/browser/download/download_file_manager.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // Without a download manager, we can't cancel the request normally, so we 357 // Without a download manager, we can't cancel the request normally, so we
358 // need to do it here. The normal path will also update the download 358 // need to do it here. The normal path will also update the download
359 // history before cancelling the request. 359 // history before cancelling the request.
360 download_file->CancelDownloadRequest(); 360 download_file->CancelDownloadRequest();
361 return; 361 return;
362 } 362 }
363 363
364 BrowserThread::PostTask( 364 BrowserThread::PostTask(
365 BrowserThread::UI, FROM_HERE, 365 BrowserThread::UI, FROM_HERE,
366 NewRunnableMethod(download_manager, 366 NewRunnableMethod(download_manager,
367 &DownloadManager::DownloadCancelled, id)); 367 &DownloadManager::CancelDownload, id));
368 } 368 }
369 369
370 void DownloadFileManager::EraseDownload(int id) { 370 void DownloadFileManager::EraseDownload(int id) {
371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
372 372
373 if (!ContainsKey(downloads_, id)) 373 if (!ContainsKey(downloads_, id))
374 return; 374 return;
375 375
376 DownloadFile* download_file = downloads_[id]; 376 DownloadFile* download_file = downloads_[id];
377 377
378 VLOG(20) << " " << __FUNCTION__ << "()" 378 VLOG(20) << " " << __FUNCTION__ << "()"
379 << " id = " << id 379 << " id = " << id
380 << " download_file = " << download_file->DebugString(); 380 << " download_file = " << download_file->DebugString();
381 381
382 downloads_.erase(id); 382 downloads_.erase(id);
383 383
384 delete download_file; 384 delete download_file;
385 385
386 if (downloads_.empty()) 386 if (downloads_.empty())
387 StopUpdateTimer(); 387 StopUpdateTimer();
388 } 388 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | content/browser/download/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698