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 contains the code to apply a Courgette patch. | 5 // This file contains the code to apply a Courgette patch. |
6 | 6 |
7 #include "courgette/ensemble.h" | 7 #include "courgette/ensemble.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/files/memory_mapped_file.h" | 11 #include "base/files/memory_mapped_file.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "courgette/crc.h" | 13 #include "courgette/crc.h" |
| 14 #include "courgette/patcher_x86_32.h" |
14 #include "courgette/region.h" | 15 #include "courgette/region.h" |
| 16 #include "courgette/simple_delta.h" |
15 #include "courgette/streams.h" | 17 #include "courgette/streams.h" |
16 #include "courgette/simple_delta.h" | |
17 #include "courgette/patcher_x86_32.h" | |
18 | 18 |
19 namespace courgette { | 19 namespace courgette { |
20 | 20 |
21 // EnsemblePatchApplication is all the logic and data required to apply the | 21 // EnsemblePatchApplication is all the logic and data required to apply the |
22 // multi-stage patch. | 22 // multi-stage patch. |
23 class EnsemblePatchApplication { | 23 class EnsemblePatchApplication { |
24 public: | 24 public: |
25 EnsemblePatchApplication(); | 25 EnsemblePatchApplication(); |
26 ~EnsemblePatchApplication(); | 26 ~EnsemblePatchApplication(); |
27 | 27 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 static_cast<int>(new_sink_stream.Length())); | 422 static_cast<int>(new_sink_stream.Length())); |
423 if (written == -1) | 423 if (written == -1) |
424 return C_WRITE_OPEN_ERROR; | 424 return C_WRITE_OPEN_ERROR; |
425 if (static_cast<size_t>(written) != new_sink_stream.Length()) | 425 if (static_cast<size_t>(written) != new_sink_stream.Length()) |
426 return C_WRITE_ERROR; | 426 return C_WRITE_ERROR; |
427 | 427 |
428 return C_OK; | 428 return C_OK; |
429 } | 429 } |
430 | 430 |
431 } // namespace | 431 } // namespace |
OLD | NEW |