Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef TracedTask_h | |
| 6 #define TracedTask_h | |
| 7 | |
| 8 #include "platform/Task.h" | |
| 9 #include "platform/TraceLocation.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class Scheduler; | |
| 14 | |
| 15 class TracedTask { | |
| 16 public: | |
| 17 typedef Function<void()> Task; | |
| 18 | |
| 19 void run() const; | |
| 20 | |
| 21 private: | |
| 22 | |
| 23 // Constructor is private, with scheduler as a friend, to keep this | |
| 24 // class hidden to everyone apart from the scheduler. | |
|
Sami
2014/08/29 14:50:25
This is a fairly common pattern in Blink so I don'
picksi1
2014/09/01 11:06:51
Done.
| |
| 25 friend Scheduler; | |
|
Sami
2014/08/29 14:50:25
nit: People tend to write "friend class Scheduler"
picksi1
2014/09/01 11:06:51
Done.
| |
| 26 TracedTask(const Task&, const TraceLocation&, const char*, int); | |
|
Sami
2014/08/29 14:50:25
Both const char* and int should have a name here.
picksi1
2014/09/01 11:06:51
I'm keen to encapsulate the fact that a task ID en
| |
| 27 | |
| 28 unsigned long long m_FlowTraceID; | |
|
Sami
2014/08/29 14:50:25
Lower caps for members: m_flowTraceID
This should
picksi1
2014/09/01 11:06:51
Done.
| |
| 29 Task m_task; | |
| 30 TraceLocation m_location; | |
| 31 const char * m_name; | |
|
Sami
2014/08/29 14:50:25
No space before "*".
picksi1
2014/09/01 11:06:51
Done.
| |
| 32 | |
| 33 }; | |
| 34 | |
| 35 } // namespace blink | |
| 36 | |
| 37 #endif // TracedTask_h | |
| OLD | NEW |