WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP v0.1 - Patch for EWS testing of base changes
bug-226624-20210603214529.patch (text/plain), 2.73 KB, created by
Patrick Angle
on 2021-06-03 21:45:30 PDT
(
hide
)
Description:
WIP v0.1 - Patch for EWS testing of base changes
Filename:
MIME Type:
Creator:
Patrick Angle
Created:
2021-06-03 21:45:30 PDT
Size:
2.73 KB
patch
obsolete
>Subversion Revision: 278325 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 960fb2dfcc2e24b52528fa11f18d6695579c5514..bf9edb043ee374600b72f62cfb2e5ed5042dd4af 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2021-06-03 Patrick Angle <pangle@apple.com> >+ >+ Web Inspector: Use WeakPtr in InspectorDOMAgent for mapping nodes to IDs >+ https://bugs.webkit.org/show_bug.cgi?id=226624 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * inspector/agents/InspectorDOMAgent.cpp: >+ (WebCore::InspectorDOMAgent::bind): >+ (WebCore::InspectorDOMAgent::nodeForId): >+ * inspector/agents/InspectorDOMAgent.h: >+ > 2021-06-01 Cameron McCormack <heycam@apple.com> > > Remove duplicate "behavior for fixed" entry from scrolling state tree logging >diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >index d462efc306a299b58e78c5d94e6e8757e1734d82..8d4d10984c883619b47ae1b1bdf28a1c2997f7ca 100644 >--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >@@ -385,7 +385,7 @@ Protocol::DOM::NodeId InspectorDOMAgent::bind(Node* node, NodeToIdMap* nodesMap) > return id; > id = m_lastNodeId++; > nodesMap->set(node, id); >- m_idToNode.set(id, node); >+ m_idToNode.set(id, makeWeakPtr(node)); > m_idToNodesMap.set(id, nodesMap); > return id; > } >@@ -574,7 +574,11 @@ Node* InspectorDOMAgent::nodeForId(Protocol::DOM::NodeId id) > if (!m_idToNode.isValidKey(id)) > return nullptr; > >- return m_idToNode.get(id); >+ if (auto node = m_idToNode.get(id)) >+ return node.get(); >+ >+ m_idToNode.remove(id); >+ return nullptr; > } > > Protocol::ErrorStringOr<void> InspectorDOMAgent::requestChildNodes(Protocol::DOM::NodeId nodeId, std::optional<int>&& depth) >diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.h b/Source/WebCore/inspector/agents/InspectorDOMAgent.h >index 74a60f618092676d8bee87538c9d697f3c584304..01fff431b615410dbff8cb053932a3043bcf6c4a 100644 >--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.h >@@ -250,7 +250,7 @@ private: > NodeToIdMap m_documentNodeToIdMap; > // Owns node mappings for dangling nodes. > Vector<std::unique_ptr<NodeToIdMap>> m_danglingNodeToIdMaps; >- HashMap<Inspector::Protocol::DOM::NodeId, Node*> m_idToNode; >+ HashMap<Inspector::Protocol::DOM::NodeId, WeakPtr<Node>> m_idToNode; > HashMap<Inspector::Protocol::DOM::NodeId, NodeToIdMap*> m_idToNodesMap; > HashSet<Inspector::Protocol::DOM::NodeId> m_childrenRequested; > Inspector::Protocol::DOM::NodeId m_lastNodeId { 1 };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 226624
:
430538
|
430586
|
430643
|
430922
|
431141
|
431155
|
431174
|
431219
|
431225