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

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

Issue 2321823002: Exclude exe files while unzipping CRXes (Closed)
Patch Set: Fix build Created 4 years, 3 months 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 23 matching lines...) Expand all
34 // descriptor |dest_fd|, without taking ownership of |dest_fd|. The paths listed 34 // descriptor |dest_fd|, without taking ownership of |dest_fd|. The paths listed
35 // in |src_relative_paths| are relative to the |src_dir| and will be used as the 35 // in |src_relative_paths| are relative to the |src_dir| and will be used as the
36 // file names in the created zip file. All source paths must be under |src_dir| 36 // file names in the created zip file. All source paths must be under |src_dir|
37 // in the file system hierarchy. 37 // in the file system hierarchy.
38 bool ZipFiles(const base::FilePath& src_dir, 38 bool ZipFiles(const base::FilePath& src_dir,
39 const std::vector<base::FilePath>& src_relative_paths, 39 const std::vector<base::FilePath>& src_relative_paths,
40 int dest_fd); 40 int dest_fd);
41 #endif // defined(OS_POSIX) 41 #endif // defined(OS_POSIX)
42 42
43 // Unzip the contents of zip_file into dest_dir. 43 // Unzip the contents of zip_file into dest_dir.
44 // For each file in zip_file, include it only if the callback |filter_cb|
45 // returns true. Otherwise omit it.
46 typedef base::Callback<bool(const base::FilePath&)> FilterCallback;
Devlin 2016/09/08 21:10:16 prefer using syntax
meacer 2016/09/08 22:40:11 Actually, this is typedeffed above so removed the
47 bool UnzipWithFilterCallback(const base::FilePath& zip_file,
48 const base::FilePath& dest_dir,
49 const FilterCallback& filter_cb);
50
51 // Unzip the contents of zip_file into dest_dir.
44 bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir); 52 bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir);
45 53
46 } // namespace zip 54 } // namespace zip
47 55
48 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ 56 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698