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

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

Issue 354023002: DevTools: disable DOMAgent when profiler is active (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 6 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
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.h ('k') | Source/devtools/front_end/sdk/DOMModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index 8541804f0f6467bcea4ba1efcdfc9ebb8935fb92..470a9301bbd74a8bc6a4fccb115679200fe5f9ad 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -276,6 +276,8 @@ void InspectorDOMAgent::clearFrontend()
void InspectorDOMAgent::restore()
{
+ if (!enabled())
pfeldman 2014/06/27 11:35:23 restore should always be if (m_state->getBoolean(
+ return;
// Reset document to avoid early return from setDocument.
m_document = nullptr;
setDocument(m_pageAgent->mainFrame()->document());
@@ -486,7 +488,7 @@ Element* InspectorDOMAgent::assertEditableElement(ErrorString* errorString, int
return element;
}
-void InspectorDOMAgent::enable(ErrorString*)
+void InspectorDOMAgent::innerEnable()
{
if (enabled())
pfeldman 2014/06/27 11:35:23 innerEnable should not check for enabled, enable s
return;
@@ -495,6 +497,13 @@ void InspectorDOMAgent::enable(ErrorString*)
m_listener->domAgentWasEnabled();
}
+void InspectorDOMAgent::enable(ErrorString*)
+{
+ innerEnable();
+ m_document = nullptr;
+ setDocument(m_pageAgent->mainFrame()->document());
pfeldman 2014/06/27 11:35:23 This should be a part of innerEnable.
+}
+
bool InspectorDOMAgent::enabled() const
{
return m_state->getBoolean(DOMAgentState::domAgentEnabled);
@@ -513,7 +522,7 @@ void InspectorDOMAgent::disable(ErrorString*)
void InspectorDOMAgent::getDocument(ErrorString* errorString, RefPtr<TypeBuilder::DOM::Node>& root)
{
// Backward compatibility. Mark agent as enabled when it requests document.
- enable(errorString);
+ innerEnable();
if (!m_document) {
*errorString = "Document is not available";
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.h ('k') | Source/devtools/front_end/sdk/DOMModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698