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

Unified Diff: runtime/vm/timer.h

Issue 1285603004: Add Thread-based constructors to TimerScope, TimelineDurationScope. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Minor fixes. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timer.h
diff --git a/runtime/vm/timer.h b/runtime/vm/timer.h
index 6cb0a200b27724766d604ed90d4b13ac3009bf90..8f290dbec11885cac00a45d4bfe40a7705b2f3fa 100644
--- a/runtime/vm/timer.h
+++ b/runtime/vm/timer.h
@@ -136,10 +136,21 @@ class TimerList : public ValueObject {
// }
class TimerScope : public StackResource {
public:
+ TimerScope(bool flag, Timer* timer, Thread* thread = NULL)
+ : StackResource(thread),
+ nested_(false),
+ timer_(flag ? timer : NULL) {
+ Init();
+ }
+
TimerScope(bool flag, Timer* timer, Isolate* isolate = NULL)
: StackResource(isolate),
nested_(false),
timer_(flag ? timer : NULL) {
+ Init();
+ }
+
+ void Init() {
if (timer_ != NULL) {
if (!timer_->running()) {
timer_->Start();
« no previous file with comments | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698