Introduce Hinted APIs to AttributeCollection.
In preparation for changing the DOM attribute APIs on Element to avoid unnecessary creation of AtomicStrings for the purpose of doing an existience check, this adds a set of "Hinted" APIs AttributeCollection that accept a hint parameter representing a weak lookup from the AtomicStringTable. WeakFind() APIs are added to AtomicStringTable to facilitate this. Knowing that no AtomicString exists for a given string contents can be used to skip a data structure search thereby avoiding all of the AtomicStringTable traversal, a potential malloc/free for a new AtomicString, and a AttributeCollection traversal. This is broken out of https://chromium-review.googlesource.com/c/chromium/src/+/2204539 which in turn is broken out of https://chromium-review.googlesource.com/c/chromium/src/+/1557854 Bug: 1083392 Change-Id: Ib996e9075704c8b68ff3cb55369adaf3bd129059 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2263472 Commit-Queue: Albert J. Wong <ajwong@chromium.org> Auto-Submit: Albert J. Wong <ajwong@chromium.org> Reviewed-by:Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#782776}
Showing
Please register or sign in to comment