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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2319533004: Removed m_isSettingStyleSheetText from InspectorCSSAgent. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 return nullptr; 608 return nullptr;
609 return toCSSMediaRule(rule); 609 return toCSSMediaRule(rule);
610 } 610 }
611 611
612 InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectedFrame s* inspectedFrames, InspectorNetworkAgent* networkAgent, InspectorResourceConten tLoader* resourceContentLoader, InspectorResourceContainer* resourceContainer) 612 InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectedFrame s* inspectedFrames, InspectorNetworkAgent* networkAgent, InspectorResourceConten tLoader* resourceContentLoader, InspectorResourceContainer* resourceContainer)
613 : m_domAgent(domAgent) 613 : m_domAgent(domAgent)
614 , m_inspectedFrames(inspectedFrames) 614 , m_inspectedFrames(inspectedFrames)
615 , m_networkAgent(networkAgent) 615 , m_networkAgent(networkAgent)
616 , m_resourceContentLoader(resourceContentLoader) 616 , m_resourceContentLoader(resourceContentLoader)
617 , m_resourceContainer(resourceContainer) 617 , m_resourceContainer(resourceContainer)
618 , m_isSettingStyleSheetText(false)
619 , m_resourceContentLoaderClientId(resourceContentLoader->createClientId()) 618 , m_resourceContentLoaderClientId(resourceContentLoader->createClientId())
620 { 619 {
621 } 620 }
622 621
623 InspectorCSSAgent::~InspectorCSSAgent() 622 InspectorCSSAgent::~InspectorCSSAgent()
624 { 623 {
625 } 624 }
626 625
627 void InspectorCSSAgent::restore() 626 void InspectorCSSAgent::restore()
628 { 627 {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 } 707 }
709 708
710 void InspectorCSSAgent::fontsUpdated() 709 void InspectorCSSAgent::fontsUpdated()
711 { 710 {
712 flushPendingProtocolNotifications(); 711 flushPendingProtocolNotifications();
713 frontend()->fontsUpdated(); 712 frontend()->fontsUpdated();
714 } 713 }
715 714
716 void InspectorCSSAgent::activeStyleSheetsUpdated(Document* document) 715 void InspectorCSSAgent::activeStyleSheetsUpdated(Document* document)
717 { 716 {
718 if (m_isSettingStyleSheetText)
719 return;
720
721 m_invalidatedDocuments.add(document); 717 m_invalidatedDocuments.add(document);
722 } 718 }
723 719
724 void InspectorCSSAgent::updateActiveStyleSheets(Document* document, StyleSheetsU pdateType styleSheetsUpdateType) 720 void InspectorCSSAgent::updateActiveStyleSheets(Document* document, StyleSheetsU pdateType styleSheetsUpdateType)
725 { 721 {
726 HeapVector<Member<CSSStyleSheet>> newSheetsVector; 722 HeapVector<Member<CSSStyleSheet>> newSheetsVector;
727 InspectorCSSAgent::collectAllDocumentStyleSheets(document, newSheetsVector); 723 InspectorCSSAgent::collectAllDocumentStyleSheets(document, newSheetsVector);
728 setActiveStyleSheets(document, newSheetsVector, styleSheetsUpdateType); 724 setActiveStyleSheets(document, newSheetsVector, styleSheetsUpdateType);
729 } 725 }
730 726
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 } 1780 }
1785 1781
1786 void InspectorCSSAgent::styleSheetChanged(InspectorStyleSheetBase* styleSheet) 1782 void InspectorCSSAgent::styleSheetChanged(InspectorStyleSheetBase* styleSheet)
1787 { 1783 {
1788 if (s_frontendOperationCounter) 1784 if (s_frontendOperationCounter)
1789 return; 1785 return;
1790 flushPendingProtocolNotifications(); 1786 flushPendingProtocolNotifications();
1791 frontend()->styleSheetChanged(styleSheet->id()); 1787 frontend()->styleSheetChanged(styleSheet->id());
1792 } 1788 }
1793 1789
1794 void InspectorCSSAgent::willReparseStyleSheet()
1795 {
1796 ASSERT(!m_isSettingStyleSheetText);
1797 m_isSettingStyleSheetText = true;
1798 }
1799
1800 void InspectorCSSAgent::didReparseStyleSheet()
1801 {
1802 ASSERT(m_isSettingStyleSheetText);
1803 m_isSettingStyleSheetText = false;
1804 }
1805
1806 void InspectorCSSAgent::resetPseudoStates() 1790 void InspectorCSSAgent::resetPseudoStates()
1807 { 1791 {
1808 HeapHashSet<Member<Document>> documentsToChange; 1792 HeapHashSet<Member<Document>> documentsToChange;
1809 for (auto& state : m_nodeIdToForcedPseudoState) { 1793 for (auto& state : m_nodeIdToForcedPseudoState) {
1810 Element* element = toElement(m_domAgent->nodeForId(state.key)); 1794 Element* element = toElement(m_domAgent->nodeForId(state.key));
1811 if (element && element->ownerDocument()) 1795 if (element && element->ownerDocument())
1812 documentsToChange.add(element->ownerDocument()); 1796 documentsToChange.add(element->ownerDocument());
1813 } 1797 }
1814 1798
1815 m_nodeIdToForcedPseudoState.clear(); 1799 m_nodeIdToForcedPseudoState.clear();
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 visitor->trace(m_idToInspectorStyleSheetForInlineStyle); 2027 visitor->trace(m_idToInspectorStyleSheetForInlineStyle);
2044 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); 2028 visitor->trace(m_cssStyleSheetToInspectorStyleSheet);
2045 visitor->trace(m_documentToCSSStyleSheets); 2029 visitor->trace(m_documentToCSSStyleSheets);
2046 visitor->trace(m_invalidatedDocuments); 2030 visitor->trace(m_invalidatedDocuments);
2047 visitor->trace(m_nodeToInspectorStyleSheet); 2031 visitor->trace(m_nodeToInspectorStyleSheet);
2048 visitor->trace(m_inspectorUserAgentStyleSheet); 2032 visitor->trace(m_inspectorUserAgentStyleSheet);
2049 InspectorBaseAgent::trace(visitor); 2033 InspectorBaseAgent::trace(visitor);
2050 } 2034 }
2051 2035
2052 } // namespace blink 2036 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698