Bug 177429

Summary: Add WeakPtr support to RenderObject.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, dino, ggaren, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 177389    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description zalan 2017-09-25 06:14:56 PDT
and remove it from the subclasses.
Comment 1 zalan 2017-09-25 06:15:36 PDT
This is related to bug 177389
Comment 2 Radar WebKit Bug Importer 2017-09-25 06:16:57 PDT
<rdar://problem/34625212>
Comment 3 zalan 2017-09-25 06:57:52 PDT
Created attachment 321679 [details]
Patch
Comment 4 zalan 2017-09-29 09:16:42 PDT
Created attachment 322188 [details]
Patch
Comment 5 WebKit Commit Bot 2017-09-29 10:51:02 PDT
Comment on attachment 322188 [details]
Patch

Clearing flags on attachment: 322188

Committed r222653: <http://trac.webkit.org/changeset/222653>
Comment 6 WebKit Commit Bot 2017-09-29 10:51:05 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Antti Koivisto 2017-09-29 11:22:04 PDT
Comment on attachment 322188 [details]
Patch

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

> Source/WebCore/rendering/RenderMultiColumnFlow.cpp:441
> +            m_spannerMap.add(placeholder.spanner(), placeholder.createWeakPtr<RenderMultiColumnSpannerPlaceholder>());

This is bit awkward. Could we have a standalone template function so we could just do

makeWeakPtr(placeholder) 

and get correctly typed WeakPtr automatically?
Comment 8 Geoffrey Garen 2017-09-29 11:32:21 PDT
> > Source/WebCore/rendering/RenderMultiColumnFlow.cpp:441
> > +            m_spannerMap.add(placeholder.spanner(), placeholder.createWeakPtr<RenderMultiColumnSpannerPlaceholder>());
> 
> This is bit awkward. Could we have a standalone template function so we
> could just do
> 
> makeWeakPtr(placeholder) 
> 
> and get correctly typed WeakPtr automatically?

Totally!

Maybe we should also change the interface so that WeakPtrFactory vends WeakReference<T>&  instead of WeakPtr<T> and WeakPtr<T> automatically constructs itself, just like RefPtr, using that WeakReference<T>&.