RESOLVED FIXED 48360
Need a way to retrieve custom user agent from a WKPage
https://bugs.webkit.org/show_bug.cgi?id=48360
Summary Need a way to retrieve custom user agent from a WKPage
Brian Weinstein
Reported 2010-10-26 12:00:46 PDT
We need a way to retrieve the custom user agent from a WKPage.
Attachments
[PATCH] Fix (4.05 KB, patch)
2010-10-26 12:10 PDT, Brian Weinstein
bweinstein: commit-queue-
[PATCH] Fix - rename to WKPageCopyCustomUserAgent (4.03 KB, patch)
2010-10-26 12:44 PDT, Brian Weinstein
darin: review+
bweinstein: commit-queue-
Brian Weinstein
Comment 1 2010-10-26 12:10:40 PDT
Created attachment 71924 [details] [PATCH] Fix
Darin Adler
Comment 2 2010-10-26 12:12:09 PDT
Comment on attachment 71924 [details] [PATCH] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=71924&action=review > WebKit2/UIProcess/API/C/WKPage.cpp:158 > +WKStringRef WKPageGetCustomUserAgent(WKPageRef pageRef) > +{ > + return toCopiedAPI(toImpl(pageRef)->customUserAgent()); > +} If you are using toCopiedAPI then this function needs Copy in its name.
Brian Weinstein
Comment 3 2010-10-26 12:14:45 PDT
(In reply to comment #2) > (From update of attachment 71924 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=71924&action=review > > > WebKit2/UIProcess/API/C/WKPage.cpp:158 > > +WKStringRef WKPageGetCustomUserAgent(WKPageRef pageRef) > > +{ > > + return toCopiedAPI(toImpl(pageRef)->customUserAgent()); > > +} > > If you are using toCopiedAPI then this function needs Copy in its name. Should this be using toCopiedAPI or just toAPI? I see functions that return a WKStringRef on WKPage that use both toCopiedAPI and toAPI.
Brian Weinstein
Comment 4 2010-10-26 12:44:51 PDT
Created attachment 71929 [details] [PATCH] Fix - rename to WKPageCopyCustomUserAgent
Darin Adler
Comment 5 2010-10-26 12:54:21 PDT
Comment on attachment 71929 [details] [PATCH] Fix - rename to WKPageCopyCustomUserAgent View in context: https://bugs.webkit.org/attachment.cgi?id=71929&action=review > WebKit2/UIProcess/WebPageProxy.cpp:462 > + if (m_customUserAgent == userAgent) > + return; This code distinguishes a null string from an empty string. I’m not sure that’s intentional.
Brian Weinstein
Comment 6 2010-10-26 13:19:05 PDT
Landed in r70561.
Note You need to log in before you can comment on or make changes to this bug.