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

Unified Diff: src/profiler/sampler.h

Issue 1858143003: Get rid of UnsafeCurrent in Sampler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update check-static-initializers.sh Created 4 years, 8 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 | « no previous file | src/profiler/sampler.cc » ('j') | src/profiler/sampler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/sampler.h
diff --git a/src/profiler/sampler.h b/src/profiler/sampler.h
index dcd1255d7578a8c8da60dcab9cf34ce78c48aca5..99233582c0830ecee2bd272e5cbce8b9ab75aef4 100644
--- a/src/profiler/sampler.h
+++ b/src/profiler/sampler.h
@@ -92,6 +92,10 @@ class Sampler {
// Whether the sampler is running (that is, consumes resources).
bool IsActive() const { return base::NoBarrier_Load(&active_); }
+ // A sampler can be registered when Start() doesn't get called,
+ // since CpuProfiler won't start the sampler but need to collect samples.
fmeawad 2016/04/06 20:07:56 I would rephrase this as // CpuProfiler collects
lpy 2016/04/06 20:19:58 Done.
+ bool IsRegistered() const { return base::NoBarrier_Load(&registered_); }
+
void DoSample();
// If true next sample must be initiated on the profiler event processor
// thread right after latest sample is processed.
@@ -119,11 +123,14 @@ class Sampler {
private:
void SetActive(bool value) { base::NoBarrier_Store(&active_, value); }
+ void SetRegistered(bool value) { base::NoBarrier_Store(&registered_, 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_;
« no previous file with comments | « no previous file | src/profiler/sampler.cc » ('j') | src/profiler/sampler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698