| Index: Source/core/inspector/InspectorProfilerAgent.cpp
|
| diff --git a/Source/core/inspector/InspectorProfilerAgent.cpp b/Source/core/inspector/InspectorProfilerAgent.cpp
|
| index 4af971556144025a25650620b286b264f090eb91..d5a1b9e5ef53bdf59cb9027fa7598e4872c09fd8 100644
|
| --- a/Source/core/inspector/InspectorProfilerAgent.cpp
|
| +++ b/Source/core/inspector/InspectorProfilerAgent.cpp
|
| @@ -47,6 +47,7 @@
|
| namespace WebCore {
|
|
|
| namespace ProfilerAgentState {
|
| +static const char samplingInterval[] = "samplingInterval";
|
| static const char userInitiatedProfiling[] = "userInitiatedProfiling";
|
| static const char profilerEnabled[] = "profilerEnabled";
|
| static const char profileHeadersRequested[] = "profileHeadersRequested";
|
| @@ -134,6 +135,16 @@ bool InspectorProfilerAgent::enabled()
|
| return m_state->getBoolean(ProfilerAgentState::profilerEnabled);
|
| }
|
|
|
| +void InspectorProfilerAgent::setSamplingInterval(ErrorString* error, int interval)
|
| +{
|
| + if (m_recordingCPUProfile) {
|
| + *error = "Cannot change sampling interval when profiling.";
|
| + return;
|
| + }
|
| + m_state->setLong(ProfilerAgentState::samplingInterval, interval);
|
| + ScriptProfiler::setSamplingInterval(interval);
|
| +}
|
| +
|
| String InspectorProfilerAgent::getCurrentUserInitiatedProfileName(bool incrementProfileNumber)
|
| {
|
| if (incrementProfileNumber)
|
| @@ -212,6 +223,8 @@ void InspectorProfilerAgent::clearFrontend()
|
| void InspectorProfilerAgent::restore()
|
| {
|
| resetFrontendProfiles();
|
| + if (long interval = m_state->getLong(ProfilerAgentState::samplingInterval, interval))
|
| + ScriptProfiler::setSamplingInterval(interval);
|
| if (m_state->getBoolean(ProfilerAgentState::userInitiatedProfiling))
|
| start();
|
| }
|
|
|