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

Unified Diff: src/log.h

Issue 2053523003: Refactor CpuProfiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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') | no next file with comments »
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..303e352898a0cd76a8774be863fbe787e3b56d65 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 observers.
+ 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_;
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698