| 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_UDIF_H_ | 5 #ifndef CHROME_UTILITY_SAFE_BROWSING_MAC_UDIF_H_ |
| 6 #define CHROME_UTILITY_SAFE_BROWSING_MAC_UDIF_H_ | 6 #define CHROME_UTILITY_SAFE_BROWSING_MAC_UDIF_H_ |
| 7 | 7 |
| 8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 size_t GetPartitionSize(size_t part_number); | 69 size_t GetPartitionSize(size_t part_number); |
| 70 | 70 |
| 71 // Returns a stream of the raw partition data for the given partition | 71 // Returns a stream of the raw partition data for the given partition |
| 72 // number. | 72 // number. |
| 73 std::unique_ptr<ReadStream> GetPartitionReadStream(size_t part_number); | 73 std::unique_ptr<ReadStream> GetPartitionReadStream(size_t part_number); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 // Parses the blkx plist trailer structure. | 76 // Parses the blkx plist trailer structure. |
| 77 bool ParseBlkx(); | 77 bool ParseBlkx(); |
| 78 | 78 |
| 79 // Reads the data pointed to by the block |chunk|, decompressing it as | |
| 80 // necessary, into the out-buffer |decompressed_data|. | |
| 81 bool ReadBlockChunk(const UDIFBlockChunk* chunk, | |
| 82 std::vector<uint8_t>* decompressed_data); | |
| 83 | |
| 84 ReadStream* const stream_; // The stream backing the UDIF image. Weak. | 79 ReadStream* const stream_; // The stream backing the UDIF image. Weak. |
| 85 std::vector<std::string> partition_names_; // The names of all partitions. | 80 std::vector<std::string> partition_names_; // The names of all partitions. |
| 86 ScopedVector<const UDIFBlock> blocks_; // All blocks in the UDIF image. | 81 ScopedVector<const UDIFBlock> blocks_; // All blocks in the UDIF image. |
| 87 uint16_t block_size_; // The image's block size, in bytes. | 82 uint16_t block_size_; // The image's block size, in bytes. |
| 88 | 83 |
| 89 DISALLOW_COPY_AND_ASSIGN(UDIFParser); | 84 DISALLOW_COPY_AND_ASSIGN(UDIFParser); |
| 90 }; | 85 }; |
| 91 | 86 |
| 92 } // namespace dmg | 87 } // namespace dmg |
| 93 } // namespace safe_browsing | 88 } // namespace safe_browsing |
| 94 | 89 |
| 95 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_UDIF_H_ | 90 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_UDIF_H_ |
| OLD | NEW |