Bug 23761

Summary: Use two-arg KURL constructor
Product: WebKit Reporter: Xan Lopez <xan.lopez>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Uso two-arg KURL ctor
ap: review+
kurl.patch ap: review+

Xan Lopez
Reported 2009-02-05 08:50:44 PST
We use the one arg KURL constructor all over WebKit/GTK, but: - It does not pretend to deal with encodings, so it would fail if we pass anything different than ASCII I think (oops?) - The single-argument KURL ctors expect their input to already be the output of a previous KURL::parse call, so for the general case (ie, random user input) we need to use the two-arg ctor anyway.
Attachments
Uso two-arg KURL ctor (5.06 KB, patch)
2009-02-05 08:54 PST, Xan Lopez
ap: review+
kurl.patch (5.05 KB, patch)
2009-02-05 14:30 PST, Xan Lopez
ap: review+
Xan Lopez
Comment 1 2009-02-05 08:54:30 PST
Created attachment 27351 [details] Uso two-arg KURL ctor
Alexey Proskuryakov
Comment 2 2009-02-05 13:52:59 PST
Comment on attachment 27351 [details] Uso two-arg KURL ctor r=me > - SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL("about:blank"), url); > + SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL(KURL(), "about:blank"), url); I think that about:blank can be left as is - KURL parsing clearly won't affect it. Not that it matters much.
Darin Adler
Comment 3 2009-02-05 13:59:42 PST
(In reply to comment #2) > > - SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL("about:blank"), url); > > + SubstituteData substituteData(sharedBuffer.release(), contentMimeType ? String(contentMimeType) : "text/html", contentEncoding ? String(contentEncoding) : "UTF-8", KURL(KURL(), "about:blank"), url); > > I think that about:blank can be left as is - KURL parsing clearly won't affect > it. Not that it matters much. Or this could use the blankURL() function from KURL.h.
Xan Lopez
Comment 4 2009-02-05 14:30:35 PST
Created attachment 27364 [details] kurl.patch Use blankURL() for 'about:blank'. Great suggestion, thanks!
Alexey Proskuryakov
Comment 5 2009-02-06 01:22:19 PST
Committed revision 40715.
Note You need to log in before you can comment on or make changes to this bug.