Index: trunk/Source/core/inspector/InspectorCSSAgent.cpp |
=================================================================== |
--- trunk/Source/core/inspector/InspectorCSSAgent.cpp (revision 169387) |
+++ trunk/Source/core/inspector/InspectorCSSAgent.cpp (working copy) |
@@ -431,22 +431,11 @@ |
wasEnabled(nullptr); |
} |
-void InspectorCSSAgent::flushPendingFrontendMessages() |
-{ |
- if (!m_invalidatedDocuments.size()) |
- return; |
- HashSet<Document*> invalidatedDocuments; |
- m_invalidatedDocuments.swap(&invalidatedDocuments); |
- for (HashSet<Document*>::iterator it = invalidatedDocuments.begin(); it != invalidatedDocuments.end(); ++it) |
- updateActiveStyleSheets(*it, ExistingFrontendRefresh); |
-} |
- |
void InspectorCSSAgent::reset() |
{ |
m_idToInspectorStyleSheet.clear(); |
m_cssStyleSheetToInspectorStyleSheet.clear(); |
m_documentToCSSStyleSheets.clear(); |
- m_invalidatedDocuments.clear(); |
m_nodeToInspectorStyleSheet.clear(); |
m_documentToViaInspectorStyleSheet.clear(); |
resetNonPersistentData(); |
@@ -530,8 +519,8 @@ |
void InspectorCSSAgent::mediaQueryResultChanged() |
{ |
- flushPendingFrontendMessages(); |
- m_frontend->mediaQueryResultChanged(); |
+ if (m_frontend) |
+ m_frontend->mediaQueryResultChanged(); |
} |
void InspectorCSSAgent::willMutateRules() |
@@ -572,9 +561,7 @@ |
{ |
if (styleSheetEditInProgress()) |
return; |
- m_invalidatedDocuments.add(document); |
- if (m_creatingViaInspectorStyleSheet) |
- flushPendingFrontendMessages(); |
+ updateActiveStyleSheets(document, ExistingFrontendRefresh); |
} |
void InspectorCSSAgent::updateActiveStyleSheets(Document* document, StyleSheetsUpdateType styleSheetsUpdateType) |
@@ -641,7 +628,6 @@ |
void InspectorCSSAgent::documentDisposed(Document* document) |
{ |
- m_invalidatedDocuments.remove(document); |
setActiveStyleSheets(document, Vector<CSSStyleSheet*>(), ExistingFrontendRefresh); |
} |
@@ -910,8 +896,6 @@ |
return; |
} |
- updateActiveStyleSheets(document, ExistingFrontendRefresh); |
- |
*outStyleSheetId = inspectorStyleSheet->id(); |
} |
@@ -1332,8 +1316,8 @@ |
void InspectorCSSAgent::styleSheetChanged(InspectorStyleSheet* styleSheet) |
{ |
- flushPendingFrontendMessages(); |
- m_frontend->styleSheetChanged(styleSheet->id()); |
+ if (m_frontend) |
+ m_frontend->styleSheetChanged(styleSheet->id()); |
} |
void InspectorCSSAgent::willReparseStyleSheet() |