[Qt][WK2] Favor QUrl to WTF::String in the Qt API layer
Created attachment 187631 [details] Patch
Comment on attachment 187631 [details] Patch nice
Comment on attachment 187631 [details] Patch LGTM, but needs owner to approve.
Comment on attachment 187631 [details] Patch Are you sure that this is the way to go? I recall Tor Arne deliberately converting from QUrl to WTFString for m_currentURL, etc. after a fair amount of thought. WKURLRef is backed by a WebURL, which is a WTFString. It also has a KURL member that is parsed on-demand. Creating a WTFString from a QString is virtually free (we adopt the QStringData). Later when converting such a WTFString back to a QString, it is also free (if it was previously adopted). QUrl on the other hand does actual url parsing as the first thing in its constructor. I feel that we only need to do this when returning a URL through our API layer, but for everything below I'm not sure QUrl's parsing gives us anything. Perhaps we need a WKURLCreateWithQString?
(In reply to comment #4) > (From update of attachment 187631 [details]) > Are you sure that this is the way to go? I recall Tor Arne deliberately converting from QUrl to WTFString for m_currentURL, etc. after a fair amount of thought. No I'm not sure actually, see my comment on bug #109564. > WKURLRef is backed by a WebURL, which is a WTFString. It also has a KURL member that is parsed on-demand. Creating a WTFString from a QString is virtually free (we adopt the QStringData). Later when converting such a WTFString back to a QString, it is also free (if it was previously adopted). > > QUrl on the other hand does actual url parsing as the first thing in its constructor. I feel that we only need to do this when returning a URL through our API layer, but for everything below I'm not sure QUrl's parsing gives us anything. > > Perhaps we need a WKURLCreateWithQString? This sounds like a better idea, let me investigate this.
Created attachment 188338 [details] Patch Now using QUrl only for the icon URL, QString for the page URL.
WKURLCreateWithQString is going to be added in the patch for bug 109564.
Comment on attachment 188338 [details] Patch LGTM, but needs approval by owners.
Comment on attachment 188338 [details] Patch Signed off by me.
Committed r145512: <http://trac.webkit.org/changeset/145512>