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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « skia/ext/image_operations_unittest.cc ('k') | third_party/zlib/google/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 "third_party/zlib/google/zip_reader.h" 5 #include "third_party/zlib/google/zip_reader.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 if (num_bytes_read == 0) { 326 if (num_bytes_read == 0) {
327 // Reached the end of the file. 327 // Reached the end of the file.
328 break; 328 break;
329 } else if (num_bytes_read < 0) { 329 } else if (num_bytes_read < 0) {
330 // If num_bytes_read < 0, then it's a specific UNZ_* error code. 330 // If num_bytes_read < 0, then it's a specific UNZ_* error code.
331 success = false; 331 success = false;
332 break; 332 break;
333 } else if (num_bytes_read > 0) { 333 } else if (num_bytes_read > 0) {
334 // Some data is read. Write it to the output file descriptor. 334 // Some data is read. Write it to the output file descriptor.
335 if (num_bytes_read != 335 if (num_bytes_read !=
336 file_util::WriteFileDescriptor(fd, buf, num_bytes_read)) { 336 base::WriteFileDescriptor(fd, buf, num_bytes_read)) {
337 success = false; 337 success = false;
338 break; 338 break;
339 } 339 }
340 } 340 }
341 } 341 }
342 342
343 unzCloseCurrentFile(zip_file_); 343 unzCloseCurrentFile(zip_file_);
344 return success; 344 return success;
345 } 345 }
346 #endif // defined(OS_POSIX) 346 #endif // defined(OS_POSIX)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 success_callback, 405 success_callback,
406 failure_callback, 406 failure_callback,
407 progress_callback, 407 progress_callback,
408 current_progress)); 408 current_progress));
409 409
410 } 410 }
411 } 411 }
412 412
413 413
414 } // namespace zip 414 } // namespace zip
OLDNEW
« no previous file with comments | « skia/ext/image_operations_unittest.cc ('k') | third_party/zlib/google/zip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698