OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_ |
6 #define CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_ | 6 #define CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 virtual void Rollback(); | 30 virtual void Rollback(); |
31 | 31 |
32 private: | 32 private: |
33 friend class WorkItem; | 33 friend class WorkItem; |
34 | 34 |
35 // See comments on corresponding member variables for the semantics of | 35 // See comments on corresponding member variables for the semantics of |
36 // arguments. | 36 // arguments. |
37 // Notes on temp_path: to facilitate rollback, the caller needs to supply | 37 // Notes on temp_path: to facilitate rollback, the caller needs to supply |
38 // a temporary directory to save the original files if they exist under | 38 // a temporary directory to save the original files if they exist under |
39 // dest_path. | 39 // dest_path. |
40 CopyTreeWorkItem(const std::wstring& source_path, | 40 CopyTreeWorkItem(const FilePath& source_path, |
41 const std::wstring& dest_path, | 41 const FilePath& dest_path, |
42 const std::wstring& temp_dir, | 42 const FilePath& temp_dir, |
43 CopyOverWriteOption overwrite_option, | 43 CopyOverWriteOption overwrite_option, |
44 const std::wstring& alternative_path); | 44 const FilePath& alternative_path); |
45 | 45 |
46 // Checks if the path specified is in use (and hence can not be deleted) | 46 // Checks if the path specified is in use (and hence can not be deleted) |
47 bool IsFileInUse(const FilePath& path); | 47 bool IsFileInUse(const FilePath& path); |
48 | 48 |
49 // Get a backup path that can keep the original files under dest_path_, | 49 // Get a backup path that can keep the original files under dest_path_, |
50 // and set backup_path_ with the result. | 50 // and set backup_path_ with the result. |
51 bool GetBackupPath(); | 51 bool GetBackupPath(); |
52 | 52 |
53 // Source path to copy files from. | 53 // Source path to copy files from. |
54 FilePath source_path_; | 54 FilePath source_path_; |
(...skipping 22 matching lines...) Expand all Loading... |
77 // Whether the source was copied to alternative_path_ because dest_path_ | 77 // Whether the source was copied to alternative_path_ because dest_path_ |
78 // existed and was in use. Needed during rollback. | 78 // existed and was in use. Needed during rollback. |
79 bool copied_to_alternate_path_; | 79 bool copied_to_alternate_path_; |
80 | 80 |
81 // The full path in temporary directory that the original dest_path_ has | 81 // The full path in temporary directory that the original dest_path_ has |
82 // been moved to. | 82 // been moved to. |
83 FilePath backup_path_; | 83 FilePath backup_path_; |
84 }; | 84 }; |
85 | 85 |
86 #endif // CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_ | 86 #endif // CHROME_INSTALLER_UTIL_COPY_TREE_WORK_ITEM_H_ |
OLD | NEW |