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

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

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "net/base/net_util.h" 54 #include "net/base/net_util.h"
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 (!base::DirectoryExists(path))
65 base::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();
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 case RESUME_MODE_USER_CONTINUE: 1681 case RESUME_MODE_USER_CONTINUE:
1682 return "USER_CONTINUE"; 1682 return "USER_CONTINUE";
1683 case RESUME_MODE_USER_RESTART: 1683 case RESUME_MODE_USER_RESTART:
1684 return "USER_RESTART"; 1684 return "USER_RESTART";
1685 } 1685 }
1686 NOTREACHED() << "Unknown resume mode " << mode; 1686 NOTREACHED() << "Unknown resume mode " << mode;
1687 return "unknown"; 1687 return "unknown";
1688 } 1688 }
1689 1689
1690 } // namespace content 1690 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/file_metadata_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698