| 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 // The main idea in Courgette is to do patching *under a tranformation*. The | 5 // The main idea in Courgette is to do patching *under a tranformation*. The |
| 6 // input is transformed into a new representation, patching occurs in the new | 6 // input is transformed into a new representation, patching occurs in the new |
| 7 // repesentation, and then the tranform is reversed to get the patched data. | 7 // repesentation, and then the tranform is reversed to get the patched data. |
| 8 // | 8 // |
| 9 // The idea is applied to pieces (or 'elements') of the whole (or 'ensemble'). | 9 // The idea is applied to pieces (or 'elements') of the whole (or 'ensemble'). |
| 10 // Each of the elements has to go through the same set of steps in lock-step. | 10 // Each of the elements has to go through the same set of steps in lock-step. |
| 11 | 11 |
| 12 // This file contains the code to create the patch. | 12 // This file contains the code to create the patch. |
| 13 | 13 |
| 14 | 14 |
| 15 #include "courgette/ensemble.h" | 15 #include "courgette/ensemble.h" |
| 16 | 16 |
| 17 #include <stddef.h> | 17 #include <stddef.h> |
| 18 | 18 |
| 19 #include <limits> | 19 #include <limits> |
| 20 #include <vector> | 20 #include <vector> |
| 21 | 21 |
| 22 #include "base/logging.h" | 22 #include "base/logging.h" |
| 23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
| 24 | 24 |
| 25 #include "courgette/crc.h" | 25 #include "courgette/crc.h" |
| 26 #include "courgette/difference_estimator.h" | 26 #include "courgette/difference_estimator.h" |
| 27 #include "courgette/patch_generator_x86_32.h" |
| 28 #include "courgette/patcher_x86_32.h" |
| 27 #include "courgette/region.h" | 29 #include "courgette/region.h" |
| 28 #include "courgette/simple_delta.h" | 30 #include "courgette/simple_delta.h" |
| 29 #include "courgette/streams.h" | 31 #include "courgette/streams.h" |
| 30 #include "courgette/third_party/bsdiff.h" | 32 #include "courgette/third_party/bsdiff/bsdiff.h" |
| 31 | |
| 32 #include "courgette/patcher_x86_32.h" | |
| 33 #include "courgette/patch_generator_x86_32.h" | |
| 34 | 33 |
| 35 namespace courgette { | 34 namespace courgette { |
| 36 | 35 |
| 37 TransformationPatchGenerator::TransformationPatchGenerator( | 36 TransformationPatchGenerator::TransformationPatchGenerator( |
| 38 Element* old_element, | 37 Element* old_element, |
| 39 Element* new_element, | 38 Element* new_element, |
| 40 TransformationPatcher* patcher) | 39 TransformationPatcher* patcher) |
| 41 : old_element_(old_element), | 40 : old_element_(old_element), |
| 42 new_element_(new_element), | 41 new_element_(new_element), |
| 43 patcher_(patcher) { | 42 patcher_(patcher) { |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 return C_STREAM_ERROR; | 446 return C_STREAM_ERROR; |
| 448 } | 447 } |
| 449 | 448 |
| 450 VLOG(1) << "done GenerateEnsemblePatch " | 449 VLOG(1) << "done GenerateEnsemblePatch " |
| 451 << (base::Time::Now() - start_time).InSecondsF() << "s"; | 450 << (base::Time::Now() - start_time).InSecondsF() << "s"; |
| 452 | 451 |
| 453 return C_OK; | 452 return C_OK; |
| 454 } | 453 } |
| 455 | 454 |
| 456 } // namespace | 455 } // namespace |
| OLD | NEW |