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

Side by Side Diff: runtime/vm/log.cc

Issue 1439483003: - Add an OSThread structure which is the generic TLS structure for all C++ (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review Created 5 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 | « runtime/vm/isolate.cc ('k') | runtime/vm/message_handler_test.cc » ('j') | 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) 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 14 matching lines...) Expand all
25 Log::~Log() { 25 Log::~Log() {
26 // Did someone enable manual flushing and then forgot to Flush? 26 // Did someone enable manual flushing and then forgot to Flush?
27 ASSERT(cursor() == 0); 27 ASSERT(cursor() == 0);
28 } 28 }
29 29
30 30
31 Log* Log::Current() { 31 Log* Log::Current() {
32 Thread* thread = Thread::Current(); 32 Thread* thread = Thread::Current();
33 Isolate* isolate = thread->isolate(); 33 Isolate* isolate = thread->isolate();
34 if (isolate != NULL && Log::ShouldLogForIsolate(isolate)) { 34 if (isolate != NULL && Log::ShouldLogForIsolate(isolate)) {
35 return thread->log(); 35 OSThread* os_thread = thread->os_thread();
36 ASSERT(os_thread != NULL);
37 return os_thread->log();
36 } else { 38 } else {
37 return Log::NoOpLog(); 39 return Log::NoOpLog();
38 } 40 }
39 } 41 }
40 42
41 43
42 void Log::Print(const char* format, ...) { 44 void Log::Print(const char* format, ...) {
43 if (this == NoOpLog()) { 45 if (this == NoOpLog()) {
44 return; 46 return;
45 } 47 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 log_->EnableManualFlush(); 162 log_->EnableManualFlush();
161 } 163 }
162 164
163 165
164 LogBlock::~LogBlock() { 166 LogBlock::~LogBlock() {
165 log_->Flush(cursor_); 167 log_->Flush(cursor_);
166 log_->DisableManualFlush(); 168 log_->DisableManualFlush();
167 } 169 }
168 170
169 } // namespace dart 171 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/message_handler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698