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

Side by Side Diff: chrome/common/safe_browsing/mach_o_image_reader_mac.h

Issue 1880143002: Convert chrome/common to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CHROME_COMMON_SAFE_BROWSING_MACH_O_IMAGE_READER_MAC_H_ 5 #ifndef CHROME_COMMON_SAFE_BROWSING_MACH_O_IMAGE_READER_MAC_H_
6 #define CHROME_COMMON_SAFE_BROWSING_MACH_O_IMAGE_READER_MAC_H_ 6 #define CHROME_COMMON_SAFE_BROWSING_MACH_O_IMAGE_READER_MAC_H_
7 7
8 #include <mach-o/loader.h> 8 #include <mach-o/loader.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
11 11
12 #include <memory>
12 #include <vector> 13 #include <vector>
13 14
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/memory/scoped_ptr.h"
17 #include "base/memory/scoped_vector.h" 17 #include "base/memory/scoped_vector.h"
18 18
19 namespace safe_browsing { 19 namespace safe_browsing {
20 20
21 class ByteSlice; 21 class ByteSlice;
22 22
23 // MachOImageReader is used to extract information about a Mach-O binary image. 23 // MachOImageReader is used to extract information about a Mach-O binary image.
24 // This class supports fat and thin images. Initialize() must be called before 24 // This class supports fat and thin images. Initialize() must be called before
25 // any other methods; if it returns false, it is illegal to call any other 25 // any other methods; if it returns false, it is illegal to call any other
26 // methods on this class. 26 // methods on this class.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 uint32_t GetFileType(); 85 uint32_t GetFileType();
86 86
87 // Returns an array of all the load commands in the image. 87 // Returns an array of all the load commands in the image.
88 const std::vector<MachOImageReader::LoadCommand>& GetLoadCommands(); 88 const std::vector<MachOImageReader::LoadCommand>& GetLoadCommands();
89 89
90 // If the image has a LC_CODE_SIGNATURE command, this retreives the code 90 // If the image has a LC_CODE_SIGNATURE command, this retreives the code
91 // signature blob in the __LINKEDIT segment. 91 // signature blob in the __LINKEDIT segment.
92 bool GetCodeSignatureInfo(std::vector<uint8_t>* info); 92 bool GetCodeSignatureInfo(std::vector<uint8_t>* info);
93 93
94 private: 94 private:
95 scoped_ptr<ByteSlice> data_; 95 std::unique_ptr<ByteSlice> data_;
96 96
97 bool is_fat_; 97 bool is_fat_;
98 ScopedVector<MachOImageReader> fat_images_; 98 ScopedVector<MachOImageReader> fat_images_;
99 99
100 bool is_64_bit_; 100 bool is_64_bit_;
101 std::vector<LoadCommand> commands_; 101 std::vector<LoadCommand> commands_;
102 102
103 DISALLOW_COPY_AND_ASSIGN(MachOImageReader); 103 DISALLOW_COPY_AND_ASSIGN(MachOImageReader);
104 }; 104 };
105 105
106 } // namespace safe_browsing 106 } // namespace safe_browsing
107 107
108 #endif // CHROME_COMMON_SAFE_BROWSING_MACH_O_IMAGE_READER_MAC_H_ 108 #endif // CHROME_COMMON_SAFE_BROWSING_MACH_O_IMAGE_READER_MAC_H_
OLDNEW
« no previous file with comments | « chrome/common/safe_browsing/binary_feature_extractor_unittest.cc ('k') | chrome/common/safe_browsing/pe_image_reader_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698