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

Unified Diff: src/log.h

Issue 2053523003: Refactor CpuProfiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: stop profiler listener when there's no cpu profiler Created 4 years, 6 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 | « BUILD.gn ('k') | src/log.cc » ('j') | src/log.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.h
diff --git a/src/log.h b/src/log.h
index 91331f04fc068c0ad3b16149a70bc85971896a14..f690d37f26a0008eb553d6e1e5150a6631cc3cba 100644
--- a/src/log.h
+++ b/src/log.h
@@ -89,6 +89,7 @@ class JitLogger;
class PerfBasicLogger;
class LowLevelLogger;
class PerfJitLogger;
+class ProfilerListener;
class Logger : public CodeEventListener {
public:
@@ -101,8 +102,16 @@ class Logger : public CodeEventListener {
void SetCodeEventHandler(uint32_t options,
JitCodeEventHandler event_handler);
+ // Sets up ProfilerListener.
+ void SetUpProfilerListener();
+
+ // Tear down ProfilerListener if it has no observer.
alph 2016/06/19 03:05:41 no observers.
lpy 2016/06/20 17:16:55 Done.
+ void TearDownProfilerListener();
+
sampler::Sampler* sampler();
+ ProfilerListener* profiler_listener() { return profiler_listener_.get(); }
+
// Frees resources acquired in SetUp.
// When a temporary file is used for the log, returns its stream descriptor,
// leaving the file open.
@@ -332,6 +341,7 @@ class Logger : public CodeEventListener {
PerfJitLogger* perf_jit_logger_;
LowLevelLogger* ll_logger_;
JitLogger* jit_logger_;
+ std::unique_ptr<ProfilerListener> profiler_listener_;
alph 2016/06/19 03:05:41 thank you!
lpy 2016/06/20 17:16:55 \o/
List<CodeEventListener*> listeners_;
// Guards against multiple calls to TearDown() that can happen in some tests.
« no previous file with comments | « BUILD.gn ('k') | src/log.cc » ('j') | src/log.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698