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

Unified Diff: third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.cpp

Issue 1621923002: [DevTools] Remove InspectorState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 11 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/core/inspector/v8/V8ProfilerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.cpp
index bb2d5408b738335aa16c5b69d7bd5bf534c468ab..798c8ad4b68156b18f3aaa95e078602f96a25667 100644
--- a/third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.cpp
+++ b/third_party/WebKit/Source/core/inspector/v8/V8ProfilerAgentImpl.cpp
@@ -6,7 +6,6 @@
#include "bindings/core/v8/ScriptCallStackFactory.h"
#include "bindings/core/v8/V8Binding.h"
-#include "core/inspector/InspectorState.h"
#include "core/inspector/ScriptCallStack.h"
#include "wtf/Atomics.h"
#include <v8-profiler.h>
@@ -199,7 +198,7 @@ void V8ProfilerAgentImpl::setSamplingInterval(ErrorString* error, int interval)
*error = "Cannot change sampling interval when profiling.";
return;
}
- m_state->setLong(ProfilerAgentState::samplingInterval, interval);
+ m_state->setNumber(ProfilerAgentState::samplingInterval, interval);
m_isolate->GetCpuProfiler()->SetSamplingInterval(interval);
}
@@ -214,9 +213,11 @@ void V8ProfilerAgentImpl::clearFrontend()
void V8ProfilerAgentImpl::restore()
{
m_enabled = true;
- if (long interval = m_state->getLong(ProfilerAgentState::samplingInterval, 0))
+ long interval = 0;
+ m_state->getNumber(ProfilerAgentState::samplingInterval, &interval);
+ if (interval)
m_isolate->GetCpuProfiler()->SetSamplingInterval(interval);
- if (m_state->getBoolean(ProfilerAgentState::userInitiatedProfiling)) {
+ if (m_state->booleanProperty(ProfilerAgentState::userInitiatedProfiling, false)) {
ErrorString error;
start(&error);
}

Powered by Google App Engine
This is Rietveld 408576698