[webkit-dev] About WebKit memory cache
Nate Chapin
japhet at chromium.org
Mon Mar 26 08:44:36 PDT 2012
On Fri, Mar 23, 2012 at 7:48 PM, gaorock <porgao at hotmail.com> wrote:
> Hi all
>
> Sometimes I met crashes about memory cache, and I traced them and found a
> bit doubt:
>
> Should we use
> typedef HashMap<String, RefPtr<CachedResource>> CachedResourceMap;
> instead of
> typedef HashMap<String, CachedResource*> CachedResourceMap;?
>
CachedResource doesn't support reference counting in the usual model. It
uses a somewhat confusing set of rules to decide when to delete itself. See
canDelete() in CachedResource.h. Figuring out a way to make CachedResource
use our normal reference counting model is on my list of things to do
someday. :-)
>
> The following is the call stack, hope it's useful for you:
>
> WebKit.dll!WebCore::ResourceRequestBase::updateResourceRequest()
> Line447 + 0x37 byte C++
> WebKit.dll!WebCore::ResourceRequestBase::url() Line123 C++
> WebKit.dll!WebCore::CachedResource::url() Line106 + 0x19 byte C++
> > WebKit.dll!WebCore::CachedResourceLoader::requestResource(WebCore::CachedResource::Type
> type=ImageResource, WebCore::ResourceRequest & request={...}, const
> WTF::String & charset={...}, const WebCore::ResourceLoaderOptions &
> options={...}, WebCore::ResourceLoadPriority priority=-1, bool
> forPreload=false) Line444 + 0x11 byte C++
> WebKit.dll!WebCore::CachedResourceLoader::requestImage(WebCore::ResourceRequest
> & request={...}) Line160 + 0x21 byte C++
> WebKit.dll!WebCore::CSSImageValue::cachedImage(WebCore::CachedResourceLoader
> * loader=0x00e6e6d8, const WTF::String & url={...}) Line90 + 0xf byte C++
> WebKit.dll!WebCore::CSSImageValue::cachedImage(WebCore::CachedResourceLoader
> * loader=0x00e6e6d8) Line79 + 0x19 byte C++
> WebKit.dll!WebCore::CSSStyleSelector::loadPendingImage(WebCore::StylePendingImage
> * pendingImage=0x0ada6f30) Line5306 + 0xc byte C++
> WebKit.dll!WebCore::CSSStyleSelector::loadPendingImages() Line5331 +
> 0x15 byte C++
> WebKit.dll!WebCore::CSSStyleSelector::applyMatchedDeclarations(const
> WebCore::CSSStyleSelector::MatchResult & matchResult={...}) Line2408 C++
> WebKit.dll!WebCore::CSSStyleSelector::styleForElement(WebCore::Element
> * element=0x0ad08088, WebCore::RenderStyle * defaultParent=0x00000000, bool
> allowSharing=true, bool resolveForRootDefault=false) Line1310 C++
> WebKit.dll!WebCore::Element::styleForRenderer() Line1035 + 0x24 byte
> C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1059 + 0xc byte C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1138 C++
> WebKit.dll!WebCore::Document::recalcStyle(WebCore::Node::StyleChange
> change=NoChange) Line1574 C++
> WebKit.dll!WebCore::Document::updateStyleIfNeeded() Line1634 C++
> WebKit.dll!WebCore::Document::updateLayout() Line1658 + 0x12 byte C++
>
> In the function of WebCore::ResourceRequestBase::updateResourceRequest(),
> the point "this" is NOT null, but all of its members are null, so actually
> it had been freed before. So I think the refCount may be helpful to solve
> this problem.
>
> This is my first time to write to WebKit-dev, it will be appreciated if
> someone could give me some instructions or whether I should file a bug for
> it?
>
Yes, please file a bug on bugs.webkit.org, and feel free to point me in its
direction.
>
> Thanks in advance!
>
> Best Regards
> Rock
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120326/8582ee5a/attachment.html>
More information about the webkit-dev
mailing list