Bug 138361

Summary: Add ptr() method to Ref class
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web Template FrameworkAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, buildbot, commit-queue, darin, kling, rniwa, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2014-11-04 10:23:13 PST
It is a very common pattern in our code base to get a pointer from a Ref object. Right now, we have to call Ref.get() and take its address which is not very nice IMHO. I propose we add a asPtr() method to Ref class to get a raw pointer, in order to simplify the code a bit.
Comment 1 Chris Dumez 2014-11-04 12:13:54 PST
Created attachment 240938 [details]
Patch
Comment 2 Darin Adler 2014-11-04 14:05:56 PST
Comment on attachment 240938 [details]
Patch

I like it. I might have named this just ptr() rather than asPtr().
Comment 3 Chris Dumez 2014-11-04 14:07:35 PST
(In reply to comment #2)
> Comment on attachment 240938 [details]
> Patch
> 
> I like it. I might have named this just ptr() rather than asPtr().

Yes, it would be shorter. I will update the patch accordingly before landing, thanks.
Comment 4 Chris Dumez 2014-11-04 14:15:16 PST
Created attachment 240947 [details]
Patch
Comment 5 WebKit Commit Bot 2014-11-04 15:00:49 PST
Comment on attachment 240947 [details]
Patch

Clearing flags on attachment: 240947

Committed r175583: <http://trac.webkit.org/changeset/175583>
Comment 6 WebKit Commit Bot 2014-11-04 15:00:53 PST
All reviewed patches have been landed.  Closing bug.