Bug 120617 - Change type of Document::doctype back to a raw pointer
Summary: Change type of Document::doctype back to a raw pointer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-02 23:47 PDT by Darin Adler
Modified: 2019-02-06 09:03 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.10 KB, patch)
2013-09-02 23:49 PDT, Darin Adler
kling: review+
kling: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2013-09-02 23:47:12 PDT
Change type of Document::doctype back to a raw pointer
Comment 1 Darin Adler 2013-09-02 23:49:13 PDT
Created attachment 210327 [details]
Patch
Comment 2 Darin Adler 2013-09-02 23:49:44 PDT
Kling, did you have a good reason to change this to a RefPtr?
Comment 3 Andreas Kling 2013-09-03 06:53:25 PDT
Comment on attachment 210327 [details]
Patch

Sure. r=me

You should change documentTypeString() in markup.cpp back as well.
Comment 4 Andreas Kling 2013-09-03 07:37:17 PDT
(In reply to comment #2)
> Kling, did you have a good reason to change this to a RefPtr?

Not a great one.

I felt that since this function is not performance-critical and its primary purpose is providing web API, we might as well tailor it to that use case. If that makes it a little more awkward to use it internally, all the better.

BUT now that I look closer, it appears that JSC bindings don't actually handle PassRefPtr return values so well, and we end up with an extra ref/deref pair! :(
Comment 5 Darin Adler 2013-09-03 10:03:15 PDT
(In reply to comment #4)
> I felt that since this function is not performance-critical and its primary purpose is providing web API, we might as well tailor it to that use case. If that makes it a little more awkward to use it internally, all the better.

It seems OK to me to put the ref into the bindings rather than into the function in the DOM itself. In my opinion, functions should not return a PassRefPtr if it they don’t need to. For one thing, if there's already a wrapper there is no need to ref the pointer.

> BUT now that I look closer, it appears that JSC bindings don't actually handle PassRefPtr return values so well, and we end up with an extra ref/deref pair! :(

Oh, we should fix that.
Comment 6 Darin Adler 2013-09-03 21:52:18 PDT
Committed r155019: <http://trac.webkit.org/changeset/155019>
Comment 7 Lucas Forschler 2019-02-06 09:03:03 PST
Mass moving XML DOM bugs to the "DOM" Component.