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

Side by Side Diff: third_party/zlib/google/zip.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
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 4
5 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ 5 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_
6 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ 6 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 12 matching lines...) Expand all
23 const FilterCallback& filter_cb); 23 const FilterCallback& filter_cb);
24 24
25 // Convenience method for callers who don't need to set up the filter callback. 25 // Convenience method for callers who don't need to set up the filter callback.
26 // If |include_hidden_files| is true, files starting with "." are included. 26 // If |include_hidden_files| is true, files starting with "." are included.
27 // Otherwise they are omitted. 27 // Otherwise they are omitted.
28 bool Zip(const base::FilePath& src_dir, const base::FilePath& dest_file, 28 bool Zip(const base::FilePath& src_dir, const base::FilePath& dest_file,
29 bool include_hidden_files); 29 bool include_hidden_files);
30 30
31 #if defined(OS_POSIX) 31 #if defined(OS_POSIX)
32 // Zips files listed in |src_relative_paths| to destination specified by file 32 // Zips files listed in |src_relative_paths| to destination specified by file
33 // descriptor |dest_fd|. The paths listed in |src_relative_paths| are relative 33 // descriptor |dest_fd|, without taking ownership of |dest_fd|. The paths listed
34 // to the |src_dir| and will be used as the file names in the created zip file. 34 // in |src_relative_paths| are relative to the |src_dir| and will be used as the
35 // All source paths must be under |src_dir| in the file system hierarchy. 35 // file names in the created zip file. All source paths must be under |src_dir|
36 // in the file system hierarchy.
36 bool ZipFiles(const base::FilePath& src_dir, 37 bool ZipFiles(const base::FilePath& src_dir,
37 const std::vector<base::FilePath>& src_relative_paths, 38 const std::vector<base::FilePath>& src_relative_paths,
38 int dest_fd); 39 int dest_fd);
39 #endif // defined(OS_POSIX) 40 #endif // defined(OS_POSIX)
40 41
41 // Unzip the contents of zip_file into dest_dir. 42 // Unzip the contents of zip_file into dest_dir.
42 bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir); 43 bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir);
43 44
44 } // namespace zip 45 } // namespace zip
45 46
46 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ 47 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_
OLDNEW
« no previous file with comments | « chrome/utility/chrome_content_utility_client.cc ('k') | third_party/zlib/google/zip_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698