| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/log.h" | 5 #include "vm/log.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 if (buffer_.is_empty()) { | 53 if (buffer_.is_empty()) { |
| 54 return; | 54 return; |
| 55 } | 55 } |
| 56 if (buffer_.length() <= cursor) { | 56 if (buffer_.length() <= cursor) { |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 TerminateString(); | 59 TerminateString(); |
| 60 const char* str = &buffer_[cursor]; | 60 const char* str = &buffer_[cursor]; |
| 61 ASSERT(str != NULL); | 61 ASSERT(str != NULL); |
| 62 printer_(str); | 62 printer_("%s", str); |
| 63 buffer_.TruncateTo(cursor); | 63 buffer_.TruncateTo(cursor); |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 void Log::Clear() { | 67 void Log::Clear() { |
| 68 if (this == NoOpLog()) { | 68 if (this == NoOpLog()) { |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 buffer_.TruncateTo(0); | 71 buffer_.TruncateTo(0); |
| 72 } | 72 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 | 118 |
| 119 LogBlock::LogBlock(Thread* thread) | 119 LogBlock::LogBlock(Thread* thread) |
| 120 : StackResource(thread->isolate()), | 120 : StackResource(thread->isolate()), |
| 121 log_(thread->isolate()->Log()), | 121 log_(thread->isolate()->Log()), |
| 122 cursor_(thread->isolate()->Log()->cursor()) { | 122 cursor_(thread->isolate()->Log()->cursor()) { |
| 123 CommonConstructor(); | 123 CommonConstructor(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace dart | 126 } // namespace dart |
| OLD | NEW |