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

Unified Diff: src/log-utils.cc

Issue 390803002: Ensure that each profiling entry ends with a new line. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log-utils.cc
diff --git a/src/log-utils.cc b/src/log-utils.cc
index 8f012252fce9d9252eefe64c677da132de71cf9a..4149186d56968ffea07f66767d5f030394cee047 100644
--- a/src/log-utils.cc
+++ b/src/log-utils.cc
@@ -219,6 +219,10 @@ void Log::MessageBuilder::AppendStringPart(const char* str, int len) {
void Log::MessageBuilder::WriteToLogFile() {
ASSERT(pos_ <= Log::kMessageBufferSize);
+ // Assert that we do not already have a new line at the end.
+ ASSERT(pos_ == 0 || log_->message_buffer_[pos_ - 1] != '\n');
+ if (pos_ == Log::kMessageBufferSize) pos_--;
+ log_->message_buffer_[pos_++] = '\n';
const int written = log_->WriteToFile(log_->message_buffer_, pos_);
if (written != pos_) {
log_->stop();
« no previous file with comments | « src/log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698