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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp

Issue 1936593002: [DevTools] Remove state from v8 agent wrappers, remove unnecessary classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-everything-from-agents
Patch Set: rebased Created 4 years, 7 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
Index: third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp
index 3bb1e05c19a1dfabb642250f3a76be315c989fed..0e2a7630a73cf7d1e3a994a05149273c035a9496 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp
@@ -16,6 +16,7 @@ namespace blink {
namespace ProfilerAgentState {
static const char samplingInterval[] = "samplingInterval";
static const char userInitiatedProfiling[] = "userInitiatedProfiling";
+static const char profilerEnabled[] = "profilerEnabled";
}
namespace {
@@ -183,6 +184,7 @@ void V8ProfilerAgentImpl::enable(ErrorString*)
if (m_enabled)
return;
m_enabled = true;
+ m_state->setBoolean(ProfilerAgentState::profilerEnabled, true);
m_session->changeInstrumentationCounter(+1);
}
@@ -196,6 +198,7 @@ void V8ProfilerAgentImpl::disable(ErrorString* errorString)
m_startedProfiles.clear();
stop(nullptr, nullptr);
m_enabled = false;
+ m_state->setBoolean(ProfilerAgentState::profilerEnabled, false);
}
void V8ProfilerAgentImpl::setSamplingInterval(ErrorString* error, int interval)
@@ -219,6 +222,8 @@ void V8ProfilerAgentImpl::clearFrontend()
void V8ProfilerAgentImpl::restore()
{
ASSERT(!m_enabled);
+ if (!m_state->booleanProperty(ProfilerAgentState::profilerEnabled, false))
+ return;
m_enabled = true;
m_session->changeInstrumentationCounter(+1);
int interval = 0;

Powered by Google App Engine
This is Rietveld 408576698