Commit d63acd80 authored by apavlov@chromium.org's avatar apavlov@chromium.org
Browse files

Web Inspector: CSS domain sends events while it is not enabled

https://bugs.webkit.org/show_bug.cgi?id=96615

Reviewed by Yury Semikhatsky.

The CSS agent is put into and removed from the instrumenting agents set upon enable() and disable(), respectively.

Tests will be shortly landed as a part of the new pure protocol testing harness.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setFrontend):
(WebCore::InspectorCSSAgent::clearFrontend):
(WebCore::InspectorCSSAgent::reset):
(WebCore):
(WebCore::InspectorCSSAgent::resetNonPersistentData):
(WebCore::InspectorCSSAgent::enable):
(WebCore::InspectorCSSAgent::disable):
* inspector/InspectorCSSAgent.h:
(InspectorCSSAgent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a0f3221c
2012-09-13 Alexander Pavlov <apavlov@chromium.org>
Web Inspector: CSS domain sends events while it is not enabled
https://bugs.webkit.org/show_bug.cgi?id=96615
Reviewed by Yury Semikhatsky.
The CSS agent is put into and removed from the instrumenting agents set upon enable() and disable(), respectively.
Tests will be shortly landed as a part of the new pure protocol testing harness.
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setFrontend):
(WebCore::InspectorCSSAgent::clearFrontend):
(WebCore::InspectorCSSAgent::reset):
(WebCore):
(WebCore::InspectorCSSAgent::resetNonPersistentData):
(WebCore::InspectorCSSAgent::enable):
(WebCore::InspectorCSSAgent::disable):
* inspector/InspectorCSSAgent.h:
(InspectorCSSAgent):
2012-09-12 Ilya Tikhonovsky <loislo@chromium.org>
 
Web Inspector: NMI: migrate core instrumentation code to WTF namespace
......@@ -541,15 +541,13 @@ void InspectorCSSAgent::setFrontend(InspectorFrontend* frontend)
{
ASSERT(!m_frontend);
m_frontend = frontend->css();
m_instrumentingAgents->setInspectorCSSAgent(this);
}
void InspectorCSSAgent::clearFrontend()
{
ASSERT(m_frontend);
m_frontend = 0;
m_instrumentingAgents->setInspectorCSSAgent(0);
resetPseudoStates();
resetNonPersistentData();
String errorString;
stopSelectorProfilerImpl(&errorString, false);
}
......@@ -578,6 +576,11 @@ void InspectorCSSAgent::reset()
m_cssStyleSheetToInspectorStyleSheet.clear();
m_nodeToInspectorStyleSheet.clear();
m_documentToInspectorStyleSheet.clear();
resetNonPersistentData();
}
void InspectorCSSAgent::resetNonPersistentData()
{
m_namedFlowCollectionsRequested.clear();
if (m_updateRegionLayoutTask)
m_updateRegionLayoutTask->reset();
......@@ -587,10 +590,12 @@ void InspectorCSSAgent::reset()
void InspectorCSSAgent::enable(ErrorString*)
{
m_state->setBoolean(CSSAgentState::cssAgentEnabled, true);
m_instrumentingAgents->setInspectorCSSAgent(this);
}
void InspectorCSSAgent::disable(ErrorString*)
{
m_instrumentingAgents->setInspectorCSSAgent(0);
m_state->setBoolean(CSSAgentState::cssAgentEnabled, false);
}
......
......@@ -145,6 +145,7 @@ private:
typedef HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > DocumentToViaInspectorStyleSheet; // "via inspector" stylesheets
typedef HashMap<int, unsigned> NodeIdToForcedPseudoState;
void resetNonPersistentData();
InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element);
Element* elementForId(ErrorString*, int nodeId);
int documentNodeWithRequestedFlowsId(Document*);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment