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

Unified Diff: chrome/browser/component_updater/component_updater_utils.h

Issue 113533004: Clean up empty directories after install and on errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/component_updater_utils.h
diff --git a/chrome/browser/component_updater/component_updater_utils.h b/chrome/browser/component_updater/component_updater_utils.h
index f4b3fdddf0b616b60490a723b303ac7f05c90ce0..fdd949e08fbfa5744d615bf671698307b26da4a7 100644
--- a/chrome/browser/component_updater/component_updater_utils.h
+++ b/chrome/browser/component_updater/component_updater_utils.h
@@ -9,6 +9,10 @@
class GURL;
+namespace base {
+class FilePath;
+}
+
namespace net {
class URLFetcher;
class URLFetcherDelegate;
@@ -55,6 +59,11 @@ int GetFetchError(const net::URLFetcher& fetcher);
// Returns true if the |status_code| represents a server error 5xx.
bool IsHttpServerError(int status_code);
+// Deletes the file and its directory, if the directory is empty. If the
+// parent directory is not empty, the function ignores deleting the directory.
+// Returns true if the file and the empty directory are deleted.
+bool DeleteFileAndEmptyParentDirectory(const base::FilePath& filepath);
+
} // namespace component_updater
#endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698