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

Unified Diff: Source/core/inspector/InspectorProfilerAgent.cpp

Issue 101323012: Revert of Stop recording CPU profiles when Profiler agent is disabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | « LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorProfilerAgent.cpp
diff --git a/Source/core/inspector/InspectorProfilerAgent.cpp b/Source/core/inspector/InspectorProfilerAgent.cpp
index e63c98da79c8a9c2de13123cfa2573b0694b424c..f7083a9cbf51ce659fe6310363bdc397348f60f5 100644
--- a/Source/core/inspector/InspectorProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorProfilerAgent.cpp
@@ -157,11 +157,6 @@
void InspectorProfilerAgent::disable(ErrorString*)
{
- for (Vector<ProfileDescriptor>::const_reverse_iterator it = m_startedProfiles.rbegin(); it != m_startedProfiles.rend(); ++it)
- m_keepAliveProfile = ScriptProfiler::stop(it->m_id);
- m_startedProfiles.clear();
- stop(0, 0);
-
m_keepAliveProfile.clear();
m_instrumentingAgents->setInspectorProfilerAgent(0);
m_state->setBoolean(ProfilerAgentState::profilerEnabled, false);
@@ -190,9 +185,10 @@
void InspectorProfilerAgent::clearFrontend()
{
m_frontend = 0;
+ stop(0, 0);
+ m_injectedScriptManager->injectedScriptHost()->clearInspectedObjects();
ErrorString error;
disable(&error);
- m_injectedScriptManager->injectedScriptHost()->clearInspectedObjects();
}
void InspectorProfilerAgent::restore()
@@ -212,8 +208,8 @@
if (m_recordingCPUProfile)
return;
if (!enabled()) {
- *error = "Profiler is not enabled";
- return;
+ ErrorString error;
+ enable(&error);
}
m_recordingCPUProfile = true;
if (m_overlay)
« no previous file with comments | « LayoutTests/inspector-protocol/cpu-profiler/record-cpu-profile.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698