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

Side by Side Diff: chrome/installer/util/delete_tree_work_item.h

Issue 5429002: Support for checking multiple keyfiles when removing an installation package.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_DELETE_TREE_WORK_ITEM_H_ 5 #ifndef CHROME_INSTALLER_UTIL_DELETE_TREE_WORK_ITEM_H_
6 #define CHROME_INSTALLER_UTIL_DELETE_TREE_WORK_ITEM_H_ 6 #define CHROME_INSTALLER_UTIL_DELETE_TREE_WORK_ITEM_H_
7 #pragma once 7 #pragma once
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
11 #include <string> 11 #include <string>
12 #include <utility>
13 #include <vector>
12 14
13 #include "base/file_path.h" 15 #include "base/file_path.h"
14 #include "chrome/installer/util/work_item.h" 16 #include "chrome/installer/util/work_item.h"
15 17
16 // A WorkItem subclass that recursively deletes a file system hierarchy at the 18 // A WorkItem subclass that recursively deletes a file system hierarchy at the
17 // given root path. The file system hierarchy could be a single file, or a 19 // given root path. The file system hierarchy could be a single file, or a
18 // directory. 20 // directory.
19 // The file system hierarchy to be deleted can have a key file. If the key file 21 // The file system hierarchy to be deleted can have a key file. If the key file
20 // is specified, deletion will be performed only if the key file is not in use. 22 // is specified, deletion will be performed only if the key file is not in use.
21 class DeleteTreeWorkItem : public WorkItem { 23 class DeleteTreeWorkItem : public WorkItem {
22 public: 24 public:
23 virtual ~DeleteTreeWorkItem(); 25 virtual ~DeleteTreeWorkItem();
24 26
25 virtual bool Do(); 27 virtual bool Do();
26 28
27 virtual void Rollback(); 29 virtual void Rollback();
28 30
29 private: 31 private:
30 friend class WorkItem; 32 friend class WorkItem;
31 33
32 // Get a backup path that can keep root_path_ or key_path_ 34 // A list of key file paths and paths to a backup of a key file.
35 // the 'first' member of the pair has the key file path, the 'second' has
36 // the path to the backup.
37 typedef std::vector<std::pair<FilePath, FilePath> > KeyFileList;
38
39 // Get a backup path that can keep root_path_ or key_paths_
33 bool GetBackupPath(const FilePath& for_path, FilePath* backup_path); 40 bool GetBackupPath(const FilePath& for_path, FilePath* backup_path);
34 41
35 DeleteTreeWorkItem(const std::wstring& root_path, 42 DeleteTreeWorkItem(const FilePath& root_path,
36 const std::wstring& key_path); 43 const std::vector<FilePath>& key_paths);
37 44
38 // Root path to delete. 45 // Root path to delete.
39 FilePath root_path_; 46 FilePath root_path_;
40 47
41 // Path to the key file. If the key file is specified, deletion will be 48 // Contains the path to key files and their backups once Do() has been called.
42 // performed only if the key file is not in use. 49 // If key files are specified, deletion will be performed only if none of the
43 FilePath key_path_; 50 // key files are in use.
51 KeyFileList key_paths_;
44 52
45 // The full path in temporary directory that the original root_path_ has 53 // The full path in temporary directory that the original root_path_ has
46 // been moved to. 54 // been moved to.
47 FilePath backup_path_; 55 FilePath backup_path_;
48
49 // The full path in temporary directory that the original key_path_ has
50 // been moved to.
51 FilePath key_backup_path_;
52 }; 56 };
53 57
54 #endif // CHROME_INSTALLER_UTIL_DELETE_TREE_WORK_ITEM_H_ 58 #endif // CHROME_INSTALLER_UTIL_DELETE_TREE_WORK_ITEM_H_
OLDNEW
« no previous file with comments | « chrome/installer/util/chrome_frame_distribution.cc ('k') | chrome/installer/util/delete_tree_work_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698