OLD | NEW |
---|---|
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_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ | 5 #ifndef CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ |
6 #define CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ | 6 #define CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 19 matching lines...) Expand all Loading... | |
30 // of the stream. | 30 // of the stream. |
31 explicit DMGIterator(ReadStream* stream); | 31 explicit DMGIterator(ReadStream* stream); |
32 ~DMGIterator(); | 32 ~DMGIterator(); |
33 | 33 |
34 // Opens the DMG file for iteration. This must be called before any other | 34 // Opens the DMG file for iteration. This must be called before any other |
35 // method. If this returns false, it is illegal to call any other methods | 35 // method. If this returns false, it is illegal to call any other methods |
36 // on this class. If this returns true, the iterator is advanced to an | 36 // on this class. If this returns true, the iterator is advanced to an |
37 // invalid element before the first item. | 37 // invalid element before the first item. |
38 bool Open(); | 38 bool Open(); |
39 | 39 |
40 // Returns the raw code signature file metadata. | |
Robert Sesek
2017/06/28 18:21:06
"This will be empty for DMGs that are not signed."
mortonm
2017/06/28 23:07:08
Done.
| |
41 const std::vector<uint8_t>& GetCodeSignature(); | |
42 | |
40 // Advances the iterator to the next file item. Returns true on success | 43 // Advances the iterator to the next file item. Returns true on success |
41 // and false on end-of-iterator. | 44 // and false on end-of-iterator. |
42 bool Next(); | 45 bool Next(); |
43 | 46 |
44 // Returns the full path in a DMG filesystem to the current file item. | 47 // Returns the full path in a DMG filesystem to the current file item. |
45 base::string16 GetPath(); | 48 base::string16 GetPath(); |
46 | 49 |
47 // Returns a ReadStream for the current file item. | 50 // Returns a ReadStream for the current file item. |
48 std::unique_ptr<ReadStream> GetReadStream(); | 51 std::unique_ptr<ReadStream> GetReadStream(); |
49 | 52 |
50 private: | 53 private: |
51 UDIFParser udif_; // The UDIF parser that accesses the partitions. | 54 UDIFParser udif_; // The UDIF parser that accesses the partitions. |
52 // Streams for all the HFS partitions. | 55 // Streams for all the HFS partitions. |
53 std::vector<std::unique_ptr<ReadStream>> partitions_; | 56 std::vector<std::unique_ptr<ReadStream>> partitions_; |
54 size_t current_partition_; // The index in |partitions_| of the current one. | 57 size_t current_partition_; // The index in |partitions_| of the current one. |
55 std::unique_ptr<HFSIterator> | 58 std::unique_ptr<HFSIterator> |
56 hfs_; // The HFSIterator for |current_partition_|. | 59 hfs_; // The HFSIterator for |current_partition_|. |
57 | 60 |
58 DISALLOW_COPY_AND_ASSIGN(DMGIterator); | 61 DISALLOW_COPY_AND_ASSIGN(DMGIterator); |
59 }; | 62 }; |
60 | 63 |
61 } // namespace dmg | 64 } // namespace dmg |
62 } // namespace safe_browsing | 65 } // namespace safe_browsing |
63 | 66 |
64 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ | 67 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ |
OLD | NEW |