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

Side by Side Diff: runtime/vm/timer.h

Issue 1410643008: Get rid of deprecated methods accessing mutator_thread_ instead of current thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « runtime/vm/stack_frame.cc ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef VM_TIMER_H_ 5 #ifndef VM_TIMER_H_
6 #define VM_TIMER_H_ 6 #define VM_TIMER_H_
7 7
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // } 101 // }
102 class TimerScope : public StackResource { 102 class TimerScope : public StackResource {
103 public: 103 public:
104 TimerScope(bool flag, Timer* timer, Thread* thread = NULL) 104 TimerScope(bool flag, Timer* timer, Thread* thread = NULL)
105 : StackResource(thread), 105 : StackResource(thread),
106 nested_(false), 106 nested_(false),
107 timer_(flag ? timer : NULL) { 107 timer_(flag ? timer : NULL) {
108 Init(); 108 Init();
109 } 109 }
110 110
111 TimerScope(bool flag, Timer* timer, Isolate* isolate = NULL)
112 : StackResource(isolate),
113 nested_(false),
114 timer_(flag ? timer : NULL) {
115 Init();
116 }
117
118 void Init() { 111 void Init() {
119 if (timer_ != NULL) { 112 if (timer_ != NULL) {
120 if (!timer_->running()) { 113 if (!timer_->running()) {
121 timer_->Start(); 114 timer_->Start();
122 } else { 115 } else {
123 nested_ = true; 116 nested_ = true;
124 } 117 }
125 } 118 }
126 } 119 }
127 ~TimerScope() { 120 ~TimerScope() {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 162
170 DISALLOW_ALLOCATION(); 163 DISALLOW_ALLOCATION();
171 DISALLOW_COPY_AND_ASSIGN(PauseTimerScope); 164 DISALLOW_COPY_AND_ASSIGN(PauseTimerScope);
172 }; 165 };
173 166
174 167
175 168
176 } // namespace dart 169 } // namespace dart
177 170
178 #endif // VM_TIMER_H_ 171 #endif // VM_TIMER_H_
OLDNEW
« no previous file with comments | « runtime/vm/stack_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698