OLD | NEW |
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 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ | 4 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ |
5 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ | 5 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/callback.h" | 13 #include "base/callback.h" |
13 #include "base/files/file.h" | 14 #include "base/files/file.h" |
14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
16 #include "base/macros.h" | 17 #include "base/macros.h" |
17 #include "base/memory/scoped_ptr.h" | |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 | 20 |
21 #if defined(USE_SYSTEM_MINIZIP) | 21 #if defined(USE_SYSTEM_MINIZIP) |
22 #include <minizip/unzip.h> | 22 #include <minizip/unzip.h> |
23 #else | 23 #else |
24 #include "third_party/zlib/contrib/minizip/unzip.h" | 24 #include "third_party/zlib/contrib/minizip/unzip.h" |
25 #endif | 25 #endif |
26 | 26 |
27 namespace zip { | 27 namespace zip { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // chunk and success/failure/progress callbacks as necessary. | 238 // chunk and success/failure/progress callbacks as necessary. |
239 void ExtractChunk(base::File target_file, | 239 void ExtractChunk(base::File target_file, |
240 const SuccessCallback& success_callback, | 240 const SuccessCallback& success_callback, |
241 const FailureCallback& failure_callback, | 241 const FailureCallback& failure_callback, |
242 const ProgressCallback& progress_callback, | 242 const ProgressCallback& progress_callback, |
243 const int64_t offset); | 243 const int64_t offset); |
244 | 244 |
245 unzFile zip_file_; | 245 unzFile zip_file_; |
246 int num_entries_; | 246 int num_entries_; |
247 bool reached_end_; | 247 bool reached_end_; |
248 scoped_ptr<EntryInfo> current_entry_info_; | 248 std::unique_ptr<EntryInfo> current_entry_info_; |
249 | 249 |
250 base::WeakPtrFactory<ZipReader> weak_ptr_factory_; | 250 base::WeakPtrFactory<ZipReader> weak_ptr_factory_; |
251 | 251 |
252 DISALLOW_COPY_AND_ASSIGN(ZipReader); | 252 DISALLOW_COPY_AND_ASSIGN(ZipReader); |
253 }; | 253 }; |
254 | 254 |
255 // A writer delegate that writes to a given File. | 255 // A writer delegate that writes to a given File. |
256 class FileWriterDelegate : public WriterDelegate { | 256 class FileWriterDelegate : public WriterDelegate { |
257 public: | 257 public: |
258 explicit FileWriterDelegate(base::File* file); | 258 explicit FileWriterDelegate(base::File* file); |
(...skipping 13 matching lines...) Expand all Loading... |
272 private: | 272 private: |
273 base::File* file_; | 273 base::File* file_; |
274 int64_t file_length_; | 274 int64_t file_length_; |
275 | 275 |
276 DISALLOW_COPY_AND_ASSIGN(FileWriterDelegate); | 276 DISALLOW_COPY_AND_ASSIGN(FileWriterDelegate); |
277 }; | 277 }; |
278 | 278 |
279 } // namespace zip | 279 } // namespace zip |
280 | 280 |
281 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ | 281 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ |
OLD | NEW |