[Webkit-unassigned] [Bug 141558] [GTK] GObject DOM bindings object are cached forever

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 17 03:13:10 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=141558

Zan Dobersek <zan at falconsigh.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #246665|review+                     |review?
              Flags|                            |

--- Comment #6 from Zan Dobersek <zan at falconsigh.net> ---
Comment on attachment 246665
  --> https://bugs.webkit.org/attachment.cgi?id=246665
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=246665&action=review

> Source/WebCore/bindings/gobject/DOMObjectCache.cpp:82
> +    auto observerPtr = domObjectCacheFrameObservers().get(frame);
> +    if (observerPtr)
> +        return *observerPtr;
> +
> +    std::unique_ptr<DOMObjectCacheFrameObserver> observer = std::make_unique<DOMObjectCacheFrameObserver>(frame);
> +    observerPtr = observer.get();
> +    domObjectCacheFrameObservers().set(frame, WTF::move(observer));
> +    return *observerPtr;

This could just call HashMap<>::add(), and then use the AddResult object that's returned to set the observer object if necessary.
Document::addAutoSizingNode() is one example of that approach.

> Source/WebCore/bindings/gobject/DOMObjectCache.cpp:166
> +    domObjects().set(objectHandle, std::make_unique<DOMObjectCacheData>(G_OBJECT(wrapper)));

Same here.

> Source/WebCore/bindings/gobject/DOMObjectCache.cpp:176
> +    domObjects().set(objectHandle, WTF::move(data));

Same here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150217/c2981d2e/attachment-0002.html>


More information about the webkit-unassigned mailing list