RESOLVED FIXED 107652
[WK2] Replace some internal API usage in EwkView with C API
https://bugs.webkit.org/show_bug.cgi?id=107652
Summary [WK2] Replace some internal API usage in EwkView with C API
Kenneth Rohde Christiansen
Reported 2013-01-23 02:10:38 PST
SSIA
Attachments
Patch (8.66 KB, patch)
2013-01-23 02:15 PST, Kenneth Rohde Christiansen
no flags
Kenneth Rohde Christiansen
Comment 1 2013-01-23 02:15:57 PST
Chris Dumez
Comment 2 2013-01-23 02:28:53 PST
Comment on attachment 184183 [details] Patch LGTM.
Gyuyoung Kim
Comment 3 2013-01-23 02:30:47 PST
Comment on attachment 184183 [details] Patch Looks fine.
Benjamin Poulain
Comment 4 2013-01-23 12:43:46 PST
Comment on attachment 184183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184183&action=review Really nice. Just one API thingy you might want to look into: > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:758 > - if (unreachableUrl && *unreachableUrl) > - impl->page()->loadAlternateHTMLString(String::fromUTF8(html), baseUrl ? String::fromUTF8(baseUrl) : "", String::fromUTF8(unreachableUrl)); > - else > - impl->page()->loadHTMLString(String::fromUTF8(html), baseUrl ? String::fromUTF8(baseUrl) : ""); > + WKRetainPtr<WKStringRef> wkHTMLString = adoptWK(WKStringCreateWithUTF8CString(html)); > + WKRetainPtr<WKURLRef> wkBaseURL = adoptWK(WKURLCreateWithUTF8CString(baseUrl)); > + > + if (unreachableUrl && *unreachableUrl) { > + WKRetainPtr<WKURLRef> wkUnreachableURL = adoptWK(WKURLCreateWithUTF8CString(unreachableUrl)); > + WKPageLoadAlternateHTMLString(impl->wkPage(), wkHTMLString.get(), wkBaseURL.get(), wkUnreachableURL.get()); > + } else > + WKPageLoadHTMLString(impl->wkPage(), wkHTMLString.get(), wkBaseURL.get()); The new code is nicer than the old one.
Benjamin Poulain
Comment 5 2013-01-23 14:18:46 PST
Comment on attachment 184183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184183&action=review > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:568 > - impl->page()->loadURL(url); > + WKRetainPtr<WKURLRef> wkUrl = adoptWK(WKURLCreateWithUTF8CString(url)); > + WKPageLoadURL(impl->wkPage(), wkUrl.get()); This change the behavior. You know supports UTF8 instead of Latin1. You may want to update the documentation and tests.
Kenneth Rohde Christiansen
Comment 6 2013-01-23 14:39:14 PST
Created #107739 to track the unit test and documentation update.
WebKit Review Bot
Comment 7 2013-01-23 14:54:39 PST
Comment on attachment 184183 [details] Patch Clearing flags on attachment: 184183 Committed r140600: <http://trac.webkit.org/changeset/140600>
WebKit Review Bot
Comment 8 2013-01-23 14:54:44 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.