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

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

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 as 5 // File method ordering: Methods in this file are in the same order as
6 // in download_item_impl.h, with the following exception: The public 6 // in download_item_impl.h, with the following exception: The public
7 // interface Start is placed in chronological order with the other 7 // interface Start is placed in chronological order with the other
8 // (private) routines that together define a DownloadItem's state 8 // (private) routines that together define a DownloadItem's state
9 // transitions as the download progresses. See "Download progression 9 // transitions as the download progresses. See "Download progression
10 // cascade" later in this file. 10 // cascade" later in this file.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 namespace content { 56 namespace content {
57 57
58 namespace { 58 namespace {
59 59
60 void DeleteDownloadedFile(const base::FilePath& path) { 60 void DeleteDownloadedFile(const base::FilePath& path) {
61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
62 62
63 // Make sure we only delete files. 63 // Make sure we only delete files.
64 if (!file_util::DirectoryExists(path)) 64 if (!file_util::DirectoryExists(path))
65 file_util::Delete(path, false); 65 base::Delete(path, false);
66 } 66 }
67 67
68 // Wrapper around DownloadFile::Detach and DownloadFile::Cancel that 68 // Wrapper around DownloadFile::Detach and DownloadFile::Cancel that
69 // takes ownership of the DownloadFile and hence implicitly destroys it 69 // takes ownership of the DownloadFile and hence implicitly destroys it
70 // at the end of the function. 70 // at the end of the function.
71 static base::FilePath DownloadFileDetach( 71 static base::FilePath DownloadFileDetach(
72 scoped_ptr<DownloadFile> download_file) { 72 scoped_ptr<DownloadFile> download_file) {
73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
74 base::FilePath full_path = download_file->FullPath(); 74 base::FilePath full_path = download_file->FullPath();
75 download_file->Detach(); 75 download_file->Detach();
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 case RESUME_MODE_USER_CONTINUE: 1683 case RESUME_MODE_USER_CONTINUE:
1684 return "USER_CONTINUE"; 1684 return "USER_CONTINUE";
1685 case RESUME_MODE_USER_RESTART: 1685 case RESUME_MODE_USER_RESTART:
1686 return "USER_RESTART"; 1686 return "USER_RESTART";
1687 } 1687 }
1688 NOTREACHED() << "Unknown resume mode " << mode; 1688 NOTREACHED() << "Unknown resume mode " << mode;
1689 return "unknown"; 1689 return "unknown";
1690 } 1690 }
1691 1691
1692 } // namespace content 1692 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/save_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698