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

Side by Side Diff: mojo/system/raw_channel.cc

Issue 448123003: RawChannel::OnWriteCompletedNoLock(): change a DCHECK to CHECK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/system/raw_channel.h" 5 #include "mojo/system/raw_channel.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 DCHECK(!write_stopped_); 461 DCHECK(!write_stopped_);
462 DCHECK(!write_buffer_->message_queue_.empty()); 462 DCHECK(!write_buffer_->message_queue_.empty());
463 463
464 if (result) { 464 if (result) {
465 write_buffer_->platform_handles_offset_ += platform_handles_written; 465 write_buffer_->platform_handles_offset_ += platform_handles_written;
466 write_buffer_->data_offset_ += bytes_written; 466 write_buffer_->data_offset_ += bytes_written;
467 467
468 MessageInTransit* message = write_buffer_->message_queue_.front(); 468 MessageInTransit* message = write_buffer_->message_queue_.front();
469 if (write_buffer_->data_offset_ >= message->total_size()) { 469 if (write_buffer_->data_offset_ >= message->total_size()) {
470 // Complete write. 470 // Complete write.
471 DCHECK_EQ(write_buffer_->data_offset_, message->total_size()); 471 CHECK_EQ(write_buffer_->data_offset_, message->total_size());
472 write_buffer_->message_queue_.pop_front(); 472 write_buffer_->message_queue_.pop_front();
473 delete message; 473 delete message;
474 write_buffer_->platform_handles_offset_ = 0; 474 write_buffer_->platform_handles_offset_ = 0;
475 write_buffer_->data_offset_ = 0; 475 write_buffer_->data_offset_ = 0;
476 476
477 if (write_buffer_->message_queue_.empty()) 477 if (write_buffer_->message_queue_.empty())
478 return true; 478 return true;
479 } 479 }
480 480
481 // Schedule the next write. 481 // Schedule the next write.
482 IOResult io_result = ScheduleWriteNoLock(); 482 IOResult io_result = ScheduleWriteNoLock();
483 if (io_result == IO_PENDING) 483 if (io_result == IO_PENDING)
484 return true; 484 return true;
485 DCHECK_EQ(io_result, IO_FAILED); 485 DCHECK_EQ(io_result, IO_FAILED);
486 } 486 }
487 487
488 write_stopped_ = true; 488 write_stopped_ = true;
489 STLDeleteElements(&write_buffer_->message_queue_); 489 STLDeleteElements(&write_buffer_->message_queue_);
490 write_buffer_->platform_handles_offset_ = 0; 490 write_buffer_->platform_handles_offset_ = 0;
491 write_buffer_->data_offset_ = 0; 491 write_buffer_->data_offset_ = 0;
492 return false; 492 return false;
493 } 493 }
494 494
495 } // namespace system 495 } // namespace system
496 } // namespace mojo 496 } // namespace mojo
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