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

Side by Side Diff: chrome/common/zip.cc

Issue 10855002: Change the type of file_type parameter to int, as the parameter actually takes or-ed bitmasks, (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix missing comma. Created 8 years, 4 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
« no previous file with comments | « chrome/common/extensions/extension_file_util.cc ('k') | chrome/common/zip_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) 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 "chrome/common/zip.h" 5 #include "chrome/common/zip.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 zipFile zip_file = internal::OpenForZipping(dest_file.AsUTF8Unsafe(), 124 zipFile zip_file = internal::OpenForZipping(dest_file.AsUTF8Unsafe(),
125 APPEND_STATUS_CREATE); 125 APPEND_STATUS_CREATE);
126 126
127 if (!zip_file) { 127 if (!zip_file) {
128 DLOG(WARNING) << "couldn't create file " << dest_file.value(); 128 DLOG(WARNING) << "couldn't create file " << dest_file.value();
129 return false; 129 return false;
130 } 130 }
131 131
132 bool success = true; 132 bool success = true;
133 file_util::FileEnumerator file_enumerator( 133 file_util::FileEnumerator file_enumerator(src_dir, true /* recursive */,
134 src_dir, true, // recursive 134 file_util::FileEnumerator::FILES |
135 static_cast<file_util::FileEnumerator::FileType>( 135 file_util::FileEnumerator::DIRECTORIES);
136 file_util::FileEnumerator::FILES |
137 file_util::FileEnumerator::DIRECTORIES));
138 for (FilePath path = file_enumerator.Next(); !path.value().empty(); 136 for (FilePath path = file_enumerator.Next(); !path.value().empty();
139 path = file_enumerator.Next()) { 137 path = file_enumerator.Next()) {
140 if (!filter_cb.Run(path)) { 138 if (!filter_cb.Run(path)) {
141 continue; 139 continue;
142 } 140 }
143 141
144 if (!AddEntryToZip(zip_file, path, src_dir)) { 142 if (!AddEntryToZip(zip_file, path, src_dir)) {
145 success = false; 143 success = false;
146 return false; 144 return false;
147 } 145 }
(...skipping 12 matching lines...) Expand all
160 if (include_hidden_files) { 158 if (include_hidden_files) {
161 return ZipWithFilterCallback( 159 return ZipWithFilterCallback(
162 src_dir, dest_file, base::Bind(&ExcludeNoFilesFilter)); 160 src_dir, dest_file, base::Bind(&ExcludeNoFilesFilter));
163 } else { 161 } else {
164 return ZipWithFilterCallback( 162 return ZipWithFilterCallback(
165 src_dir, dest_file, base::Bind(&ExcludeHiddenFilesFilter)); 163 src_dir, dest_file, base::Bind(&ExcludeHiddenFilesFilter));
166 } 164 }
167 } 165 }
168 166
169 } // namespace zip 167 } // namespace zip
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_file_util.cc ('k') | chrome/common/zip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698