| 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> |
| 11 |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "chrome/utility/safe_browsing/mac/udif.h" | 15 #include "chrome/utility/safe_browsing/mac/udif.h" |
| 15 | 16 |
| 16 namespace safe_browsing { | 17 namespace safe_browsing { |
| 17 namespace dmg { | 18 namespace dmg { |
| 18 | 19 |
| 19 class HFSIterator; | 20 class HFSIterator; |
| 20 class ReadStream; | 21 class ReadStream; |
| 21 | 22 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 37 bool Open(); | 38 bool Open(); |
| 38 | 39 |
| 39 // Advances the iterator to the next file item. Returns true on success | 40 // Advances the iterator to the next file item. Returns true on success |
| 40 // and false on end-of-iterator. | 41 // and false on end-of-iterator. |
| 41 bool Next(); | 42 bool Next(); |
| 42 | 43 |
| 43 // Returns the full path in a DMG filesystem to the current file item. | 44 // Returns the full path in a DMG filesystem to the current file item. |
| 44 base::string16 GetPath(); | 45 base::string16 GetPath(); |
| 45 | 46 |
| 46 // Returns a ReadStream for the current file item. | 47 // Returns a ReadStream for the current file item. |
| 47 scoped_ptr<ReadStream> GetReadStream(); | 48 std::unique_ptr<ReadStream> GetReadStream(); |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 UDIFParser udif_; // The UDIF parser that accesses the partitions. | 51 UDIFParser udif_; // The UDIF parser that accesses the partitions. |
| 51 ScopedVector<ReadStream> partitions_; // Streams for all the HFS partitions. | 52 ScopedVector<ReadStream> partitions_; // Streams for all the HFS partitions. |
| 52 size_t current_partition_; // The index in |partitions_| of the current one. | 53 size_t current_partition_; // The index in |partitions_| of the current one. |
| 53 scoped_ptr<HFSIterator> hfs_; // The HFSIterator for |current_partition_|. | 54 std::unique_ptr<HFSIterator> |
| 55 hfs_; // The HFSIterator for |current_partition_|. |
| 54 | 56 |
| 55 DISALLOW_COPY_AND_ASSIGN(DMGIterator); | 57 DISALLOW_COPY_AND_ASSIGN(DMGIterator); |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 } // namespace dmg | 60 } // namespace dmg |
| 59 } // namespace safe_browsing | 61 } // namespace safe_browsing |
| 60 | 62 |
| 61 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ | 63 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_ITERATOR_H_ |
| OLD | NEW |