From c7461567cea07391d59bb42b3cef1223ec88f4f2 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Wed, 15 May 2019 22:34:15 +0800 Subject: [PATCH] inspector: mark profile type const PR-URL: https://github.com/nodejs/node/pull/27712 Reviewed-By: Colin Ihrig Reviewed-By: Yongsheng Zhang Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: James M Snell --- src/inspector_profiler.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/inspector_profiler.h b/src/inspector_profiler.h index 219405b8c7f3f4..345ef90d4e15c6 100644 --- a/src/inspector_profiler.h +++ b/src/inspector_profiler.h @@ -75,7 +75,7 @@ class V8CoverageConnection : public V8ProfilerConnection { void Start() override; void End() override; - const char* type() const override { return type_.c_str(); } + const char* type() const override { return "coverage"; } bool ending() const override { return ending_; } std::string GetDirectory() const override; @@ -85,7 +85,6 @@ class V8CoverageConnection : public V8ProfilerConnection { private: std::unique_ptr session_; bool ending_ = false; - std::string type_ = "coverage"; }; class V8CpuProfilerConnection : public V8ProfilerConnection { @@ -96,7 +95,7 @@ class V8CpuProfilerConnection : public V8ProfilerConnection { void Start() override; void End() override; - const char* type() const override { return type_.c_str(); } + const char* type() const override { return "CPU"; } bool ending() const override { return ending_; } std::string GetDirectory() const override; @@ -106,7 +105,6 @@ class V8CpuProfilerConnection : public V8ProfilerConnection { private: std::unique_ptr session_; bool ending_ = false; - std::string type_ = "CPU"; }; } // namespace profiler