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

Side by Side Diff: content/browser/download/download_file.h

Issue 9316004: Move common file path related methods between chrome & content to file_util. I reduced the 4 meth... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove includes Created 8 years, 10 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 virtual std::string GetHashState() = 0; 64 virtual std::string GetHashState() = 0;
65 65
66 // Cancels the download request associated with this file. 66 // Cancels the download request associated with this file.
67 virtual void CancelDownloadRequest() = 0; 67 virtual void CancelDownloadRequest() = 0;
68 68
69 virtual int Id() const = 0; 69 virtual int Id() const = 0;
70 virtual DownloadManager* GetDownloadManager() = 0; 70 virtual DownloadManager* GetDownloadManager() = 0;
71 virtual const DownloadId& GlobalId() const = 0; 71 virtual const DownloadId& GlobalId() const = 0;
72 72
73 virtual std::string DebugString() const = 0; 73 virtual std::string DebugString() const = 0;
74
75 // Appends the passed-in |number| between parenthesis to the |path| before
76 // the file extension.
77 static void AppendNumberToPath(FilePath* path, int number);
78
79 // Appends the passed-in |suffix| to the |path|.
80 static FilePath AppendSuffixToPath(const FilePath& path,
81 const FilePath::StringType& suffix);
82
83 // Attempts to find a number that can be appended to the |path| to make it
84 // unique. If |path| does not exist, 0 is returned. If it fails to find such
85 // a number, -1 is returned.
86 static int GetUniquePathNumber(const FilePath& path);
87
88 // Same as GetUniquePathNumber, except that it also checks the existence
89 // of it with the given suffix.
90 // If |path| does not exist, 0 is returned. If it fails to find such
91 // a number, -1 is returned.
92 static int GetUniquePathNumberWithSuffix(
93 const FilePath& path,
94 const FilePath::StringType& suffix);
95 }; 74 };
96 75
97 } // namespace content 76 } // namespace content
98 77
99 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ 78 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
OLDNEW
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698