OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/files/file_path.h" |
11 #include "chrome/browser/component_updater/component_unpacker.h" | 12 #include "chrome/browser/component_updater/component_unpacker.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class FilePath; | |
15 class DictionaryValue; | 15 class DictionaryValue; |
16 } // namespace base | 16 } // namespace base |
17 | 17 |
18 namespace component_updater { | 18 namespace component_updater { |
19 | 19 |
20 class ComponentInstaller; | 20 class ComponentInstaller; |
21 class ComponentPatcher; | 21 class ComponentPatcher; |
22 | 22 |
23 class DeltaUpdateOp { | 23 class DeltaUpdateOp { |
24 public: | 24 public: |
25 | 25 |
26 DeltaUpdateOp(); | 26 DeltaUpdateOp(); |
27 virtual ~DeltaUpdateOp(); | 27 virtual ~DeltaUpdateOp(); |
28 | 28 |
29 // Parses, runs, and verifies the operation, returning an error code if an | 29 // Parses, runs, and verifies the operation, returning an error code if an |
30 // error is encountered, and DELTA_OK otherwise. In case of errors, | 30 // error is encountered, and DELTA_OK otherwise. In case of errors, |
31 // extended error information can be returned in the |error| parameter. | 31 // extended error information can be returned in the |error| parameter. |
32 ComponentUnpacker::Error Run( | 32 ComponentUnpacker::Error Run(base::DictionaryValue* command_args, |
33 base::DictionaryValue* command_args, | 33 const base::FilePath& input_dir, |
34 const base::FilePath& input_dir, | 34 const base::FilePath& unpack_dir, |
35 const base::FilePath& unpack_dir, | 35 ComponentPatcher* patcher, |
36 ComponentPatcher* patcher, | 36 ComponentInstaller* installer, |
37 ComponentInstaller* installer, | 37 int* error); |
38 int* error); | |
39 | 38 |
40 protected: | 39 protected: |
41 std::string output_sha256_; | 40 std::string output_sha256_; |
42 base::FilePath output_abs_path_; | 41 base::FilePath output_abs_path_; |
43 | 42 |
44 private: | 43 private: |
45 ComponentUnpacker::Error CheckHash(); | 44 ComponentUnpacker::Error CheckHash(); |
46 | 45 |
47 // Subclasses must override DoParseArguments to parse operation-specific | 46 // Subclasses must override DoParseArguments to parse operation-specific |
48 // arguments. DoParseArguments returns DELTA_OK on success; any other code | 47 // arguments. DoParseArguments returns DELTA_OK on success; any other code |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 150 |
152 DISALLOW_COPY_AND_ASSIGN(DeltaUpdateOpPatchCourgette); | 151 DISALLOW_COPY_AND_ASSIGN(DeltaUpdateOpPatchCourgette); |
153 }; | 152 }; |
154 | 153 |
155 // Factory function to create DeltaUpdateOp instances. | 154 // Factory function to create DeltaUpdateOp instances. |
156 DeltaUpdateOp* CreateDeltaUpdateOp(base::DictionaryValue* command); | 155 DeltaUpdateOp* CreateDeltaUpdateOp(base::DictionaryValue* command); |
157 | 156 |
158 } // namespace component_updater | 157 } // namespace component_updater |
159 | 158 |
160 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ | 159 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ |
OLD | NEW |