| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ | 5 #ifndef COMPONENTS_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ |
| 6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ | 6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback.h" | 10 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "components/component_updater/component_unpacker.h" | 15 #include "components/component_updater/component_unpacker.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class DictionaryValue; | 18 class DictionaryValue; |
| 19 } // namespace base | 19 } // namespace base |
| 20 | 20 |
| 21 namespace component_updater { | 21 namespace component_updater { |
| 22 | 22 |
| 23 extern const char kOp[]; | 23 extern const char kOp[]; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(DeltaUpdateOpCreate); | 125 DISALLOW_COPY_AND_ASSIGN(DeltaUpdateOpCreate); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 // An interface an embedder may fulfill to enable out-of-process patching. | 128 // An interface an embedder may fulfill to enable out-of-process patching. |
| 129 class OutOfProcessPatcher | 129 class OutOfProcessPatcher |
| 130 : public base::RefCountedThreadSafe<OutOfProcessPatcher> { | 130 : public base::RefCountedThreadSafe<OutOfProcessPatcher> { |
| 131 public: | 131 public: |
| 132 virtual void Patch(const std::string& operation, | 132 virtual void Patch(const std::string& operation, |
| 133 scoped_refptr<base::SequencedTaskRunner> task_runner, | 133 scoped_refptr<base::SequencedTaskRunner> task_runner, |
| 134 base::FilePath& input_abs_path, | 134 const base::FilePath& input_abs_path, |
| 135 base::FilePath& patch_abs_path, | 135 const base::FilePath& patch_abs_path, |
| 136 base::FilePath& output_abs_path, | 136 const base::FilePath& output_abs_path, |
| 137 base::Callback<void(int result)> callback) = 0; | 137 base::Callback<void(int result)> callback) = 0; |
| 138 | 138 |
| 139 protected: | 139 protected: |
| 140 friend class base::RefCountedThreadSafe<OutOfProcessPatcher>; | 140 friend class base::RefCountedThreadSafe<OutOfProcessPatcher>; |
| 141 | 141 |
| 142 virtual ~OutOfProcessPatcher() {} | 142 virtual ~OutOfProcessPatcher() {} |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 // Both 'bsdiff' and 'courgette' operations take an existing file on disk, | 145 // Both 'bsdiff' and 'courgette' operations take an existing file on disk, |
| 146 // and a bsdiff- or Courgette-format patch file provided in the delta update | 146 // and a bsdiff- or Courgette-format patch file provided in the delta update |
| (...skipping 28 matching lines...) Expand all Loading... |
| 175 DISALLOW_COPY_AND_ASSIGN(DeltaUpdateOpPatch); | 175 DISALLOW_COPY_AND_ASSIGN(DeltaUpdateOpPatch); |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 DeltaUpdateOp* CreateDeltaUpdateOp( | 178 DeltaUpdateOp* CreateDeltaUpdateOp( |
| 179 const std::string& operation, | 179 const std::string& operation, |
| 180 scoped_refptr<OutOfProcessPatcher> out_of_process_patcher); | 180 scoped_refptr<OutOfProcessPatcher> out_of_process_patcher); |
| 181 | 181 |
| 182 } // namespace component_updater | 182 } // namespace component_updater |
| 183 | 183 |
| 184 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ | 184 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_H_ |
| OLD | NEW |