[Webkit-unassigned] [Bug 55017] SVGImage causes MainResourceLoader leaks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 23 19:12:29 PST 2011


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





--- Comment #7 from Xianzhu Wang <wangxianzhu at google.com>  2011-02-23 19:12:29 PST ---
(In reply to comment #6)
> (From update of attachment 83472 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=83472&action=review
> 
> Nice catch.
> 
> > Source/WebCore/svg/graphics/SVGImage.cpp:285
> > +        loader->activeDocumentLoader()->cancelMainResourceLoad(ResourceError());
> 
> Will this result in an error line in Safari activity window, and/or in Web Inspector?
>

Seems the Web Inspector will report this as an error.

> FWIW, existing callers of this function provide a real error object. The case in WebHTMLRepresentation.mm looks very similar:
> 
>     if (coreFrame->document()->isMediaDocument())
>         coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));

This is not a real error, just a cancellation of the fake empty request with no error. ResourceLoader will replace the empty error with a cancellation error.

I'm wondering better ways to avoid the leak.
1) better way to clear the loader for the fake request.
  frame loader -> document loader -> main resource loader 
(In reply to comment #6)
> (From update of attachment 83472 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=83472&action=review
> 
> Nice catch.
> 
> > Source/WebCore/svg/graphics/SVGImage.cpp:285
> > +        loader->activeDocumentLoader()->cancelMainResourceLoad(ResourceError());
> 
> Will this result in an error line in Safari activity window, and/or in Web Inspector?
> 
> FWIW, existing callers of this function provide a real error object. The case in WebHTMLRepresentation.mm looks very similar:
> 
>     if (coreFrame->document()->isMediaDocument())
>         coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));

There is no real error because I just want to cancel the loading for the fake request. ResourceLoader will replace the empty ResourceError with a cancellation error.

However, I just found a way to avoid calling loader->load(...). I'll create a patch soon.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list