Chromium Code Reviews| Index: src/profiler/sampler.h |
| diff --git a/src/profiler/sampler.h b/src/profiler/sampler.h |
| index dcd1255d7578a8c8da60dcab9cf34ce78c48aca5..eb84777ea4518eca47335ef53b6c872642e54fa0 100644 |
| --- a/src/profiler/sampler.h |
| +++ b/src/profiler/sampler.h |
| @@ -92,6 +92,11 @@ class Sampler { |
| // Whether the sampler is running (that is, consumes resources). |
| bool IsActive() const { return base::NoBarrier_Load(&active_); } |
| + // CpuProfiler collects samples by calling DoSample directly |
| + // without calling Start, to keep it work, we register it |
| + // sampler is in use by the CpuProfiler. |
|
Yang
2016/04/15 05:35:53
Comment is a bit weird. How about
"CpuProfiler col
lpy
2016/04/15 05:57:53
Done.
|
| + bool IsRegistered() const { return base::NoBarrier_Load(®istered_); } |
| + |
| void DoSample(); |
| // If true next sample must be initiated on the profiler event processor |
| // thread right after latest sample is processed. |
| @@ -119,11 +124,14 @@ class Sampler { |
| private: |
| void SetActive(bool value) { base::NoBarrier_Store(&active_, value); } |
| + void SetRegistered(bool value) { base::NoBarrier_Store(®istered_, value); } |
| + |
| Isolate* isolate_; |
| const int interval_; |
| base::Atomic32 profiling_; |
| base::Atomic32 has_processing_thread_; |
| base::Atomic32 active_; |
| + base::Atomic32 registered_; |
| PlatformData* data_; // Platform specific data. |
| // Counts stack samples taken in various VM states. |
| bool is_counting_samples_; |