Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: courgette/encoded_program.h

Issue 1629703002: [Courgette] Refactor: Manage AssemblyProgram and EncodedProgram with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix courgette_fuzzer in libfuzzer. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « courgette/encode_decode_unittest.cc ('k') | courgette/encoded_program.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h"
14 #include "courgette/disassembler.h" 15 #include "courgette/disassembler.h"
15 #include "courgette/label_manager.h" 16 #include "courgette/label_manager.h"
16 #include "courgette/memory_allocator.h" 17 #include "courgette/memory_allocator.h"
17 #include "courgette/types_elf.h" 18 #include "courgette/types_elf.h"
18 19
19 namespace courgette { 20 namespace courgette {
20 21
21 // Stream indexes. 22 // Stream indexes.
22 const int kStreamMisc = 0; 23 const int kStreamMisc = 0;
23 const int kStreamOps = 1; 24 const int kStreamOps = 1;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 UInt32Vector rel32_ix_; 134 UInt32Vector rel32_ix_;
134 UInt32Vector abs32_ix_; 135 UInt32Vector abs32_ix_;
135 136
136 // Table of the addresses containing abs32 relocations; computed during 137 // Table of the addresses containing abs32 relocations; computed during
137 // assembly, used to generate base relocation table. 138 // assembly, used to generate base relocation table.
138 UInt32Vector abs32_relocs_; 139 UInt32Vector abs32_relocs_;
139 140
140 DISALLOW_COPY_AND_ASSIGN(EncodedProgram); 141 DISALLOW_COPY_AND_ASSIGN(EncodedProgram);
141 }; 142 };
142 143
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.
146 Status ReadEncodedProgram(SourceStreamSet* source,
147 scoped_ptr<EncodedProgram>* output);
148
143 } // namespace courgette 149 } // namespace courgette
150
144 #endif // COURGETTE_ENCODED_PROGRAM_H_ 151 #endif // COURGETTE_ENCODED_PROGRAM_H_
OLDNEW
« no previous file with comments | « courgette/encode_decode_unittest.cc ('k') | courgette/encoded_program.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698