| OLD | NEW |
| 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 // This file exposes the public interface to the mini_installer re-versioner. | 5 // This file exposes the public interface to the mini_installer re-versioner. |
| 6 | 6 |
| 7 #ifndef CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ | 7 #ifndef CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ |
| 8 #define CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ | 8 #define CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 class Version; |
| 13 |
| 14 namespace base { |
| 12 class FilePath; | 15 class FilePath; |
| 13 class Version; | 16 } |
| 14 | 17 |
| 15 namespace upgrade_test { | 18 namespace upgrade_test { |
| 16 | 19 |
| 17 enum Direction { | 20 enum Direction { |
| 18 PREVIOUS_VERSION, | 21 PREVIOUS_VERSION, |
| 19 NEXT_VERSION | 22 NEXT_VERSION |
| 20 }; | 23 }; |
| 21 | 24 |
| 22 // Generates an alternate mini_installer.exe using the one indicated by | 25 // Generates an alternate mini_installer.exe using the one indicated by |
| 23 // |original_installer_path|, giving the new one a lower or higher version than | 26 // |original_installer_path|, giving the new one a lower or higher version than |
| 24 // the original and placing it in |target_path|. Any previous file at | 27 // the original and placing it in |target_path|. Any previous file at |
| 25 // |target_path| is clobbered. Returns true on success. |original_version| and | 28 // |target_path| is clobbered. Returns true on success. |original_version| and |
| 26 // |new_version|, when non-NULL, are given the original and new version numbers | 29 // |new_version|, when non-NULL, are given the original and new version numbers |
| 27 // on success. | 30 // on success. |
| 28 bool GenerateAlternateVersion(const FilePath& original_installer_path, | 31 bool GenerateAlternateVersion(const base::FilePath& original_installer_path, |
| 29 const FilePath& target_path, | 32 const base::FilePath& target_path, |
| 30 Direction direction, | 33 Direction direction, |
| 31 std::wstring* original_version, | 34 std::wstring* original_version, |
| 32 std::wstring* new_version); | 35 std::wstring* new_version); |
| 33 | 36 |
| 34 // Given a path to a PEImage in |original_file|, copy that file to | 37 // Given a path to a PEImage in |original_file|, copy that file to |
| 35 // |target_file|, modifying the version of the copy according to |direction|. | 38 // |target_file|, modifying the version of the copy according to |direction|. |
| 36 // Any previous file at |target_file| is clobbered. Returns true on success. | 39 // Any previous file at |target_file| is clobbered. Returns true on success. |
| 37 // Note that |target_file| may still be mutated on failure. | 40 // Note that |target_file| may still be mutated on failure. |
| 38 bool GenerateAlternatePEFileVersion(const FilePath& original_file, | 41 bool GenerateAlternatePEFileVersion(const base::FilePath& original_file, |
| 39 const FilePath& target_file, | 42 const base::FilePath& target_file, |
| 40 Direction direction); | 43 Direction direction); |
| 41 | 44 |
| 42 // Given a path to a PEImage in |original_file|, copy that file to | 45 // Given a path to a PEImage in |original_file|, copy that file to |
| 43 // |target_file|, modifying the version of the copy according to |version|. | 46 // |target_file|, modifying the version of the copy according to |version|. |
| 44 // Any previous file at |target_file| is clobbered. Returns true on success. | 47 // Any previous file at |target_file| is clobbered. Returns true on success. |
| 45 // Note that |target_file| may still be mutated on failure. | 48 // Note that |target_file| may still be mutated on failure. |
| 46 bool GenerateSpecificPEFileVersion(const FilePath& original_file, | 49 bool GenerateSpecificPEFileVersion(const base::FilePath& original_file, |
| 47 const FilePath& target_file, | 50 const base::FilePath& target_file, |
| 48 const Version& version); | 51 const Version& version); |
| 49 | 52 |
| 50 } // namespace upgrade_test | 53 } // namespace upgrade_test |
| 51 | 54 |
| 52 #endif // CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ | 55 #endif // CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ |
| OLD | NEW |