Bug 108803 - Web Inspector: Native Memory Instrumentation: fix the instrumentation of GraphicsLayers
Summary: Web Inspector: Native Memory Instrumentation: fix the instrumentation of Grap...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks: 107254
  Show dependency treegraph
 
Reported: 2013-02-04 01:16 PST by Ilya Tikhonovsky
Modified: 2013-04-08 12:28 PDT (History)
12 users (show)

See Also:


Attachments
Patch (5.14 KB, patch)
2013-02-04 01:20 PST, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2013-02-04 01:16:01 PST
GraphicsLayer class was instrumented earlier but it doesn't appear in the snapshot because there were no links to it.
Also it could report the expected size of the image buffer, so we can report it.
Comment 1 Ilya Tikhonovsky 2013-02-04 01:20:14 PST
Created attachment 186319 [details]
Patch
Comment 2 Simon Fraser (smfr) 2013-02-04 08:52:21 PST
Comment on attachment 186319 [details]
Patch

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

> Source/WebCore/rendering/RenderLayerCompositor.cpp:2902
> -    info.addWeakPointer(m_renderView);
> +    info.addMember(m_renderView, "renderView");

It's not clear to me that this is correct. RenderView is a "back pointer"; it's not owned by RLC.
Comment 3 Ilya Tikhonovsky 2013-02-04 10:22:08 PST
(In reply to comment #2)
> (From update of attachment 186319 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=186319&action=review
> 
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:2902
> > -    info.addWeakPointer(m_renderView);
> > +    info.addMember(m_renderView, "renderView");
> 
> It's not clear to me that this is correct. RenderView is a "back pointer"; it's not owned by RLC.

The instrumentation code detects the ownership attribute automatically by addObjectImpl method. The method has explicit overloads for RefPtr and OwnPtr.
https://code.google.com/p/chromium/source/search?q=addObjectImpl&origq=addObjectImpl&btnG=Search+Trunk

So the edges for the raw pointers will get 'weak' attribute. The old idea with addWeakPointer doesn't work properly with our template based containers. I'm going to remove this method from the instrumentation code.

It works fine in almost all the cases except those where objects are owned via raw pointers.

I've found and fixed two such cases:
http://trac.webkit.org/changeset/136288
http://trac.webkit.org/changeset/135605

Unfortunately we have the same problem with the pointers to the render objects which couldn't be solved that way. But I think we can support a 'delete strategy' template parameter with a default implementation in RefPtr and OwnPtr templates and create the custom 'delete strategy' for the pointers to the render objects. But I'd like to discuss this idea in webkit-dev at the beginning.
Comment 4 Ilya Tikhonovsky 2013-02-04 10:24:18 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 186319 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=186319&action=review
> > 
> > > Source/WebCore/rendering/RenderLayerCompositor.cpp:2902
> > > -    info.addWeakPointer(m_renderView);
> > > +    info.addMember(m_renderView, "renderView");
> > 
> > It's not clear to me that this is correct. RenderView is a "back pointer"; it's not owned by RLC.
> 
> The instrumentation code detects the ownership attribute automatically by addObjectImpl method. The method has explicit overloads for RefPtr and OwnPtr.
> https://code.google.com/p/chromium/source/search?q=addObjectImpl&origq=addObjectImpl&btnG=Search+Trunk
> 
> So the edges for the raw pointers will get 'weak' attribute. The old idea with addWeakPointer doesn't work properly with our template based containers. I'm going to remove this method from the instrumentation code.
> 
> It works fine in almost all the cases except those where objects are owned via raw pointers.

I mean the current schema works fine .......

> 
> I've found and fixed two such cases:
> http://trac.webkit.org/changeset/136288
> http://trac.webkit.org/changeset/135605
> 
> Unfortunately we have the same problem with the pointers to the render objects which couldn't be solved that way. But I think we can support a 'delete strategy' template parameter with a default implementation in RefPtr and OwnPtr templates and create the custom 'delete strategy' for the pointers to the render objects. But I'd like to discuss this idea in webkit-dev at the beginning.
Comment 5 Pavel Feldman 2013-03-19 09:50:40 PDT
Comment on attachment 186319 [details]
Patch

Clearing r? - it has been there for ages.