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

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

Issue 1885933002: Ensure that DLOG(FATAL) also asserts in release-with-asserts builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment with installer fix Created 4 years, 8 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 | « ppapi/utility/completion_callback_factory_thread_traits.h ('k') | 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 510 }
511 511
512 // FileWriterDelegate ---------------------------------------------------------- 512 // FileWriterDelegate ----------------------------------------------------------
513 513
514 FileWriterDelegate::FileWriterDelegate(base::File* file) 514 FileWriterDelegate::FileWriterDelegate(base::File* file)
515 : file_(file), 515 : file_(file),
516 file_length_(0) { 516 file_length_(0) {
517 } 517 }
518 518
519 FileWriterDelegate::~FileWriterDelegate() { 519 FileWriterDelegate::~FileWriterDelegate() {
520 #if !defined(NDEBUG) 520 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
521 const bool success = 521 const bool success =
522 #endif 522 #endif
523 file_->SetLength(file_length_); 523 file_->SetLength(file_length_);
524 DPLOG_IF(ERROR, !success) << "Failed updating length of written file"; 524 DPLOG_IF(ERROR, !success) << "Failed updating length of written file";
525 } 525 }
526 526
527 bool FileWriterDelegate::PrepareOutput() { 527 bool FileWriterDelegate::PrepareOutput() {
528 return file_->Seek(base::File::FROM_BEGIN, 0) >= 0; 528 return file_->Seek(base::File::FROM_BEGIN, 0) >= 0;
529 } 529 }
530 530
531 bool FileWriterDelegate::WriteBytes(const char* data, int num_bytes) { 531 bool FileWriterDelegate::WriteBytes(const char* data, int num_bytes) {
532 int bytes_written = file_->WriteAtCurrentPos(data, num_bytes); 532 int bytes_written = file_->WriteAtCurrentPos(data, num_bytes);
533 if (bytes_written > 0) 533 if (bytes_written > 0)
534 file_length_ += bytes_written; 534 file_length_ += bytes_written;
535 return bytes_written == num_bytes; 535 return bytes_written == num_bytes;
536 } 536 }
537 537
538 } // namespace zip 538 } // namespace zip
OLDNEW
« no previous file with comments | « ppapi/utility/completion_callback_factory_thread_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698