| 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 #ifndef COURGETTE_ENCODED_PROGRAM_H_ | 5 #ifndef COURGETTE_ENCODED_PROGRAM_H_ |
| 6 #define COURGETTE_ENCODED_PROGRAM_H_ | 6 #define COURGETTE_ENCODED_PROGRAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "courgette/disassembler.h" | 15 #include "courgette/disassembler.h" |
| 16 #include "courgette/label_manager.h" | 16 #include "courgette/label_manager.h" |
| 17 #include "courgette/memory_allocator.h" | 17 #include "courgette/memory_allocator.h" |
| 18 #include "courgette/types_elf.h" | 18 #include "courgette/types_elf.h" |
| 19 | 19 |
| 20 namespace courgette { | 20 namespace courgette { |
| 21 | 21 |
| 22 // Stream indexes. | 22 // Stream indexes. |
| 23 const int kStreamMisc = 0; | 23 const int kStreamMisc = 0; |
| 24 const int kStreamOps = 1; | 24 const int kStreamOps = 1; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Table of the addresses containing abs32 relocations; computed during | 137 // Table of the addresses containing abs32 relocations; computed during |
| 138 // assembly, used to generate base relocation table. | 138 // assembly, used to generate base relocation table. |
| 139 UInt32Vector abs32_relocs_; | 139 UInt32Vector abs32_relocs_; |
| 140 | 140 |
| 141 DISALLOW_COPY_AND_ASSIGN(EncodedProgram); | 141 DISALLOW_COPY_AND_ASSIGN(EncodedProgram); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 // Deserializes program from a stream set to |*output|. Returns C_OK if | 144 // Deserializes program from a stream set to |*output|. Returns C_OK if |
| 145 // successful, otherwise assigns |*output| to null and returns an error status. | 145 // successful, otherwise assigns |*output| to null and returns an error status. |
| 146 Status ReadEncodedProgram(SourceStreamSet* source, | 146 Status ReadEncodedProgram(SourceStreamSet* source, |
| 147 scoped_ptr<EncodedProgram>* output); | 147 std::unique_ptr<EncodedProgram>* output); |
| 148 | 148 |
| 149 } // namespace courgette | 149 } // namespace courgette |
| 150 | 150 |
| 151 #endif // COURGETTE_ENCODED_PROGRAM_H_ | 151 #endif // COURGETTE_ENCODED_PROGRAM_H_ |
| OLD | NEW |