Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: third_party/zlib/google/zip_reader.h

Issue 683913009: Eliminate resource leaks from zip::ZipFiles and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/zlib/google/zip_internal.cc ('k') | third_party/zlib/google/zip_reader_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 DISALLOW_COPY_AND_ASSIGN(EntryInfo); 95 DISALLOW_COPY_AND_ASSIGN(EntryInfo);
96 }; 96 };
97 97
98 ZipReader(); 98 ZipReader();
99 ~ZipReader(); 99 ~ZipReader();
100 100
101 // Opens the zip file specified by |zip_file_path|. Returns true on 101 // Opens the zip file specified by |zip_file_path|. Returns true on
102 // success. 102 // success.
103 bool Open(const base::FilePath& zip_file_path); 103 bool Open(const base::FilePath& zip_file_path);
104 104
105 // Opens the zip file referred to by the platform file |zip_fd|. 105 // Opens the zip file referred to by the platform file |zip_fd|, without
106 // Returns true on success. 106 // taking ownership of |zip_fd|. Returns true on success.
107 bool OpenFromPlatformFile(base::PlatformFile zip_fd); 107 bool OpenFromPlatformFile(base::PlatformFile zip_fd);
108 108
109 // Opens the zip data stored in |data|. This class uses a weak reference to 109 // Opens the zip data stored in |data|. This class uses a weak reference to
110 // the given sring while extracting files, i.e. the caller should keep the 110 // the given sring while extracting files, i.e. the caller should keep the
111 // string until it finishes extracting files. 111 // string until it finishes extracting files.
112 bool OpenFromString(const std::string& data); 112 bool OpenFromString(const std::string& data);
113 113
114 // Closes the currently opened zip file. This function is called in the 114 // Closes the currently opened zip file. This function is called in the
115 // destructor of the class, so you usually don't need to call this. 115 // destructor of the class, so you usually don't need to call this.
116 void Close(); 116 void Close();
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 scoped_ptr<EntryInfo> current_entry_info_; 228 scoped_ptr<EntryInfo> current_entry_info_;
229 229
230 base::WeakPtrFactory<ZipReader> weak_ptr_factory_; 230 base::WeakPtrFactory<ZipReader> weak_ptr_factory_;
231 231
232 DISALLOW_COPY_AND_ASSIGN(ZipReader); 232 DISALLOW_COPY_AND_ASSIGN(ZipReader);
233 }; 233 };
234 234
235 } // namespace zip 235 } // namespace zip
236 236
237 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ 237 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_
OLDNEW
« no previous file with comments | « third_party/zlib/google/zip_internal.cc ('k') | third_party/zlib/google/zip_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698