Summary: | Web Inspector: identify layers for CSS generated content in LayerTreeAgent | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Antoine Quint <graouts> | ||||||
Component: | Web Inspector (Deprecated) | Assignee: | Antoine Quint <graouts> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | apavlov, esprehn+autocc, joepeck, keishi, loislo, ojan.autocc, pfeldman, pmuellr, timothy, vsevik, web-inspector-bugs, webkit-bug-importer, webkit.review.bot, yurys | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Antoine Quint
2013-03-06 02:54:39 PST
Created attachment 191703 [details]
Patch
Comment on attachment 191703 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=191703&action=review > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:250 > + return ""; It's better to use emptyString(). > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:268 > + String identifier = m_pseudoElementToIdMap.get(pseudoElement); > + if (identifier.isNull()) > + return; > + > + m_pseudoElementToIdMap.remove(pseudoElement); > + m_idToPseudoElement.remove(identifier); get() and remove() both do hash lookups. It would be better to find(), compare with != .end() to know if you found anything, then use remove(iterator); Created attachment 191952 [details]
Patch for landing
(In reply to comment #3) > (From update of attachment 191703 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=191703&action=review > > > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:250 > > + return ""; > > It's better to use emptyString(). Will fix in landing patch. > > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:268 > > + String identifier = m_pseudoElementToIdMap.get(pseudoElement); > > + if (identifier.isNull()) > > + return; > > + > > + m_pseudoElementToIdMap.remove(pseudoElement); > > + m_idToPseudoElement.remove(identifier); > > get() and remove() both do hash lookups. It would be better to find(), compare with != .end() to know if you found anything, then use remove(iterator); Good point. I rewrote the method as follows for landing: void InspectorLayerTreeAgent::unbindPseudoElement(PseudoElement* pseudoElement) { HashMap<PseudoElement*, String>::iterator iterator = m_pseudoElementToIdMap.find(pseudoElement); if (iterator == m_pseudoElementToIdMap.end()) return; m_idToPseudoElement.remove(iterator->value); m_pseudoElementToIdMap.remove(iterator); } Comment on attachment 191952 [details] Patch for landing Clearing flags on attachment: 191952 Committed r145057: <http://trac.webkit.org/changeset/145057> All reviewed patches have been landed. Closing bug. |