| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "third_party/zlib/google/zip_reader.h" | 5 #include "third_party/zlib/google/zip_reader.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 zip_file_ = internal::OpenHandleForUnzipping(zip_fd); | 100 zip_file_ = internal::OpenHandleForUnzipping(zip_fd); |
| 101 #endif | 101 #endif |
| 102 if (!zip_file_) { | 102 if (!zip_file_) { |
| 103 return false; | 103 return false; |
| 104 } | 104 } |
| 105 | 105 |
| 106 return OpenInternal(); | 106 return OpenInternal(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool ZipReader::OpenFromString(const std::string& data) { | 109 bool ZipReader::OpenFromString(const std::string& data) { |
| 110 zip_file_ = internal::PreprareMemoryForUnzipping(data); | 110 zip_file_ = internal::PrepareMemoryForUnzipping(data); |
| 111 if (!zip_file_) | 111 if (!zip_file_) |
| 112 return false; | 112 return false; |
| 113 return OpenInternal(); | 113 return OpenInternal(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void ZipReader::Close() { | 116 void ZipReader::Close() { |
| 117 if (zip_file_) { | 117 if (zip_file_) { |
| 118 unzClose(zip_file_); | 118 unzClose(zip_file_); |
| 119 } | 119 } |
| 120 Reset(); | 120 Reset(); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 success_callback, | 404 success_callback, |
| 405 failure_callback, | 405 failure_callback, |
| 406 progress_callback, | 406 progress_callback, |
| 407 current_progress)); | 407 current_progress)); |
| 408 | 408 |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| 412 | 412 |
| 413 } // namespace zip | 413 } // namespace zip |
| OLD | NEW |