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

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

Issue 2512933002: Make ifdefs consistent in zib. (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 508
509 // FileWriterDelegate ---------------------------------------------------------- 509 // FileWriterDelegate ----------------------------------------------------------
510 510
511 FileWriterDelegate::FileWriterDelegate(base::File* file) 511 FileWriterDelegate::FileWriterDelegate(base::File* file)
512 : file_(file), 512 : file_(file),
513 file_length_(0) { 513 file_length_(0) {
514 } 514 }
515 515
516 FileWriterDelegate::~FileWriterDelegate() { 516 FileWriterDelegate::~FileWriterDelegate() {
517 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) 517 #if DCHECK_IS_ON()
518 const bool success = 518 const bool success =
satorux1 2016/11/21 01:23:06 Having a variable guarded by #ifdef looks a bit ha
Alexander Alekseev 2016/11/21 10:22:27 Done.
519 #endif 519 #endif
520 file_->SetLength(file_length_); 520 file_->SetLength(file_length_);
521 DPLOG_IF(ERROR, !success) << "Failed updating length of written file"; 521 DPLOG_IF(ERROR, !success) << "Failed updating length of written file";
522 } 522 }
523 523
524 bool FileWriterDelegate::PrepareOutput() { 524 bool FileWriterDelegate::PrepareOutput() {
525 return file_->Seek(base::File::FROM_BEGIN, 0) >= 0; 525 return file_->Seek(base::File::FROM_BEGIN, 0) >= 0;
526 } 526 }
527 527
528 bool FileWriterDelegate::WriteBytes(const char* data, int num_bytes) { 528 bool FileWriterDelegate::WriteBytes(const char* data, int num_bytes) {
529 int bytes_written = file_->WriteAtCurrentPos(data, num_bytes); 529 int bytes_written = file_->WriteAtCurrentPos(data, num_bytes);
530 if (bytes_written > 0) 530 if (bytes_written > 0)
531 file_length_ += bytes_written; 531 file_length_ += bytes_written;
532 return bytes_written == num_bytes; 532 return bytes_written == num_bytes;
533 } 533 }
534 534
535 } // namespace zip 535 } // namespace zip
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698