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

Unified Diff: chrome/installer/util/copy_tree_work_item.h

Issue 6538025: Temp dir cleanup:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/copy_tree_work_item.h
===================================================================
--- chrome/installer/util/copy_tree_work_item.h (revision 75264)
+++ chrome/installer/util/copy_tree_work_item.h (working copy)
@@ -6,11 +6,9 @@
#define CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_
#pragma once
-#include <windows.h>
-
-#include <string>
-
#include "base/file_path.h"
+#include "base/gtest_prod_util.h"
+#include "base/scoped_temp_dir.h"
#include "chrome/installer/util/work_item.h"
// A WorkItem subclass that recursively copies a file system hierarchy from
@@ -46,10 +44,6 @@
// Checks if the path specified is in use (and hence can not be deleted)
bool IsFileInUse(const FilePath& path);
- // Get a backup path that can keep the original files under dest_path_,
- // and set backup_path_ with the result.
- bool GetBackupPath();
-
// Source path to copy files from.
FilePath source_path_;
@@ -78,9 +72,14 @@
// existed and was in use. Needed during rollback.
bool copied_to_alternate_path_;
- // The full path in temporary directory that the original dest_path_ has
- // been moved to.
- FilePath backup_path_;
+ // The temporary directory into which the original dest_path_ has been moved.
+ ScopedTempDir backup_path_;
+
+ FRIEND_TEST_ALL_PREFIXES(CopyTreeWorkItemTest, CopyFileSameContent);
+ FRIEND_TEST_ALL_PREFIXES(CopyTreeWorkItemTest, CopyFileInUse);
+ FRIEND_TEST_ALL_PREFIXES(CopyTreeWorkItemTest, CopyFileAndCleanup);
+ FRIEND_TEST_ALL_PREFIXES(CopyTreeWorkItemTest, NewNameAndCopyTest);
+ FRIEND_TEST_ALL_PREFIXES(CopyTreeWorkItemTest, CopyFileInUseAndCleanup);
};
#endif // CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_

Powered by Google App Engine
This is Rietveld 408576698